Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 657 was 592, checked in by nicolasc, 17 years ago

added engineglow particle effect - based of treibwerk
other various changes

File size: 1.5 KB
RevLine 
[417]1//
2// C++ Interface: PacketTypes
3//
[592]4// Description:
[417]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
[592]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   */
[417]32  struct GameState{
33    int id;
[592]34    int size;                       //!< total size of data
[436]35    // new ---- change functions
36    bool diffed;
[592]37    unsigned char *data;            //!< pointer to data
[417]38  };
39
[592]40  /**
41   * this struct defines a gamestate:
[417]42   * compsize is the size of the compressed data
43   * normsize is the size of the uncompressed data
44   * data are the gamestates
[592]45   */
[417]46  struct GameStateCompressed{
[592]47    int id;
48    int compsize;                   //!< size of compressed data
49    int normsize;                   //!< size of uncompressed data
[436]50    // new ----- change functions
51    bool diffed;
[592]52    unsigned char *data;            //!< gamestate data
[417]53  };
54
55  struct classid{
56    int id;
57    int length;
58    int clid;
59    const char *message;
60  };
[592]61
62
[417]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
Note: See TracBrowser for help on using the repository browser.