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
0
Merge Requests
0
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
baichixing
ygopro
Commits
f45f5392
Commit
f45f5392
authored
May 04, 2024
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into develop
parents
a1df10b4
3d8c3621
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
748 additions
and
730 deletions
+748
-730
gframe/bufferio.h
gframe/bufferio.h
+7
-8
gframe/client_card.cpp
gframe/client_card.cpp
+8
-8
gframe/client_field.cpp
gframe/client_field.cpp
+5
-5
gframe/data_manager.cpp
gframe/data_manager.cpp
+5
-5
gframe/data_manager.h
gframe/data_manager.h
+5
-3
gframe/deck_con.h
gframe/deck_con.h
+37
-37
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+1
-1
gframe/deck_manager.h
gframe/deck_manager.h
+1
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+368
-360
gframe/game.cpp
gframe/game.cpp
+4
-3
gframe/game.h
gframe/game.h
+1
-1
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+59
-59
gframe/single_duel.cpp
gframe/single_duel.cpp
+85
-85
gframe/single_mode.cpp
gframe/single_mode.cpp
+62
-62
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+90
-90
premake5.lua
premake5.lua
+2
-2
strings.conf
strings.conf
+8
-0
No files found.
gframe/bufferio.h
View file @
f45f5392
#ifndef BUFFERIO_H
#define BUFFERIO_H
#ifdef _MSC_VER
#pragma warning(disable: 4244)
#endif
class
BufferIO
{
public:
...
...
@@ -43,7 +40,7 @@ public:
inline
static
int
CopyWStr
(
T1
*
src
,
T2
*
pstr
,
int
bufsize
)
{
int
l
=
0
;
while
(
src
[
l
]
&&
l
<
bufsize
-
1
)
{
pstr
[
l
]
=
src
[
l
];
pstr
[
l
]
=
(
T2
)
src
[
l
];
l
++
;
}
pstr
[
l
]
=
0
;
...
...
@@ -53,7 +50,7 @@ public:
inline
static
int
CopyWStrRef
(
T1
*
src
,
T2
*&
pstr
,
int
bufsize
)
{
int
l
=
0
;
while
(
src
[
l
]
&&
l
<
bufsize
-
1
)
{
pstr
[
l
]
=
src
[
l
];
pstr
[
l
]
=
(
T2
)
src
[
l
];
l
++
;
}
pstr
+=
l
;
...
...
@@ -65,7 +62,7 @@ public:
char
*
pstr
=
str
;
while
(
*
wsrc
!=
0
)
{
if
(
*
wsrc
<
0x80
)
{
*
str
=
*
wsrc
;
*
str
=
(
char
)
*
wsrc
;
++
str
;
}
else
if
(
*
wsrc
<
0x800
)
{
str
[
0
]
=
((
*
wsrc
>>
6
)
&
0x1f
)
|
0xc0
;
...
...
@@ -131,12 +128,14 @@ public:
return
wp
-
wstr
;
}
static
int
GetVal
(
const
wchar_t
*
pstr
)
{
int
ret
=
0
;
unsigned
int
ret
=
0
;
while
(
*
pstr
>=
L'0'
&&
*
pstr
<=
L'9'
)
{
ret
=
ret
*
10
+
(
*
pstr
-
L'0'
);
pstr
++
;
}
return
ret
;
if
(
*
pstr
==
0
)
return
(
int
)
ret
;
return
0
;
}
};
...
...
gframe/client_card.cpp
View file @
f45f5392
...
...
@@ -113,10 +113,10 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
if
(
flag
&
QUERY_REASON_CARD
)
buf
+=
4
;
if
(
flag
&
QUERY_EQUIP_CARD
)
{
int
c
=
BufferIO
::
ReadInt8
(
buf
);
int
l
=
BufferIO
::
Read
Int8
(
buf
);
int
s
=
BufferIO
::
ReadInt8
(
buf
);
BufferIO
::
ReadInt8
(
buf
);
int
c
=
BufferIO
::
Read
U
Int8
(
buf
);
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
buf
);
int
s
=
BufferIO
::
Read
U
Int8
(
buf
);
BufferIO
::
Read
U
Int8
(
buf
);
ClientCard
*
ecard
=
mainGame
->
dField
.
GetCard
(
mainGame
->
LocalPlayer
(
c
),
l
,
s
);
if
(
ecard
)
{
equipTarget
=
ecard
;
...
...
@@ -126,10 +126,10 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
if
(
flag
&
QUERY_TARGET_CARD
)
{
int
count
=
BufferIO
::
ReadInt32
(
buf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
c
=
BufferIO
::
ReadInt8
(
buf
);
int
l
=
BufferIO
::
Read
Int8
(
buf
);
int
s
=
BufferIO
::
ReadInt8
(
buf
);
BufferIO
::
ReadInt8
(
buf
);
int
c
=
BufferIO
::
Read
U
Int8
(
buf
);
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
buf
);
int
s
=
BufferIO
::
Read
U
Int8
(
buf
);
BufferIO
::
Read
U
Int8
(
buf
);
ClientCard
*
tcard
=
mainGame
->
dField
.
GetCard
(
mainGame
->
LocalPlayer
(
c
),
l
,
s
);
if
(
tcard
)
{
cardTarget
.
insert
(
tcard
);
...
...
gframe/client_field.cpp
View file @
f45f5392
...
...
@@ -192,7 +192,7 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
case
LOCATION_DECK
:
{
if
(
sequence
!=
0
||
deck
[
controler
].
size
()
==
0
)
{
deck
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
deck
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
deck
[
controler
].
size
()
-
1
)
;
}
else
{
deck
[
controler
].
push_back
(
0
);
for
(
int
i
=
deck
[
controler
].
size
()
-
1
;
i
>
0
;
--
i
)
{
...
...
@@ -207,7 +207,7 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
}
case
LOCATION_HAND
:
{
hand
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
hand
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
hand
[
controler
].
size
()
-
1
)
;
break
;
}
case
LOCATION_MZONE
:
{
...
...
@@ -220,18 +220,18 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
}
case
LOCATION_GRAVE
:
{
grave
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
grave
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
grave
[
controler
].
size
()
-
1
)
;
break
;
}
case
LOCATION_REMOVED
:
{
remove
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
remove
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
remove
[
controler
].
size
()
-
1
)
;
break
;
}
case
LOCATION_EXTRA
:
{
if
(
extra_p_count
[
controler
]
==
0
||
(
pcard
->
position
&
POS_FACEUP
))
{
extra
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
extra
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
extra
[
controler
].
size
()
-
1
)
;
}
else
{
extra
[
controler
].
push_back
(
0
);
int
p
=
extra
[
controler
].
size
()
-
extra_p_count
[
controler
]
-
1
;
...
...
gframe/data_manager.cpp
View file @
f45f5392
...
...
@@ -197,7 +197,7 @@ code_pointer DataManager::GetCodePointer(unsigned int code) const {
string_pointer
DataManager
::
GetStringPointer
(
unsigned
int
code
)
const
{
return
_strings
.
find
(
code
);
}
bool
DataManager
::
GetString
(
int
code
,
CardString
*
pStr
)
{
bool
DataManager
::
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
{
pStr
->
name
=
unknown_string
;
...
...
@@ -207,7 +207,7 @@ bool DataManager::GetString(int code, CardString* pStr) {
*
pStr
=
csit
->
second
;
return
true
;
}
const
wchar_t
*
DataManager
::
GetName
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetName
(
unsigned
int
code
)
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
...
...
@@ -215,7 +215,7 @@ const wchar_t* DataManager::GetName(int code) {
return
csit
->
second
.
name
.
c_str
();
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetText
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetText
(
unsigned
int
code
)
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
...
...
@@ -224,7 +224,7 @@ const wchar_t* DataManager::GetText(int code) {
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetDesc
(
unsigned
int
strCode
)
{
if
(
strCode
<
10000u
)
if
(
strCode
<
(
MIN_CARD_ID
<<
4
)
)
return
GetSysString
(
strCode
);
unsigned
int
code
=
(
strCode
>>
4
)
&
0x0fffffff
;
unsigned
int
offset
=
strCode
&
0xf
;
...
...
@@ -236,7 +236,7 @@ const wchar_t* DataManager::GetDesc(unsigned int strCode) {
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
{
if
(
code
<
0
||
code
>=
2048
)
if
(
code
<
0
||
code
>
MAX_STRING_ID
)
return
unknown_string
;
auto
csit
=
_sysStrings
.
find
(
code
);
if
(
csit
==
_sysStrings
.
end
())
...
...
gframe/data_manager.h
View file @
f45f5392
...
...
@@ -8,6 +8,8 @@
#include <unordered_map>
namespace
ygo
{
constexpr
int
MAX_STRING_ID
=
0x7ff
;
constexpr
unsigned
int
MIN_CARD_ID
=
(
unsigned
int
)(
MAX_STRING_ID
+
1
)
>>
4
;
class
DataManager
{
public:
...
...
@@ -20,9 +22,9 @@ public:
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
);
code_pointer
GetCodePointer
(
unsigned
int
code
)
const
;
string_pointer
GetStringPointer
(
unsigned
int
code
)
const
;
bool
GetString
(
int
code
,
CardString
*
pStr
);
const
wchar_t
*
GetName
(
int
code
);
const
wchar_t
*
GetText
(
int
code
);
bool
GetString
(
unsigned
int
code
,
CardString
*
pStr
);
const
wchar_t
*
GetName
(
unsigned
int
code
);
const
wchar_t
*
GetText
(
unsigned
int
code
);
const
wchar_t
*
GetDesc
(
unsigned
int
strCode
);
const
wchar_t
*
GetSysString
(
int
code
);
const
wchar_t
*
GetVictoryString
(
int
code
);
...
...
gframe/deck_con.h
View file @
f45f5392
...
...
@@ -41,49 +41,49 @@ public:
void
pop_side
(
int
seq
);
bool
check_limit
(
code_pointer
pointer
);
long
long
filter_effect
;
unsigned
int
filter_type
;
unsigned
int
filter_type2
;
unsigned
int
filter_attrib
;
unsigned
int
filter_race
;
unsigned
int
filter_atktype
;
int
filter_atk
;
unsigned
int
filter_deftype
;
int
filter_def
;
unsigned
int
filter_lvtype
;
unsigned
int
filter_lv
;
unsigned
int
filter_scltype
;
unsigned
int
filter_scl
;
unsigned
int
filter_marks
;
int
filter_lm
;
long
long
filter_effect
{}
;
unsigned
int
filter_type
{}
;
unsigned
int
filter_type2
{}
;
unsigned
int
filter_attrib
{}
;
unsigned
int
filter_race
{}
;
unsigned
int
filter_atktype
{}
;
int
filter_atk
{}
;
unsigned
int
filter_deftype
{}
;
int
filter_def
{}
;
unsigned
int
filter_lvtype
{}
;
unsigned
int
filter_lv
{}
;
unsigned
int
filter_scltype
{}
;
unsigned
int
filter_scl
{}
;
unsigned
int
filter_marks
{}
;
int
filter_lm
{}
;
position2di
mouse_pos
;
int
hovered_code
;
int
hovered_pos
;
int
hovered_seq
;
int
is_lastcard
;
int
click_pos
;
bool
is_draging
;
bool
is_starting_dragging
;
int
dragx
;
int
dragy
;
int
bigcard_code
;
float
bigcard_zoom
;
size_t
pre_mainc
;
size_t
pre_extrac
;
size_t
pre_sidec
;
int
hovered_code
{}
;
int
hovered_pos
{}
;
int
hovered_seq
{
-
1
}
;
int
is_lastcard
{}
;
int
click_pos
{}
;
bool
is_draging
{}
;
bool
is_starting_dragging
{}
;
int
dragx
{}
;
int
dragy
{}
;
int
bigcard_code
{}
;
float
bigcard_zoom
{}
;
size_t
pre_mainc
{}
;
size_t
pre_extrac
{}
;
size_t
pre_sidec
{}
;
code_pointer
draging_pointer
;
int
prev_category
;
int
prev_deck
;
s32
prev_operation
;
int
prev_sel
;
bool
is_modified
;
bool
readonly
;
bool
showing_pack
;
int
prev_category
{}
;
int
prev_deck
{}
;
s32
prev_operation
{}
;
int
prev_sel
{
-
1
}
;
bool
is_modified
{}
;
bool
readonly
{}
;
bool
showing_pack
{}
;
mt19937
rnd
;
const
std
::
unordered_map
<
int
,
int
>*
filterList
;
std
::
vector
<
code_pointer
>
results
;
wchar_t
result_string
[
8
];
wchar_t
result_string
[
8
]
{}
;
std
::
vector
<
std
::
wstring
>
expansionPacks
;
};
...
...
gframe/deck_manager.cpp
View file @
f45f5392
...
...
@@ -5,7 +5,7 @@
namespace
ygo
{
char
DeckManager
::
deckBuffer
[
0x10000
];
char
DeckManager
::
deckBuffer
[
0x10000
]
{}
;
DeckManager
deckManager
;
void
DeckManager
::
LoadLFListSingle
(
const
char
*
path
)
{
...
...
gframe/deck_manager.h
View file @
f45f5392
...
...
@@ -10,7 +10,7 @@
namespace
ygo
{
struct
LFList
{
unsigned
int
hash
;
unsigned
int
hash
{}
;
std
::
wstring
listName
;
std
::
unordered_map
<
int
,
int
>
content
;
};
...
...
gframe/duelclient.cpp
View file @
f45f5392
...
...
@@ -1004,8 +1004,8 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_HINT
:
{
int
type
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
BufferIO
::
ReadInt8
(
pbuf
);
int
type
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
data
=
BufferIO
::
ReadInt32
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
...
...
@@ -1139,8 +1139,8 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_WIN
:
{
mainGame
->
dInfo
.
isFinished
=
true
;
int
player
=
BufferIO
::
ReadInt8
(
pbuf
);
int
type
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
type
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
showcarddif
=
110
;
mainGame
->
showcardp
=
0
;
mainGame
->
dInfo
.
vic_string
=
0
;
...
...
@@ -1190,7 +1190,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
showcard
=
0
;
mainGame
->
gMutex
.
lock
();
mainGame
->
dField
.
Clear
();
int
playertype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
playertype
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dInfo
.
isFirst
=
(
playertype
&
0xf
)
?
false
:
true
;
if
(
playertype
&
0xf0
)
mainGame
->
dInfo
.
player_type
=
7
;
...
...
@@ -1200,7 +1200,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
else
mainGame
->
dInfo
.
tag_player
[
0
]
=
true
;
}
mainGame
->
dInfo
.
duel_rule
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dInfo
.
duel_rule
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dInfo
.
lp
[
mainGame
->
LocalPlayer
(
0
)]
=
BufferIO
::
ReadInt32
(
pbuf
);
mainGame
->
dInfo
.
lp
[
mainGame
->
LocalPlayer
(
1
)]
=
BufferIO
::
ReadInt32
(
pbuf
);
myswprintf
(
mainGame
->
dInfo
.
strLP
[
0
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
0
]);
...
...
@@ -1227,36 +1227,37 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_UPDATE_DATA
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
location
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
location
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
gMutex
.
lock
();
mainGame
->
dField
.
UpdateFieldCard
(
player
,
location
,
pbuf
);
mainGame
->
gMutex
.
unlock
();
return
true
;
}
case
MSG_UPDATE_CARD
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
loc
=
BufferIO
::
Read
Int8
(
pbuf
);
int
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
loc
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
seq
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
gMutex
.
lock
();
mainGame
->
dField
.
UpdateCard
(
player
,
loc
,
seq
,
pbuf
);
mainGame
->
gMutex
.
unlock
();
break
;
}
case
MSG_SELECT_BATTLECMD
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
int
code
,
desc
,
count
,
con
,
loc
,
seq
/*, diratt*/
;
/*int selecting_player = */
BufferIO
::
ReadUInt8
(
pbuf
);
int
desc
,
count
,
con
,
seq
/*, diratt*/
;
unsigned
int
code
,
loc
;
ClientCard
*
pcard
;
mainGame
->
dField
.
activatable_cards
.
clear
();
mainGame
->
dField
.
activatable_descs
.
clear
();
mainGame
->
dField
.
conti_cards
.
clear
();
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
BufferIO
::
ReadInt32
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
loc
=
BufferIO
::
Read
Int8
(
pbuf
);
seq
=
BufferIO
::
Read
Int8
(
pbuf
);
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
loc
=
BufferIO
::
ReadU
Int8
(
pbuf
);
seq
=
BufferIO
::
ReadU
Int8
(
pbuf
);
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
int
flag
=
0
;
if
(
code
&
0x80000000
)
{
...
...
@@ -1282,24 +1283,24 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
}
mainGame
->
dField
.
attackable_cards
.
clear
();
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
/*code = */
BufferIO
::
ReadInt32
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
loc
=
BufferIO
::
ReadInt8
(
pbuf
);
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
/*diratt = */
BufferIO
::
ReadInt8
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
loc
=
BufferIO
::
Read
U
Int8
(
pbuf
);
seq
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*diratt = */
BufferIO
::
Read
U
Int8
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
mainGame
->
dField
.
attackable_cards
.
push_back
(
pcard
);
pcard
->
cmdFlag
|=
COMMAND_ATTACK
;
}
mainGame
->
gMutex
.
lock
();
if
(
BufferIO
::
ReadInt8
(
pbuf
))
{
if
(
BufferIO
::
Read
U
Int8
(
pbuf
))
{
mainGame
->
btnM2
->
setVisible
(
true
);
mainGame
->
btnM2
->
setEnabled
(
true
);
mainGame
->
btnM2
->
setPressed
(
false
);
}
if
(
BufferIO
::
ReadInt8
(
pbuf
))
{
if
(
BufferIO
::
Read
U
Int8
(
pbuf
))
{
mainGame
->
btnEP
->
setVisible
(
true
);
mainGame
->
btnEP
->
setEnabled
(
true
);
mainGame
->
btnEP
->
setPressed
(
false
);
...
...
@@ -1308,27 +1309,28 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_IDLECMD
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
int
code
,
desc
,
count
,
con
,
loc
,
seq
;
/*int selecting_player = */
BufferIO
::
ReadUInt8
(
pbuf
);
int
desc
,
count
,
con
,
seq
;
unsigned
int
code
,
loc
;
ClientCard
*
pcard
;
mainGame
->
dField
.
summonable_cards
.
clear
();
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
BufferIO
::
ReadInt32
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
loc
=
BufferIO
::
ReadInt8
(
pbuf
);
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
loc
=
BufferIO
::
Read
U
Int8
(
pbuf
);
seq
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
mainGame
->
dField
.
summonable_cards
.
push_back
(
pcard
);
pcard
->
cmdFlag
|=
COMMAND_SUMMON
;
}
mainGame
->
dField
.
spsummonable_cards
.
clear
();
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
BufferIO
::
ReadInt32
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
loc
=
BufferIO
::
ReadInt8
(
pbuf
);
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
loc
=
BufferIO
::
Read
U
Int8
(
pbuf
);
seq
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
mainGame
->
dField
.
spsummonable_cards
.
push_back
(
pcard
);
pcard
->
cmdFlag
|=
COMMAND_SPSUMMON
;
...
...
@@ -1348,34 +1350,34 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
}
mainGame
->
dField
.
reposable_cards
.
clear
();
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
BufferIO
::
ReadInt32
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
loc
=
BufferIO
::
ReadInt8
(
pbuf
);
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
loc
=
BufferIO
::
Read
U
Int8
(
pbuf
);
seq
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
mainGame
->
dField
.
reposable_cards
.
push_back
(
pcard
);
pcard
->
cmdFlag
|=
COMMAND_REPOS
;
}
mainGame
->
dField
.
msetable_cards
.
clear
();
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
BufferIO
::
ReadInt32
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
loc
=
BufferIO
::
ReadInt8
(
pbuf
);
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
loc
=
BufferIO
::
Read
U
Int8
(
pbuf
);
seq
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
mainGame
->
dField
.
msetable_cards
.
push_back
(
pcard
);
pcard
->
cmdFlag
|=
COMMAND_MSET
;
}
mainGame
->
dField
.
ssetable_cards
.
clear
();
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
BufferIO
::
ReadInt32
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
loc
=
BufferIO
::
ReadInt8
(
pbuf
);
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
loc
=
BufferIO
::
Read
U
Int8
(
pbuf
);
seq
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
mainGame
->
dField
.
ssetable_cards
.
push_back
(
pcard
);
pcard
->
cmdFlag
|=
COMMAND_SSET
;
...
...
@@ -1383,12 +1385,12 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
dField
.
activatable_cards
.
clear
();
mainGame
->
dField
.
activatable_descs
.
clear
();
mainGame
->
dField
.
conti_cards
.
clear
();
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
BufferIO
::
ReadInt32
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
loc
=
BufferIO
::
ReadInt8
(
pbuf
);
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
loc
=
BufferIO
::
Read
U
Int8
(
pbuf
);
seq
=
BufferIO
::
Read
U
Int8
(
pbuf
);
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
int
flag
=
0
;
...
...
@@ -1414,17 +1416,17 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
}
}
if
(
BufferIO
::
ReadInt8
(
pbuf
))
{
if
(
BufferIO
::
Read
U
Int8
(
pbuf
))
{
mainGame
->
btnBP
->
setVisible
(
true
);
mainGame
->
btnBP
->
setEnabled
(
true
);
mainGame
->
btnBP
->
setPressed
(
false
);
}
if
(
BufferIO
::
ReadInt8
(
pbuf
))
{
if
(
BufferIO
::
Read
U
Int8
(
pbuf
))
{
mainGame
->
btnEP
->
setVisible
(
true
);
mainGame
->
btnEP
->
setEnabled
(
true
);
mainGame
->
btnEP
->
setPressed
(
false
);
}
if
(
BufferIO
::
ReadInt8
(
pbuf
))
{
if
(
BufferIO
::
Read
U
Int8
(
pbuf
))
{
mainGame
->
btnShuffle
->
setVisible
(
true
);
}
else
{
mainGame
->
btnShuffle
->
setVisible
(
false
);
...
...
@@ -1432,15 +1434,15 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_EFFECTYN
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
unsigned
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
pcard
->
code
!=
code
)
pcard
->
SetCode
(
code
);
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
l
!=
LOCATION_DECK
)
{
pcard
->
is_highlighting
=
true
;
mainGame
->
dField
.
highlighting_card
=
pcard
;
...
...
@@ -1466,7 +1468,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_YESNO
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
mainGame
->
dField
.
highlighting_card
=
0
;
mainGame
->
gMutex
.
lock
();
...
...
@@ -1476,8 +1478,8 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_OPTION
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
select_options
.
clear
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
mainGame
->
dField
.
select_options
.
push_back
(
BufferIO
::
ReadInt32
(
pbuf
));
...
...
@@ -1486,14 +1488,15 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_CARD
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_cancelable
=
BufferIO
::
ReadInt8
(
pbuf
)
!=
0
;
mainGame
->
dField
.
select_min
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_max
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
select_cancelable
=
BufferIO
::
Read
U
Int8
(
pbuf
)
!=
0
;
mainGame
->
dField
.
select_min
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
select_max
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
selectable_cards
.
clear
();
mainGame
->
dField
.
selected_cards
.
clear
();
int
c
,
l
,
s
,
ss
;
int
c
,
s
,
ss
;
unsigned
int
l
;
unsigned
int
code
;
bool
panelmode
=
false
;
size_t
hand_count
[
2
]
=
{
mainGame
->
dField
.
hand
[
0
].
size
(),
mainGame
->
dField
.
hand
[
1
].
size
()
};
...
...
@@ -1502,11 +1505,11 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
dField
.
select_ready
=
select_ready
;
ClientCard
*
pcard
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
ss
=
BufferIO
::
ReadInt8
(
pbuf
);
code
=
BufferIO
::
ReadInt32
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
l
=
BufferIO
::
Read
U
Int8
(
pbuf
);
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
ss
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
((
l
&
LOCATION_OVERLAY
)
>
0
)
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
&
0x7f
,
s
)
->
overlayed
[
ss
];
else
...
...
@@ -1549,16 +1552,17 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_UNSELECT_CARD
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
bool
finishable
=
BufferIO
::
ReadInt8
(
pbuf
)
!=
0
;
bool
cancelable
=
BufferIO
::
ReadInt8
(
pbuf
)
!=
0
;
/*int selecting_player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
bool
finishable
=
BufferIO
::
Read
U
Int8
(
pbuf
)
!=
0
;
bool
cancelable
=
BufferIO
::
Read
U
Int8
(
pbuf
)
!=
0
;
mainGame
->
dField
.
select_cancelable
=
finishable
||
cancelable
;
mainGame
->
dField
.
select_min
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_max
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count1
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_min
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
select_max
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count1
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
selectable_cards
.
clear
();
mainGame
->
dField
.
selected_cards
.
clear
();
int
c
,
l
,
s
,
ss
;
int
c
,
s
,
ss
;
unsigned
int
l
;
unsigned
int
code
;
bool
panelmode
=
false
;
size_t
hand_count
[
2
]
=
{
mainGame
->
dField
.
hand
[
0
].
size
(),
mainGame
->
dField
.
hand
[
1
].
size
()
};
...
...
@@ -1567,10 +1571,10 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
ClientCard
*
pcard
;
for
(
int
i
=
0
;
i
<
count1
;
++
i
)
{
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
ss
=
BufferIO
::
ReadInt8
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
l
=
BufferIO
::
Read
U
Int8
(
pbuf
);
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
ss
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
((
l
&
LOCATION_OVERLAY
)
>
0
)
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
&
0x7f
,
s
)
->
overlayed
[
ss
];
else
...
...
@@ -1588,13 +1592,13 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
panelmode
=
true
;
}
}
int
count2
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count2
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
count1
;
i
<
count1
+
count2
;
++
i
)
{
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
ss
=
BufferIO
::
ReadInt8
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
l
=
BufferIO
::
Read
U
Int8
(
pbuf
);
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
ss
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
((
l
&
LOCATION_OVERLAY
)
>
0
)
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
&
0x7f
,
s
)
->
overlayed
[
ss
];
else
...
...
@@ -1643,13 +1647,14 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_CHAIN
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
specount
=
BufferIO
::
ReadInt8
(
pbuf
);
int
forced
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
specount
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
forced
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int hint0 = */
BufferIO
::
ReadInt32
(
pbuf
);
/*int hint1 = */
BufferIO
::
ReadInt32
(
pbuf
);
int
code
,
c
,
l
,
s
,
ss
,
desc
;
int
c
,
s
,
ss
,
desc
;
unsigned
int
code
,
l
;
ClientCard
*
pcard
;
bool
panelmode
=
false
;
bool
conti_exist
=
false
;
...
...
@@ -1659,12 +1664,12 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
dField
.
activatable_descs
.
clear
();
mainGame
->
dField
.
conti_cards
.
clear
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
flag
=
BufferIO
::
ReadInt8
(
pbuf
);
int
flag
=
BufferIO
::
Read
U
Int8
(
pbuf
);
code
=
BufferIO
::
ReadInt32
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
ss
=
BufferIO
::
ReadInt8
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
l
=
BufferIO
::
Read
U
Int8
(
pbuf
);
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
ss
=
BufferIO
::
Read
U
Int8
(
pbuf
);
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
,
ss
);
mainGame
->
dField
.
activatable_cards
.
push_back
(
pcard
);
...
...
@@ -1739,8 +1744,8 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_SELECT_PLACE
:
case
MSG_SELECT_DISFIELD
:
{
int
selecting_player
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
selecting_player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
select_min
=
count
>
0
?
count
:
1
;
mainGame
->
dField
.
select_ready
=
false
;
mainGame
->
dField
.
select_cancelable
=
count
==
0
;
...
...
@@ -1824,9 +1829,9 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_POSITION
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
positions
=
BufferIO
::
Read
Int8
(
pbuf
);
unsigned
int
positions
=
BufferIO
::
ReadU
Int8
(
pbuf
);
if
(
positions
==
0x1
||
positions
==
0x2
||
positions
==
0x4
||
positions
==
0x8
)
{
SetResponseI
(
positions
);
return
true
;
...
...
@@ -1867,26 +1872,26 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_TRIBUTE
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_cancelable
=
BufferIO
::
ReadInt8
(
pbuf
)
!=
0
;
mainGame
->
dField
.
select_min
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_max
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
select_cancelable
=
BufferIO
::
Read
U
Int8
(
pbuf
)
!=
0
;
mainGame
->
dField
.
select_min
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
select_max
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
selectable_cards
.
clear
();
mainGame
->
dField
.
selected_cards
.
clear
();
mainGame
->
dField
.
selectsum_all
.
clear
();
mainGame
->
dField
.
selectsum_cards
.
clear
();
mainGame
->
dField
.
select_panalmode
=
false
;
int
c
,
l
,
s
,
t
;
unsigned
int
code
;
int
c
,
s
,
t
;
unsigned
int
code
,
l
;
ClientCard
*
pcard
;
mainGame
->
dField
.
select_ready
=
false
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
t
=
BufferIO
::
ReadInt8
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
l
=
BufferIO
::
Read
U
Int8
(
pbuf
);
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
t
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
code
&&
pcard
->
code
!=
code
)
pcard
->
SetCode
(
code
);
...
...
@@ -1912,18 +1917,19 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_COUNTER
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
select_counter_type
=
BufferIO
::
ReadInt16
(
pbuf
);
mainGame
->
dField
.
select_counter_count
=
BufferIO
::
ReadInt16
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
selectable_cards
.
clear
();
int
c
,
l
,
s
,
t
/*, code*/
;
int
c
,
s
,
t
/*, code*/
;
unsigned
int
l
;
ClientCard
*
pcard
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
/*code = */
BufferIO
::
ReadInt32
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
l
=
BufferIO
::
Read
U
Int8
(
pbuf
);
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
t
=
BufferIO
::
ReadInt16
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
mainGame
->
dField
.
selectable_cards
.
push_back
(
pcard
);
...
...
@@ -1938,21 +1944,21 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_SUM
:
{
mainGame
->
dField
.
select_mode
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_mode
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int selecting_player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
select_sumval
=
BufferIO
::
ReadInt32
(
pbuf
);
mainGame
->
dField
.
select_min
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_max
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
must_select_count
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_min
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
select_max
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
must_select_count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
selectsum_all
.
clear
();
mainGame
->
dField
.
selected_cards
.
clear
();
mainGame
->
dField
.
selectsum_cards
.
clear
();
mainGame
->
dField
.
select_panalmode
=
false
;
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
must_select_count
;
++
i
)
{
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
code
!=
0
&&
pcard
->
code
!=
code
)
pcard
->
SetCode
(
code
);
...
...
@@ -1960,12 +1966,12 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
pcard
->
select_seq
=
0
;
mainGame
->
dField
.
selected_cards
.
push_back
(
pcard
);
}
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
code
!=
0
&&
pcard
->
code
!=
code
)
pcard
->
SetCode
(
code
);
...
...
@@ -1989,19 +1995,19 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
mainGame
->
dField
.
ShowSelectSum
(
mainGame
->
dField
.
select_panalmode
);
}
case
MSG_SORT_CARD
:
{
/*int player = */
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
selectable_cards
.
clear
();
mainGame
->
dField
.
selected_cards
.
clear
();
mainGame
->
dField
.
sort_list
.
clear
();
int
c
,
l
,
s
;
unsigned
int
code
;
int
c
,
s
;
unsigned
int
code
,
l
;
ClientCard
*
pcard
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
l
=
BufferIO
::
Read
U
Int8
(
pbuf
);
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
code
!=
0
&&
pcard
->
code
!=
code
)
pcard
->
SetCode
(
code
);
...
...
@@ -2015,9 +2021,9 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_CONFIRM_DECKTOP
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
code
;
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
unsigned
int
code
;
ClientCard
*
pcard
;
mainGame
->
dField
.
selectable_cards
.
clear
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
...
...
@@ -2053,9 +2059,9 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_CONFIRM_EXTRATOP
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
code
;
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
unsigned
int
code
;
ClientCard
*
pcard
;
mainGame
->
dField
.
selectable_cards
.
clear
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
...
...
@@ -2090,9 +2096,10 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_CONFIRM_CARDS
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
code
,
c
,
l
,
s
;
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadUInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadUInt8
(
pbuf
);
int
c
,
s
;
unsigned
int
code
,
l
;
std
::
vector
<
ClientCard
*>
field_confirm
;
std
::
vector
<
ClientCard
*>
panel_confirm
;
ClientCard
*
pcard
;
...
...
@@ -2105,9 +2112,9 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
AddLog
(
textBuffer
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
BufferIO
::
ReadInt32
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
l
=
BufferIO
::
Read
U
Int8
(
pbuf
);
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
code
!=
0
)
pcard
->
SetCode
(
code
);
...
...
@@ -2190,7 +2197,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_SHUFFLE_DECK
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
if
(
mainGame
->
dField
.
deck
[
player
].
size
()
<
2
)
return
true
;
bool
rev
=
mainGame
->
dField
.
deck_reversed
;
...
...
@@ -2229,8 +2236,8 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_SHUFFLE_HAND
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
if
(
count
>
1
)
soundManager
.
PlaySoundEffect
(
SOUND_SHUFFLE
);
...
...
@@ -2272,8 +2279,8 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_SHUFFLE_EXTRA
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
((
mainGame
->
dField
.
extra
[
player
].
size
()
-
mainGame
->
dField
.
extra_p_count
[
player
])
<
2
)
return
true
;
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
...
...
@@ -2301,11 +2308,11 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_REFRESH_DECK
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
return
true
;
}
case
MSG_SWAP_GRAVE_DECK
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dField
.
grave
[
player
].
swap
(
mainGame
->
dField
.
deck
[
player
]);
for
(
auto
cit
=
mainGame
->
dField
.
grave
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
grave
[
player
].
end
();
++
cit
)
...
...
@@ -2359,9 +2366,9 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_DECK_TOP
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
seq
=
BufferIO
::
Read
U
Int8
(
pbuf
);
unsigned
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
player
,
LOCATION_DECK
,
mainGame
->
dField
.
deck
[
player
].
size
()
-
1
-
seq
);
pcard
->
SetCode
(
code
&
0x7fffffff
);
bool
rev
=
(
code
&
0x80000000
)
!=
0
;
...
...
@@ -2373,20 +2380,21 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_SHUFFLE_SET_CARD
:
{
std
::
vector
<
ClientCard
*>*
lst
=
0
;
int
loc
=
BufferIO
::
Read
Int8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
unsigned
int
loc
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
loc
==
LOCATION_MZONE
)
lst
=
mainGame
->
dField
.
mzone
;
else
lst
=
mainGame
->
dField
.
szone
;
ClientCard
*
mc
[
5
];
ClientCard
*
mc
[
5
]
{
nullptr
}
;
ClientCard
*
swp
;
int
c
,
l
,
s
,
ps
;
int
c
,
s
,
ps
;
unsigned
int
l
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
l
=
BufferIO
::
Read
U
Int8
(
pbuf
);
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
mc
[
i
]
=
lst
[
c
][
s
];
mc
[
i
]
->
SetCode
(
0
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
...
...
@@ -2399,10 +2407,10 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
mainGame
->
WaitFrameSignal
(
20
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
l
=
BufferIO
::
Read
U
Int8
(
pbuf
);
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
ps
=
mc
[
i
]
->
sequence
;
if
(
l
>
0
)
{
swp
=
lst
[
c
][
s
];
...
...
@@ -2424,7 +2432,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_NEW_TURN
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
mainGame
->
dInfo
.
turn
++
;
if
(
!
mainGame
->
dInfo
.
isTag
&&
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
player_type
<
7
)
{
mainGame
->
btnLeaveGame
->
setText
(
dataManager
.
GetSysString
(
1351
));
...
...
@@ -2507,15 +2515,15 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_MOVE
:
{
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
pc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
pl
=
BufferIO
::
ReadUInt8
(
pbuf
);
int
ps
=
BufferIO
::
ReadInt8
(
pbuf
);
int
pp
=
BufferIO
::
Read
Int8
(
pbuf
);
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
cl
=
BufferIO
::
ReadUInt8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cp
=
BufferIO
::
Read
Int8
(
pbuf
);
unsigned
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
int
pc
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
pl
=
BufferIO
::
ReadUInt8
(
pbuf
);
int
ps
=
BufferIO
::
Read
U
Int8
(
pbuf
);
unsigned
int
pp
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
cl
=
BufferIO
::
ReadUInt8
(
pbuf
);
int
cs
=
BufferIO
::
Read
U
Int8
(
pbuf
);
unsigned
int
cp
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
reason
=
BufferIO
::
ReadInt32
(
pbuf
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
if
(
cl
&
LOCATION_REMOVED
&&
pl
!=
cl
)
...
...
@@ -2641,7 +2649,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
dField
.
overlay_cards
.
insert
(
pcard
);
pcard
->
overlayTarget
=
olcard
;
pcard
->
location
=
LOCATION_OVERLAY
;
pcard
->
sequence
=
olcard
->
overlayed
.
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
olcard
->
overlayed
.
size
()
-
1
)
;
}
else
{
mainGame
->
gMutex
.
lock
();
mainGame
->
dField
.
RemoveCard
(
pc
,
pl
,
ps
);
...
...
@@ -2650,7 +2658,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
gMutex
.
unlock
();
pcard
->
overlayTarget
=
olcard
;
pcard
->
location
=
LOCATION_OVERLAY
;
pcard
->
sequence
=
olcard
->
overlayed
.
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
olcard
->
overlayed
.
size
()
-
1
)
;
if
(
olcard
->
location
==
LOCATION_MZONE
)
{
mainGame
->
gMutex
.
lock
();
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
...
...
@@ -2671,7 +2679,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
mainGame
->
dField
.
overlay_cards
.
erase
(
pcard
);
for
(
size_t
i
=
0
;
i
<
olcard
->
overlayed
.
size
();
++
i
)
olcard
->
overlayed
[
i
]
->
sequence
=
i
;
olcard
->
overlayed
[
i
]
->
sequence
=
(
unsigned
char
)
i
;
}
else
{
mainGame
->
gMutex
.
lock
();
olcard
->
overlayed
.
erase
(
olcard
->
overlayed
.
begin
()
+
pcard
->
sequence
);
...
...
@@ -2680,7 +2688,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
dField
.
AddCard
(
pcard
,
cc
,
cl
,
cs
);
mainGame
->
dField
.
overlay_cards
.
erase
(
pcard
);
for
(
size_t
i
=
0
;
i
<
olcard
->
overlayed
.
size
();
++
i
)
{
olcard
->
overlayed
[
i
]
->
sequence
=
i
;
olcard
->
overlayed
[
i
]
->
sequence
=
(
unsigned
char
)
i
;
mainGame
->
dField
.
MoveCard
(
olcard
->
overlayed
[
i
],
2
);
}
mainGame
->
gMutex
.
unlock
();
...
...
@@ -2697,21 +2705,21 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
olcard1
->
overlayed
.
erase
(
olcard1
->
overlayed
.
begin
()
+
pcard
->
sequence
);
olcard2
->
overlayed
.
push_back
(
pcard
);
pcard
->
sequence
=
olcard2
->
overlayed
.
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
olcard2
->
overlayed
.
size
()
-
1
)
;
pcard
->
location
=
LOCATION_OVERLAY
;
pcard
->
overlayTarget
=
olcard2
;
for
(
size_t
i
=
0
;
i
<
olcard1
->
overlayed
.
size
();
++
i
)
{
olcard1
->
overlayed
[
i
]
->
sequence
=
i
;
olcard1
->
overlayed
[
i
]
->
sequence
=
(
unsigned
char
)
i
;
}
}
else
{
mainGame
->
gMutex
.
lock
();
olcard1
->
overlayed
.
erase
(
olcard1
->
overlayed
.
begin
()
+
pcard
->
sequence
);
olcard2
->
overlayed
.
push_back
(
pcard
);
pcard
->
sequence
=
olcard2
->
overlayed
.
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
olcard2
->
overlayed
.
size
()
-
1
)
;
pcard
->
location
=
LOCATION_OVERLAY
;
pcard
->
overlayTarget
=
olcard2
;
for
(
size_t
i
=
0
;
i
<
olcard1
->
overlayed
.
size
();
++
i
)
{
olcard1
->
overlayed
[
i
]
->
sequence
=
i
;
olcard1
->
overlayed
[
i
]
->
sequence
=
(
unsigned
char
)
i
;
mainGame
->
dField
.
MoveCard
(
olcard1
->
overlayed
[
i
],
2
);
}
mainGame
->
dField
.
MoveCard
(
pcard
,
10
);
...
...
@@ -2723,12 +2731,12 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_POS_CHANGE
:
{
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
cl
=
BufferIO
::
Read
Int8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
pp
=
BufferIO
::
Read
Int8
(
pbuf
);
int
cp
=
BufferIO
::
Read
Int8
(
pbuf
);
unsigned
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
cl
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
cs
=
BufferIO
::
Read
U
Int8
(
pbuf
);
unsigned
int
pp
=
BufferIO
::
ReadU
Int8
(
pbuf
);
unsigned
int
cp
=
BufferIO
::
ReadU
Int8
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
cc
,
cl
,
cs
);
if
((
pp
&
POS_FACEUP
)
&&
(
cp
&
POS_FACEDOWN
))
{
pcard
->
counters
.
clear
();
...
...
@@ -2746,10 +2754,10 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_SET
:
{
/*int code = */
BufferIO
::
ReadInt32
(
pbuf
);
/*int cc = mainGame->LocalPlayer*/
(
BufferIO
::
ReadInt8
(
pbuf
));
/*int cl = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int cs = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int cp = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int cc = mainGame->LocalPlayer*/
(
BufferIO
::
Read
U
Int8
(
pbuf
));
/*int cl = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int cs = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int cp = */
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
soundManager
.
PlaySoundEffect
(
SOUND_SET
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1601
));
...
...
@@ -2757,15 +2765,15 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_SWAP
:
{
/*int code1 = */
BufferIO
::
ReadInt32
(
pbuf
);
int
c1
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l1
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s1
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int p1 = */
BufferIO
::
ReadInt8
(
pbuf
);
int
c1
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l1
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s1
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int p1 = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int code2 = */
BufferIO
::
ReadInt32
(
pbuf
);
int
c2
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l2
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s2
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int p2 = */
BufferIO
::
ReadInt8
(
pbuf
);
int
c2
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l2
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s2
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int p2 = */
BufferIO
::
Read
U
Int8
(
pbuf
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1602
));
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
...
...
@@ -2799,11 +2807,11 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_SUMMONING
:
{
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
/*int cc = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
/*int cl = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int cs = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int cp = */
BufferIO
::
ReadInt8
(
pbuf
);
unsigned
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
/*int cc = */
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
/*int cl = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int cs = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int cp = */
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
soundManager
.
PlaySoundEffect
(
SOUND_SUMMON
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1603
),
dataManager
.
GetName
(
code
));
...
...
@@ -2822,11 +2830,11 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_SPSUMMONING
:
{
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
/*int cc = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
/*int cl = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int cs = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int cp = */
BufferIO
::
ReadInt8
(
pbuf
);
unsigned
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
/*int cc = */
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
/*int cl = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int cs = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int cp = */
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
CardData
cd
;
if
(
dataManager
.
GetData
(
code
,
&
cd
)
&&
(
cd
.
type
&
TYPE_TOKEN
))
...
...
@@ -2848,11 +2856,11 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_FLIPSUMMONING
:
{
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
cl
=
BufferIO
::
Read
Int8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cp
=
BufferIO
::
Read
Int8
(
pbuf
);
unsigned
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
cl
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
cs
=
BufferIO
::
Read
U
Int8
(
pbuf
);
unsigned
int
cp
=
BufferIO
::
ReadU
Int8
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
cc
,
cl
,
cs
);
pcard
->
SetCode
(
code
);
pcard
->
position
=
cp
;
...
...
@@ -2876,16 +2884,16 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_CHAINING
:
{
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
pcc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
pcl
=
BufferIO
::
Read
Int8
(
pbuf
);
int
pcs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
subs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
cl
=
BufferIO
::
Read
Int8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
unsigned
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
int
pcc
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
pcl
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
pcs
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
subs
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
cl
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
cs
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
/*int ct = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int ct = */
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
soundManager
.
PlaySoundEffect
(
SOUND_ACTIVATE
);
...
...
@@ -2936,7 +2944,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_CHAINED
:
{
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
int
ct
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1609
),
dataManager
.
GetName
(
mainGame
->
dField
.
current_chain
.
code
));
...
...
@@ -2949,7 +2957,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_CHAIN_SOLVING
:
{
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
int
ct
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
if
(
mainGame
->
dField
.
chains
.
size
()
>
1
||
mainGame
->
gameConf
.
draw_single_chain
)
{
...
...
@@ -2966,7 +2974,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_CHAIN_SOLVED
:
{
/*int ct = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int ct = */
BufferIO
::
Read
U
Int8
(
pbuf
);
return
true
;
}
case
MSG_CHAIN_END
:
{
...
...
@@ -2980,7 +2988,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_CHAIN_NEGATED
:
case
MSG_CHAIN_DISABLED
:
{
int
ct
=
BufferIO
::
ReadInt8
(
pbuf
);
int
ct
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
showcardcode
=
mainGame
->
dField
.
chains
[
ct
-
1
].
code
;
mainGame
->
showcarddif
=
0
;
...
...
@@ -2994,8 +3002,8 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_RANDOM_SELECTED
:
{
/*int player = */
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int player = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
pbuf
+=
count
*
4
;
return
true
;
...
...
@@ -3003,10 +3011,10 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
soundManager
.
PlaySoundEffect
(
SOUND_DICE
);
ClientCard
*
pcards
[
10
];
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
int
ss
=
BufferIO
::
ReadInt8
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
ss
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
((
l
&
LOCATION_OVERLAY
)
>
0
)
pcards
[
i
]
=
mainGame
->
dField
.
GetCard
(
c
,
l
&
0x7f
,
s
)
->
overlayed
[
ss
];
else
...
...
@@ -3020,16 +3028,16 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_BECOME_TARGET
:
{
//soundManager.PlaySoundEffect(SOUND_TARGET);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
pbuf
+=
count
*
4
;
return
true
;
}
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int ss = */
BufferIO
::
ReadInt8
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int ss = */
BufferIO
::
Read
U
Int8
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
pcard
->
is_highlighting
=
true
;
mainGame
->
dField
.
current_chain
.
target
.
insert
(
pcard
);
...
...
@@ -3058,11 +3066,11 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_DRAW
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
ClientCard
*
pcard
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
unsigned
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
player
,
LOCATION_DECK
,
mainGame
->
dField
.
deck
[
player
].
size
()
-
1
-
i
);
if
(
!
mainGame
->
dField
.
deck_reversed
||
code
)
pcard
->
SetCode
(
code
&
0x7fffffff
);
...
...
@@ -3092,7 +3100,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_DAMAGE
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
val
=
BufferIO
::
ReadInt32
(
pbuf
);
int
final
=
mainGame
->
dInfo
.
lp
[
player
]
-
val
;
if
(
final
<
0
)
...
...
@@ -3123,7 +3131,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_RECOVER
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
val
=
BufferIO
::
ReadInt32
(
pbuf
);
int
final
=
mainGame
->
dInfo
.
lp
[
player
]
+
val
;
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
...
...
@@ -3152,14 +3160,14 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_EQUIP
:
{
int
c1
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l1
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s1
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
c2
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l2
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s2
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
c1
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l1
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s1
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
int
c2
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l2
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s2
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
...
...
@@ -3186,7 +3194,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_LPUPDATE
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
val
=
BufferIO
::
ReadInt32
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
mainGame
->
dInfo
.
lp
[
player
]
=
val
;
...
...
@@ -3204,10 +3212,10 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_UNEQUIP
:
{
int
c1
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l1
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s1
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
c1
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l1
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s1
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
ClientCard
*
pc
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
pc
->
equipTarget
->
equipped
.
erase
(
pc
);
...
...
@@ -3225,14 +3233,14 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_CARD_TARGET
:
{
int
c1
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l1
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s1
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
c2
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l2
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s2
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
c1
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l1
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s1
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
int
c2
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l2
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s2
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
...
...
@@ -3251,14 +3259,14 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_CANCEL_TARGET
:
{
int
c1
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l1
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s1
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
c2
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l2
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s2
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
c1
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l1
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s1
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
int
c2
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l2
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s2
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
ClientCard
*
pc1
=
mainGame
->
dField
.
GetCard
(
c1
,
l1
,
s1
);
ClientCard
*
pc2
=
mainGame
->
dField
.
GetCard
(
c2
,
l2
,
s2
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
{
...
...
@@ -3277,7 +3285,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_PAY_LPCOST
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
cost
=
BufferIO
::
ReadInt32
(
pbuf
);
int
final
=
mainGame
->
dInfo
.
lp
[
player
]
-
cost
;
if
(
final
<
0
)
...
...
@@ -3305,9 +3313,9 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_ADD_COUNTER
:
{
int
type
=
BufferIO
::
ReadInt16
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt16
(
pbuf
);
ClientCard
*
pc
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
pc
->
counters
.
count
(
type
))
...
...
@@ -3328,9 +3336,9 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_REMOVE_COUNTER
:
{
int
type
=
BufferIO
::
ReadInt16
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt16
(
pbuf
);
ClientCard
*
pc
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
pc
->
counters
[
type
]
-=
count
;
...
...
@@ -3350,15 +3358,15 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_ATTACK
:
{
int
ca
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
la
=
BufferIO
::
Read
Int8
(
pbuf
);
int
sa
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
ca
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
la
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
sa
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
attacker
=
mainGame
->
dField
.
GetCard
(
ca
,
la
,
sa
);
int
cd
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
ld
=
BufferIO
::
Read
Int8
(
pbuf
);
int
sd
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
cd
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
ld
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
sd
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
float
sy
;
...
...
@@ -3401,20 +3409,20 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_BATTLE
:
{
int
ca
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
la
=
BufferIO
::
Read
Int8
(
pbuf
);
int
sa
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
ca
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
la
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
sa
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
int
aatk
=
BufferIO
::
ReadInt32
(
pbuf
);
int
adef
=
BufferIO
::
ReadInt32
(
pbuf
);
/*int da = */
BufferIO
::
ReadInt8
(
pbuf
);
int
cd
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
ld
=
BufferIO
::
Read
Int8
(
pbuf
);
int
sd
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
/*int da = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
cd
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
ld
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
sd
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
int
datk
=
BufferIO
::
ReadInt32
(
pbuf
);
int
ddef
=
BufferIO
::
ReadInt32
(
pbuf
);
/*int dd = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int dd = */
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
mainGame
->
gMutex
.
lock
();
...
...
@@ -3453,18 +3461,18 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_MISSED_EFFECT
:
{
BufferIO
::
ReadInt32
(
pbuf
);
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
unsigned
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
1622
),
dataManager
.
GetName
(
code
));
mainGame
->
AddLog
(
textBuffer
,
code
);
return
true
;
}
case
MSG_TOSS_COIN
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
wchar_t
*
pwbuf
=
textBuffer
;
BufferIO
::
CopyWStrRef
(
dataManager
.
GetSysString
(
1623
),
pwbuf
,
256
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
res
=
BufferIO
::
ReadInt8
(
pbuf
);
int
res
=
BufferIO
::
Read
U
Int8
(
pbuf
);
*
pwbuf
++
=
L'['
;
BufferIO
::
CopyWStrRef
(
dataManager
.
GetSysString
(
res
?
60
:
61
),
pwbuf
,
256
);
*
pwbuf
++
=
L']'
;
...
...
@@ -3482,12 +3490,12 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_TOSS_DICE
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
wchar_t
*
pwbuf
=
textBuffer
;
BufferIO
::
CopyWStrRef
(
dataManager
.
GetSysString
(
1624
),
pwbuf
,
256
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
res
=
BufferIO
::
ReadInt8
(
pbuf
);
int
res
=
BufferIO
::
Read
U
Int8
(
pbuf
);
*
pwbuf
++
=
L'['
;
*
pwbuf
++
=
L'0'
+
res
;
*
pwbuf
++
=
L']'
;
...
...
@@ -3505,7 +3513,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_ROCK_PAPER_SCISSORS
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
mainGame
->
gMutex
.
lock
();
...
...
@@ -3514,7 +3522,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_HAND_RES
:
{
int
res
=
BufferIO
::
ReadInt8
(
pbuf
);
int
res
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplaySkiping
)
return
true
;
mainGame
->
stHintMsg
->
setVisible
(
false
);
...
...
@@ -3531,8 +3539,8 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_ANNOUNCE_RACE
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
mainGame
->
dField
.
announce_count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
mainGame
->
dField
.
announce_count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
available
=
BufferIO
::
ReadInt32
(
pbuf
);
for
(
int
i
=
0
,
filter
=
0x1
;
i
<
RACES_COUNT
;
++
i
,
filter
<<=
1
)
{
mainGame
->
chkRace
[
i
]
->
setChecked
(
false
);
...
...
@@ -3551,8 +3559,8 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_ANNOUNCE_ATTRIB
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
mainGame
->
dField
.
announce_count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
mainGame
->
dField
.
announce_count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
available
=
BufferIO
::
ReadInt32
(
pbuf
);
for
(
int
i
=
0
,
filter
=
0x1
;
i
<
7
;
++
i
,
filter
<<=
1
)
{
mainGame
->
chkAttribute
[
i
]
->
setChecked
(
false
);
...
...
@@ -3571,7 +3579,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_ANNOUNCE_CARD
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
count
=
BufferIO
::
ReadUInt8
(
pbuf
);
mainGame
->
dField
.
declare_opcodes
.
clear
();
for
(
int
i
=
0
;
i
<
count
;
++
i
)
...
...
@@ -3589,7 +3597,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_ANNOUNCE_NUMBER
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
count
=
BufferIO
::
ReadUInt8
(
pbuf
);
mainGame
->
gMutex
.
lock
();
mainGame
->
cbANNumber
->
clear
();
...
...
@@ -3641,11 +3649,11 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_CARD_HINT
:
{
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l
=
BufferIO
::
Read
Int8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
BufferIO
::
ReadInt8
(
pbuf
);
int
chtype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
s
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
Read
U
Int8
(
pbuf
);
int
chtype
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
value
=
BufferIO
::
ReadInt32
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
!
pcard
)
...
...
@@ -3678,8 +3686,8 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_PLAYER_HINT
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
chtype
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
chtype
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
value
=
BufferIO
::
ReadInt32
(
pbuf
);
auto
&
player_desc_hints
=
mainGame
->
dField
.
player_desc_hints
[
player
];
if
(
value
==
CARD_QUESTION
&&
player
==
0
)
{
...
...
@@ -3703,11 +3711,11 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_TAG_SWAP
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
size_t
mcount
=
(
size_t
)
BufferIO
::
ReadInt8
(
pbuf
);
size_t
ecount
=
(
size_t
)
BufferIO
::
ReadInt8
(
pbuf
);
size_t
pcount
=
(
size_t
)
BufferIO
::
ReadInt8
(
pbuf
);
size_t
hcount
=
(
size_t
)
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
size_t
mcount
=
(
size_t
)
BufferIO
::
Read
U
Int8
(
pbuf
);
size_t
ecount
=
(
size_t
)
BufferIO
::
Read
U
Int8
(
pbuf
);
size_t
pcount
=
(
size_t
)
BufferIO
::
Read
U
Int8
(
pbuf
);
size_t
hcount
=
(
size_t
)
BufferIO
::
Read
U
Int8
(
pbuf
);
int
topcode
=
BufferIO
::
ReadInt32
(
pbuf
);
if
(
!
mainGame
->
dInfo
.
isReplay
||
!
mainGame
->
dInfo
.
isReplaySkiping
)
{
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
...
...
@@ -3747,7 +3755,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
ClientCard
*
ccard
=
new
ClientCard
;
ccard
->
controler
=
player
;
ccard
->
location
=
LOCATION_DECK
;
ccard
->
sequence
=
mainGame
->
dField
.
deck
[
player
].
size
();
ccard
->
sequence
=
(
unsigned
char
)
mainGame
->
dField
.
deck
[
player
].
size
();
mainGame
->
dField
.
deck
[
player
].
push_back
(
ccard
);
}
}
...
...
@@ -3762,7 +3770,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
ClientCard
*
ccard
=
new
ClientCard
;
ccard
->
controler
=
player
;
ccard
->
location
=
LOCATION_HAND
;
ccard
->
sequence
=
mainGame
->
dField
.
hand
[
player
].
size
();
ccard
->
sequence
=
(
unsigned
char
)
mainGame
->
dField
.
hand
[
player
].
size
();
mainGame
->
dField
.
hand
[
player
].
push_back
(
ccard
);
}
}
...
...
@@ -3777,7 +3785,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
ClientCard
*
ccard
=
new
ClientCard
;
ccard
->
controler
=
player
;
ccard
->
location
=
LOCATION_EXTRA
;
ccard
->
sequence
=
mainGame
->
dField
.
extra
[
player
].
size
();
ccard
->
sequence
=
(
unsigned
char
)
mainGame
->
dField
.
extra
[
player
].
size
();
mainGame
->
dField
.
extra
[
player
].
push_back
(
ccard
);
}
}
...
...
@@ -3818,19 +3826,19 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
case
MSG_RELOAD_FIELD
:
{
mainGame
->
gMutex
.
lock
();
mainGame
->
dField
.
Clear
();
mainGame
->
dInfo
.
duel_rule
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dInfo
.
duel_rule
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
val
=
0
;
for
(
int
i
=
0
;
i
<
2
;
++
i
)
{
int
p
=
mainGame
->
LocalPlayer
(
i
);
mainGame
->
dInfo
.
lp
[
p
]
=
BufferIO
::
ReadInt32
(
pbuf
);
myswprintf
(
mainGame
->
dInfo
.
strLP
[
p
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
p
]);
for
(
int
seq
=
0
;
seq
<
7
;
++
seq
)
{
val
=
BufferIO
::
ReadInt8
(
pbuf
);
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
val
)
{
ClientCard
*
ccard
=
new
ClientCard
;
mainGame
->
dField
.
AddCard
(
ccard
,
p
,
LOCATION_MZONE
,
seq
);
ccard
->
position
=
BufferIO
::
ReadInt8
(
pbuf
);
val
=
BufferIO
::
ReadInt8
(
pbuf
);
ccard
->
position
=
BufferIO
::
Read
U
Int8
(
pbuf
);
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
val
)
{
for
(
int
xyz
=
0
;
xyz
<
val
;
++
xyz
)
{
ClientCard
*
xcard
=
new
ClientCard
;
...
...
@@ -3838,7 +3846,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
dField
.
overlay_cards
.
insert
(
xcard
);
xcard
->
overlayTarget
=
ccard
;
xcard
->
location
=
LOCATION_OVERLAY
;
xcard
->
sequence
=
ccard
->
overlayed
.
size
()
-
1
;
xcard
->
sequence
=
(
unsigned
char
)(
ccard
->
overlayed
.
size
()
-
1
)
;
xcard
->
owner
=
p
;
xcard
->
controler
=
p
;
}
...
...
@@ -3846,52 +3854,52 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
}
for
(
int
seq
=
0
;
seq
<
8
;
++
seq
)
{
val
=
BufferIO
::
ReadInt8
(
pbuf
);
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
val
)
{
ClientCard
*
ccard
=
new
ClientCard
;
mainGame
->
dField
.
AddCard
(
ccard
,
p
,
LOCATION_SZONE
,
seq
);
ccard
->
position
=
BufferIO
::
ReadInt8
(
pbuf
);
ccard
->
position
=
BufferIO
::
Read
U
Int8
(
pbuf
);
}
}
val
=
BufferIO
::
ReadInt8
(
pbuf
);
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
seq
=
0
;
seq
<
val
;
++
seq
)
{
ClientCard
*
ccard
=
new
ClientCard
;
mainGame
->
dField
.
AddCard
(
ccard
,
p
,
LOCATION_DECK
,
seq
);
}
val
=
BufferIO
::
ReadInt8
(
pbuf
);
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
seq
=
0
;
seq
<
val
;
++
seq
)
{
ClientCard
*
ccard
=
new
ClientCard
;
mainGame
->
dField
.
AddCard
(
ccard
,
p
,
LOCATION_HAND
,
seq
);
}
val
=
BufferIO
::
ReadInt8
(
pbuf
);
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
seq
=
0
;
seq
<
val
;
++
seq
)
{
ClientCard
*
ccard
=
new
ClientCard
;
mainGame
->
dField
.
AddCard
(
ccard
,
p
,
LOCATION_GRAVE
,
seq
);
}
val
=
BufferIO
::
ReadInt8
(
pbuf
);
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
seq
=
0
;
seq
<
val
;
++
seq
)
{
ClientCard
*
ccard
=
new
ClientCard
;
mainGame
->
dField
.
AddCard
(
ccard
,
p
,
LOCATION_REMOVED
,
seq
);
}
val
=
BufferIO
::
ReadInt8
(
pbuf
);
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
seq
=
0
;
seq
<
val
;
++
seq
)
{
ClientCard
*
ccard
=
new
ClientCard
;
mainGame
->
dField
.
AddCard
(
ccard
,
p
,
LOCATION_EXTRA
,
seq
);
}
val
=
BufferIO
::
ReadInt8
(
pbuf
);
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
dField
.
extra_p_count
[
p
]
=
val
;
}
mainGame
->
dField
.
RefreshAllCards
();
val
=
BufferIO
::
ReadInt8
(
pbuf
);
//chains
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
//chains
for
(
int
i
=
0
;
i
<
val
;
++
i
)
{
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
pcc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
pcl
=
BufferIO
::
Read
Int8
(
pbuf
);
int
pcs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
subs
=
BufferIO
::
ReadInt8
(
pbuf
);
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
cl
=
BufferIO
::
Read
Int8
(
pbuf
);
int
cs
=
BufferIO
::
ReadInt8
(
pbuf
);
unsigned
int
code
=
BufferIO
::
ReadInt32
(
pbuf
);
int
pcc
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
pcl
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
pcs
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
subs
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
cc
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
cl
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
cs
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
pcc
,
pcl
,
pcs
,
subs
);
mainGame
->
dField
.
current_chain
.
chain_card
=
pcard
;
...
...
gframe/game.cpp
View file @
f45f5392
...
...
@@ -1067,7 +1067,7 @@ void Game::MainLoop() {
SingleMode
::
StopPlay
(
true
);
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
500
));
SaveConfig
();
//
device->drop();
device
->
drop
();
}
void
Game
::
BuildProjectionMatrix
(
irr
::
core
::
matrix4
&
mProjection
,
f32
left
,
f32
right
,
f32
bottom
,
f32
top
,
f32
znear
,
f32
zfar
)
{
for
(
int
i
=
0
;
i
<
16
;
++
i
)
...
...
@@ -1775,8 +1775,9 @@ void Game::CloseDuelWindow() {
ClearTextures
();
closeDoneSignal
.
Set
();
}
int
Game
::
LocalPlayer
(
int
player
)
{
return
dInfo
.
isFirst
?
player
:
1
-
player
;
int
Game
::
LocalPlayer
(
int
player
)
const
{
int
pid
=
player
?
1
:
0
;
return
dInfo
.
isFirst
?
pid
:
1
-
pid
;
}
const
wchar_t
*
Game
::
LocalName
(
int
local_player
)
{
return
local_player
==
0
?
dInfo
.
hostname
:
dInfo
.
clientname
;
...
...
gframe/game.h
View file @
f45f5392
...
...
@@ -167,7 +167,7 @@ public:
void
CloseGameWindow
();
void
CloseDuelWindow
();
int
LocalPlayer
(
int
player
);
int
LocalPlayer
(
int
player
)
const
;
const
wchar_t
*
LocalName
(
int
local_player
);
bool
HasFocus
(
EGUI_ELEMENT_TYPE
type
)
const
{
...
...
gframe/replay_mode.cpp
View file @
f45f5392
...
...
@@ -352,141 +352,141 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_BATTLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
+
2
;
ReplayRefresh
();
return
ReadReplayResponse
();
}
case
MSG_SELECT_IDLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
+
3
;
ReplayRefresh
();
return
ReadReplayResponse
();
}
case
MSG_SELECT_EFFECTYN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
12
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_YESNO
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_OPTION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_CARD
:
case
MSG_SELECT_TRIBUTE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
3
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_UNSELECT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_CHAIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
10
+
count
*
13
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_PLACE
:
case
MSG_SELECT_DISFIELD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_POSITION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_COUNTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
9
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_SUM
:
{
pbuf
++
;
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
6
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
return
ReadReplayResponse
();
}
case
MSG_SORT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
return
ReadReplayResponse
();
}
case
MSG_CONFIRM_DECKTOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_CONFIRM_EXTRATOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_CONFIRM_CARDS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_SHUFFLE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
ReplayRefreshDeck
(
player
);
break
;
}
case
MSG_SHUFFLE_HAND
:
{
/*int oplayer = */
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int oplayer = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_SHUFFLE_EXTRA
:
{
/*int oplayer = */
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int oplayer = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
...
...
@@ -497,7 +497,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SWAP_GRAVE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
ReplayRefreshGrave
(
player
);
break
;
...
...
@@ -515,7 +515,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_SHUFFLE_SET_CARD
:
{
pbuf
++
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
...
...
@@ -529,7 +529,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
gMutex
.
unlock
();
}
}
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
...
...
@@ -653,22 +653,22 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_CARD_SELECTED
:
case
MSG_RANDOM_SELECTED
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
pauseable
=
false
;
break
;
}
case
MSG_BECOME_TARGET
:
{
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_DRAW
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
...
...
@@ -761,21 +761,21 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_TOSS_COIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_TOSS_DICE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_ROCK_PAPER_SCISSORS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
return
ReadReplayResponse
();
}
case
MSG_HAND_RES
:
{
...
...
@@ -784,18 +784,18 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_ANNOUNCE_RACE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
return
ReadReplayResponse
();
}
case
MSG_ANNOUNCE_ATTRIB
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
return
ReadReplayResponse
();
}
case
MSG_ANNOUNCE_CARD
:
case
MSG_ANNOUNCE_NUMBER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadUInt8
(
pbuf
);
pbuf
+=
4
*
count
;
return
ReadReplayResponse
();
...
...
@@ -827,12 +827,12 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
pbuf
+=
4
;
for
(
int
seq
=
0
;
seq
<
7
;
++
seq
)
{
int
val
=
BufferIO
::
ReadInt8
(
pbuf
);
int
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
val
)
pbuf
+=
2
;
}
for
(
int
seq
=
0
;
seq
<
8
;
++
seq
)
{
int
val
=
BufferIO
::
ReadInt8
(
pbuf
);
int
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
val
)
pbuf
++
;
}
...
...
gframe/single_duel.cpp
View file @
f45f5392
...
...
@@ -87,7 +87,7 @@ void SingleDuel::JoinGame(DuelPlayer* dp, void* pdata, bool is_creater) {
dp
->
type
=
NETPLAYER_TYPE_OBSERVER
;
sctc
.
type
|=
NETPLAYER_TYPE_OBSERVER
;
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
scwc
.
watch_count
=
(
unsigned
short
)
observers
.
size
();
if
(
players
[
0
])
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_HS_WATCH_CHANGE
,
scwc
);
if
(
players
[
1
])
...
...
@@ -121,7 +121,7 @@ void SingleDuel::JoinGame(DuelPlayer* dp, void* pdata, bool is_creater) {
}
if
(
observers
.
size
())
{
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
scwc
.
watch_count
=
(
unsigned
short
)
observers
.
size
();
NetServer
::
SendPacketToPlayer
(
dp
,
STOC_HS_WATCH_CHANGE
,
scwc
);
}
}
...
...
@@ -133,7 +133,7 @@ void SingleDuel::LeaveGame(DuelPlayer* dp) {
observers
.
erase
(
dp
);
if
(
duel_stage
==
DUEL_STAGE_BEGIN
)
{
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
scwc
.
watch_count
=
(
unsigned
short
)
observers
.
size
();
if
(
players
[
0
])
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_HS_WATCH_CHANGE
,
scwc
);
if
(
players
[
1
])
...
...
@@ -199,7 +199,7 @@ void SingleDuel::ToDuelist(DuelPlayer* dp) {
scpe
.
pos
=
1
;
}
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
scwc
.
watch_count
=
(
unsigned
short
)
observers
.
size
();
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_HS_PLAYER_ENTER
,
scpe
);
NetServer
::
SendPacketToPlayer
(
players
[
0
],
STOC_HS_WATCH_CHANGE
,
scwc
);
if
(
players
[
1
])
{
...
...
@@ -322,12 +322,12 @@ void SingleDuel::StartDuel(DuelPlayer* dp) {
}
unsigned
char
deckbuff
[
12
];
auto
pbuf
=
deckbuff
;
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
side
.
size
());
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
char
tempbuff
[
6
];
memcpy
(
tempbuff
,
deckbuff
,
6
);
...
...
@@ -587,8 +587,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
1
;
}
case
MSG_HINT
:
{
type
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
type
=
BufferIO
::
Read
U
Int8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
ReadInt32
(
pbuf
);
switch
(
type
)
{
case
1
:
...
...
@@ -620,8 +620,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_WIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
type
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
type
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
...
@@ -640,10 +640,10 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
2
;
}
case
MSG_SELECT_BATTLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
+
2
;
RefreshMzone
(
0
);
RefreshMzone
(
1
);
...
...
@@ -656,18 +656,18 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
1
;
}
case
MSG_SELECT_IDLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
+
3
;
RefreshMzone
(
0
);
RefreshMzone
(
1
);
...
...
@@ -680,22 +680,22 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
1
;
}
case
MSG_SELECT_EFFECTYN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
12
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_SELECT_YESNO
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_SELECT_OPTION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -703,17 +703,17 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
}
case
MSG_SELECT_CARD
:
case
MSG_SELECT_TRIBUTE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
3
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
c
/*, l, s, ss, code*/
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
pbufw
=
pbuf
;
/*code = */
BufferIO
::
ReadInt32
(
pbuf
);
c
=
BufferIO
::
ReadInt8
(
pbuf
);
/*l = */
BufferIO
::
ReadInt8
(
pbuf
);
/*s = */
BufferIO
::
ReadInt8
(
pbuf
);
/*ss = */
BufferIO
::
ReadInt8
(
pbuf
);
c
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*l = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*s = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*ss = */
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
c
!=
player
)
BufferIO
::
WriteInt32
(
pbufw
,
0
);
}
WaitforResponse
(
player
);
...
...
@@ -721,27 +721,27 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
1
;
}
case
MSG_SELECT_UNSELECT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
c
/*, l, s, ss, code*/
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
pbufw
=
pbuf
;
/*code = */
BufferIO
::
ReadInt32
(
pbuf
);
c
=
BufferIO
::
ReadInt8
(
pbuf
);
/*l = */
BufferIO
::
ReadInt8
(
pbuf
);
/*s = */
BufferIO
::
ReadInt8
(
pbuf
);
/*ss = */
BufferIO
::
ReadInt8
(
pbuf
);
c
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*l = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*s = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*ss = */
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
c
!=
player
)
BufferIO
::
WriteInt32
(
pbufw
,
0
);
}
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
pbufw
=
pbuf
;
/*code = */
BufferIO
::
ReadInt32
(
pbuf
);
c
=
BufferIO
::
ReadInt8
(
pbuf
);
/*l = */
BufferIO
::
ReadInt8
(
pbuf
);
/*s = */
BufferIO
::
ReadInt8
(
pbuf
);
/*ss = */
BufferIO
::
ReadInt8
(
pbuf
);
c
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*l = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*s = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*ss = */
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
c
!=
player
)
BufferIO
::
WriteInt32
(
pbufw
,
0
);
}
WaitforResponse
(
player
);
...
...
@@ -749,8 +749,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
1
;
}
case
MSG_SELECT_CHAIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
10
+
count
*
13
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -758,23 +758,23 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
}
case
MSG_SELECT_PLACE
:
case
MSG_SELECT_DISFIELD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_SELECT_POSITION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_SELECT_COUNTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
9
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -782,27 +782,27 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
}
case
MSG_SELECT_SUM
:
{
pbuf
++
;
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
6
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_SORT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_CONFIRM_DECKTOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -811,8 +811,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_CONFIRM_EXTRATOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -821,8 +821,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_CONFIRM_CARDS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
pbuf
[
5
]
!=
LOCATION_DECK
)
{
pbuf
+=
count
*
7
;
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -836,7 +836,7 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
...
@@ -844,8 +844,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_HAND
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
(
pbuf
-
offset
)
+
count
*
4
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
BufferIO
::
WriteInt32
(
pbuf
,
0
);
...
...
@@ -856,8 +856,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_EXTRA
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
(
pbuf
-
offset
)
+
count
*
4
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
BufferIO
::
WriteInt32
(
pbuf
,
0
);
...
...
@@ -876,7 +876,7 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SWAP_GRAVE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
...
...
@@ -900,8 +900,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_SET_CARD
:
{
int
loc
=
BufferIO
::
Read
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
unsigned
int
loc
=
BufferIO
::
ReadU
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -1148,14 +1148,14 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_CARD_SELECTED
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
break
;
}
case
MSG_RANDOM_SELECTED
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -1164,7 +1164,7 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_BECOME_TARGET
:
{
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -1173,8 +1173,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_DRAW
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbufw
=
pbuf
;
pbuf
+=
count
*
4
;
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -1317,8 +1317,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_TOSS_COIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -1327,8 +1327,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_TOSS_DICE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -1337,7 +1337,7 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_ROCK_PAPER_SCISSORS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
...
...
@@ -1351,14 +1351,14 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_ANNOUNCE_RACE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_ANNOUNCE_ATTRIB
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -1366,7 +1366,7 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
}
case
MSG_ANNOUNCE_CARD
:
case
MSG_ANNOUNCE_NUMBER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadUInt8
(
pbuf
);
pbuf
+=
4
*
count
;
WaitforResponse
(
player
);
...
...
gframe/single_mode.cpp
View file @
f45f5392
...
...
@@ -192,8 +192,8 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_HINT
:
{
/*int type = */
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int type = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int data = */
BufferIO
::
ReadInt32
(
pbuf
);
if
(
player
==
0
)
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
...
...
@@ -205,10 +205,10 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_BATTLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
+
2
;
SinglePlayRefresh
();
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
...
...
@@ -218,18 +218,18 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SELECT_IDLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
+
3
;
SinglePlayRefresh
();
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
...
...
@@ -239,7 +239,7 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SELECT_EFFECTYN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
12
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
...
...
@@ -249,7 +249,7 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SELECT_YESNO
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -258,8 +258,8 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SELECT_OPTION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -269,9 +269,9 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_SELECT_CARD
:
case
MSG_SELECT_TRIBUTE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
3
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -280,11 +280,11 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SELECT_UNSELECT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -293,8 +293,8 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SELECT_CHAIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
10
+
count
*
13
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -304,7 +304,7 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_SELECT_PLACE
:
case
MSG_SELECT_DISFIELD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -313,7 +313,7 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SELECT_POSITION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -322,9 +322,9 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SELECT_COUNTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
9
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -334,11 +334,11 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_SELECT_SUM
:
{
pbuf
++
;
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
6
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -347,8 +347,8 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SORT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -357,42 +357,42 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_CONFIRM_DECKTOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_CONFIRM_EXTRATOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_CONFIRM_CARDS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_SHUFFLE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
SinglePlayRefreshDeck
(
player
);
break
;
}
case
MSG_SHUFFLE_HAND
:
{
/*int oplayer = */
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int oplayer = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_SHUFFLE_EXTRA
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
...
...
@@ -403,7 +403,7 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SWAP_GRAVE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
SinglePlayRefreshGrave
(
player
);
break
;
...
...
@@ -421,13 +421,13 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_SHUFFLE_SET_CARD
:
{
pbuf
++
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_NEW_TURN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
...
...
@@ -543,21 +543,21 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_CARD_SELECTED
:
case
MSG_RANDOM_SELECTED
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_BECOME_TARGET
:
{
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_DRAW
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
...
...
@@ -642,21 +642,21 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_TOSS_COIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_TOSS_DICE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_ROCK_PAPER_SCISSORS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Wait
();
...
...
@@ -669,7 +669,7 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_ANNOUNCE_RACE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -678,7 +678,7 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_ANNOUNCE_ATTRIB
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
...
...
@@ -688,7 +688,7 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_ANNOUNCE_CARD
:
case
MSG_ANNOUNCE_NUMBER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadUInt8
(
pbuf
);
pbuf
+=
4
*
count
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
...
...
@@ -724,18 +724,18 @@ bool SingleMode::SinglePlayAnalyze(unsigned char* msg, unsigned int len) {
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
pbuf
+=
4
;
for
(
int
seq
=
0
;
seq
<
7
;
++
seq
)
{
int
val
=
BufferIO
::
ReadInt8
(
pbuf
);
int
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
val
)
pbuf
+=
2
;
}
for
(
int
seq
=
0
;
seq
<
8
;
++
seq
)
{
int
val
=
BufferIO
::
ReadInt8
(
pbuf
);
int
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
val
)
pbuf
++
;
}
pbuf
+=
6
;
}
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
15
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
SinglePlayReload
();
...
...
gframe/tag_duel.cpp
View file @
f45f5392
...
...
@@ -85,7 +85,7 @@ void TagDuel::JoinGame(DuelPlayer* dp, void* pdata, bool is_creater) {
dp
->
type
=
NETPLAYER_TYPE_OBSERVER
;
sctc
.
type
|=
NETPLAYER_TYPE_OBSERVER
;
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
scwc
.
watch_count
=
(
unsigned
short
)
observers
.
size
();
for
(
int
i
=
0
;
i
<
4
;
++
i
)
if
(
players
[
i
])
NetServer
::
SendPacketToPlayer
(
players
[
i
],
STOC_HS_WATCH_CHANGE
,
scwc
);
...
...
@@ -108,7 +108,7 @@ void TagDuel::JoinGame(DuelPlayer* dp, void* pdata, bool is_creater) {
}
if
(
observers
.
size
())
{
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
scwc
.
watch_count
=
(
unsigned
short
)
observers
.
size
();
NetServer
::
SendPacketToPlayer
(
dp
,
STOC_HS_WATCH_CHANGE
,
scwc
);
}
}
...
...
@@ -120,7 +120,7 @@ void TagDuel::LeaveGame(DuelPlayer* dp) {
observers
.
erase
(
dp
);
if
(
duel_stage
==
DUEL_STAGE_BEGIN
)
{
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
scwc
.
watch_count
=
(
unsigned
short
)
observers
.
size
();
for
(
int
i
=
0
;
i
<
4
;
++
i
)
if
(
players
[
i
])
NetServer
::
SendPacketToPlayer
(
players
[
i
],
STOC_HS_WATCH_CHANGE
,
scwc
);
...
...
@@ -165,7 +165,7 @@ void TagDuel::ToDuelist(DuelPlayer* dp) {
players
[
dp
->
type
]
=
dp
;
scpe
.
pos
=
dp
->
type
;
STOC_HS_WatchChange
scwc
;
scwc
.
watch_count
=
observers
.
size
();
scwc
.
watch_count
=
(
unsigned
short
)
observers
.
size
();
for
(
int
i
=
0
;
i
<
4
;
++
i
)
if
(
players
[
i
])
{
NetServer
::
SendPacketToPlayer
(
players
[
i
],
STOC_HS_PLAYER_ENTER
,
scpe
);
...
...
@@ -286,12 +286,12 @@ void TagDuel::StartDuel(DuelPlayer* dp) {
}
unsigned
char
deckbuff
[
12
];
auto
pbuf
=
deckbuff
;
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
side
.
size
());
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
char
tempbuff
[
6
];
...
...
@@ -535,8 +535,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
1
;
}
case
MSG_HINT
:
{
type
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
ReadInt8
(
pbuf
);
type
=
BufferIO
::
Read
U
Int8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
BufferIO
::
ReadInt32
(
pbuf
);
switch
(
type
)
{
case
1
:
...
...
@@ -570,8 +570,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_WIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
type
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
type
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
...
...
@@ -582,10 +582,10 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
2
;
}
case
MSG_SELECT_BATTLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
+
2
;
RefreshMzone
(
0
);
RefreshMzone
(
1
);
...
...
@@ -598,18 +598,18 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
1
;
}
case
MSG_SELECT_IDLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
+
3
;
RefreshMzone
(
0
);
RefreshMzone
(
1
);
...
...
@@ -622,22 +622,22 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
1
;
}
case
MSG_SELECT_EFFECTYN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
12
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_SELECT_YESNO
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_SELECT_OPTION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -645,17 +645,17 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
}
case
MSG_SELECT_CARD
:
case
MSG_SELECT_TRIBUTE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
3
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
c
/*, l, s, ss, code*/
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
pbufw
=
pbuf
;
/*code = */
BufferIO
::
ReadInt32
(
pbuf
);
c
=
BufferIO
::
ReadInt8
(
pbuf
);
/*l = */
BufferIO
::
ReadInt8
(
pbuf
);
/*s = */
BufferIO
::
ReadInt8
(
pbuf
);
/*ss = */
BufferIO
::
ReadInt8
(
pbuf
);
c
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*l = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*s = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*ss = */
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
c
!=
player
)
BufferIO
::
WriteInt32
(
pbufw
,
0
);
}
WaitforResponse
(
player
);
...
...
@@ -663,27 +663,27 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
1
;
}
case
MSG_SELECT_UNSELECT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
c
/*, l, s, ss, code*/
;
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
pbufw
=
pbuf
;
/*code = */
BufferIO
::
ReadInt32
(
pbuf
);
c
=
BufferIO
::
ReadInt8
(
pbuf
);
/*l = */
BufferIO
::
ReadInt8
(
pbuf
);
/*s = */
BufferIO
::
ReadInt8
(
pbuf
);
/*ss = */
BufferIO
::
ReadInt8
(
pbuf
);
c
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*l = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*s = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*ss = */
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
c
!=
player
)
BufferIO
::
WriteInt32
(
pbufw
,
0
);
}
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
pbufw
=
pbuf
;
/*code = */
BufferIO
::
ReadInt32
(
pbuf
);
c
=
BufferIO
::
ReadInt8
(
pbuf
);
/*l = */
BufferIO
::
ReadInt8
(
pbuf
);
/*s = */
BufferIO
::
ReadInt8
(
pbuf
);
/*ss = */
BufferIO
::
ReadInt8
(
pbuf
);
c
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*l = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*s = */
BufferIO
::
Read
U
Int8
(
pbuf
);
/*ss = */
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
c
!=
player
)
BufferIO
::
WriteInt32
(
pbufw
,
0
);
}
WaitforResponse
(
player
);
...
...
@@ -691,8 +691,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
return
1
;
}
case
MSG_SELECT_CHAIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
10
+
count
*
13
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -700,23 +700,23 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
}
case
MSG_SELECT_PLACE
:
case
MSG_SELECT_DISFIELD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_SELECT_POSITION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_SELECT_COUNTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
9
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -724,27 +724,27 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
}
case
MSG_SELECT_SUM
:
{
pbuf
++
;
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
6
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_SORT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_CONFIRM_DECKTOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -755,8 +755,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_CONFIRM_EXTRATOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -767,8 +767,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_CONFIRM_CARDS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
pbuf
[
5
]
!=
LOCATION_DECK
)
{
pbuf
+=
count
*
7
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -784,7 +784,7 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
...
...
@@ -794,8 +794,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_HAND
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
(
pbuf
-
offset
)
+
count
*
4
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
BufferIO
::
WriteInt32
(
pbuf
,
0
);
...
...
@@ -808,8 +808,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_EXTRA
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
(
pbuf
-
offset
)
+
count
*
4
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
BufferIO
::
WriteInt32
(
pbuf
,
0
);
...
...
@@ -832,7 +832,7 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SWAP_GRAVE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
NetServer
::
ReSendToPlayer
(
players
[
2
]);
...
...
@@ -862,8 +862,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_SET_CARD
:
{
int
loc
=
BufferIO
::
Read
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
unsigned
int
loc
=
BufferIO
::
ReadU
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -1159,14 +1159,14 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_CARD_SELECTED
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
break
;
}
case
MSG_RANDOM_SELECTED
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -1177,7 +1177,7 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_BECOME_TARGET
:
{
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -1188,8 +1188,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_DRAW
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbufw
=
pbuf
;
pbuf
+=
count
*
4
;
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -1364,8 +1364,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_TOSS_COIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -1376,8 +1376,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_TOSS_DICE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
...
...
@@ -1388,7 +1388,7 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_ROCK_PAPER_SCISSORS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
...
...
@@ -1404,14 +1404,14 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_ANNOUNCE_RACE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
case
MSG_ANNOUNCE_ATTRIB
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
@@ -1419,7 +1419,7 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
}
case
MSG_ANNOUNCE_CARD
:
case
MSG_ANNOUNCE_NUMBER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadUInt8
(
pbuf
);
pbuf
+=
4
*
count
;
WaitforResponse
(
player
);
...
...
@@ -1447,11 +1447,11 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_TAG_SWAP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int mcount = */
BufferIO
::
ReadInt8
(
pbuf
);
int
ecount
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int pcount = */
BufferIO
::
ReadInt8
(
pbuf
);
int
hcount
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int mcount = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
ecount
=
BufferIO
::
Read
U
Int8
(
pbuf
);
/*int pcount = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
hcount
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbufw
=
pbuf
+
4
;
pbuf
+=
hcount
*
4
+
ecount
*
4
+
4
;
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
...
...
premake5.lua
View file @
f45f5392
...
...
@@ -197,7 +197,7 @@ workspace "YGOPro"
filter
{
"configurations:Release"
,
"action:vs*"
}
flags
{
"LinkTimeOptimization"
}
staticruntime
"On"
disablewarnings
{
"4244"
,
"4267"
,
"4838"
,
"4577"
,
"4
819"
,
"4018"
,
"4996"
,
"4477"
,
"4091"
,
"4828
"
,
"4800"
,
"6011"
,
"6031"
,
"6054"
,
"6262"
}
disablewarnings
{
"4244"
,
"4267"
,
"4838"
,
"4577"
,
"4
018"
,
"4996"
,
"4477"
,
"4091
"
,
"4800"
,
"6011"
,
"6031"
,
"6054"
,
"6262"
}
filter
{
"configurations:Release"
,
"not action:vs*"
}
symbols
"On"
...
...
@@ -207,7 +207,7 @@ workspace "YGOPro"
end
filter
{
"configurations:Debug"
,
"action:vs*"
}
disablewarnings
{
"
4819"
,
"4828"
,
"
6011"
,
"6031"
,
"6054"
,
"6262"
}
disablewarnings
{
"6011"
,
"6031"
,
"6054"
,
"6262"
}
filter
"action:vs*"
vectorextensions
"SSE2"
...
...
strings.conf
View file @
f45f5392
...
...
@@ -657,6 +657,8 @@
!
counter
0
x68
指示物(图腾柱)
!
counter
0
x69
指示物(吠陀-优婆尼沙昙)
!
counter
0
x6a
响鸣指示物
!
counter
0
x6b
狂乱指示物
!
counter
0
x6c
访问指示物
#setnames, using tab for comment
!
setname
0
x1
正义盟军
A
・
O
・
J
!
setname
0
x2
次世代 ジェネクス
...
...
@@ -1212,3 +1214,9 @@
!
setname
0
x1ab
蕾祸 蕾禍
!
setname
0
x1ac
飞龙炎
Salamandra
!
setname
0
x1ad
灰尽
Ashened
!
setname
0
x1ae
千年 千年/ミレニアム
!
setname
0
x1af
艾格佐德 エグゾード
!
setname
0
x1b0
刻魔 デモンスミス
!
setname
0
x1b1
白森林 白き森
!
setname
0
x1b2
欢聚友伴 マルチャミー
!
setname
0
x1b3
徽记 エンブレーマ
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