Skip to main content
Topic: Network compatibility query (Read 2297 times) previous topic - next topic

Network compatibility query

I am trying to work on making the automatic convoy  replacer in Simutrans-Experimental network compatible. In former verseions of Experimental, the convoy replacer has used a vector of vehicles and a few bool flags in convoi_t object itself, but I am moving the system over to using a new cl****. replace_data_t, in order to save memory when the convoy replacing is not being used (storing just a single null pointer in that case rather than an empty vector and a large number of bool flags).

However, to make it network compatible, I have to p**** more than a pointer from simwerkz.cc, since the pointers will, of course, point to different memory locations on different machines. How do I best propogate a new replace_data_t cl**** amongst convoys from a GIUI window? I imagine that it would be something similar to the position in respect of schedules/lines - is that right? Also, to copy from one convoy to another, I have to use, I imagine, call_convoi_tool to p**** the ID of the convoy from which the object needs to be copied to the convoy to which the object needs to be copied;  how best to modifiy call_convoi_tool to take an additional parameter being an additional convoy  ID? I tried last night, and it didn't work properly?

I should be very grateful for any ****istance with the tricky network compatibility complexities!
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: Network compatibility query

Reply #1
Why not use a procedure similar to the transferring of the schedule's: printf/scanf everything to/from the extra parameter.
Parsley, sage, rosemary, and maggikraut.

 

Re: Network compatibility query

Reply #2
That's what I wad thinking, but I haven't delved into that code in detail - how does it work, in outline? How best to implement 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: Network compatibility query

Reply #3
Jsut look in
bool wkz_change_convoi_t::init( karte_t *welt, spieler_t *sp )
case 'g'.

There fpl->sscanf_schedule( p ); appears.

The printf is somewhere else. You should figure this out youself ;)
Parsley, sage, rosemary, and maggikraut.