- Home /
Linux game server
Hello unity people!
I am working on a multiplayer game, and it's time to start testing on a (linux) server. I have managed to somewhat get it to run on my server, with variable results. Over all though, it has not been successful, since the player tries to login and fails to do so. The problem is, I am finding it hard even to debug the server since I'm not sure if the messages are outputting correctly when I run it.
These are some logs of me running the server when I built the game as "headless" and ran it with -batchmode and -nographics...
> > ./Server.x86_64 -batchmode -nographics
> > Set current directory to
> > /home/forge/server Found path:
> > /home/forge/server/Server.x86_64 Mono
> > path[0] =
> > '/home/forge/server/Server_Data/Managed'
> > Mono path[1] =
> > '/home/forge/server/Server_Data/Mono'
> > Mono config path =
> > '/home/forge/server/Server_Data/Mono/etc'
> > PlayerConnection initialized from
> > /home/forge/server/Server_Data (debug
> > = 0) PlayerConnection initialized network socket : 0.0.0.0
> 55205
> > Multi-casting "[IP] 206.189.27.151
> > [Port] 55205 [Flags] 2 [Guid]
> > 161226713 [EditorId] 2169020580
> > [Version] 1048832 [Id]
> > LinuxPlayer(206.189.27.151) [Debug] 0"
> > to [225.0.0.222:54997]... Started
> > listening to [0.0.0.0:55205] Unable to
> > preload the following plugins:
> > ScreenSelector.so PlayerConnection already initialized -
> > listening to [0.0.0.0:55205] Player
> > data archive not found at
> > `/home/forge/server/Server_Data/data.unity3d`,
> > using local
> > filesystem♥##unity-automation:{"messageType":"MemoryLeaks","allocatedMemory":25585,"memoryLabels":[{"Permanent":12608},{"NewDelete":8},{"Manager":104},{"GfxDevice":336},{"Serialization":9152},{"BaseObject":360},{"Terrain":176},{"String":617},{"DynamicArray":16},{"PoolAlloc":-176},{"ScriptManager":1776},{"Unet":16},{"CloudService":360},{"SceneManager":232}]}
The heart is where I cancelled out of the game, and it prints what appears to be a memory leak report!
I connected to the server during this test (or so it appears to) but I don't see any 'player connected' message in the output or anything like that? And there's no error messages to tell me it failed to connect to the database (which it undoubtly is)... which leads me onto another question, I am using a mysql dll to connect to the database, but I fear this may not work in Linux since it's a DLL and not an SO??
I've also tried running the game without -batchmode and -nographics, and it outputs this... (same build, so with headless option enabled)
> ./Server.x86_64 Set current directory
> to /home/forge/server Found path:
> /home/forge/server/Server.x86_64 Mono
> path[0] =
> '/home/forge/server/Server_Data/Managed'
> Mono path[1] =
> '/home/forge/server/Server_Data/Mono'
> Mono config path =
> '/home/forge/server/Server_Data/Mono/etc'
> PlayerConnection initialized from
> /home/forge/server/Server_Data (debug
> = 0) PlayerConnection initialized network socket : 0.0.0.0 55058
> Multi-casting "[IP] 206.189.27.151
> [Port] 55058 [Flags] 2 [Guid]
> 496774710 [EditorId] 2169020580
> [Version] 1048832 [Id]
> LinuxPlayer(206.189.27.151) [Debug] 0"
> to [225.0.0.222:54997]... Started
> listening to [0.0.0.0:55058] Unable to
> preload the following plugins:
> ScreenSelector.so PlayerConnection already initialized -
> listening to [0.0.0.0:55058] Player
> data archive not found at
> `/home/forge/server/Server_Data/data.unity3d`,
> using local filesystemStacktrace:
>
>
> Native stacktrace:
>
> /home/forge/server/Server_Data/Mono/x86_64/libmono.so(+0x91be1) [0x7f1ba099abe1]
> /lib/x86_64-linux-gnu/libpthread.so.0(+0x1288f)
> [0x7f1ba3f6f88f]
> /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)
> [0x7f1ba305ee97]
> /lib/x86_64-linux-gnu/libc.so.6(abort+0x140)
> [0x7f1ba3060800]
> ./Server.x86_64() [0xf0a65b]
> /home/forge/server/Server_Data/Mono/x86_64/libmono.so(+0xd0c46) [0x7f1ba09d9c46]
> /home/forge/server/Server_Data/Mono/x86_64/libmono.so(+0x34a12) [0x7f1ba093da12]
> /lib/x86_64-linux-gnu/libpthread.so.0(+0x1288f)
> [0x7f1ba3f6f88f]
> ./Server.x86_64(SDL_GL_GetAttribute_REAL+0x1e3)
> [0x1a9c7a3]
> ./Server.x86_64() [0x1927a47]
> ./Server.x86_64() [0x192640f]
> ./Server.x86_64() [0x19264cd]
> ./Server.x86_64() [0x18eca73]
> ./Server.x86_64() [0x4a3de6]
> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe6) [0x7f1ba3041b96]
> ./Server.x86_64() [0x4aee18]
>
> Debug info from gdb:
>
>
> ================================================================= Got a SIGABRT while executing native
> code. This usually indicates a fatal
> error in the mono runtime or one of
> the native libraries used by your
> application.
> =================================================================
>
> Aborted (core dumped)
I'm not sure what to make of these varying error messages? How can I better debug the server, I see no true log files?
Answer by wooolly · Aug 20, 2018 at 09:17 AM
I was able to add the -logFile argument when trying to run the server and I was able to debug and resolve my issues, for anyone who is struggling running on a command line.