Jump to content

Improvements for the dedicated server


Alloc

Recommended Posts

Hm, there were no code changes at all from 218 to 222 (only the AC#.dll was patched for b10, now you run b9 on the server).

 

Also "Telnet" and HTTP aren't related in any way, I fear there's some kind of bigger problem in there like thread count problems :( Will continue investigating, maybe after all I have to replace the HTTP library.

 

Btw, are you using the authentication on the webmap?

 

@bolibompa: Do you also get a spam of those log entries as Soylent before the "Telnet" connection hangs?

 

Hi

 

I grepped for "Net.Sockets.SocketException:" but found nothing.

 

I use authentication on the webmap.

 

I get tons of these though. The log files are 600MB each day.

2015.01.12 09:35:53: Can't send RPC function because the target is not connected to the server.
2015.01.12 09:35:53: Can't send RPC function because the target is not connected to the server.
2015.01.12 09:35:54: Can't send RPC function because the target is not connected to the server.
2015.01.12 09:35:54: Can't send RPC function because the target is not connected to the server.
2015.01.12 09:35:54: Can't send RPC function because the target is not connected to the server.
2015.01.12 09:35:54: Can't send RPC function because the target is not connected to the server.
2015.01.12 09:35:55: Can't send RPC function because the target is not connected to the server.
2015.01.12 09:35:55: Can't send RPC function because the target is not connected to the server.
2015.01.12 09:35:55: Can't send RPC function because the target is not connected to the server.
2015.01.12 09:35:55: Can't send RPC function because the target is not connected to the server.

Link to comment
Share on other sites

Hi

 

I grepped for "Net.Sockets.SocketException:" but found nothing.

 

I use authentication on the webmap.

 

I get tons of these though. The log files are 600MB each day.

 

You are running a Linux server, aren't you? If so could you check the number of open threads every now and then?

cat /proc/$(cat /home/sdtd/instances/<instancename>/7dtd.pid)/status | grep Threads

 

Also if possible try to watch memory consumption of the game server over time.

Link to comment
Share on other sites

Yes, running on Linux.

 

I'm logging number of thread and memory usage now on two game servers.

 

You are running a Linux server, aren't you? If so could you check the number of open threads every now and then?

cat /proc/$(cat /home/sdtd/instances/<instancename>/7dtd.pid)/status | grep Threads

 

Also if possible try to watch memory consumption of the game server over time.

Link to comment
Share on other sites

Hm, there were no code changes at all from 218 to 222 (only the AC#.dll was patched for b10, now you run b9 on the server).

 

Also "Telnet" and HTTP aren't related in any way, I fear there's some kind of bigger problem in there like thread count problems :( Will continue investigating, maybe after all I have to replace the HTTP library.

 

Btw, are you using the authentication on the webmap?

 

@bolibompa: Do you also get a spam of those log entries as Soylent before the "Telnet" connection hangs?

 

No, not using authentication currently. One of the problems troubleshooting these things is that when the server crashes and restarts, it creates a new output.log file. And when telnet hangs, I can't putty into the server to see what's going on.

Link to comment
Share on other sites

No, not using authentication currently. One of the problems troubleshooting these things is that when the server crashes and restarts, it creates a new output.log file. And when telnet hangs, I can't putty into the server to see what's going on.

Have it create a new log: -logfile "somelog-with-timestamp.txt". If you use the batch file you can use Windows commands to get the current time automatically and insert that to the filename.

 

Do you know at what point it stopped working?

Link to comment
Share on other sites

Have it create a new log: -logfile "somelog-with-timestamp.txt". If you use the batch file you can use Windows commands to get the current time automatically and insert that to the filename.

 

 

Do you know at what point it stopped working?

 

Actually. I don't know when it stops responding to telnet requests.

 

I will make telnet requests and log that too.

I'll be back.

Link to comment
Share on other sites

Actually. I don't know when it stops responding to telnet requests.

 

I will make telnet requests and log that too.

I'll be back.

 

That would be great. Could you use the "webstat" command to do that? It could also give a bit of further information.

Link to comment
Share on other sites

Have it create a new log: -logfile "somelog-with-timestamp.txt". If you use the batch file you can use Windows commands to get the current time automatically and insert that to the filename.

 

 

Do you know at what point it stopped working?

 

I cannot, as it is a rented server. I don't have access to the executable.

Link to comment
Share on other sites

i get the same error alot, windows server

2015-01-26T18:21:48 38543.227 INF Error in ApiHandler.HandleRequest(): Handler threw an exception: System.IO.IOException: Write failure ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host.





 at System.Net.Sockets.Socket.Send (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags) [0x00000] in <filename unknown>:0 


 at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0 


 --- End of inner exception stack trace ---


 at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0 


 at System.Net.ResponseStream.InternalWrite (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in <filename unknown>:0 


 at System.Net.ResponseStream.Write (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in <filename unknown>:0 


 at AllocsFixes.NetConnections.Servers.Web.API.WebAPI.WriteJSON (System.Net.HttpListenerResponse resp, AllocsFixes.JSON.JSONNode root) [0x00000] in <filename unknown>:0 


 at AllocsFixes.NetConnections.Servers.Web.API.GetPlayersLocation.HandleRequest (System.Net.HttpListenerRequest req, System.Net.HttpListenerResponse resp, System.Net.HttpListenerBasicIdentity user) [0x00000] in <filename unknown>:0 


 at AllocsFixes.NetConnections.Servers.Web.ApiHandler.HandleRequest (System.Net.HttpListenerRequest req, System.Net.HttpListenerResponse resp, System.Net.HttpListenerBasicIdentity user) [0x00000] in <filename unknown>:0 


2015-01-26T18:21:48 38543.229 INF Error in Web.HandleRequest(): System.InvalidOperationException: Cannot be changed after headers are sent.


 at System.Net.HttpListenerResponse.set_StatusCode (Int32 value) [0x00000] in <filename unknown>:0 


 at AllocsFixes.NetConnections.Servers.Web.ApiHandler.HandleRequest (System.Net.HttpListenerRequest req, System.Net.HttpListenerResponse resp, System.Net.HttpListenerBasicIdentity user) [0x00000] in <filename unknown>:0 


 at AllocsFixes.NetConnections.Servers.Web.Web.HandleRequest (IAsyncResult result) [0x00000] in <filename unknown>:0 

 

 

here the output from today

 

http://www.7dayszombiestomp.com/log/output_log1262015.txt

Link to comment
Share on other sites

Heh, ok, good point, should have made that clearer as it's an undocumented one ;)

It's one of the mods console commands. Only for debugging purposes so I never wrote it down. Just execute it as the command you run regularly and save the output so I can compare it to the thread/mem monitoring :)

Link to comment
Share on other sites

Hi alloc! I was wondering if it was possible for me to add my own code to your patch?

I tried the steps under "Build yourself" on your website (https://7dtd.illy.bz/wiki/Server%20fixes) but I ran into so many problems. :(

 

building Deobfuscator requires plenty of dependencies, missing patchers.xml, etc

 

Would it be possible to package everything in a zip file, deob bin for windows and maybe a small sample on how to write and add/replace code on top of your mod in the server dll?

 

I would appreciate it a lot!! <3 *makes cute eyes*

There are so many stuff I'd like to add. :)

Link to comment
Share on other sites

My serverhost Vilayer apparently can't add the webserver. this is their response;

 

Sorry for the delay, this is not possible currently as we do not run Linux servers so we cannot run webservers along side the game. We will look in to this and try to find a solution but we do not have an eta, once it is added or not added we will email all customers about the update.

 

Do you know of any way to make it work?

Link to comment
Share on other sites

building Deobfuscator requires plenty of dependencies, missing patchers.xml, etc

Get the release build of the deobfuscator. You don't have to use its source. Also there is no missing dependency, the only thing not included in the source is the patchers.xml which can be taken from any of the releases.

 

Sorry for the delay, this is not possible currently as we do not run Linux servers so we cannot run webservers along side the game.

They neither have to run on Linux nor do they have to run any additional software. The webserver stuff is part of the mod and thus is run from within the game server itself. Just add the webserver-folder to the game's root folder and it will run. They only have to make sure the ports aren't in use by anything else and are not blocked by their firewall.

Link to comment
Share on other sites

Get the release build of the deobfuscator. You don't have to use its source. Also there is no missing dependency, the only thing not included in the source is the patchers.xml which can be taken from any of the releases.

ah right, got it. Got your latest head from your svn and the file webstats.cs is missing (or a bad reference in the csproj?)

Link to comment
Share on other sites

so ummm, I did a lot of poking around, I managed to deob AC dll, build the fixes dll, the fixer exe. Here's some things I did/had to do:

 

open '\binary-improvements\server-fixes.sln' with MonoDevelop

change 7dtd-server-fixes target framework to "Mono/.net 4.0". (was 3.5 and yielded compile errors on default parameters, don't know why)

 

Now I do a full rebuild using Release config. I get the fixer exe and fixes dll under '\binary-improvements\bin\Release' along with all kind of other dll that I'm not sure where they come from. I guess the AC dll in there is the deob one.

run the fixer.exe and get:

 

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)

at System.Reflection.RuntimeMethodInfo.get_CallingConvention()

at Mono.Cecil.MetadataImporter.ImportMethod(MethodBase method, IGenericContext context, ImportGenericKind import_kind)

at dtdfixer.MainClass.addHook(TypeDefinition type, String methodName, Boolean addThisRef, Int32 opCount, Boolean atEnd, MethodBase targetMethod)

at dtdfixer.MainClass.mappingPatch(ModuleDefinition module)

at dtdfixer.MainClass.Main(String[] args)

 

I've poke around a lot to see what I'm doing wrong. Someone said to remove RSA from the deob AC.dll. I don't know what that means nor how to do that.

 

So please tell me what I'm doing wrong here. Any idea or pointers?

Thanks

Edited by StephanieRct (see edit history)
Link to comment
Share on other sites

*one million pokes later*

 

ok I was able to remove the strong name thingy using .Net Reflector + Reflexil v1.8 add-in Strong Name Remover (the tool is a bit hidden under the UI). Select UnityEngine.dll and added my compiled 7dtd-server-fixes.dll and deof Assembly-CSharp.dll under '\binary-improvements\bin\Release'

 

After that painful step, running 7dtd-fixer.exe works.

but not if I compiled it with MonoDevelop. starting the server would yield a truck load of 'System.MissingMethodException: Method not found: 'System.Threading.Monitor.Enter'.' exception (and other methods)

So I built 'binary-improvements\server-fixes.sln' using Visual Studio 2010.

*BUT*

I reverted the solution/projects to the SVN head, so the target framework for fixes dll is back to 3.5.

So I fixed all the 'default parameter not allowed' build errors. (Mostly from JSON code)

Then did a rebuild of everything in Release (Not Release_Version as it does not work if you do not have bash)

 

Then did the Remove Strong name excruciating step again. Copied the dlls to my dedicated server and it WORKS!

omg I still can't believe it!

Link to comment
Share on other sites

Hey Alloc, any idea why the map coords in IE shows with 12 decimal places? Screenshot

No idea. But I'm not explicitly formatting the values either so it might just be non exact calculations or something caused by the floats.

 

change 7dtd-server-fixes target framework to "Mono/.net 4.0". (was 3.5 and yielded compile errors on default parameters, don't know why)

.NET 4 wont work as Unity uses 3.5. Why some people get that default params error ... no idea, never had this happen.

Link to comment
Share on other sites

Hey Folks,

 

I don't know if it's the right place to ask but since it's kinda related to your fixes Alloc I'll just give it try.

 

Well, I'm hosting a 7DTD dedicated server on Ubuntu Server 14.02 64-bit, everything works fine so far, except for one thing and honestly I googl'd my ass off to find a solution but nobody says anything about it.

 

Let's come to the point, on almost every other Server I noticed commands like /rules, /sethome, /gimme, /home, etc and yea I know that you can implement them by running FrontRunnerTeks Servermanager, but since I'm running Ubuntu on the Server I obviously can't use it.

 

So my question is, is there any other possible opportunity to enable chat commands for players via the chat frame and not via console?

 

I would be glad if anyone knows an answer to this.

 

Thanks in advance and best regards

 

pitufocabeza

Link to comment
Share on other sites

You can for example use the hooks if you use my management scripts and code something that way. Or you can run FRTs SM from a Windows machine and have it connect over the network. Finally you could extend the mod to implement chat commands though that's probably the hardest way (especially if you're not familiar with C# and you'd also have to get used to how the chat stuff of the game works).

Link to comment
Share on other sites

Thanks for the quick reply,

 

Thats what I'm currently doing, I'm running FRTs SM on my local PC, but as you can imagine the idea of running the server on a dedicated linux host was that my PC doesn't have to run day and night.

 

So I think I'll will go into the hooks, any advise?

 

Unfortunately my knowledge about C# isn't good enough to extend the mod.

 

Regards

Pitufocabeza

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...