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.15 by root, Sat Jul 28 12:02:58 2007 UTC vs.
Revision 1.16 by root, Sun Jul 29 02:24:34 2007 UTC

267{ 267{
268 enum { size = 5 }; // maximum length of an encoded ber32 268 enum { size = 5 }; // maximum length of an encoded ber32
269 uint32 val; 269 uint32 val;
270 270
271 ber32 (uint32 val) : val (val) { } 271 ber32 (uint32 val) : val (val) { }
272
273 static int encoded_size (uint32 val)
274 {
275 if (val >= (1 << 7*4)) return 5;
276 if (val >= (1 << 7*3)) return 4;
277 if (val >= (1 << 7*2)) return 3;
278 if (val >= (1 << 7*1)) return 2;
279 return 1;
280 }
272}; 281};
273 282
274/* Contains the base information we use to make up a packet we want to send. */ 283/* Contains the base information we use to make up a packet we want to send. */
275struct packet 284struct packet
276{ 285{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines