From: <no...@so...> - 2002-02-20 14:34:46
|
Bugs item #520395, was opened at 2002-02-20 01:37 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103248&aid=520395&group_id=3248 Category: BZFS Group: None Status: Open Resolution: None Priority: 5 Submitted By: Dave Brosius (dbrosius) Assigned to: Tim Riker (timriker) Summary: ID patching not right for MsgGrab/Drop Initial Comment: Would someone please do a sanity check here? In static void patchMessage(PlayerId fromId, PlayerId toId, const void *msg) in bzfs.cpp is this code case MsgDropFlag: case MsgGrabFlag: if (len > 28) // server version patchPlayerId(fromId, toId, msg, 4); patchPlayerId(fromId, toId, msg, 20); break; ;; When these messages go from client to server, besides sending the PlayerID at pos 4, they send MsgDropFlag -> position MsgGrabFlag -> flagIndex (in other words small amount of data) When these messages go from server to client, besides sending the PlayerID at pos 4, they send Both -> flagIndex, flagInfo So when the buffer is big, there's a flagInfo there, and inside that is an owner with a playerID, that needs patching. So, I think the code should be case MsgDropFlag: case MsgGrabFlag: if (len > 28) { // server version // patch owner in flagInfo patchPlayerId(fromId, toId, msg, 16); } patchPlayerId(fromId, toId, msg, 4); break; ; >> Secondly, the offset I believe is 16 ByteOffset Info ------------------------- 0 Msgcode/length 4 PlayerID 8 flagIndex 10 FlagID 12 flagstatus 14 flagtype 16 OWNER Right? ---------------------------------------------------------------------- Comment By: Dave Brosius (dbrosius) Date: 2002-02-20 06:34 Message: Logged In: YES user_id=66596 Hey Frank, Thanks... Of course,, dang your right. PlayeriD length is 8.... was looking at Address.unpack. I'm an idiot. And *blush* yup client messages don't have playerIDs at offset 4. Slap me again. <Protocol.h is wrong then> But, Where is the PlayerID at offset 20 for client messages? case MsgDropFlag: case MsgGrabFlag: if (len > 28) // server version patchPlayerId(fromId, toId, msg, 4); >>>> patchPlayerId(fromId, toId, msg, 20); break; The client does: void ServerLink::sendDropFlag(const float* position) { char msg[12]; void* buf = msg; buf = nboPackVector(buf, position); send(MsgDropFlag, sizeof(msg), msg); } Then doesn't that if need braces? case MsgDropFlag: case MsgGrabFlag: if (len > 28) { // server version patchPlayerId(fromId, toId, msg, 4); patchPlayerId(fromId, toId, msg, 20); } break; ---------------------------------------------------------------------- Comment By: Frank Thilo (chestal) Date: 2002-02-20 02:52 Message: Logged In: YES user_id=48940 I think the current code is correct. I am not using E5 server right now, but when I used it I remember that at least that part of it worked flawless. Other bugs have been fixed in the meantime, except for the UDP incompatibility with old clients (which of course is actualyl a bug in the old clients). The offset of +20 is correct, PlayerID has a size of 8 bytes, not 4 as in your table. The client messages do not need patching because they do not contain a PlayerId at all. For MsgGrabFlag the flag number is at offset 4, for DropFlag it's the x coordinate. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=103248&aid=520395&group_id=3248 |