OverSim
SCPacket.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 Institut fuer Telematik, Universitaet Karlsruhe (TH)
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 //
18 
24 #ifndef __SCPACKET_H_
25 #define __SCPACKET_H_
26 
27 #define SC_MOVE_INDICATION 0
28 #define SC_ADD_NEIGHBOR 1
29 #define SC_REMOVE_NEIGHBOR 2
30 #define SC_RESIZE_AOI 3
31 #define SC_PARAM_REQUEST 4
32 #define SC_PARAM_RESPONSE 5
33 #define SC_EV_CHAT 6
34 #define SC_EV_SNOWBALL 7
35 #define SC_EV_FROZEN 8
36 
37 class SCBasePacket // SC_PARAM_REQUEST
38 {
39  public:
40  unsigned char packetType;
41 };
42 
43 class SCAddPacket : public SCBasePacket // SC_ADD_NEIGHBOR
44 {
45  public:
46  double posX;
47  double posY;
48  unsigned int ip;
49 };
50 
51 class SCRemovePacket : public SCBasePacket // SC_REMOVE_NEIGHBOR
52 {
53  public:
54  unsigned int ip;
55 };
56 
57 class SCMovePacket : public SCBasePacket // SC_MOVE_INDICATION
58 {
59  public:
60  double posX;
61  double posY;
62 };
63 
64 class SCAOIPacket : public SCBasePacket // SC_RESIZE_AOI
65 {
66  public:
67  double AOI;
68 };
69 
70 class SCParamPacket : public SCBasePacket // SC_PARAM_RESPONSE
71 {
72  public:
73  double speed;
74  double dimension;
75  double AOI;
76  double delay;
77  double startX;
78  double startY;
79  unsigned int ip;
80  unsigned int seed;
81 };
82 
83 
84 class SCChatPacket : public SCBasePacket // SC_EV_CHAT
85 {
86  public:
87  unsigned int ip;
88  char msg[];
89 };
90 
91 class SCSnowPacket : public SCBasePacket // SC_EV_SNOWBALL
92 {
93  public:
94  unsigned int ip;
95  double startX;
96  double startY;
97  double endX;
98  double endY;
99  int time_sec;
101 };
102 
103 class SCFrozenPacket : public SCBasePacket // SC_EV_FROZEN
104 {
105  public:
106  unsigned int ip;
107  unsigned int source;
108  int time_sec;
110 };
111 
112 #endif