QuestionROTMG Linux Server

Posts 18 of 8 · Page 1 of 1
ROTMG Linux Server
Hello,
i checked out nearly every thread here and tried a serveral ways to run a private server on my linux (debian) maschine
After nearly one week of reinstalling mono,setting up webservers etc i decided to ask here for help.
It would be awesome when someone is able to help me out with that
I have a advanced linux knowledge,so everythign around that should not be a problem !
Ofc u can reach me in skype,just send me a pm when u are realy interested in helping me

Greetings
Bone
I was just about to make this thread.

So far I have been unable to completely get a server working (any version). I am currently playing with Trapped's server. Everything is done in a seperate wineprefix, all ports are forwarded...

Summary:
- mysql works perfectly fine (obviously, no emulation needed). Successfully added accounts + characters/whatnot
- server.exe runs (usually) and can connect to the mysql database.
- client can connect to the server, login, view characters etc.
- wserver.exe runs, but client is unable to connect to it. After selection of character, client is unable to connect to worldserver.

Details:
Tried several different versions from Trapped's github (after failing with MMOE and Krazy) and am currently using "Guild board now fully working".
mysql is using ./db/structure.sql, I tried patching the dump to make it work before realising it was so out of date it didnt have whitelist/bans, it partially worked regardless.
Accounts + characters added to mysql database are useable in client.

server.exe usually starts with two errors, but otherwise communicates with client fine. Errors:
- Problems loading config.cfg. The default data has been used instead #(shouldnt be a problem)
- protocol "IP" not found; You might want to add this to /etc/protocol #(server.exe seems to work fine so maybe not an issue?)

Server also likes to hang for no reason and refuses to terminate, all without errors. Restarting server.exe fixes this.

Although sometimes spams an error message and hangs or quits. Stopping and waiting a bit usually fixes this...
Error message:
Code:
Unhandled Exception:
System.Net.Sockets.SocketException: Error looking up error string
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointListener..ctor (System.Net.IPAddress addr, Int32 port, Boolean secure) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.GetEPListener (System.String host, Int32 port, System.Net.HttpListener listener, Boolean secure) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.AddPrefixInternal (System.String p, System.Net.HttpListener listener) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.AddListener (System.Net.HttpListener listener) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Net.Sockets.SocketException: Error looking up error string
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointListener..ctor (System.Net.IPAddress addr, Int32 port, Boolean secure) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.GetEPListener (System.String host, Int32 port, System.Net.HttpListener listener, Boolean secure) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.AddPrefixInternal (System.String p, System.Net.HttpListener listener) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.AddListener (System.Net.HttpListener listener) [0x00000] in <filename unknown>:0 
[user@ProjectCinnamon ~]$ WINEPREFIX=~/.wine-rotmg wine /home/user/Downloads/rotmg_svr-final/rotmg_svr-96f1a022b690ff66b0631defadd9685df7c57350/server/bin/Release/server.exe
Problems loading config.cfg. The default data has been used instead
protocol "IP" not found; You might want to add this to /etc/protocols
Wserver.exe runs seemingly fine, with the protocol "IP" not found error (aswell as the lagged and merchant spam). Nothing would indicate that it is not working, seems more stable than server.exe, never crashed. As mentioned previously, when a character is selected by client, the message "Connecting to EUSouth" appears as expected, then the error message "Security Error:Error #2048 Connection Failed! Retrying...". I suspect this is simply the client being unable to communicate with the wserver, as wserver.exe looks like it is working, and client can connect to server.exe. EDIT: this is probably due to server.exe not properly directing the client to wserver...

I have tried running the client through firefox aswell as flashprojecter in the same wineprefix as the server and wserver, both have the same results. Can login with various accounts, can view all characters associated with said accounts.

Note: KrazyServer works on windows...

Thank you @Trapped for entertaining me for a weekend, and providing me with this educational experience

PS: Arch Linux
Quote Originally Posted by Syuff View Post
I was just about to make this thread.

So far I have been unable to completely get a server working (any version). I am currently playing with Trapped's server. Everything is done in a seperate wineprefix, all ports are forwarded...

Summary:
- mysql works perfectly fine (obviously, no emulation needed). Successfully added accounts + characters/whatnot
- server.exe runs (usually) and can connect to the mysql database.
- client can connect to the server, login, view characters etc.
- wserver.exe runs, but client is unable to connect to it. After selection of character, client is unable to connect to worldserver.

Details:
Tried several different versions from Trapped's github (after failing with MMOE and Krazy) and am currently using "Guild board now fully working".
mysql is using ./db/structure.sql, I tried patching the dump to make it work before realising it was so out of date it didnt have whitelist/bans, it partially worked regardless.
Accounts + characters added to mysql database are useable in client.

server.exe usually starts with two errors, but otherwise communicates with client fine. Errors:
- Problems loading config.cfg. The default data has been used instead #(shouldnt be a problem)
- protocol "IP" not found; You might want to add this to /etc/protocol #(server.exe seems to work fine so maybe not an issue?)

Server also likes to hang for no reason and refuses to terminate, all without errors. Restarting server.exe fixes this.

Although sometimes spams an error message and hangs or quits. Stopping and waiting a bit usually fixes this...
Error message:
Code:
Unhandled Exception:
System.Net.Sockets.SocketException: Error looking up error string
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointListener..ctor (System.Net.IPAddress addr, Int32 port, Boolean secure) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.GetEPListener (System.String host, Int32 port, System.Net.HttpListener listener, Boolean secure) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.AddPrefixInternal (System.String p, System.Net.HttpListener listener) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.AddListener (System.Net.HttpListener listener) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.Net.Sockets.SocketException: Error looking up error string
  at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointListener..ctor (System.Net.IPAddress addr, Int32 port, Boolean secure) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.GetEPListener (System.String host, Int32 port, System.Net.HttpListener listener, Boolean secure) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.AddPrefixInternal (System.String p, System.Net.HttpListener listener) [0x00000] in <filename unknown>:0 
  at System.Net.EndPointManager.AddListener (System.Net.HttpListener listener) [0x00000] in <filename unknown>:0 
[user@ProjectCinnamon ~]$ WINEPREFIX=~/.wine-rotmg wine /home/user/Downloads/rotmg_svr-final/rotmg_svr-96f1a022b690ff66b0631defadd9685df7c57350/server/bin/Release/server.exe
Problems loading config.cfg. The default data has been used instead
protocol "IP" not found; You might want to add this to /etc/protocols
Wserver.exe runs seemingly fine, with the protocol "IP" not found error (aswell as the lagged and merchant spam). Nothing would indicate that it is not working, seems more stable than server.exe, never crashed. As mentioned previously, when a character is selected by client, the message "Connecting to EUSouth" appears as expected, then the error message "Security Error:Error #2048 Connection Failed! Retrying...". I suspect this is simply the client being unable to communicate with the wserver, as wserver.exe looks like it is working, and client can connect to server.exe. EDIT: this is probably due to server.exe not properly directing the client to wserver...

I have tried running the client through firefox aswell as flashprojecter in the same wineprefix as the server and wserver, both have the same results. Can login with various accounts, can view all characters associated with said accounts.

Note: KrazyServer works on windows...

Thank you @Trapped for entertaining me for a weekend, and providing me with this educational experience

PS: Arch Linux
Dude. DUDE. I love you. You actually TRIED and have almost successfully been able to use the server on Linux (even thought Arch isn't actually the most flexible of the distros in terms of emulation of windows runtime - I know that Wine is not an emulator, let's go over that).
The actual problem is the IP protocol missing on Linux. Actually, as you may already know, Windows uses its version of the TCP/IPv4(6), and Linux uses different versions (as of course the Windows libraries can't be used). I'm not much experienced about effectively using something different than windows (damn you Bill), but I think that by downloading some files (hurr durr that was obvious) and placing them in /etc/protocols (herp derp that was obvious too) you could solve this problem.
This would solve the wServer problem, that was caused by this (it would attempt to create a connection, which is impossible without the necessary protocol).
The server problem is different, as it uses the default HttpListener class. I don't know the details for this, but as you said it currently works, so... don't fix what isn't broken.

The other option (which would be the best idea - MMOE would use the same code after doing that) would be porting the code with Mono to make it run /almost/ natively on Linux. This would take a bit (or maybe not, nobody has tried yet I think).
Anyways, I'd like to talk with you (Steam? Skype? Something that is instant possibly) for some tests.
Mono

Mono is a software platform designed to allow developers to easily create cross platform applications. Sponsored by Xamarin, Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. A growing family of solutions and an active and enthusiastic contributing community is helping position Mono to become the leading choice for development of Linux applications.
This seems like the best option? Why emulate windows when you can compile code for linux..
Thanks!
Unfortunately I didnt look at this thread earlier...
Simply running mono on the .exes resulted the same as running through wine (but without all the errors, only the wserver issue, which makes sense with Trapped's post)
Will fix my /etc/protocol when I get the chance.

I have since been learning how to rebuild the project in monodevelop, thinking that might make a difference (having never heard of mono thismorning)...
I have come to a dead end though, one small error that I cant seem to fix.
Code:
 /home/user/Downloads/rotmg_svr-final/rotmg_svr-96f1a022b690ff66b0631defadd9685df7c57350/terrain/Vector2.cs(23,23): Error CS0234: The type or namespace name `Sqrt' does not exist in the namespace `Mono.Math'. Are you missing an assembly reference? (CS0234) (terrain)
I get this 6 times for Sqrt in that file
Removing System from references fixes this, but brings up additional issues with Biome.cs as it is required there.
I dont have time for the next couple days to work on this, I'll let you know how it goes when I do.

Edit: Seems like I only need to link the native maths library, unfortunately I know too little to be able to add this to code, and can find no documentation on how to link it in xbuild.

Thanks again!

Skype is best bet to contact me, justin-syuff
Awesome that u try it that hard to run Syuff
Im still very interested in that cause my actual main Server in linux based and it would be pure insane when u get this working
Linux server working!
So I got the linux server to work, I feel pretty silly after figuring out my error that stumped me for 2 days...

packages used: mono, monodevelop, mysql, mysqlworkbench

start mysql
systemctl start mysqld
add database as norm using MySQL Workbench

Rebuilding the server for mono requires changing all uses of Math.Sqrt() to System.Math.Sqrt() in the files ./wServer/Vector2.cs and ./terrain/Vector2.cs
Build using xbuild in command line (monodevelop will not build it)
xbuild server.sln
start the server.exe and wserver.exe with mono
mono server.exe
sudo mono wserver.exe

Done. That was easy...

I also messed with ./wServer/Program.cs a little but I dont think that made a difference

....wServer needs root to start the tcplistener whilst httplistener does not... I realised this after some nmap from both my linux and windows...

Can also connect from my windows via LAN

@Trapped @Bone9

If any more info is needed or if you want a copy of my modified files just message me.
Quote Originally Posted by Syuff View Post
So I got the linux server to work, I feel pretty silly after figuring out my error that stumped me for 2 days...

packages used: mono, monodevelop, mysql, mysqlworkbench

start mysql
systemctl start mysqld
add database as norm using MySQL Workbench

Rebuilding the server for mono requires changing all uses of Math.Sqrt() to System.Math.Sqrt() in the files ./wServer/Vector2.cs and ./terrain/Vector2.cs
Build using xbuild in command line (monodevelop will not build it)
xbuild server.sln
start the server.exe and wserver.exe with mono
mono server.exe
sudo mono wserver.exe

Done. That was easy...

I also messed with ./wServer/Program.cs a little but I dont think that made a difference

....wServer needs root to start the tcplistener whilst httplistener does not... I realised this after some nmap from both my linux and windows...

Can also connect from my windows via LAN

@Trapped @Bone9

If any more info is needed or if you want a copy of my modified files just message me.
You are an incredible person. It's rare to find someone like you here on MPGH.
It's strange how wServer needs to have admin rights and server does not... on Windows it's inverted.
For the files, pack them and open a thread to release them. Write the complete procedure you did to get it working.
Thanks for the effort! <3
Posts 18 of 8 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Need help?