News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Further network compatibility query

Started by jamespetts, April 26, 2010, 07:12:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

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.

prissi

Depens if server or clientwise; but there is network_cmd.cc with nwc_join_t class ...

jamespetts

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.

Dwachs

Quote from: jamespetts on April 26, 2010, 10:15:16 PM... 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.

prissi

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.

jamespetts

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.