Last change
on this file since 729 was
673,
checked in by rgrieder, 17 years ago
|
- deleted obsolete classes: BaseEntity, Entity, Light and SceneNode (please complain if not agreed)
- improved include guard naming consistency
|
File size:
1.5 KB
|
Line | |
---|
1 | // |
---|
2 | // C++ Interface: PacketTypes |
---|
3 | // |
---|
4 | // Description: |
---|
5 | // |
---|
6 | // |
---|
7 | // Author: <>, (C) 2007 |
---|
8 | // |
---|
9 | // Copyright: See COPYING file that comes with this distribution |
---|
10 | // |
---|
11 | // |
---|
12 | |
---|
13 | #ifndef _PacketTypes_H__ |
---|
14 | #define _PacketTypes_H__ |
---|
15 | |
---|
16 | namespace network{ |
---|
17 | enum packet_id { |
---|
18 | ACK, |
---|
19 | MOUSE, |
---|
20 | KEYBOARD, |
---|
21 | CHAT, |
---|
22 | GAMESTATE , |
---|
23 | CLASSID |
---|
24 | }; |
---|
25 | |
---|
26 | |
---|
27 | /** |
---|
28 | * This struct defines a gamestate: |
---|
29 | * size: total size of the data in *data |
---|
30 | * data: pointer to the data allocated in the memory |
---|
31 | */ |
---|
32 | struct GameState{ |
---|
33 | int id; |
---|
34 | int size; //!< total size of data |
---|
35 | // new ---- change functions |
---|
36 | bool diffed; |
---|
37 | unsigned char *data; //!< pointer to data |
---|
38 | }; |
---|
39 | |
---|
40 | /** |
---|
41 | * this struct defines a gamestate: |
---|
42 | * compsize is the size of the compressed data |
---|
43 | * normsize is the size of the uncompressed data |
---|
44 | * data are the gamestates |
---|
45 | */ |
---|
46 | struct GameStateCompressed{ |
---|
47 | int id; |
---|
48 | int compsize; //!< size of compressed data |
---|
49 | int normsize; //!< size of uncompressed data |
---|
50 | // new ----- change functions |
---|
51 | bool diffed; |
---|
52 | unsigned char *data; //!< gamestate data |
---|
53 | }; |
---|
54 | |
---|
55 | struct classid{ |
---|
56 | int id; |
---|
57 | int length; |
---|
58 | int clid; |
---|
59 | const char *message; |
---|
60 | }; |
---|
61 | |
---|
62 | |
---|
63 | struct ack { |
---|
64 | int id; |
---|
65 | int a; |
---|
66 | }; |
---|
67 | |
---|
68 | struct mouse { |
---|
69 | int id; |
---|
70 | double x; |
---|
71 | double y; |
---|
72 | }; |
---|
73 | |
---|
74 | struct keyboard { |
---|
75 | int id; |
---|
76 | char press; |
---|
77 | }; |
---|
78 | //only in this class, not PacketGenerator, used as pattern to put incoming |
---|
79 | //bytes inside |
---|
80 | struct chat { |
---|
81 | int id; |
---|
82 | const char* message; |
---|
83 | }; |
---|
84 | |
---|
85 | } |
---|
86 | |
---|
87 | #endif /* _PacketTypes_H__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.