-
Notifications
You must be signed in to change notification settings - Fork 13
/
packet-bnetp-w3gs.lua
1428 lines (1098 loc) · 37.6 KB
/
packet-bnetp-w3gs.lua
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
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
local X = require('xproto')
local p = X.protocol('w3gs', 'Warcraft III Game Protocol',
{ key = 'bnetp.type', value = 0xF7 })
--[[
`request_packet_data` is a custom DSL construct that
calls the `request` method on the state object to perform
reassembly of TCP PDUs all in one place.
--]]
p.api.request_packet_data = function(proto, ...)
local args = proto.utils.make_args_table_with_positional_map(
{ 'keyref', 'already_consumed' },
...
)
if not args.keyref or type(args.keyref) ~= 'string' then
error('keyref parameter is a required value of type string'
.. package.loaded.debug.traceback()
)
end
if args.already_consumed and type(args.already_consumed) ~= 'number' then
error('already_consumed parameter is an optional number'
.. package.loaded.debug.traceback()
)
end
return {
args = args,
dissect = function(self, state)
local plen = state.packet[self.args.keyref]
state:request(plen - (self.args.already_consumed or 0))
end
}
end
--[[
-- slot([label])
--
-- Displays a slot struct.
-- Is equals to the sequence
--
-- p:uint8 {"Player Number"},
-- p:uint8 {"Download status"},
-- p:uint8 {"Slot status"},
-- p:uint8 {"Computer status"},
-- p:uint8 {"Team"},
-- p:uint8 {"Colour"},
-- p:uint8 {"Race"},
-- p:uint8 {"Computer type"},
-- p:uint8 {"Handicap"},
--
-- with some summary.
--
-- Quick call:
-- @par label Name of the field. It will be used as a label for the
-- field's node at the dissection tree.
--]]
p.api.slot = function(proto, ...)
local args = proto.utils.make_args_table_with_positional_map(
{ "label" },
...
)
local template = { protofield_type = "bytes" }
function template.size()
return 9
end
---@diagnostic disable-next-line: redefined-local
function template:dissect(state, proto)
local proto_node = state.proto_node
state.proto_node = proto_node:add(self.pf, state:peek(self.size()))
state:dissect_packets(proto, self.imp)
local summary = string.format("Slot %d", state.packet.pnum)
if (self.label ~= nil) then
summary = self.label .. ": " .. summary
end
state.proto_node:set_text(summary)
state.proto_node = proto_node
end
local imp = {
proto:uint8 { "Player Number", key = "pnum" },
proto:uint8 { "Download status" },
proto:uint8 { "Slot status" },
proto:uint8 { "Computer Status" },
proto:uint8 { "Teram" },
proto:uint8 { "Colour" },
proto:uint8 { "Race" },
proto:uint8 { "Computer Type" },
proto:uint8 { "Handicap" },
}
return {
args = args,
imp = imp,
register = function (self)
self.args.imp = proto.utils.map_table(
self.imp,
function (c)
if c.register then
return c:register()
else
return c
end
end
)
-- add a dummy label as it's required by create_proto_field
self.args.label = self.args.label or "Slot"
local label = self.args.label
local tmp = proto.utils.create_proto_field(proto, template, self.args)
tmp.label = label
return tmp
end
}
end
p:entrypoint {
p:lookahead_uint8_check(0xF7),
p:begin_packet(),
p:uint8 {
label = 'Header Type',
display = base.HEX,
key = 'type',
filter = 'type'
},
p:when {
p.conditions.keyEquals('isServerPacket', true),
{p:uint8 {
'Packet ID',
base.HEX,
p.descs.server_packets,
key = 'pid',
filter = 'pid'
}},
{p:uint8 {
'Packet ID',
base.HEX,
p.descs.client_packets,
key = 'pid',
filter = 'pid'
}},
},
p:uint16 {
label = 'Packet Length',
display = base.DEC,
key = 'plen',
filter = 'plen'
},
-- Before jumping to the corresponding packet description,
-- request all the data in this packet.
--
-- This is done for perfomace and also because `stringz`
-- can only request one byte at a time and some kind of
-- Wireshark reassembly limit is reached before the whole
-- packet can be dissected successfuly.
p:request_packet_data('plen', 4),
p:jump {
ref = 'pid',
ccollection = 'client_packets',
scollection = 'server_packets'
},
p:consume('plen'),
p:end_packet('plen'),
}
p:collection {
name = 'client_packets',
packets = {
--[[doc
Message ID: 0x1E
Message Name: W3GS_REQJOIN
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (DWORD) Host Counter (Game ID)
(DWORD) Entry Key (used in LAN)
(BYTE) Unknown
(WORD) Listen Port
(DWORD) Peer Key
(STRING) Player name
(BYTE)[] Unknown
(SOCKADDR) Internal
Remarks: A client sends this to the host to enter the game lobby.
The internal IP uses the Windows sockaddr_in structure.
Related: [0x05] W3GS_REJECTJOIN (S->C), [0x04] W3GS_SLOTINFOJOIN (S->C),
[0x06] W3GS_PLAYERINFO (S->C), [0x3D] W3GS_MAPCHECK (S->C)
]]
{
id = 0x1E,
name = "W3GS_REQJOIN",
def = {
p:uint32("Host Counter"),
p:uint32("Entry Key"),
p:uint8("Unknown"),
p:uint16("Listen Port"),
p:uint32("Peer Key"),
p:stringz("Player name"),
p:uint8{"Unknown", key="length"},
p:iterator{alias="none", label="Unknown", refkey="length", repeated={
p:uint8("Unknown")
}},
p:sockaddr("Socket"),
},
},
--[[doc
Message ID: 0x21
Message Name: W3GS_LEAVEREQ
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (DWORD) Reason
Remarks: A client requests to leave.
Reasons:
0x01 PLAYERLEAVE_DISCONNECT
0x07 PLAYERLEAVE_LOST
0x08 PLAYERLEAVE_LOSTBUILDINGS
0x09 PLAYERLEAVE_WON
0x0A PLAYERLEAVE_DRAW
0x0B PLAYERLEAVE_OBSERVER
0x0D PLAYERLEAVE_LOBBY
Related: [0x1E] W3GS_REQJOIN (C->S), [0x1B] W3GS_LEAVERES (S->C)
]]
{
id = 0x21,
name = "W3GS_LEAVEREQ",
def = {
p:uint32("Reason", nil, {
[0x01] = "PLAYERLEAVE_DISCONNECT",
[0x07] = "PLAYERLEAVE_LOST",
[0x08] = "PLAYERLEAVE_LOSTBUILDINGS",
[0x09] = "PLAYERLEAVE_WON",
[0x0A] = "PLAYERLEAVE_DRAW",
[0x0B] = "PLAYERLEAVE_OBSERVER",
[0x0D] = "PLAYERLEAVE_LOBBY",
}),
},
},
--[[doc
Message ID: 0x23
Message Name: W3GS_GAMELOADED_SELF
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: [blank]
Remarks: The client sends this to the host when they have finished loading the
map.
Related: [0x08] W3GS_PLAYERLOADED (S->C), [0x0B] W3GS_COUNTDOWN_END (S->C)
]]
{
id = 0x23,
name = "W3GS_GAMELOADED_SELF",
def = {},
},
--[[doc
Message ID: 0x26
Message Name: W3GS_OUTGOING_ACTION
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (DWORD) CRC-32 encryption
(VOID) Action data
Remarks: A client sends this to the game host to execute an action in-game.
Related: [0x0C] W3GS_INCOMING_ACTION (S->C)
]]
{
id = 0x26,
name = "W3GS_OUTGOING_ACTION",
def = {
p:uint32("CRC-32 encryption"),
p:consume("plen", "Action data", 'action_data'),
},
},
--[[doc
Message ID: 0x27
Message Name: W3GS_OUTGOING_KEEPALIVE
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (BYTE)[] Unknown
Remarks: This is sent to the host from each client.
The unknown value may be a checksum and is also used in replays.
]]
{
id = 0x27,
name = "W3GS_OUTGOING_KEEPALIVE",
def = {
p:array("Unknown", p.uint8, 5),
},
},
--[[doc
Message ID: 0x28
Message Name: W3GS_CHAT_TO_HOST
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (BYTE) Total
For each total:
(BYTE) To player number
(BYTE) From player number
(BYTE) Flags
For Flag 0x10:
(STRING) Message
For Flag 0x11:
(BYTE) Team
For Flag 0x12:
(BYTE) Color
For Flag 0x13:
(BYTE) Race
For Flag 0x14:
(BYTE) Handicap
For Flag 0x20:
(DWORD) Extra Flags
(STRING) Message
Remarks: This is sent from the client to the host to send a message to the
other clients.
Related: [0x0F] W3GS_CHAT_FROM_HOST (S->C)
]]
{
id = 0x28,
name = "W3GS_CHAT_TO_HOST",
def = {
p:uint8("Total"),
p:uint8("To player number"),
p:uint8("From player number"),
p:uint8{"Flags", key="flags"},
p:casewhen{
{p.conditions.keyEquals("flags", 0x10), {
p:stringz("Message"),
}},
{p.conditions.keyEquals("flags", 0x11), {
p:uint8("Team"),
}},
{p.conditions.keyEquals("flags", 0x12), {
p:uint8("Color"),
}},
{p.conditions.keyEquals("flags", 0x13), {
p:uint8("Race"),
}},
{p.conditions.keyEquals("flags", 0x14), {
p:uint8("Handicap"),
}},
{p.conditions.keyEquals("flags", 0x20), {
p:uint32("Extra Flags"), --message scope
p:stringz("Message"),
}},
{p.conditions.always(), { --Probably never happens
p:stringz("Message"),
}},
},
},
},
--[[doc
Message ID: 0x2F
Message Name: W3GS_SEARCHGAME
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (DWORD) Product
(DWORD) Version
(DWORD) Unknown (0)
Remarks: This is sent to the entire local area network to detect games.
Product is either WAR3 or W3XP.
Related: [0x30] W3GS_GAMEINFO (S->C)
]]
{
id = 0x2F,
name = "W3GS_SEARCHGAME",
def = {
p:strdw("Product", p.descs.ClientTag),
p:uint32("Version"),
p:uint32("Unknown"),
},
},
--[[doc
Message ID: 0x35
Message Name: W3GS_PING_FROM_OTHERS
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: [blank]
Remarks: Client requests an echo from another client (occurs every 10 seconds).
Related: [0x36] W3GS_PONG_TO_OTHERS (S->C)
]]
{
id = 0x35,
name = "W3GS_PING_FROM_OTHERS",
def = {},
},
--[[doc
Message ID: 0x37
Message Name: W3GS_CLIENTINFO
Message Status: MORE RESEARCH NEEDED
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (DWORD) Player Counter
(DWORD) Unknown (0)
(BYTE) Player number
(BYTE)[5] Unknown
Remarks: A client sends this to another client to gain information about self
when connected.
The first byte in the second unknown is possibly the status of the
player.
Packet Log:
F7 37 12 00
02 00 00 00
00 00 00 00
06
FF 5E 00 00 00
]]
{
id = 0x37,
name = "W3GS_CLIENTINFO",
def = {
p:uint32("Player Counter"),
p:uint32("Unknown"),
p:uint8("Player number"),
p:uint8("[5] Unknown"),
},
},
--[[doc
Message ID: 0x3F
Message Name: W3GS_STARTDOWNLOAD
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: [blank]
Remarks: A client sends this to the host to initiate a map download.
Related: [0x3D] W3GS_MAPCHECK (S->C)
]]
{
id = 0x3F,
name = "W3GS_STARTDOWNLOAD",
def = {},
},
--[[doc
Message ID: 0x42
Message Name: W3GS_MAPSIZE
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (DWORD) Unknown
(BYTE) Size Flag
(DWORD) Map Size
Remarks: This is sent from the client to tell the host about the map file on
the client's local system.
]]
{
id = 0x42,
name = "W3GS_MAPSIZE",
def = {
p:uint32("Unknown"),
p:uint8("Size Flag"),
p:uint32("Map Size"),
},
},
--[[doc
Message ID: 0x44
Message Name: W3GS_MAPPARTOK
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (BYTE) To player number
(BYTE) From player number
(DWORD) Unknown
(DWORD) Chunk position in file
Remarks: The client sends this when it has successfully received a chunk of the
map file from the host client.
Related: [0x43] W3GS_MAPPART (S->C)
]]
{
id = 0x44,
name = "W3GS_MAPPARTOK",
def = {
p:uint8("To player number"),
p:uint8("From player number"),
p:uint32("Unknown"),
p:uint32("Chunk position in file"),
},
},
--[[doc
Message ID: 0x45
Message Name: W3GS_MAPPARTNOTOK
Message Status: MORE RESEARCH NEEDED
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: [unknown]
Remarks: More research is required.
This is sent when downloading a map in reply to 0x43 W3GS_MAPPART and
a chunk of the map file does not match its CRC encryption.
Related: [0x43] W3GS_MAPPART (S->C), [0x44] W3GS_MAPPARTOK (C->S)
]]
{
id = 0x45,
name = "W3GS_MAPPARTNOTOK",
def = {
p:consume('plen', 'Unknown')
}
},
--[[doc
Message ID: 0x46
Message Name: W3GS_PONG_TO_HOST
Direction: Client -> Server (Sent)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (DWORD) tickCount
Remarks: This is sent in response to 0x01 W3GS_HOSTECHOREQ.
The tickCount value is from GetTickCount().
Ping = (GetTickCount()-tickCount)/2
For the local area network, it can be 0.
Related: [0x01] W3GS_PING_FROM_HOST (S->C)
]]
{
id = 0x46,
name = "W3GS_PONG_TO_HOST",
def = {
p:uint32("tickCount"),
},
},
},
}
p:collection {
name = 'server_packets',
packets = {
--[[doc
Message ID: 0x01
Message Name: W3GS_PING_FROM_HOST
Direction: Server -> Client (Received)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (DWORD) Tick Count
Remarks: This is sent every 30 seconds to make sure that the client is still
responsive.
Related: [0x46] W3GS_PONG_TO_HOST (C->S)
]]
{
id = 0x01,
name = "W3GS_PING_FROM_HOST",
def = {
p:uint32("tickCount"),
},
},
--[[doc
Message ID: 0x04
Message Name: W3GS_SLOTINFOJOIN
Direction: Server -> Client (Received)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (WORD) Length of Slot Info
(BYTE) Number of slots
(BYTE)[] Slot data
(DWORD) Random seed
(BYTE) Game type
(BYTE) Number of player slots without observers
(BYTE) Player number
(SOCKADDR) Player's socket data
For each slot:
(BYTE) Player number
(BYTE) Download status
(BYTE) Slot status
(BYTE) Computer status
(BYTE) Team
(BYTE) Color
(BYTE) Race
(BYTE) Computer type (Difficulty)
(BYTE) Handicap
Remarks: This is sent to tell the client about the game slots, upon entry of
the lobby.
Download status is a percentage of their download progress. As such,
this value can only be between 0 and 100.
Slot statuses:
0x00 Open
0x01 Closed
0x02 Occupied
If the slot is a computer, then Computer will be 0x01, otherwise
it will be 0x00.
Available races:
0x01 Human
0x02 Orc
0x04 Night Elf
0x08 Undead
0x20 Random
0x40 Fixed
Computer types:
0x00 Easy
0x01 Normal / Human
0x02 Hard
Related: [0x1E] W3GS_REQJOIN (C->S)
]]
{
id = 0x04,
name = "W3GS_SLOTINFOJOIN",
def = {
p:uint16("Length of Slot Info"),
p:uint8{"Number of slots", key="length"},
p:iterator{alias="none", label="Slot data", refkey="length", repeated={
p:slot()
}},
p:uint32("Random seed"),
p:uint8("Game type"),
p:uint8("Number of player slots without observers"),
p:uint8("Player number"),
p:sockaddr("Socket"),
},
},
--[[doc
Message ID: 0x05
Message Name: W3GS_REJECTJOIN
Direction: Server -> Client (Received)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (DWORD) Reason
Remarks: This is sent in a response to a request to join the game lobby and
indicates that the request was denied.
Reasons:
0x09 REJECTJOIN_FULL
0x10 REJECTJOIN_STARTED
0x27 REJECTJOIN_WRONGPASSWORD
Related: [0x1E] W3GS_REQJOIN (C->S)
]]
{
id = 0x05,
name = "W3GS_REJECTION",
def = {
p:uint32("Reason"),
},
},
--[[doc
Message ID: 0x06
Message Name: W3GS_PLAYERINFO
Message Status: MORE RESEARCH NEEDED
Direction: Server -> Client (Received)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (DWORD) Player Counter
(BYTE) Player number
(STRING) Player name
(BYTE)[] Unknown
(SOCKADDR) External
(SOCKADDR) Internal
Remarks: Tells a client about a player's information.
The external and internal IP are always zero for the host.
NOTE: This packet needs a better structure in the Format. Until then,
you will have to deal with the unorganized fields.
]]
{
id = 0x06,
name = "W3GS_PLAYERINFO",
def = {
p:uint32("Player Counter"),
p:uint8("Player number"),
p:stringz("Player name"),
p:uint8{"Unknown", key="length"},
p:iterator{alias="none", label="Unknown", refkey="length", repeated={
p:uint8("Unknown")
}},
p:sockaddr("External Socket"),
p:sockaddr("Internal Socket"),
},
},
--[[doc
Message ID: 0x07
Message Name: W3GS_PLAYERLEFT
Direction: Server -> Client (Received)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (BYTE) Player number
(DWORD) Reason
Remarks: This is received from the game host when a player leaves.
Reasons:
0x01 PLAYERLEAVE_DISCONNECT
0x07 PLAYERLEAVE_LOST
0x08 PLAYERLEAVE_LOSTBUILDINGS
0x09 PLAYERLEAVE_WON
0x0A PLAYERLEAVE_DRAW
0x0B PLAYERLEAVE_OBSERVER
0x0D PLAYERLEAVE_LOBBY
]]
{
id = 0x07,
name = "W3GS_PLAYERLEFT",
def = {
p:uint8("Player number"),
p:uint32("Reason"),
},
},
--[[doc
Message ID: 0x08
Message Name: W3GS_PLAYERLOADED
Direction: Server -> Client (Received)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (BYTE) Player number
Remarks: Sent to all other clients in-game to notify that a player has finished
loading.
]]
{
id = 0x08,
name = "W3GS_PLAYERLOADED",
def = {
p:uint8("Player number"),
},
},
--[[doc
Message ID: 0x09
Message Name: W3GS_SLOTINFO
Direction: Server -> Client (Received)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (WORD) Length of Slot Info
(BYTE) Number of slots
(BYTE)[] Slot data
(DWORD) Random seed
(BYTE) Game type
(BYTE) Number of player slots without observers
Slot Info:
(BYTE) Player number
(BYTE) Download status
(BYTE) Slot status
(BYTE) Computer status
(BYTE) Team
(BYTE) Color
(BYTE) Race
(BYTE) Computer type
(BYTE) Handicap
Remarks: This is sent for slot updates.
The length of slot info should always be 0x0B.
Related: [0x04] W3GS_SLOTINFOJOIN (S->C)
]]
{
id = 0x09,
name = "W3GS_SLOTINFO",
def = {
p:uint16("Length of Slot Info"),
p:uint8{"Number of slots", key="length"},
p:iterator{alias="none", label="Slot data", refkey="length", repeated={
p:slot()
}},
p:uint32("Random seed"),
p:uint8("Layout status", nil, {
[0x00] = "Melee",
[0x01] = "Custom forces",
[0x02] = "Fixed player settings",
[0x03] = "Custom forces and fixed player settings",
}),
p:uint8("Non-observer slots")
},
},
--[[doc
Message ID: 0x0A
Message Name: W3GS_COUNTDOWN_START
Direction: Server -> Client (Received)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: [blank]
Remarks: The game has begun the countdown to start.
The official clients countdown from 5 seconds, however it is possible
to use any time you wish. For example, the GHost++ bot uses 10 seconds
when auto-hosted, but 5 seconds when started using an administrative
command.
Related: [0x0B] W3GS_COUNTDOWN_END (S->C)
]]
{
id = 0x0A,
name = "W3GS_COUNTDOWN_START",
def = {},
},
--[[doc
Message ID: 0x0B
Message Name: W3GS_COUNTDOWN_END
Direction: Server -> Client (Received)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: [blank]
Remarks: The game has finished the countdown and has now started. Players
should see a loading screen for the map once this is received.
0x10 W3GS_COUNTDOWN_START should be received before this packet is,
even if there is no countdown.
Related: [0x0A] W3GS_COUNTDOWN_START (S->C)
]]
{
id = 0x0B,
name = "W3GS_COUNTDOWN_END",
def = {},
},
--[[doc
Message ID: 0x0C
Message Name: W3GS_INCOMING_ACTION
Direction: Server -> Client (Received)
Used By: Warcraft III: The Frozen Throne, Warcraft III
Format: (WORD) Send interval
(WORD) CRC-16 encryption