Author Topic: [SOLVE] TNet Server on Amazon EC2 linux  (Read 3269 times)

ibaanb

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 17
    • View Profile
[SOLVE] TNet Server on Amazon EC2 linux
« on: October 02, 2014, 06:50:43 AM »
What can I do to make TNetserver run on linux instance? And how it done?

Can I build TNetserver project and how to do it?

« Last Edit: October 09, 2014, 04:25:09 AM by ibaanb »

ndizazzo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: TNet Server on Amazon EC2 linux
« Reply #1 on: October 02, 2014, 08:44:49 AM »
I had this exact same question, then I found this in a previous reply to a question by ArenMook. He said:

Quote from: 'ArenMook'
TNet doesn't use Unity's networking, which is why the server executable is only ~50 kb instead of 10 megabytes.

To add code to your server side, just modify the server code files (TNet\Server folder). You can test it from within Unity by creating an instance of it using TNServerInstance, or you can compile it into a stand-alone executable as I've done. The readme file contains info on where to find the Visual Studio solution files for the server.

So, by that logic, you should be able to compile the server binary (since it's stand-alone and doesn't require any linking to Unity libraries) using Mono for Linux. I'm not sure about the compatibility because I haven't tried this yet, but I'm guessing it works. See this for a blog post with a trivial example.

MCoburn

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 7
  • Posts: 69
    • View Profile
Re: TNet Server on Amazon EC2 linux
« Reply #2 on: October 02, 2014, 11:01:38 PM »
You'll need to install "mono-complete" in Ubuntu or Debian. I did this on a ARM-based ODROID-XU.

  1. apt-get install mono-complete

This will pull a lot of dependencies including NET 2.0 to 4.0 support. Then, upload your TNServer stuff to a empty directory (ie. <homedir>/tnet ). Change into that directory and run "xbuild".

Then all you need to do on the binary is:

  1. mono TNServer.exe <vars go here>
.

Make sure you open your firewall ports in both Amazon Security Groups AND iptables!

If you have any issues, I can try to help. I successfully compiled 1.9.9 and 2.0.0 on Ubuntu 14.04 both on a Core i5 x64 machine, and a ODROID-XU ARM machine. I'm a linux system administrator so I know a fair chunk of issues that can stump newcomers.

ibaanb

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: TNet Server on Amazon EC2 linux
« Reply #3 on: October 06, 2014, 11:58:46 PM »
When I'm Build TNServer.sln
it's alway give same error on linux and windows.

Quote
Build FAILED.
Errors:

/home/ibaanb/TNetServer/TNServer.sln (default targets) ->
(Build target) ->
/home/ibaanb/TNetServer/TNServer.csproj (default targets) ->
/usr/lib/mono/4.5/Microsoft.CSharp.targets (CoreCompile target) ->

   : error CS2001: Source file `Assets/TNet/Common/TNBuffer.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Common/TNDatagram.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Common/TNList.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Common/TNPacket.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Common/TNPlayer.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Common/TNServerList.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Common/TNTcpProtocol.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Common/TNTools.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Common/TNUdpProtocol.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Common/TNUPnP.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Server/TNChannel.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Server/TNFileServer.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Server/TNLobbyLink.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Server/TNLobbyServer.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Server/TNGameServer.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Server/TNTcpLobbyLink.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Server/TNTcpLobbyServer.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Server/TNTcpPlayer.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Server/TNUdpLobbyLink.cs' could not be found
   : error CS2001: Source file `Assets/TNet/Server/TNUdpLobbyServer.cs' could not be found

    0 Warning(s)
    20 Error(s)

MCoburn

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 7
  • Posts: 69
    • View Profile
Re: TNet Server on Amazon EC2 linux
« Reply #4 on: October 07, 2014, 12:46:44 AM »
Copy the Assets/TNet folder from the UnityPackage to the server.

ibaanb

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: TNet Server on Amazon EC2 linux
« Reply #5 on: October 09, 2014, 02:51:52 AM »
Thank very much MCoburn.

I'm able to start it in centOS and every work fine.