Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
ygopro
Commits
13d45ea3
Commit
13d45ea3
authored
Nov 12, 2017
by
edo9300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uint64 descriptions
parent
4625d85f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
54 deletions
+60
-54
gframe/data_manager.cpp
gframe/data_manager.cpp
+2
-2
gframe/data_manager.h
gframe/data_manager.h
+1
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+22
-18
gframe/game.h
gframe/game.h
+1
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+11
-11
gframe/single_mode.cpp
gframe/single_mode.cpp
+12
-11
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+11
-11
No files found.
gframe/data_manager.cpp
View file @
13d45ea3
...
@@ -154,10 +154,10 @@ const wchar_t* DataManager::GetText(int code) {
...
@@ -154,10 +154,10 @@ const wchar_t* DataManager::GetText(int code) {
return
csit
->
second
.
text
;
return
csit
->
second
.
text
;
return
unknown_string
;
return
unknown_string
;
}
}
const
wchar_t
*
DataManager
::
GetDesc
(
int
strCode
)
{
const
wchar_t
*
DataManager
::
GetDesc
(
u64
strCode
)
{
if
(
strCode
<
10000
)
if
(
strCode
<
10000
)
return
GetSysString
(
strCode
);
return
GetSysString
(
strCode
);
int
code
=
strCode
>>
4
;
u64
code
=
strCode
>>
4
;
int
offset
=
strCode
&
0xf
;
int
offset
=
strCode
&
0xf
;
auto
csit
=
_strings
.
find
(
code
);
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
if
(
csit
==
_strings
.
end
())
...
...
gframe/data_manager.h
View file @
13d45ea3
...
@@ -19,7 +19,7 @@ public:
...
@@ -19,7 +19,7 @@ public:
bool
GetString
(
int
code
,
CardString
*
pStr
);
bool
GetString
(
int
code
,
CardString
*
pStr
);
const
wchar_t
*
GetName
(
int
code
);
const
wchar_t
*
GetName
(
int
code
);
const
wchar_t
*
GetText
(
int
code
);
const
wchar_t
*
GetText
(
int
code
);
const
wchar_t
*
GetDesc
(
int
strCode
);
const
wchar_t
*
GetDesc
(
u64
strCode
);
const
wchar_t
*
GetSysString
(
int
code
);
const
wchar_t
*
GetSysString
(
int
code
);
const
wchar_t
*
GetVictoryString
(
int
code
);
const
wchar_t
*
GetVictoryString
(
int
code
);
const
wchar_t
*
GetCounterName
(
int
code
);
const
wchar_t
*
GetCounterName
(
int
code
);
...
...
gframe/duelclient.cpp
View file @
13d45ea3
...
@@ -22,7 +22,7 @@ bufferevent* DuelClient::client_bev = 0;
...
@@ -22,7 +22,7 @@ bufferevent* DuelClient::client_bev = 0;
char
DuelClient
::
duel_client_read
[
0x2000
];
char
DuelClient
::
duel_client_read
[
0x2000
];
char
DuelClient
::
duel_client_write
[
0x2000
];
char
DuelClient
::
duel_client_write
[
0x2000
];
bool
DuelClient
::
is_closing
=
false
;
bool
DuelClient
::
is_closing
=
false
;
int
DuelClient
::
select_hint
=
0
;
u64
DuelClient
::
select_hint
=
0
;
wchar_t
DuelClient
::
event_string
[
256
];
wchar_t
DuelClient
::
event_string
[
256
];
mtrandom
DuelClient
::
rnd
;
mtrandom
DuelClient
::
rnd
;
...
@@ -402,6 +402,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -402,6 +402,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
myswprintf
(
msgbuf
,
L"*%ls
\n
"
,
dataManager
.
GetSysString
(
1260
+
rule
-
1
));
myswprintf
(
msgbuf
,
L"*%ls
\n
"
,
dataManager
.
GetSysString
(
1260
+
rule
-
1
));
str
.
append
(
msgbuf
);
str
.
append
(
msgbuf
);
}
}
mainGame
->
dInfo
.
lua64
=
pkt
->
info
.
check
==
2
;
if
(
pkt
->
info
.
check
==
2
)
{
if
(
pkt
->
info
.
check
==
2
)
{
if
(
pkt
->
info
.
destiny_draw
)
{
if
(
pkt
->
info
.
destiny_draw
)
{
myswprintf
(
msgbuf
,
L"*%ls
\n
"
,
dataManager
.
GetSysString
(
1134
));
myswprintf
(
msgbuf
,
L"*%ls
\n
"
,
dataManager
.
GetSysString
(
1134
));
...
@@ -977,7 +978,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -977,7 +978,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case
MSG_HINT
:
{
case
MSG_HINT
:
{
int
type
=
BufferIO
::
ReadInt8
(
pbuf
);
int
type
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int player = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int player = */
BufferIO
::
ReadInt8
(
pbuf
);
int
data
=
BufferIO
::
ReadInt32
(
pbuf
);
u64
data
=
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
return
true
;
switch
(
type
)
{
switch
(
type
)
{
...
@@ -1168,7 +1169,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1168,7 +1169,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
case
MSG_SELECT_BATTLECMD
:
{
case
MSG_SELECT_BATTLECMD
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
int
/*code, */
desc
,
count
,
con
,
loc
,
seq
/*, diratt*/
;
int
/*code, */
count
,
con
,
loc
,
seq
/*, diratt*/
;
u64
desc
;
ClientCard
*
pcard
;
ClientCard
*
pcard
;
mainGame
->
dField
.
activatable_cards
.
clear
();
mainGame
->
dField
.
activatable_cards
.
clear
();
mainGame
->
dField
.
activatable_descs
.
clear
();
mainGame
->
dField
.
activatable_descs
.
clear
();
...
@@ -1178,7 +1180,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1178,7 +1180,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
loc
=
BufferIO
::
ReadInt8
(
pbuf
);
loc
=
BufferIO
::
ReadInt8
(
pbuf
);
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
desc
=
BufferIO
::
ReadInt32
(
pbuf
)
;
desc
=
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
);
;
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
mainGame
->
dField
.
activatable_cards
.
push_back
(
pcard
);
mainGame
->
dField
.
activatable_cards
.
push_back
(
pcard
);
mainGame
->
dField
.
activatable_descs
.
push_back
(
std
::
make_pair
(
desc
,
0
));
mainGame
->
dField
.
activatable_descs
.
push_back
(
std
::
make_pair
(
desc
,
0
));
...
@@ -1216,7 +1218,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1216,7 +1218,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
case
MSG_SELECT_IDLECMD
:
{
case
MSG_SELECT_IDLECMD
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
int
code
,
desc
,
count
,
con
,
loc
,
seq
;
int
code
,
count
,
con
,
loc
,
seq
;
u64
desc
;
ClientCard
*
pcard
;
ClientCard
*
pcard
;
mainGame
->
dField
.
summonable_cards
.
clear
();
mainGame
->
dField
.
summonable_cards
.
clear
();
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
...
@@ -1249,7 +1252,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1249,7 +1252,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
else
if
(
pcard
->
location
==
LOCATION_EXTRA
)
else
if
(
pcard
->
location
==
LOCATION_EXTRA
)
mainGame
->
dField
.
extra_act
=
true
;
mainGame
->
dField
.
extra_act
=
true
;
else
{
else
{
int
seq
=
mainGame
->
dInfo
.
duel_
rule
>=
4
?
(
mainGame
->
dInfo
.
speed
)
?
1
:
0
:
6
;
int
seq
=
mainGame
->
dInfo
.
duel_
field
==
4
?
(
mainGame
->
dInfo
.
extraval
&
0x1
)
?
1
:
0
:
6
;
if
(
pcard
->
location
==
LOCATION_SZONE
&&
pcard
->
sequence
==
seq
&&
(
pcard
->
type
&
TYPE_PENDULUM
)
&&
!
pcard
->
equipTarget
)
if
(
pcard
->
location
==
LOCATION_SZONE
&&
pcard
->
sequence
==
seq
&&
(
pcard
->
type
&
TYPE_PENDULUM
)
&&
!
pcard
->
equipTarget
)
mainGame
->
dField
.
pzone_act
[
pcard
->
controler
]
=
true
;
mainGame
->
dField
.
pzone_act
[
pcard
->
controler
]
=
true
;
}
}
...
@@ -1295,7 +1298,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1295,7 +1298,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
loc
=
BufferIO
::
ReadInt8
(
pbuf
);
loc
=
BufferIO
::
ReadInt8
(
pbuf
);
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
desc
=
BufferIO
::
ReadInt32
(
pbuf
)
;
desc
=
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
);
;
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
mainGame
->
dField
.
activatable_cards
.
push_back
(
pcard
);
mainGame
->
dField
.
activatable_cards
.
push_back
(
pcard
);
mainGame
->
dField
.
activatable_descs
.
push_back
(
std
::
make_pair
(
desc
,
0
));
mainGame
->
dField
.
activatable_descs
.
push_back
(
std
::
make_pair
(
desc
,
0
));
...
@@ -1336,7 +1339,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1336,7 +1339,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
pcard
->
is_highlighting
=
true
;
pcard
->
is_highlighting
=
true
;
mainGame
->
dField
.
highlighting_card
=
pcard
;
mainGame
->
dField
.
highlighting_card
=
pcard
;
}
}
int
desc
=
BufferIO
::
ReadInt32
(
pbuf
)
;
u64
desc
=
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
);
;
if
(
desc
==
0
)
{
if
(
desc
==
0
)
{
wchar_t
ynbuf
[
256
];
wchar_t
ynbuf
[
256
];
myswprintf
(
ynbuf
,
dataManager
.
GetSysString
(
200
),
dataManager
.
FormatLocation
(
l
,
s
),
dataManager
.
GetName
(
code
));
myswprintf
(
ynbuf
,
dataManager
.
GetSysString
(
200
),
dataManager
.
FormatLocation
(
l
,
s
),
dataManager
.
GetName
(
code
));
...
@@ -1354,7 +1357,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1354,7 +1357,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
case
MSG_SELECT_YESNO
:
{
case
MSG_SELECT_YESNO
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
int
desc
=
BufferIO
::
ReadInt32
(
pbuf
)
;
u64
desc
=
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
);
;
mainGame
->
dField
.
highlighting_card
=
0
;
mainGame
->
dField
.
highlighting_card
=
0
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
dataManager
.
GetDesc
(
desc
));
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
dataManager
.
GetDesc
(
desc
));
...
@@ -1367,7 +1370,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1367,7 +1370,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_options
.
clear
();
mainGame
->
dField
.
select_options
.
clear
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
for
(
int
i
=
0
;
i
<
count
;
++
i
)
mainGame
->
dField
.
select_options
.
push_back
(
BufferIO
::
ReadInt32
(
pbuf
));
mainGame
->
dField
.
select_options
.
push_back
(
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
));
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stOptions
,
310
,
mainGame
->
textFont
,
mainGame
->
SetStaticText
(
mainGame
->
stOptions
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
dataManager
.
GetDesc
(
mainGame
->
dField
.
select_options
[
0
]));
(
wchar_t
*
)
dataManager
.
GetDesc
(
mainGame
->
dField
.
select_options
[
0
]));
...
@@ -1539,7 +1542,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1539,7 +1542,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
forced
=
BufferIO
::
ReadInt8
(
pbuf
);
int
forced
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int hint0 = */
BufferIO
::
ReadInt32
(
pbuf
);
/*int hint0 = */
BufferIO
::
ReadInt32
(
pbuf
);
/*int hint1 = */
BufferIO
::
ReadInt32
(
pbuf
);
/*int hint1 = */
BufferIO
::
ReadInt32
(
pbuf
);
int
code
,
c
,
l
,
s
,
ss
,
desc
;
int
code
,
c
,
l
,
s
,
ss
;
u64
desc
;
ClientCard
*
pcard
;
ClientCard
*
pcard
;
bool
panelmode
=
false
;
bool
panelmode
=
false
;
bool
conti_exist
=
false
;
bool
conti_exist
=
false
;
...
@@ -1554,7 +1558,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -1554,7 +1558,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
l
=
BufferIO
::
ReadInt8
(
pbuf
);
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
ss
=
BufferIO
::
ReadInt8
(
pbuf
);
ss
=
BufferIO
::
ReadInt8
(
pbuf
);
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
desc
=
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
,
ss
);
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
,
ss
);
mainGame
->
dField
.
activatable_cards
.
push_back
(
pcard
);
mainGame
->
dField
.
activatable_cards
.
push_back
(
pcard
);
mainGame
->
dField
.
activatable_descs
.
push_back
(
std
::
make_pair
(
desc
,
flag
));
mainGame
->
dField
.
activatable_descs
.
push_back
(
std
::
make_pair
(
desc
,
flag
));
...
@@ -2689,7 +2693,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2689,7 +2693,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
cl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
u64
desc
=
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
);
/*int ct = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int ct = */
BufferIO
::
ReadInt8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
return
true
;
...
@@ -3378,7 +3382,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -3378,7 +3382,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
cbANNumber
->
clear
();
mainGame
->
cbANNumber
->
clear
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
value
=
BufferIO
::
ReadInt32
(
pbuf
);
u64
value
=
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
);
myswprintf
(
textBuffer
,
L" % d"
,
value
);
myswprintf
(
textBuffer
,
L" % d"
,
value
);
mainGame
->
cbANNumber
->
addItem
(
textBuffer
,
value
);
mainGame
->
cbANNumber
->
addItem
(
textBuffer
,
value
);
}
}
...
@@ -3398,7 +3402,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -3398,7 +3402,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
declarable_type
=
0
;
mainGame
->
dField
.
declarable_type
=
0
;
mainGame
->
dField
.
opcode
.
clear
();
mainGame
->
dField
.
opcode
.
clear
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
for
(
int
i
=
0
;
i
<
count
;
++
i
)
mainGame
->
dField
.
opcode
.
push_back
(
BufferIO
::
ReadInt32
(
pbuf
));
mainGame
->
dField
.
opcode
.
push_back
(
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
));
if
(
select_hint
)
if
(
select_hint
)
myswprintf
(
textBuffer
,
L"%ls"
,
dataManager
.
GetDesc
(
select_hint
));
myswprintf
(
textBuffer
,
L"%ls"
,
dataManager
.
GetDesc
(
select_hint
));
else
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
564
));
else
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
564
));
...
@@ -3417,7 +3421,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -3417,7 +3421,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
chtype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
chtype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
value
=
BufferIO
::
ReadInt32
(
pbuf
);
u64
value
=
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
!
pcard
)
if
(
!
pcard
)
return
true
;
return
true
;
...
@@ -3451,7 +3455,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -3451,7 +3455,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
case
MSG_PLAYER_HINT
:
{
case
MSG_PLAYER_HINT
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
chtype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
chtype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
value
=
BufferIO
::
ReadInt32
(
pbuf
);
u64
value
=
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
);
auto
&
player_desc_hints
=
mainGame
->
dField
.
player_desc_hints
[
player
];
auto
&
player_desc_hints
=
mainGame
->
dField
.
player_desc_hints
[
player
];
if
(
chtype
==
PHINT_DESC_ADD
)
{
if
(
chtype
==
PHINT_DESC_ADD
)
{
player_desc_hints
[
value
]
++
;
player_desc_hints
[
value
]
++
;
...
@@ -3670,7 +3674,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -3670,7 +3674,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
cl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cl
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
u64
desc
=
(
mainGame
->
dInfo
.
lua64
)
?
BufferIO
::
ReadInt64
(
pbuf
)
:
BufferIO
::
ReadInt32
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
pcc
,
pcl
,
pcs
,
subs
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
pcc
,
pcl
,
pcs
,
subs
);
mainGame
->
dField
.
current_chain
.
chain_card
=
pcard
;
mainGame
->
dField
.
current_chain
.
chain_card
=
pcard
;
mainGame
->
dField
.
current_chain
.
code
=
code
;
mainGame
->
dField
.
current_chain
.
code
=
code
;
...
...
gframe/game.h
View file @
13d45ea3
...
@@ -58,6 +58,7 @@ struct DuelInfo {
...
@@ -58,6 +58,7 @@ struct DuelInfo {
int
startlp
;
int
startlp
;
int
duel_rule
;
int
duel_rule
;
int
speed
=
false
;
int
speed
=
false
;
int
lua64
;
int
turn
;
int
turn
;
short
curMsg
;
short
curMsg
;
wchar_t
hostname
[
20
];
wchar_t
hostname
[
20
];
...
...
gframe/single_duel.cpp
View file @
13d45ea3
...
@@ -611,7 +611,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -611,7 +611,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
case
MSG_HINT
:
{
case
MSG_HINT
:
{
type
=
BufferIO
::
ReadInt8
(
pbuf
);
type
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt
32
(
pbuf
);
BufferIO
::
ReadInt
64
(
pbuf
);
switch
(
type
)
{
switch
(
type
)
{
case
1
:
case
1
:
case
2
:
case
2
:
...
@@ -663,7 +663,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -663,7 +663,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
case
MSG_SELECT_BATTLECMD
:
{
case
MSG_SELECT_BATTLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
1
1
;
pbuf
+=
count
*
1
5
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
8
+
2
;
pbuf
+=
count
*
8
+
2
;
RefreshMzone
(
0
);
RefreshMzone
(
0
);
...
@@ -689,7 +689,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -689,7 +689,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
1
1
+
3
;
pbuf
+=
count
*
1
5
+
3
;
RefreshMzone
(
0
);
RefreshMzone
(
0
);
RefreshMzone
(
1
);
RefreshMzone
(
1
);
RefreshSzone
(
0
);
RefreshSzone
(
0
);
...
@@ -702,14 +702,14 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -702,14 +702,14 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
}
}
case
MSG_SELECT_EFFECTYN
:
{
case
MSG_SELECT_EFFECTYN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
1
2
;
pbuf
+=
1
6
;
WaitforResponse
(
player
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
return
1
;
}
}
case
MSG_SELECT_YESNO
:
{
case
MSG_SELECT_YESNO
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
4
;
pbuf
+=
8
;
WaitforResponse
(
player
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
return
1
;
...
@@ -717,7 +717,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -717,7 +717,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
case
MSG_SELECT_OPTION
:
{
case
MSG_SELECT_OPTION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
4
;
pbuf
+=
count
*
8
;
WaitforResponse
(
player
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
return
1
;
...
@@ -772,7 +772,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -772,7 +772,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
case
MSG_SELECT_CHAIN
:
{
case
MSG_SELECT_CHAIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
10
+
count
*
1
3
;
pbuf
+=
10
+
count
*
1
7
;
WaitforResponse
(
player
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
return
1
;
...
@@ -1068,7 +1068,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -1068,7 +1068,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
break
;
break
;
}
}
case
MSG_CHAINING
:
{
case
MSG_CHAINING
:
{
pbuf
+=
16
;
pbuf
+=
20
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
@@ -1368,13 +1368,13 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -1368,13 +1368,13 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
case
MSG_ANNOUNCE_CARD_FILTER
:
{
case
MSG_ANNOUNCE_CARD_FILTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
4
*
count
;
pbuf
+=
8
*
count
;
WaitforResponse
(
player
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
return
1
;
}
}
case
MSG_CARD_HINT
:
{
case
MSG_CARD_HINT
:
{
pbuf
+=
9
;
pbuf
+=
13
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
@@ -1382,7 +1382,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -1382,7 +1382,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
break
;
break
;
}
}
case
MSG_PLAYER_HINT
:
{
case
MSG_PLAYER_HINT
:
{
pbuf
+=
6
;
pbuf
+=
10
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
...
gframe/single_mode.cpp
View file @
13d45ea3
...
@@ -47,6 +47,7 @@ int SingleMode::SinglePlayThread(void* param) {
...
@@ -47,6 +47,7 @@ int SingleMode::SinglePlayThread(void* param) {
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
MessageHandler
);
set_message_handler
((
message_handler
)
MessageHandler
);
pduel
=
create_duel
(
rnd
.
rand
());
pduel
=
create_duel
(
rnd
.
rand
());
mainGame
->
dInfo
.
lua64
=
true
;
set_player_info
(
pduel
,
0
,
8000
,
5
,
1
);
set_player_info
(
pduel
,
0
,
8000
,
5
,
1
);
set_player_info
(
pduel
,
1
,
8000
,
5
,
1
);
set_player_info
(
pduel
,
1
,
8000
,
5
,
1
);
mainGame
->
dInfo
.
lp
[
0
]
=
8000
;
mainGame
->
dInfo
.
lp
[
0
]
=
8000
;
...
@@ -140,7 +141,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
...
@@ -140,7 +141,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
case
MSG_HINT
:
{
case
MSG_HINT
:
{
/*int type = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int type = */
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int data = */
BufferIO
::
ReadInt
32
(
pbuf
);
/*int data = */
BufferIO
::
ReadInt
64
(
pbuf
);
if
(
player
==
0
)
if
(
player
==
0
)
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
...
@@ -153,7 +154,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
...
@@ -153,7 +154,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
case
MSG_SELECT_BATTLECMD
:
{
case
MSG_SELECT_BATTLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
1
1
;
pbuf
+=
count
*
1
5
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
8
+
2
;
pbuf
+=
count
*
8
+
2
;
SinglePlayRefresh
();
SinglePlayRefresh
();
...
@@ -176,7 +177,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
...
@@ -176,7 +177,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
1
1
+
3
;
pbuf
+=
count
*
1
5
+
3
;
SinglePlayRefresh
();
SinglePlayRefresh
();
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Reset
();
...
@@ -186,7 +187,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
...
@@ -186,7 +187,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
}
}
case
MSG_SELECT_EFFECTYN
:
{
case
MSG_SELECT_EFFECTYN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
1
2
;
pbuf
+=
1
6
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Reset
();
...
@@ -196,7 +197,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
...
@@ -196,7 +197,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
}
}
case
MSG_SELECT_YESNO
:
{
case
MSG_SELECT_YESNO
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
4
;
pbuf
+=
8
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Wait
();
mainGame
->
singleSignal
.
Wait
();
...
@@ -206,7 +207,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
...
@@ -206,7 +207,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
case
MSG_SELECT_OPTION
:
{
case
MSG_SELECT_OPTION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
4
;
pbuf
+=
count
*
8
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Wait
();
mainGame
->
singleSignal
.
Wait
();
...
@@ -241,7 +242,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
...
@@ -241,7 +242,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
case
MSG_SELECT_CHAIN
:
{
case
MSG_SELECT_CHAIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
10
+
count
*
1
3
;
pbuf
+=
10
+
count
*
1
7
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Wait
();
mainGame
->
singleSignal
.
Wait
();
...
@@ -435,7 +436,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
...
@@ -435,7 +436,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
break
;
break
;
}
}
case
MSG_CHAINING
:
{
case
MSG_CHAINING
:
{
pbuf
+=
16
;
pbuf
+=
20
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
}
}
...
@@ -631,7 +632,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
...
@@ -631,7 +632,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
case
MSG_ANNOUNCE_CARD_FILTER
:
{
case
MSG_ANNOUNCE_CARD_FILTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
4
*
count
;
pbuf
+=
8
*
count
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Wait
();
mainGame
->
singleSignal
.
Wait
();
...
@@ -639,12 +640,12 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
...
@@ -639,12 +640,12 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
break
;
break
;
}
}
case
MSG_CARD_HINT
:
{
case
MSG_CARD_HINT
:
{
pbuf
+=
9
;
pbuf
+=
13
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
}
}
case
MSG_PLAYER_HINT
:
{
case
MSG_PLAYER_HINT
:
{
pbuf
+=
6
;
pbuf
+=
10
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
}
}
...
...
gframe/tag_duel.cpp
View file @
13d45ea3
...
@@ -562,7 +562,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -562,7 +562,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
case
MSG_HINT
:
{
case
MSG_HINT
:
{
type
=
BufferIO
::
ReadInt8
(
pbuf
);
type
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt
32
(
pbuf
);
BufferIO
::
ReadInt
64
(
pbuf
);
switch
(
type
)
{
switch
(
type
)
{
case
1
:
case
1
:
case
2
:
case
2
:
...
@@ -602,7 +602,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -602,7 +602,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
case
MSG_SELECT_BATTLECMD
:
{
case
MSG_SELECT_BATTLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
1
1
;
pbuf
+=
count
*
1
5
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
8
+
2
;
pbuf
+=
count
*
8
+
2
;
RefreshMzone
(
0
);
RefreshMzone
(
0
);
...
@@ -628,7 +628,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -628,7 +628,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
1
1
+
3
;
pbuf
+=
count
*
1
5
+
3
;
RefreshMzone
(
0
);
RefreshMzone
(
0
);
RefreshMzone
(
1
);
RefreshMzone
(
1
);
RefreshSzone
(
0
);
RefreshSzone
(
0
);
...
@@ -641,14 +641,14 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -641,14 +641,14 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
}
}
case
MSG_SELECT_EFFECTYN
:
{
case
MSG_SELECT_EFFECTYN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
1
2
;
pbuf
+=
1
6
;
WaitforResponse
(
player
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
return
1
;
}
}
case
MSG_SELECT_YESNO
:
{
case
MSG_SELECT_YESNO
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
4
;
pbuf
+=
8
;
WaitforResponse
(
player
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
return
1
;
...
@@ -656,7 +656,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -656,7 +656,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
case
MSG_SELECT_OPTION
:
{
case
MSG_SELECT_OPTION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
4
;
pbuf
+=
count
*
8
;
WaitforResponse
(
player
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
return
1
;
...
@@ -711,7 +711,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -711,7 +711,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
case
MSG_SELECT_CHAIN
:
{
case
MSG_SELECT_CHAIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
10
+
count
*
1
3
;
pbuf
+=
10
+
count
*
1
7
;
WaitforResponse
(
player
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
return
1
;
...
@@ -1059,7 +1059,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -1059,7 +1059,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
break
;
break
;
}
}
case
MSG_CHAINING
:
{
case
MSG_CHAINING
:
{
pbuf
+=
16
;
pbuf
+=
20
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
...
@@ -1415,13 +1415,13 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -1415,13 +1415,13 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
case
MSG_ANNOUNCE_CARD_FILTER
:
{
case
MSG_ANNOUNCE_CARD_FILTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
4
*
count
;
pbuf
+=
8
*
count
;
WaitforResponse
(
player
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
return
1
;
}
}
case
MSG_CARD_HINT
:
{
case
MSG_CARD_HINT
:
{
pbuf
+=
9
;
pbuf
+=
13
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
...
@@ -1431,7 +1431,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
...
@@ -1431,7 +1431,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
break
;
break
;
}
}
case
MSG_PLAYER_HINT
:
{
case
MSG_PLAYER_HINT
:
{
pbuf
+=
6
;
pbuf
+=
10
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment