ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/lowlevel.C
(Generate patch)

Comparing deliantra/server/socket/lowlevel.C (file contents):
Revision 1.36 by root, Wed Mar 14 15:44:47 2007 UTC vs.
Revision 1.39 by root, Mon Apr 23 19:10:17 2007 UTC

190static struct packet_type packets[] = { 190static struct packet_type packets[] = {
191 {"ncom", PC(NewPlayerCmd) PF_PLAYING | PF_COMMAND6 }, 191 {"ncom", PC(NewPlayerCmd) PF_PLAYING | PF_COMMAND6 },
192 {"command", PC(PlayerCmd) PF_PLAYING | PF_COMMAND0 }, 192 {"command", PC(PlayerCmd) PF_PLAYING | PF_COMMAND0 },
193 193
194 {"examine", PC(ExamineCmd) PF_PLAYING }, 194 {"examine", PC(ExamineCmd) PF_PLAYING },
195 {"ex", PC(ExCmd) PF_PLAYING },
195 {"apply", PC(ApplyCmd) PF_PLAYING }, 196 {"apply", PC(ApplyCmd) PF_PLAYING },
196 {"lookat", PC(LookAt) PF_PLAYING }, 197 {"lookat", PC(LookAt) PF_PLAYING },
197 {"lock", PC(LockItem) PF_PLAYING }, 198 {"lock", PC(LockItem) PF_PLAYING },
198 {"mark", PC(MarkItem) PF_PLAYING }, 199 {"mark", PC(MarkItem) PF_PLAYING },
199 {"move", PC(MoveCmd) PF_PLAYING }, 200 {"move", PC(MoveCmd) PF_PLAYING },
200 {"ext", PC(ExtCmd) 0 }, /* CF+ */ 201 {"ext", PC(ExtCmd) 0 }, // CF+
201 {"mapredraw", PC(MapRedrawCmd) 0 }, /* Added: phil */ 202 {"mapredraw", PC(MapRedrawCmd) 0 },
202 {"mapinfo", PC(MapInfoCmd) 0 }, /* CF+ */ 203 {"mapinfo", PC(MapInfoCmd) 0 }, // CF+
203 204
204 {"reply", SC(ReplyCmd) 0 }, 205 {"reply", SC(ReplyCmd) 0 },
205 {"exti", SC(ExtiCmd) 0 }, /* CF+ */ 206 {"exti", SC(ExtiCmd) 0 }, // CF+
206 {"addme", SC(AddMeCmd) 0 }, 207 {"addme", SC(AddMeCmd) 0 },
207 {"askface", SC(AskFaceCmd) 0 }, 208 {"askface", SC(AskFaceCmd) 0 },
208 {"requestinfo", SC(RequestInfo) 0 }, 209 {"requestinfo", SC(RequestInfo) 0 },
209 {"setfacemode", SC(SetFaceMode) 0 }, 210 {"setfacemode", SC(SetFaceMode) 0 },
210 {"setsound", SC(SetSound) 0 }, 211 {"setsound", SC(SetSound) 0 },
525 int len = strlen (name); 526 int len = strlen (name);
526 memcpy (cur, name, len); cur += len; 527 memcpy (cur, name, len); cur += len;
527 *cur++ = ' '; 528 *cur++ = ' ';
528} 529}
529 530
531packet &packet::operator <<(const ber32 v)
532{
533 enum { maxlen = 32 / 7 + 1};
534 uint8 buf[maxlen];
535 uint8 *p = buf + maxlen;
536 uint32 val = v.val;
537
538 *--p = val & 0x7F;
539
540 while (val > 0x7F)
541 {
542 val >>= 7;
543 *--p = (val & 0x7F) | 0x80;
544 }
545
546 return *this << data (p, buf + maxlen - p);
547}
548
530packet &packet::operator <<(const data &v) 549packet &packet::operator <<(const data &v)
531{ 550{
532 if (room () < v.len) 551 if (room () < v.len)
533 reset (); 552 reset ();
534 else 553 else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines