Im in a situation where i have 3 programs, namely a matchmaking server, a gameserver and a client.
- the matchmaking server runs 2 servers, one for the clients to connect to and one for the gameservers.
- the client runs 2 clients, one connecting to the matchmaking server and the other one connecting to the gameserver once it was told to do so by the matchmaking server.
- the gameserver should run one client and one server, the client connecting to the matchmaking server, and the server for clients connections
Im now facing some Serialization / Registration issues, especially on the gameserver.
when i start the gameserver server before i start its client to the matchmaking server, there is a message in the log saying “Skipping registration as registry is locked, presumably by a local server process.”. The comment above the logging line in the source code assumes that this is intended in case the client and server are meant to connect to each other, or in case thats not wanted (in my case also) one would have to disable ServerSerializerRegistrationsService.
How exactly would i go about doing that? I mean i can probably disable it but wouldnt i somehow have to replace its functionality?
When i do it the other way round and connect the gamservers client to the matchmaking server before i start the gameservers server for clients, i get “java.lang.IllegalArgumentException: Channel is undefined:0” when trying to do rmi calls to the matchmaking server (the matchmaking server has properly setup that extra channel). i guess that is because the server i started later has overriden some serialization settings?
And since i guess its related to this, in the sim-es-eth example, a DelayService is added to do some delay once a new client has connected. the comment above it tells that is to assure some serialization has been probably properly finished. I guess its not something that should appear in a final release, so out of interest, how would i go about solving the problem this solution temporarily solves? maybe @pspeed already had a cleaner solution in mind when saying its for debugging only?
Yes i know, my code must look fine from over there, but im not about getting it to work, im about understanding whats actually behind the serialization process.
I understand that serialization should be done on the server, so once the serialization is done the server can send some precompiled serialization instructions that are used on the clients then so there is no need to ensure exact same serialization code on client and server. Just this seems to be singleton style and i would like to understand how i would go about doing this in my situation
EDIT: i see 2 solutions:
- have all code that either of the 3 server-client-connections use (2 servers on matchmakingserver and 1 server on gameserver) and register them all together so even the gameserver would have the serialization information that would actually only be needed for matchmaking - client connections.
- basically copy and paste all Serializer related code and make it not static / singleton, but that would enclude a whole lot of code that i would have to dublicate
is this the only solutions?
Many thanks and greetings from the shire,