~ubuntu-branches/ubuntu/trusty/teeworlds/trusty-updates

« back to all changes in this revision

Viewing changes to src/game/g_protocol.h

  • Committer: Bazaar Package Importer
  • Author(s): Gonéri Le Bouder
  • Date: 2009-04-12 02:32:37 UTC
  • mfrom: (3.2.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090412023237-ufmf1xn0rkjmx6f3
Tags: 0.5.1-2
* Fix the ouput of teeworlds-server --help with /bin/sh ->
  /bin/bash (Closes: #511600)
* Standard version 3.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
2
 
// NOTE: Be very careful when editing this file as it will change the network version
3
 
 
4
 
#ifndef GAME_PROTOCOL_H
5
 
#define GAME_PROTOCOL_H
6
 
 
7
 
#include <game/generated/g_protocol.h>
8
 
 
9
 
// Network stuff
10
 
/*
11
 
enum
12
 
{
13
 
        OBJTYPE_NULL=0,
14
 
        OBJTYPE_GAME,
15
 
        OBJTYPE_PLAYER_INFO,
16
 
        OBJTYPE_PLAYER_CHARACTER, // use this if you are searching for the player entity
17
 
        OBJTYPE_PROJECTILE,
18
 
        OBJTYPE_LASER,
19
 
        OBJTYPE_POWERUP,
20
 
        OBJTYPE_FLAG,
21
 
        EVENT_EXPLOSION,
22
 
        EVENT_DAMAGEINDICATION,
23
 
        EVENT_SOUND_WORLD,
24
 
        EVENT_SMOKE,
25
 
        EVENT_PLAYERSPAWN,
26
 
        EVENT_DEATH,
27
 
        EVENT_AIR_JUMP,
28
 
        
29
 
        EVENT_DUMMY
30
 
};
31
 
 
32
 
enum
33
 
{
34
 
        MSG_NULL=0,
35
 
        MSG_SAY, // client -> server
36
 
        MSG_CHAT, // server -> client
37
 
        MSG_SETINFO, // server -> client - contains name, skin and color info
38
 
        MSG_KILLMSG, // server -> client
39
 
        MSG_SETTEAM,
40
 
        MSG_JOIN,
41
 
        MSG_QUIT,
42
 
        MSG_EMOTICON,
43
 
        MSG_STARTINFO, // client -> server
44
 
        MSG_CHANGEINFO, // client -> server
45
 
        MSG_READY_TO_ENTER, // server -> client
46
 
    MSG_WEAPON_PICKUP,
47
 
    MSG_SOUND_GLOBAL,
48
 
    MSG_TUNE_PARAMS,
49
 
        MSG_KILL,
50
 
    MSG_EXTRA_PROJECTILE, // server -> client
51
 
        
52
 
};
53
 
 
54
 
enum
55
 
{
56
 
        EMOTE_NORMAL=0,
57
 
        EMOTE_PAIN,
58
 
        EMOTE_HAPPY,
59
 
        EMOTE_SURPRISE,
60
 
        EMOTE_ANGRY,
61
 
        EMOTE_BLINK,
62
 
};
63
 
 
64
 
enum
65
 
{
66
 
        INPUT_STATE_MASK=0x1f,
67
 
};
68
 
 
69
 
enum
70
 
{
71
 
        PLAYERSTATE_UNKNOWN=0,
72
 
        PLAYERSTATE_PLAYING,
73
 
        PLAYERSTATE_IN_MENU,
74
 
        PLAYERSTATE_CHATTING,
75
 
 
76
 
        GAMETYPE_DM=0,
77
 
        GAMETYPE_TDM,
78
 
        GAMETYPE_CTF,
79
 
};
80
 
 
81
 
struct player_input
82
 
{
83
 
        int left;
84
 
        int right;
85
 
 
86
 
        int target_x;
87
 
        int target_y;
88
 
 
89
 
        int jump;
90
 
        int fire;
91
 
        int hook;
92
 
        int blink;
93
 
 
94
 
        int player_state;
95
 
 
96
 
        int wanted_weapon;
97
 
        int next_weapon;
98
 
        int prev_weapon;
99
 
};
100
 
 
101
 
struct ev_common
102
 
{
103
 
        int x, y;
104
 
};
105
 
 
106
 
struct ev_explosion : public ev_common
107
 
{
108
 
};
109
 
 
110
 
struct ev_spawn : public ev_common
111
 
{
112
 
};
113
 
 
114
 
struct ev_death : public ev_common
115
 
{
116
 
};
117
 
 
118
 
struct ev_sound : public ev_common
119
 
{
120
 
        int sound;
121
 
};
122
 
 
123
 
struct ev_damageind : public ev_common
124
 
{
125
 
        int angle;
126
 
};
127
 
 
128
 
struct obj_game
129
 
{
130
 
        int round_start_tick;
131
 
        int game_over;
132
 
        int sudden_death;
133
 
        int paused;
134
 
 
135
 
        int score_limit;
136
 
        int time_limit;
137
 
        int gametype;
138
 
 
139
 
        int warmup;
140
 
 
141
 
        int teamscore[2];
142
 
};
143
 
 
144
 
struct obj_projectile
145
 
{
146
 
        int x, y;
147
 
        int vx, vy; // should be an angle instead
148
 
        int type;
149
 
        int start_tick;
150
 
};
151
 
 
152
 
struct obj_laser
153
 
{
154
 
        int x, y;
155
 
        int from_x, from_y;
156
 
        int eval_tick;
157
 
};
158
 
 
159
 
struct obj_powerup
160
 
{
161
 
        int x, y;
162
 
        int type; // why do we need two types?
163
 
        int subtype;
164
 
};
165
 
 
166
 
struct obj_flag
167
 
{
168
 
        int x, y;
169
 
        int team;
170
 
        int carried_by; // is set if the local player has the flag
171
 
};
172
 
 
173
 
// core object needed for physics
174
 
struct obj_player_core
175
 
{
176
 
        int x, y;
177
 
        int vx, vy;
178
 
        int angle;
179
 
        int jumped;
180
 
 
181
 
        int hooked_player;
182
 
        int hook_state;
183
 
        int hook_tick;
184
 
        int hook_x, hook_y;
185
 
        int hook_dx, hook_dy;
186
 
};
187
 
 
188
 
// info about the player that is only needed when it's on screen
189
 
struct obj_player_character : public obj_player_core
190
 
{
191
 
        int player_state;
192
 
 
193
 
        int health;
194
 
        int armor;
195
 
        int ammocount;
196
 
        int weaponstage;
197
 
 
198
 
        int weapon; // current active weapon
199
 
 
200
 
        int emote;
201
 
 
202
 
        int attacktick; // num attack ticks left of current attack
203
 
};
204
 
 
205
 
// information about the player that is always needed
206
 
struct obj_player_info
207
 
{
208
 
        int local;
209
 
        int clientid;
210
 
 
211
 
        int team;
212
 
        int score;
213
 
        int latency;
214
 
        int latency_flux;
215
 
};*/
216
 
 
217
 
#endif