Author Topic: Compile new TNServer.exe  (Read 3650 times)

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
Compile new TNServer.exe
« on: July 21, 2016, 04:12:08 PM »
I am upgrading all aspects of my previous projects to TNet3 and am having some difficulties.

At one point I was able to compile this solution for TNServer.exe with the ability to change the "Server.dat"

http://www.tasharen.com/forum/index.php?topic=13812.0

I am using a Mac; and perhaps I lucked into compiling it previously, now I cannot seem to recompile any changes with with TNServer.exe from ServerMain.cs. Would you be willing to share how you compiled that .exe?

Is it possible, as a feature request; to have the ability to alter "Server.dat" file name while starting the TNServer.exe?

I have several games made with TNet that connect on the same server. I believe this feature will be useful for your users as well if they find success with their projects and continue to make games with TNet.

Thanks.

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: Compile new TNServer.exe
« Reply #1 on: July 21, 2016, 06:47:50 PM »
To re-compile in Visual Studio:  from the menu "Build > Rebuild Solution".  The path to the new exe will be shown in the Output window.

------------------
ExampleMenu.cs line #200

  1. TNServerInstance.Start("server.dat");

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
Re: Compile new TNServer.exe
« Reply #2 on: July 23, 2016, 01:21:08 PM »
Thanks Devomage

When I try that it tells me it cannot find any files associated with the TNServer.exe.

Perhaps I am doing this all wrong. I unzip the TNetServer.zip. Modify ServerMain.cs and then hit rebuild solution.

Am I supposed to compile something else or add files? 

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: Compile new TNServer.exe
« Reply #3 on: July 23, 2016, 04:31:28 PM »
you also need to copy in the TNET asset and make sure that all the files are resolved.

1. Look at the file structure, find "Assets/TNet".  The folders "Common", "LZMA" and "Server" will be empty.

2. From your Unity project copy the "Common", "LZMA" and "Server" folders.

3. Open "Solution Explorer" in visual studio and find the "Common" folder.  Make sure each of the files are resolved.  Rinse and repeat for all files in each of the 3 folders.  (there has to be an easier way to do this step, idk how)

Everything should work after this -- although there should be a compile bug.  Find the fix for that here:

http://www.tasharen.com/forum/index.php?topic=13999.0

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Compile new TNServer.exe
« Reply #4 on: July 24, 2016, 06:56:18 AM »
The included TNServer solution file assumes the location of the files is that of a default import: Assets/TNet. Copying things around isn't necessary in this case. Attached is the source and the compiled executable that is able to accept a new -fn <filename> parameter.

devomage

  • Sr. Member
  • ****
  • Thank You
  • -Given: 7
  • -Receive: 67
  • Posts: 250
    • View Profile
Re: Compile new TNServer.exe
« Reply #5 on: July 24, 2016, 05:35:02 PM »
my bad.  the explanation that i gave assumes that you are developing the "standalone" on a machine that doesnt have unity.

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
Re: Compile new TNServer.exe
« Reply #6 on: September 15, 2016, 12:51:09 AM »
-fn doesn't appear to work in the latest version.

  1.                         else if (param == "-fn")
  2.                         {
  3.                                 fn = val1;  //change fn = val0; seems to fix
  4.                         }
  5.  
  6.  

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Compile new TNServer.exe
« Reply #7 on: September 17, 2016, 01:03:35 AM »
You're right, thanks.