-
Notifications
You must be signed in to change notification settings - Fork 2
/
messagePackage.pas
113 lines (94 loc) · 2.84 KB
/
messagePackage.pas
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
unit messagePackage;
interface
uses ygo_client_protocol;
type tpackage = object
protocolhead1:Char;
end;
type tchatmessage = Packed record
// protocolhead1:Char;
// usertype:Char;
messages:array[0..254] of WideChar;
end;
type tDuelRoom =Packed record
pkghead:tpackage;
seed:array[0..7] of char;
password2name:array[0..19] of WideChar;
end;
type tYgoMessage =record
//pkghead:tpackage;
msghead1:char;
msghead2:char;
msghead3:char;
messages:array[0..19] of WideChar;
end;
type tDuelPlayer =Packed record
pkghead:tpackage;
name:array[0..19] of WideChar;
end;
type tplayerpostion= record
pkghead:tpackage;
pos:char;
end;
type tDuelGameInfo =Packed record //struct HostInfo
{protocolhead1:Char;
protocolhead2:Char;}
protocolhead3:array[0..3] of Char;//lflist:Cardinal; °æ±¾µÄhashÖµ
rule:Char;
mode:Char;
enable_priority,no_check_deck,no_shuffle_deck:Char;
DuelGameInfosplit1:array[0..2] of Char;
start_lp:Cardinal;
//DuelGameInfosplit2:array[0..1] of char;
start_hand:Char;
draw_count:Char;
time:cardinal;
{
unsigned int lflist;
unsigned char rule;
unsigned char mode;
bool enable_priority;
bool no_check_deck;
bool no_shuffle_deck;
unsigned int start_lp;
unsigned char start_hand;
unsigned char draw_count;
}
end;
type tPlayerJoin =record //STOC_HS_PlayerEnter
name:array[0..37] of char;
split:array[0..1] of Char;
pos:Char;
end;
function consplayerjoin(str:string):tPlayerJoin;
function consDuelGameInfo():tDuelGameInfo;
implementation
function consplayerjoin(str:string):tPlayerJoin;
var wstr:array[0..19] of WideChar;
begin
StringToWideChar(str,wstr,38);
move(wstr,result.name[0],38);
result.split[0]:=char(0);
result.split[1]:=char(0);
result.pos:=char(0);
end;
function consDuelGameInfo():tDuelGameInfo;
begin
//DuelGameInfo.protocolhead1:=char(0);
//DuelGameInfo.protocolhead2:=char(STOC_JOIN_GAME);
result.protocolhead3[0]:=char($1b);
result.protocolhead3[1]:=char($0c);
result.protocolhead3[2]:=char($e9);
result.protocolhead3[3]:=char($25);
// DuelGameInfo.lflist:=1;
result.rule:=char(0);
result.mode:=char(0);
result.enable_priority:=char(0);
result.no_check_deck:=char(0);
result.no_shuffle_deck:=char(0);
result.DuelGameInfosplit1:=char(0);
result.start_lp:=8000;
result.start_hand:=char(0);
result.draw_count:=char(0);
result.time:=0;
end;
end.