Skip to main content
Topic: Further network compatibility query (Read 1977 times) previous topic - next topic

Further network compatibility query

If I want a particular method to be called whenever a player joins a network game, where should I put the instruction to call it?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: Further network compatibility query

Reply #1
Depens if server or clientwise; but there is network_cmd.cc with nwc_join_t cl**** ...

Re: Further network compatibility query

Reply #2
Suppose a new client joins the server - where are methods called then? The reason that I am asking is because, in Experimental, I am setting up a system to check which towns are connected to which other towns by road, and, because those values aren't saved or transmitted accross the network, they need to be recalculated (for all players) on loading or a new player joining.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: Further network compatibility query

Reply #3
... on loading or a new player joining.
After transmitting the game, it is loaded by the client the same way as a normal savegame. That said, it should be safe for you to put these calculations in the rdwr() methods.
Parsley, sage, rosemary, and maggikraut.

Re: Further network compatibility query

Reply #4
All clients (and the server too) saves their game and loading it at the time another player joins, since also simutrans standrad has many stuff that happens during loading of games. You most likely do not have to change something.

 

Re: Further network compatibility query

Reply #5
Thank you very much :-)
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.