Invalid Packet ?
by Devil`s Workshop · in Torque Game Engine · 08/09/2003 (5:58 pm) · 9 replies
Strange...after applying the modifications(www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2150) i can't start any mission. The engine is giving me a invalid packet message.
"Connection error: Invalid packet from server.."
Anybody got an idea how to fix that ?
Thanks,
Alexander
PS: Checked the code again..can't see any typos or similar errors :(
PPS: Has SkinMask to remain in shapebase.cc/h?
"Connection error: Invalid packet from server.."
Anybody got an idea how to fix that ?
Thanks,
Alexander
PS: Checked the code again..can't see any typos or similar errors :(
PPS: Has SkinMask to remain in shapebase.cc/h?
// Network state masks
enum ShapeBaseMasks {
NameMask = Parent::NextFreeMask,
DamageMask = Parent::NextFreeMask << 1,
NoWarpMask = Parent::NextFreeMask << 2,
MountedMask = Parent::NextFreeMask << 3,
CloakMask = Parent::NextFreeMask << 4,
ShieldMask = Parent::NextFreeMask << 5,
InvincibleMask = Parent::NextFreeMask << 6,
SkinMask = Parent::NextFreeMask << 7,
//Preacher old above
HideNodeMask = Parent::NextFreeMask << 8,
SoundMaskN = Parent::NextFreeMask << 9, // Extends + MaxSoundThreads bits// was 8
ThreadMaskN = SoundMaskN << MaxSoundThreads, // Extends + MaxScriptThreads bits
ImageMaskN = ThreadMaskN << MaxScriptThreads, // Extends + MaxMountedImage bits
NextFreeMask = ImageMaskN << MaxMountedImages
};from shapebase.hif (stream->writeFlag(mask & SkinMask)) {
con->packStringHandleU(stream, mSkinNameHandle);
// RFB ->
mathWrite(*stream, mLightDir);
// <- RFB
}from shapebase.ccAbout the author
#2
but as far as I can tell your at 32.
5 before ShapeBase
14 at SoundMaskN = Parent::NextFreeMask << 9,
so add 4 for MaxSoundThreads
add 4 for MaxScriptThreads
add 8 for MaxMountedImages
plus the 2 more you have added to your edition
(SkinMask|HideNodeMask)
is 32
if any of the 3 Max* has changed. you'll be in trouble.
08/09/2003 (10:46 pm)
I might be off by one ..but as far as I can tell your at 32.
5 before ShapeBase
14 at SoundMaskN = Parent::NextFreeMask << 9,
so add 4 for MaxSoundThreads
add 4 for MaxScriptThreads
add 8 for MaxMountedImages
plus the 2 more you have added to your edition
(SkinMask|HideNodeMask)
is 32
if any of the 3 Max* has changed. you'll be in trouble.
#3
still wondering about the error message. Anybody else recieving the message ?
08/10/2003 (7:05 am)
Hmm, still wondering about the error message. Anybody else recieving the message ?
#4
If you have over 32 mask bits, this will happen, as Torque allocates only 4 bytes for flags (this can be changed, but it's better to work around it than to incur a bandwidth penalty), and the code will therefore not work properly.
All clear?
08/10/2003 (11:26 am)
The error message means that the packet read/write code mismatched and the client was unable to read what the server wrote.If you have over 32 mask bits, this will happen, as Torque allocates only 4 bytes for flags (this can be changed, but it's better to work around it than to incur a bandwidth penalty), and the code will therefore not work properly.
All clear?
#5
I'm not really sure how to extend the mask to use some part of the 32 bits by differnt masks.
So for example share the bits used by Invincible Mask .
Thanks,
Alexander
08/11/2003 (6:38 pm)
Ok, got that. But the problem now is how to get it still working ;)I'm not really sure how to extend the mask to use some part of the 32 bits by differnt masks.
So for example share the bits used by Invincible Mask .
Thanks,
Alexander
#6
08/13/2003 (7:45 am)
Nobody uses the HideNode Ressource ? How you're got it working with recent HEAD ??
#7
08/13/2003 (11:17 am)
Never heard of that resource... Never used it, anyway.
#8
Well currently the only problem is to add the HideNodeMask. In the ressource this mask was added as 7th (see source) but after the SkinMask has been added to HEAD (at 7th position) the HideNodeMask has to be added at a new position. That's my problem so far, i've only to know how to extend the mask to add the HideNodeMask.
08/13/2003 (11:28 am)
public:
ShapeBase();
~ShapeBase();
TSShapeInstance* getShapeInstance() { return mShapeInstance; }
// Network state masks
enum ShapeBaseMasks {
NameMask = Parent::NextFreeMask,
DamageMask = Parent::NextFreeMask << 1,
NoWarpMask = Parent::NextFreeMask << 2,
MountedMask = Parent::NextFreeMask << 3,
CloakMask = Parent::NextFreeMask << 4,
ShieldMask = Parent::NextFreeMask << 5,
InvincibleMask = Parent::NextFreeMask << 6,
SkinMask = Parent::NextFreeMask << 7,
//HideNodeMask = Parent::NextFreeMask << 7,
SoundMaskN = Parent::NextFreeMask << 8, // Extends + MaxSoundThreads bits// was 8
ThreadMaskN = SoundMaskN << MaxSoundThreads, // Extends + MaxScriptThreads bits
ImageMaskN = ThreadMaskN << MaxScriptThreads, // Extends + MaxMountedImage bits
NextFreeMask = ImageMaskN << MaxMountedImages,
};
enum BaseMaskConstants {
SoundMask = (SoundMaskN << MaxSoundThreads) - SoundMaskN,
ThreadMask = (ThreadMaskN << MaxScriptThreads) - ThreadMaskN,
ImageMask = (ImageMaskN << MaxMountedImages) - ImageMaskN
};
//Preacher
bool isHiddenNode(S32 node); // checks mHiddenNodes array
//<PreacherWell currently the only problem is to add the HideNodeMask. In the ressource this mask was added as 7th (see source) but after the SkinMask has been added to HEAD (at 7th position) the HideNodeMask has to be added at a new position. That's my problem so far, i've only to know how to extend the mask to add the HideNodeMask.
#9
but im pretty sure like I said before .. if you Add this bit you will overflow the mask.
but now if you count the bits you will see too many.
you should pack up a new mask.
and modify the code to use one mask as a series test.
example:
now with SeriesMask, if you find it in the netmask
you have to send another mask (one you will define & pack)
and parse that mask on the other side
08/13/2003 (11:36 am)
Simple...but im pretty sure like I said before .. if you Add this bit you will overflow the mask.
... SkinMask = Parent::NextFreeMask << 7, HideNodeMask = Parent::NextFreeMask << 8, SoundMaskN = Parent::NextFreeMask << 9, // slip it in change this one to 9
but now if you count the bits you will see too many.
you should pack up a new mask.
and modify the code to use one mask as a series test.
example:
... SkinMask = Parent::NextFreeMask << 7, SeriesMask = Parent::NextFreeMask << 8, SoundMaskN = Parent::NextFreeMask << 9, // slip it in change this one to 9
now with SeriesMask, if you find it in the netmask
you have to send another mask (one you will define & pack)
and parse that mask on the other side
Associate Kyle Carter