H&D2 Server Manager Source Code

1 year 5 months ago #13 by snowman
Replied by snowman on topic H&D2 Server Manager Source Code
Maybe Paul can enlighten us again... if I remember correctly the discussion he mentioned:

Hidden and Dangerous Server Manager - Launches the server but can't access the console because it identifies them by name on the server windows and windows in WINE don't have the correct name on the server console windows.

also that he is not using Linux, but FreeBSD.

"HD2 Server console - justice" where "justice" is the name of the server you have in the Sever Manager, so each server you add from there gets added to the console name after HD2 Server console -.

Stern, the idea with different mpmaplists is genius! I was thinking of something similar, more specifically, also about ProSabre's maplist editor. So you can also alter the mission items from the server manager. I know that wouldn't be easy to implement, just a similar idea, maybe.

Metox, maybe there's a way to run send the commands through Wine? I'm don't know enough even to suggest this and the idea sounds too complicated. Somehow making everything work with Wine seems the way to go. But this would mean whoever is working on the Server Manager is also able to test on Linux.

"Straight and narrow is the path."

Please Log in or Create an account to join the conversation.

1 year 5 months ago #14 by Stern
Replied by Stern on topic H&D2 Server Manager Source Code
So this BSD is complete different ?
But why mess with Linux if server can work on MS Windows and this BSD ?

This is what seems to fail the usage of ServerManager:

toadlife post=25353Stern" post=25352

ServerManager changes title to be able to work with multiple servers
That's what fails with WINE. Server manager fails to change the window title when it launches the server which makes everything else fail.

The console text logger has the same limitation under wine because it goes by window title.

But it can be something else:
I found that ServerManager makes changes in Console memory to make it work with 64 player slots.
And this memory moddification is made before changing Console Title.
 

The one who hesitates is lost !
The following user(s) said Thank You: snowman

Please Log in or Create an account to join the conversation.

1 year 5 months ago #15 by snowman
Replied by snowman on topic H&D2 Server Manager Source Code

But it can be something else:
I found that ServerManager makes changes in Console memory to make it work with 64 player slots.
And this memory moddification is made before changing Console Title.
 
So this means it's possible to add more slots to the servers? I've added 63 on the party event because on 64 is just gives a /0 at the number of slots available. As you've seen no more than 32 players could join at one time. That's why I've already prepared another config on Otto, because it was never tested with more than 32, at least I've never seen it.

"Straight and narrow is the path."

Please Log in or Create an account to join the conversation.

1 year 5 months ago #16 by MeToX
Replied by MeToX on topic H&D2 Server Manager Source Code

Running HD2 server on Linux is no problem, there's a servers named Blair Coop, that runs on Linux and these servers are stable and have less bugs (for Clients) than RPR servers.

Thank you, this is very interesting actually, so atleast WINE can do the job and the software doesent need to be recompiled.

ServerManager changes that to work with multiple servers, it must have something to recognize each server to pinpoint correct one if user makes changes.

This is strange... Every process has its own unique ID, no matter what the name of the application is or if an application with that name already runs (unless specified). If you initiate a new process with the CreateProcess function you can get its ID via the "lpProcessInformation" pointer
.
In linux its similar with the PIDs. It would be much easier if the manager sends messages with the given IDs but maybe there are also other reasons why the title altering was necessary, or maybe I am just missing something. Any ideas?

I found that ServerManager makes changes in Console memory to make it work with 64 player slots.
And this memory moddification is made before changing Console Title.

Yea as snow already mentioned, it shows 64 players but it doesent help becaue the server can't simply handle more than 32 players. To make this possible I am afraid that more changes deep in the net code need to be applied.

Metox, maybe there's a way to run send the commands through Wine? I'm don't know enough even to suggest this and the idea sounds too complicated. Somehow making everything work with Wine seems the way to go. But this would mean whoever is working on the Server Manager is also able to test on Linux.

I have to admit that I never used WINE, but I would expect that it is capable of sending commands if the PIDs are given. I can ensure you one thing though: Making it work with WINE is still a lot easier and faster than reverse engineer the whole HD2DS.exe so I guess we should work on that.
The following user(s) said Thank You: snowman

Please Log in or Create an account to join the conversation.

1 year 5 months ago #17 by Stern
Replied by Stern on topic H&D2 Server Manager Source Code

But it can be something else:
I found that ServerManager makes changes in Console memory to make it work with 64 player slots.
And this memory moddification is made before changing Console Title.

 
So this means it's possible to add more slots to the servers? I've added 63 on the party event because on 64 is just gives a /0 at the number of slots available. As you've seen no more than 32 players could join at one time. That's why I've already prepared another config on Otto, because it was never tested with more than 32, at least I'venever seen it.
 
I dont know, but my point was that if this ability is not coded into Console then simple memory hack cannot add this ability anyway and it might make Console unstable.
This part of code i would disable.
And maybe this memory modification makes Console to crash in WINE.

 

U mean this:
https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa

I guess the reason was just its simple to hook the process to Title.
And it gives a chance to other programs (example RSC) to be able to work with multiple server consoles.

The one who hesitates is lost !
The following user(s) said Thank You: snowman

Please Log in or Create an account to join the conversation.

1 year 5 months ago - 1 year 5 months ago #18 by Stern
Replied by Stern on topic H&D2 Server Manager Source Code
I tested this mpmaplist reading part, just a test program that has only this part of code (I cannot compile original source files.) and it can easily read file of 1,5 MB so no problems there, limit should be in connection.

This might be the limit of data, 65535 bytes
 
 
Stream:=TWinSocketStream.Create (ClientSocket,0);    
GetMem (RecvBuffer,65535);    
GetMem (SendBuffer,65535);



Connection loss:
MAX_CLIENT_INACTIVITY  = 300;     

300s=5minutes.
And If im correct this isnt coded to be real in-activity, its just forced timeout, no matter if user is doing something or not.
 

The one who hesitates is lost !
The following user(s) said Thank You: snowman

Please Log in or Create an account to join the conversation.

  • reamy birthday is in 3 days (71)
  • czSemtex birthday is in 5 days (27)
  • Gendolf birthday is in 5 days (38)
  • Jetswinger birthday is in 6 days (35)
  • kerrand birthday is in 9 days (26)
Powered by Kunena Forum