glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] Cleanups...


From: simon schuler
Subject: Re: [glob2-devel] Cleanups...
Date: Mon, 24 Jan 2005 21:54:08 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041229

Nuage wrote:

This is true.

But, for some tricks, we need the "clear()" to set *all* the 32 bits
of this field in a *deterministic* value.

As you know, glob2 networking is based on a "globaly synchoneous"
architecture. Notice that this is techincaly nice, but quite hard to
work with it!

To improve the chance to detect a desynchronisation bug, and detect it
faster, there is a ::checksum() method in all important objects. The
"Map" use it. And in order it to be computed as fast as possible, it
use a 32-bits length access. It use "Ressource::getUint32()". Here is
the problem. If the inital value of this 32bits field is not correctly
initialised, the checlsum result will not be the same on every computer.
This is the reason why your parch can't be applied, sorry.

Another reason, would be that we want to keep all values of the engine
to behave in a deterministic behaviour. Therefor un-initialised values,
even in unused fields should be avoided. (despite it's not always
made, nor possible).

Still, it's possible to make the Map::checksum() to be insensitive on
the non-initalised values. If you still want to make it ?


Don't hesitate to ask! Is it clear enough ?
Nuage


simon schuler wrote:

another trivial patch, that shouldn't change anything in the Game (just for readability and coding style): If NO_RES_TYPE is already defined, it should be used; no need to set the other members, as they're undefined after setting type=NO_RES_TYPE.

simon



------------------------------------------------------------------------

_______________________________________________
glob2-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/glob2-devel



_______________________________________________
glob2-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/glob2-devel


Hmm, yes I see...
I just read this:

   //! No ressource identifier. This correspond to ressource type 255.
   On this case, variety, amout and animation are undefined.

   #define NO_RES_TYPE 0xFF

and checked if the patch breaks any code, but I didn't see any code that used the other fields when type=NO_RES_TYPE so, just ignore this patch, as it was just cosmetics anyway... I just think it's better not to do unused things, as it could hide bugs in other functions.
I'll have a look at the checksum part

thanks for the reply
Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]