Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/network/PacketTypes.h @ 417

Last change on this file since 417 was 417, checked in by scheusso, 16 years ago

blabla

File size: 1.2 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 NETWORK_PACKETTYPES_H
14#define NETWORK_PACKETTYPES_H
15
16namespace network{
17enum 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;
35    unsigned char *data;
36  };
37
38/**
39 * this struct defines a gamestate:
40   * compsize is the size of the compressed data
41   * normsize is the size of the uncompressed data
42   * data are the gamestates
43 */
44  struct GameStateCompressed{
45    int id; 
46    int compsize;
47    int normsize;
48    unsigned char *data;
49  };
50
51  struct classid{
52    int id;
53    int length;
54    int clid;
55    const char *message;
56  };
57 
58 
59  struct ack {
60    int id;
61    int a;
62  };
63
64  struct mouse {
65    int id;
66    double x;
67    double y;
68  };
69
70  struct keyboard {
71    int id;
72    char press;
73  };
74        //only in this class, not PacketGenerator, used as pattern to put incoming
75        //bytes inside
76  struct chat {
77    int id;
78    const char* message;
79  };
80
81}
82
83#endif
Note: See TracBrowser for help on using the repository browser.