This repository was archived by the owner on Jan 30, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoom.cs
More file actions
375 lines (328 loc) · 5.31 KB
/
Room.cs
File metadata and controls
375 lines (328 loc) · 5.31 KB
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
public class Room
{
public enum COLUMN
{
NO,
TYPE,
TITLE,
STATUS,
NUM_PLAYER,
MAP_ALIAS,
PING,
COUNTRY,
WPN_OPT
}
public enum ROOM_TYPE
{
NONE = -1,
MAP_EDITOR,
TEAM_MATCH,
INDIVIDUAL,
CAPTURE_THE_FLAG,
EXPLOSION,
MISSION,
BND,
BUNGEE,
ESCAPE,
ZOMBIE,
NUM_TYPE
}
public enum MODE_MASK
{
TEAM_MATCH_MASK = 1,
INDIVIDUAL_MATCH_MASK = 2,
CAPTURE_THE_FALG_MATCH = 4,
EXPLOSION_MATCH = 8,
MISSION_MASK = 0x10,
BND_MASK = 0x20,
BUNGEE_MASK = 0x40,
ESCAPE_MASK = 0x80,
ZOMBIE_MASK = 0x100,
ALL_MASK = 0x7FFF
}
public enum ROOM_STATUS
{
NONE = -1,
WAITING,
PENDING,
PLAYING,
MATCHING,
MATCH_END
}
public static string[] sceneByMode = new string[10]
{
"MapEditor",
"TeamMatch",
"IndividualMatch",
"CaptureTheFlagMatch",
"ExplosionMatch",
"Defense",
"BndMatch",
"Bungee",
"Escape",
"Zombie"
};
public static string[] typeStringKey = new string[10]
{
"ROOM_TYPE_MAP_EDITOR",
"ROOM_TYPE_TEAM_MATCH",
"ROOM_TYPE_INDIVIDUAL_MATCH",
"ROOM_TYPE_CAPTURE_THE_FLAG",
"ROOM_TYPE_EXPLOSION",
"ROOM_TYPE_MISSION",
"ROOM_TYPE_BND",
"ROOM_TYPE_BUNGEE",
"ROOM_TYPE_ESCAPE",
"ROOM_TYPE_ZOMBIE"
};
public static ushort[] modeMasks = new ushort[10]
{
0,
1,
2,
4,
8,
16,
32,
64,
128,
256
};
public static ushort[] modeSelector = new ushort[10]
{
32767,
1,
2,
4,
8,
16,
32,
64,
128,
256
};
public static byte official = 1;
public static byte clanMatch = 2;
public static byte excludeRanking = 4;
public static byte blocked = 8;
private static string[] statusStringKey = new string[3]
{
"ROOM_STATUS_WAITING",
"ROOM_STATUS_PENDING",
"ROOM_STATUS_PLAYING"
};
private bool locked;
public int no;
private int squad;
private int squadCounter;
private string title;
public ROOM_TYPE type;
private ROOM_STATUS status;
private int curPlayer;
private int maxPlayer;
private string curMapAlias;
public int map;
public int goal;
public int timelimit;
public int weaponOption;
public int ping;
public int score1;
public int score2;
public int CountryFilter;
public bool isBreakInto;
public bool isDropItem;
public bool isWanted;
public bool Locked
{
get
{
return locked;
}
set
{
locked = value;
}
}
public int No => no;
public int Squad
{
get
{
return squad;
}
set
{
squad = value;
}
}
public int SquadCounter
{
get
{
return squadCounter;
}
set
{
squadCounter = value;
}
}
public string Title
{
get
{
return title;
}
set
{
title = value;
}
}
public ROOM_TYPE Type
{
get
{
return type;
}
set
{
type = value;
}
}
public ROOM_STATUS Status
{
get
{
return status;
}
set
{
status = value;
}
}
public int CurPlayer
{
get
{
return curPlayer;
}
set
{
curPlayer = value;
}
}
public int MaxPlayer
{
get
{
return maxPlayer;
}
set
{
maxPlayer = value;
}
}
public string CurMapAlias
{
get
{
return curMapAlias;
}
set
{
curMapAlias = value;
}
}
public Room(Room src)
{
locked = src.Locked;
no = src.No;
title = src.Title;
type = src.Type;
status = src.Status;
curPlayer = src.CurPlayer;
maxPlayer = src.MaxPlayer;
map = src.map;
curMapAlias = src.curMapAlias;
goal = src.goal;
timelimit = src.timelimit;
weaponOption = src.weaponOption;
ping = src.ping;
score1 = src.score1;
score2 = src.score2;
CountryFilter = src.CountryFilter;
isBreakInto = src.isBreakInto;
isDropItem = src.isDropItem;
isWanted = src.isWanted;
squad = src.squad;
squadCounter = src.squadCounter;
}
public Room(bool isLocked, int roomNo, string roomTitle, ROOM_TYPE roomType, ROOM_STATUS roomStatus, int cur, int max, int mapId, string alias, int roomGoal, int roomTimelimit, int RoomWeaponOption, int RoomPing, int RoomScore1, int RoomScore2, int countryFilter, bool breakInto, bool wanted, bool dropItem, int _squad, int _squadCounter)
{
locked = isLocked;
no = roomNo;
title = roomTitle;
type = roomType;
status = roomStatus;
curPlayer = cur;
maxPlayer = max;
map = mapId;
curMapAlias = alias;
goal = roomGoal;
timelimit = roomTimelimit;
weaponOption = RoomWeaponOption;
ping = RoomPing;
score1 = RoomScore1;
score2 = RoomScore2;
CountryFilter = countryFilter;
isBreakInto = breakInto;
isWanted = wanted;
isDropItem = dropItem;
squad = _squad;
squadCounter = _squadCounter;
}
public int Compare(Room arg, COLUMN sortedBy, bool ascending)
{
int num = 0;
switch (sortedBy)
{
case COLUMN.NO:
num = no.CompareTo(arg.No);
break;
case COLUMN.TYPE:
{
int num3 = (int)type;
num = num3.CompareTo((int)arg.Type);
break;
}
case COLUMN.TITLE:
num = title.CompareTo(arg.Title);
break;
case COLUMN.STATUS:
{
int num2 = (int)status;
num = num2.CompareTo((int)arg.Status);
break;
}
case COLUMN.NUM_PLAYER:
num = curPlayer.CompareTo(arg.CurPlayer);
break;
case COLUMN.MAP_ALIAS:
num = curMapAlias.CompareTo(arg.curMapAlias);
break;
case COLUMN.PING:
num = ping.CompareTo(arg.ping);
break;
case COLUMN.COUNTRY:
num = CountryFilter.CompareTo(arg.CountryFilter);
break;
case COLUMN.WPN_OPT:
num = weaponOption.CompareTo(arg.weaponOption);
break;
}
if (!ascending)
{
num = -num;
}
return num;
}
}