ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/network.h
(Generate patch)

Comparing deliantra/server/include/network.h (file contents):
Revision 1.8 by pippijn, Mon Jan 15 21:06:19 2007 UTC vs.
Revision 1.9 by root, Mon Apr 2 19:56:11 2007 UTC

258 data16 (const void *ptr, int len) : len (len), ptr (ptr) { } 258 data16 (const void *ptr, int len) : len (len), ptr (ptr) { }
259 data16 (const char *str) : len (strlen (str ? str : 0)), ptr ((void *)str) { } 259 data16 (const char *str) : len (strlen (str ? str : 0)), ptr ((void *)str) { }
260 data16 (const shstr &sh) : len (sh.length ()), ptr ((void *)&sh) { } 260 data16 (const shstr &sh) : len (sh.length ()), ptr ((void *)&sh) { }
261}; 261};
262 262
263struct ber32
264{
265 uint32 val;
266
267 ber32 (uint32 val) : val (val) { }
268};
269
263/* Contains the base information we use to make up a packet we want to send. */ 270/* Contains the base information we use to make up a packet we want to send. */
264struct packet 271struct packet
265{ 272{
266 enum { bufsize = MAXSOCKBUF }; 273 enum { bufsize = MAXSOCKBUF };
267 enum { hdrlen = 2 }; // keep this many bytes free at the front 274 enum { hdrlen = 2 }; // keep this many bytes free at the front
299 packet &operator <<(sint16 v) { return *this << (uint16)v; } 306 packet &operator <<(sint16 v) { return *this << (uint16)v; }
300 packet &operator <<(sint32 v) { return *this << (uint32)v; } 307 packet &operator <<(sint32 v) { return *this << (uint32)v; }
301 packet &operator <<(sint64 v) { return *this << (uint64)v; } 308 packet &operator <<(sint64 v) { return *this << (uint64)v; }
302 309
303 // checked 310 // checked
311 packet &operator <<(const ber32 v);
312
304 packet &operator <<(const data &v); 313 packet &operator <<(const data &v);
305 packet &operator <<(const data8 &v); 314 packet &operator <<(const data8 &v);
306 packet &operator <<(const data16 &v); 315 packet &operator <<(const data16 &v);
307 316
308 packet &operator <<(const char *v); 317 packet &operator <<(const char *v);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines