File: cs.h

package info (click to toggle)
yiff 2.14.5-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,344 kB
  • ctags: 3,360
  • sloc: ansic: 40,505; cpp: 7,420; makefile: 425; sh: 242
file content (209 lines) | stat: -rw-r--r-- 4,173 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/*
                      CyberSpace Network Protocol

	Base network protocol specification used by the ShipWars.
 */

#ifndef CS_H
#define CS_H


/*
 *	String Deliminator Character:
 */
#define CS_STRING_DELIMINATOR_CHAR	';'


/*
 *	Data Segment Maximums Length (in bytes):
 *
 *	CS_DATA_MAX_LEN must be big enough to contain all the bytes
 *	of all the different CS message types.
 */
#define CS_DATA_MAX_LEN			384
#define CS_DATA_MAX_BACKLOG		100000



/*
 *	Message length Maximums:
 *
 *	For CS_CODE_LIVEMESSAGE and others
 *
 *	Must be smaller than CS_DATA_MAX_LEN.
 */
#define CS_MESG_MAX			256


/*
 *	CS Message Types:
 *
 *	Each CS message consists of:
 *
 *	A command code (one of CS_CODE_*) which identifies the CS
 *	message type (this is always the first value).
 *
 *	Arguments which describe the subsequent values of a CS message,
 *	the arguments specification may differ depending on if the
 *	CS message is sent to the server or to the client.
 */

/*
 *	To client: major minor release
 *	To server: major minor release
 *
 *	Both the client and the server should send this to one another
 *	on initial connect (before login) to identify which CS protocol
 *	version it is using.
 */
#define CS_CODE_VERSION			10

/*
 *	To client:
 *	To server: name;password;client_type
 */
#define CS_CODE_LOGIN			11

/*
 *	To client:
 *	To server:
 */
#define CS_CODE_LOGOUT			12

/*
 *	To client: object_num;name
 *	To server:
 */
#define CS_CODE_WHOAMI			13

/*
 *      To client: *not sent*
 *      To server:
 */
#define CS_CODE_REFRESH			14

/*
 *      To client: *not sent*
 *      To server: interval
 */
#define CS_CODE_INTERVAL		15

/*
 *      To client: path
 *      To server:
 */
#define CS_CODE_IMAGESET		16

/*
 *      To client: path
 *      To server:
 */
#define CS_CODE_SOUNDSET		17


/*
 *	To client: url
 *	To server: *not sent*
 */
#define CS_CODE_FORWARD			20

/*
 *	To client: message
 *	To server: *not sent*
 */
#define CS_CODE_LIVEMESSAGE		30

/*
 *	To client: sys_mesg_code message
 *	To server: *not sent*
 *
 *	Note: sys_mesg_code can be one of CS_SYSMESG_*.
 */
#define CS_CODE_SYSMESSAGE		31

/*
 *	To client: *not sent*
 *	To server: command
 */
#define CS_CODE_LITERALCMD		32


/*
 *	To client: sound_code, left_volume, right_volume
 *	To server: *not sent*
 */
#define CS_CODE_PLAYSOUND		37


/*
 *	To client: object_num, type, isref_num, owner, size,
 *	           locked_on, intercepting_object, scanner_range,
 *		   sect_x, sect_y, sect_z,
 *	           x, y, z, heading, pitch, bank,
 *	           velocity, velocity_heading, velocity_pitch,
 *	           velocity_bank, current_frame, anim_int,
 *	           total_frames, cycle_times
 *	To server: *not sent*
 */
#define CS_CODE_CREATEOBJ		40

/* 
 *      To client: object_num
 *      To server: *not sent*
 */
#define CS_CODE_RECYCLEOBJ		41

/*
 *      To client: object_num, type, imageset, size, x, y, z,
 *                 heading, pitch, bank, velocity, velocity_heading,
 *                 velocity_pitch, velocity_bank, current_frame
 *      To server: *not sent*
 */
#define CS_CODE_POSEOBJ			42

/*
 *	To client: object_num, type, imageset, size, x, y, z,
 *	           heading, pitch, bank, velocity, velocity_heading,
 *	           velocity_pitch, velocity_bank, current_frame
 *	To server: *not sent*
 */
#define CS_CODE_FORCEPOSEOBJ		43


/*
 *	To client: propriatery_code [arg...]
 *	To server: propriatery_code [arg...]
 */
#define CS_CODE_EXT			80




/*
 *	Systems Message Codes:
 *
 *	These are prefix codes for each CS_CODE_SYSMESSAGE.
 *	Client and server should NOT send any message with a prefix code
 *	not listed here.
 *
 *	Example for a CS_CODE_SYSMESSAGE using
 *	CS_SYSMESG_LOGINFAIL:
 *
 *	    "31 10 Login failed."
 *
 *	The message (third optional argument) must be less than
 *	CS_MESG_MAX in bytes.
 */
#define CS_SYSMESG_CODE_ERROR		0	/* General error */
#define CS_SYSMESG_CODE_WARNING		1	/* General warning */

#define CS_SYSMESG_CODE_LOGINFAIL	10
#define CS_SYSMESG_CODE_LOGINSUCC	11

#define CS_SYSMESG_CODE_ABNDISCON	15	/* Abnormal disconnect */

#define CS_SYSMESG_CODE_BADVALUE	20
#define CS_SYSMESG_CODE_BADARG		21


#endif /* CS_H */