Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/merge/src/network/PacketTypes.h @ 1262

Last change on this file since 1262 was 1056, checked in by landauf, 16 years ago

don't panic, no codechanges!
added a link to www.orxonox.net

File size: 2.5 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      ...
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29//
30// C++ Interface: PacketTypes
31//
32// Description:
33//
34//
35// Author:  <>, (C) 2007
36//
37// Copyright: See COPYING file that comes with this distribution
38//
39//
40
41#ifndef _PacketTypes_H__
42#define _PacketTypes_H__
43
44#include "NetworkPrereqs.h"
45
46namespace network
47{
48  enum packet_id {
49    ACK,
50    MOUSE,
51    KEYBOARD,
52    CHAT,
53    GAMESTATE ,
54    CLASSID
55  };
56
57
58  /**
59  * This struct defines a gamestate:
60  * size: total size of the data in *data
61  * data: pointer to the data allocated in the memory
62  */
63  struct GameState{
64    int id;
65    int size;                       //!< total size of data
66    // new ---- change functions
67    bool diffed;
68    unsigned char *data;            //!< pointer to data
69  };
70
71  /**
72  * this struct defines a gamestate:
73  * compsize is the size of the compressed data
74  * normsize is the size of the uncompressed data
75  * data are the gamestates
76  */
77  struct GameStateCompressed{
78    int id;
79    int compsize;                   //!< size of compressed data
80    int normsize;                   //!< size of uncompressed data
81    // new ----- change functions
82    bool diffed;
83    unsigned char *data;            //!< gamestate data
84  };
85
86  struct classid{
87    int id;
88    int length;
89    int clid;
90    const char *message;
91  };
92
93
94  struct ack {
95    int id;
96    int a;
97  };
98
99  struct mouse {
100    int id;
101    double x;
102    double y;
103  };
104
105  struct keyboard {
106    int id;
107    char press;
108  };
109  //only in this class, not PacketGenerator, used as pattern to put incoming
110  //bytes inside
111  struct chat {
112    int id;
113    const char* message;
114  };
115
116}
117
118#endif /* _PacketTypes_H__ */
Note: See TracBrowser for help on using the repository browser.