Archived from groups: alt.games.vga-planets (More info?)
>> Other clients running at the same time can be served. Hit Save, do
>> something with the other client, hit Load. OK, the Load didn't work until
>> this thread came up, but it does now
In CVS.
>
> How do you avoid that gibberish is written to the files if both clients
> have the idea that they want to save files simultaneously?
>
> That aside, if your "save" rewrites the game data from scratch, it would
> work. However, if you only update the things you changed (which is what
> VPA does), you could accidentially generate inconsistent data files:
JVPC writes from scratch; If you edit in two clients and save after each
other, half the edits will be gone. If you press save in two clients at
the same time, I know of no way to prevent gibberish. User will have to be
slightly dumb and very quick for that, these days.
Having most programmers on this list, could we use some sort of
lockfile to prevent gibberish in our clients? Inasmuch as DOS has
lockfiles...
> Say you have three ships with 100 kt fuel each. In VPA instance A, you
> move 100 kt from ship 1 to ship 2. When you save that, you have
> 0/200/100 on disk, which is valid. In VPA instance B, you move 100 kt
> from ship 1 to 3, and save that. So you now have 0/200/200 on disk. If
> you serialize things by using a shell-to-$OS function, this won't happen.
Full ack.
(part of the no-criticism, really
>> RVV even goes as far as skipping messages on a Reload, since there is only
>> a class of "editable" data that you need. I suppose I could skip reading
>> files like target??.dat as well.
>
> What if the program you shell to updates messages (UFO4VPA)? What if it
> merges targetX.dat files?
RVV will take care of all data and messages itself, no need for ufo4vpa
JVPC does not, I think it will reread everything, unknowing and
uncaring about the change. I like the symmetry of full-Load combined
with full-Save. I'd better document it somewhere...
OK, I haven't thought about ufo4vpa before. I will put a check
on the todolist of RVV.
NB: from the sound of it, ufo4vpa adds incoming messages? from another
source of incoming data? Sounds horrible, if you ask me...
+--- Kero ----------------------- kero@chello@nl ---+
| all the meaningless and empty words I spoke |
| Promises -- The Cranberries |
+--- M38c --- http://httpd.chello.nl/k.vangelder ---+
>> Other clients running at the same time can be served. Hit Save, do
>> something with the other client, hit Load. OK, the Load didn't work until
>> this thread came up, but it does now

>
> How do you avoid that gibberish is written to the files if both clients
> have the idea that they want to save files simultaneously?
>
> That aside, if your "save" rewrites the game data from scratch, it would
> work. However, if you only update the things you changed (which is what
> VPA does), you could accidentially generate inconsistent data files:
JVPC writes from scratch; If you edit in two clients and save after each
other, half the edits will be gone. If you press save in two clients at
the same time, I know of no way to prevent gibberish. User will have to be
slightly dumb and very quick for that, these days.
Having most programmers on this list, could we use some sort of
lockfile to prevent gibberish in our clients? Inasmuch as DOS has
lockfiles...
> Say you have three ships with 100 kt fuel each. In VPA instance A, you
> move 100 kt from ship 1 to ship 2. When you save that, you have
> 0/200/100 on disk, which is valid. In VPA instance B, you move 100 kt
> from ship 1 to 3, and save that. So you now have 0/200/200 on disk. If
> you serialize things by using a shell-to-$OS function, this won't happen.
Full ack.
(part of the no-criticism, really

>> RVV even goes as far as skipping messages on a Reload, since there is only
>> a class of "editable" data that you need. I suppose I could skip reading
>> files like target??.dat as well.
>
> What if the program you shell to updates messages (UFO4VPA)? What if it
> merges targetX.dat files?
RVV will take care of all data and messages itself, no need for ufo4vpa

JVPC does not, I think it will reread everything, unknowing and
uncaring about the change. I like the symmetry of full-Load combined
with full-Save. I'd better document it somewhere...
OK, I haven't thought about ufo4vpa before. I will put a check
on the todolist of RVV.
NB: from the sound of it, ufo4vpa adds incoming messages? from another
source of incoming data? Sounds horrible, if you ask me...
+--- Kero ----------------------- kero@chello@nl ---+
| all the meaningless and empty words I spoke |
| Promises -- The Cranberries |
+--- M38c --- http://httpd.chello.nl/k.vangelder ---+