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
wind2009
ygopro
Commits
4a7147f3
Commit
4a7147f3
authored
May 06, 2024
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
into server
parents
1513831b
3d8c3621
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
758 additions
and
740 deletions
+758
-740
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
+14
-13
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 @
4a7147f3
#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 @
4a7147f3
...
...
@@ -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 @
4a7147f3
...
...
@@ -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 @
4a7147f3
...
...
@@ -238,7 +238,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
;
...
...
@@ -248,7 +248,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
;
...
...
@@ -256,7 +256,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
;
...
...
@@ -265,7 +265,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
;
...
...
@@ -277,7 +277,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 @
4a7147f3
...
...
@@ -10,6 +10,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:
...
...
@@ -28,9 +30,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 @
4a7147f3
...
...
@@ -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 @
4a7147f3
...
...
@@ -6,7 +6,7 @@
namespace
ygo
{
#ifndef YGOPRO_SERVER_MODE
char
DeckManager
::
deckBuffer
[
0x10000
];
char
DeckManager
::
deckBuffer
[
0x10000
]
{}
;
#endif
DeckManager
deckManager
;
...
...
gframe/deck_manager.h
View file @
4a7147f3
...
...
@@ -12,7 +12,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 @
4a7147f3
...
...
@@ -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,35 +1227,36 @@ 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
);
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
;
...
...
@@ -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 @
4a7147f3
...
...
@@ -771,7 +771,7 @@ bool Game::Initialize() {
cbCardType
->
addItem
(
dataManager
.
GetSysString
(
1312
));
cbCardType
->
addItem
(
dataManager
.
GetSysString
(
1313
));
cbCardType
->
addItem
(
dataManager
.
GetSysString
(
1314
));
cbCardType2
=
env
->
addComboBox
(
rect
<
s32
>
(
125
,
25
/
6
,
200
,
20
+
25
/
6
),
wFilter
,
COMBOBOX_SECONDTYPE
);
cbCardType2
=
env
->
addComboBox
(
rect
<
s32
>
(
125
,
25
/
6
,
195
,
20
+
25
/
6
),
wFilter
,
COMBOBOX_SECONDTYPE
);
cbCardType2
->
setMaxSelectionRows
(
10
);
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1310
),
0
);
stLimit
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1315
),
rect
<
s32
>
(
205
,
2
+
25
/
6
,
280
,
22
+
25
/
6
),
false
,
false
,
wFilter
);
...
...
@@ -787,13 +787,13 @@ bool Game::Initialize() {
cbLimit
->
addItem
(
dataManager
.
GetSysString
(
1484
));
cbLimit
->
addItem
(
dataManager
.
GetSysString
(
1485
));
stAttribute
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1319
),
rect
<
s32
>
(
10
,
22
+
50
/
6
,
70
,
42
+
50
/
6
),
false
,
false
,
wFilter
);
cbAttribute
=
env
->
addComboBox
(
rect
<
s32
>
(
60
,
20
+
50
/
6
,
19
0
,
40
+
50
/
6
),
wFilter
,
COMBOBOX_ATTRIBUTE
);
cbAttribute
=
env
->
addComboBox
(
rect
<
s32
>
(
60
,
20
+
50
/
6
,
19
5
,
40
+
50
/
6
),
wFilter
,
COMBOBOX_ATTRIBUTE
);
cbAttribute
->
setMaxSelectionRows
(
10
);
cbAttribute
->
addItem
(
dataManager
.
GetSysString
(
1310
),
0
);
for
(
int
filter
=
0x1
;
filter
!=
0x80
;
filter
<<=
1
)
cbAttribute
->
addItem
(
dataManager
.
FormatAttribute
(
filter
),
filter
);
stRace
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1321
),
rect
<
s32
>
(
10
,
42
+
75
/
6
,
70
,
62
+
75
/
6
),
false
,
false
,
wFilter
);
cbRace
=
env
->
addComboBox
(
rect
<
s32
>
(
60
,
40
+
75
/
6
,
19
0
,
60
+
75
/
6
),
wFilter
,
COMBOBOX_RACE
);
cbRace
=
env
->
addComboBox
(
rect
<
s32
>
(
60
,
40
+
75
/
6
,
19
5
,
60
+
75
/
6
),
wFilter
,
COMBOBOX_RACE
);
cbRace
->
setMaxSelectionRows
(
10
);
cbRace
->
addItem
(
dataManager
.
GetSysString
(
1310
),
0
);
for
(
int
filter
=
0x1
;
filter
<
(
1
<<
RACES_COUNT
);
filter
<<=
1
)
...
...
@@ -808,7 +808,7 @@ bool Game::Initialize() {
ebStar
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
60
,
60
+
100
/
6
,
100
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_INPUTS
);
ebStar
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
stScale
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1336
),
rect
<
s32
>
(
101
,
62
+
100
/
6
,
150
,
82
+
100
/
6
),
false
,
false
,
wFilter
);
ebScale
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
150
,
60
+
100
/
6
,
19
0
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_INPUTS
);
ebScale
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
150
,
60
+
100
/
6
,
19
5
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_INPUTS
);
ebScale
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
stSearch
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1325
),
rect
<
s32
>
(
205
,
62
+
100
/
6
,
280
,
82
+
100
/
6
),
false
,
false
,
wFilter
);
ebCardName
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
260
,
60
+
100
/
6
,
390
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_KEYWORD
);
...
...
@@ -836,7 +836,7 @@ bool Game::Initialize() {
int
wcatewidth
=
catewidth
*
4
+
16
;
wCategories
->
setRelativePosition
(
rect
<
s32
>
(
1000
-
wcatewidth
,
60
,
1000
,
305
));
btnCategoryOK
->
setRelativePosition
(
recti
(
wcatewidth
/
2
-
50
,
210
,
wcatewidth
/
2
+
50
,
235
));
btnMarksFilter
=
env
->
addButton
(
rect
<
s32
>
(
60
,
80
+
125
/
6
,
19
0
,
100
+
125
/
6
),
wFilter
,
BUTTON_MARKS_FILTER
,
dataManager
.
GetSysString
(
1374
));
btnMarksFilter
=
env
->
addButton
(
rect
<
s32
>
(
60
,
80
+
125
/
6
,
19
5
,
100
+
125
/
6
),
wFilter
,
BUTTON_MARKS_FILTER
,
dataManager
.
GetSysString
(
1374
));
wLinkMarks
=
env
->
addWindow
(
rect
<
s32
>
(
700
,
30
,
820
,
150
),
false
,
L""
);
wLinkMarks
->
getCloseButton
()
->
setVisible
(
false
);
wLinkMarks
->
setDrawTitlebar
(
false
);
...
...
@@ -1111,7 +1111,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
)
...
...
@@ -1844,8 +1844,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
;
...
...
@@ -1897,12 +1898,12 @@ void Game::OnResize() {
wFilter
->
setRelativePosition
(
Resize
(
610
,
5
,
1020
,
130
));
scrFilter
->
setRelativePosition
(
Resize
(
999
,
161
,
1019
,
629
));
cbCardType
->
setRelativePosition
(
Resize
(
60
,
25
/
6
,
120
,
20
+
25
/
6
));
cbCardType2
->
setRelativePosition
(
Resize
(
1
30
,
25
/
6
,
190
,
20
+
25
/
6
));
cbRace
->
setRelativePosition
(
Resize
(
60
,
40
+
75
/
6
,
19
0
,
60
+
75
/
6
));
cbAttribute
->
setRelativePosition
(
Resize
(
60
,
20
+
50
/
6
,
19
0
,
40
+
50
/
6
));
cbCardType2
->
setRelativePosition
(
Resize
(
1
25
,
25
/
6
,
195
,
20
+
25
/
6
));
cbRace
->
setRelativePosition
(
Resize
(
60
,
40
+
75
/
6
,
19
5
,
60
+
75
/
6
));
cbAttribute
->
setRelativePosition
(
Resize
(
60
,
20
+
50
/
6
,
19
5
,
40
+
50
/
6
));
cbLimit
->
setRelativePosition
(
Resize
(
260
,
25
/
6
,
390
,
20
+
25
/
6
));
ebStar
->
setRelativePosition
(
Resize
(
60
,
60
+
100
/
6
,
95
,
80
+
100
/
6
));
ebScale
->
setRelativePosition
(
Resize
(
155
,
60
+
100
/
6
,
19
0
,
80
+
100
/
6
));
ebScale
->
setRelativePosition
(
Resize
(
155
,
60
+
100
/
6
,
19
5
,
80
+
100
/
6
));
ebAttack
->
setRelativePosition
(
Resize
(
260
,
20
+
50
/
6
,
340
,
40
+
50
/
6
));
ebDefense
->
setRelativePosition
(
Resize
(
260
,
40
+
75
/
6
,
340
,
60
+
75
/
6
));
ebCardName
->
setRelativePosition
(
Resize
(
260
,
60
+
100
/
6
,
390
,
80
+
100
/
6
));
...
...
@@ -1910,7 +1911,7 @@ void Game::OnResize() {
btnStartFilter
->
setRelativePosition
(
Resize
(
260
,
80
+
125
/
6
,
390
,
100
+
125
/
6
));
if
(
btnClearFilter
)
btnClearFilter
->
setRelativePosition
(
Resize
(
205
,
80
+
125
/
6
,
255
,
100
+
125
/
6
));
btnMarksFilter
->
setRelativePosition
(
Resize
(
60
,
80
+
125
/
6
,
19
0
,
100
+
125
/
6
));
btnMarksFilter
->
setRelativePosition
(
Resize
(
60
,
80
+
125
/
6
,
19
5
,
100
+
125
/
6
));
recti
btncatepos
=
btnEffectFilter
->
getAbsolutePosition
();
wCategories
->
setRelativePosition
(
recti
(
...
...
gframe/game.h
View file @
4a7147f3
...
...
@@ -178,7 +178,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 @
4a7147f3
...
...
@@ -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 @
4a7147f3
...
...
@@ -129,7 +129,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
])
...
...
@@ -169,7 +169,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
);
}
}
...
...
@@ -204,7 +204,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
])
...
...
@@ -291,7 +291,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
])
{
...
...
@@ -443,12 +443,12 @@ void SingleDuel::StartDuel(DuelPlayer* dp) {
#endif
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
);
...
...
@@ -756,8 +756,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
:
...
...
@@ -795,8 +795,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
)
...
...
@@ -818,10 +818,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
);
...
...
@@ -834,18 +834,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
);
...
...
@@ -858,22 +858,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
);
...
...
@@ -881,17 +881,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
);
...
...
@@ -899,27 +899,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
);
...
...
@@ -927,8 +927,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
);
...
...
@@ -936,23 +936,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
);
...
...
@@ -960,27 +960,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
]);
...
...
@@ -992,8 +992,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
]);
...
...
@@ -1005,8 +1005,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
);
...
...
@@ -1023,7 +1023,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
)
...
...
@@ -1034,8 +1034,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
);
#ifdef YGOPRO_SERVER_MODE
NetServer
::
ReSendToPlayer
(
replay_recorder
);
...
...
@@ -1052,8 +1052,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
);
#ifdef YGOPRO_SERVER_MODE
NetServer
::
ReSendToPlayer
(
replay_recorder
);
...
...
@@ -1081,7 +1081,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
)
...
...
@@ -1114,8 +1114,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
]);
...
...
@@ -1439,14 +1439,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
]);
...
...
@@ -1458,7 +1458,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
]);
...
...
@@ -1470,8 +1470,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
);
...
...
@@ -1665,8 +1665,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
]);
...
...
@@ -1678,8 +1678,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
]);
...
...
@@ -1691,7 +1691,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
;
...
...
@@ -1705,14 +1705,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
);
...
...
@@ -1720,7 +1720,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 @
4a7147f3
...
...
@@ -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 @
4a7147f3
...
...
@@ -127,7 +127,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
);
...
...
@@ -156,7 +156,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
);
}
}
...
...
@@ -197,7 +197,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
);
...
...
@@ -254,7 +254,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
);
...
...
@@ -410,12 +410,12 @@ void TagDuel::StartDuel(DuelPlayer* dp) {
#endif
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
];
...
...
@@ -693,8 +693,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
:
...
...
@@ -731,8 +731,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
]);
...
...
@@ -746,10 +746,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
);
...
...
@@ -762,18 +762,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
);
...
...
@@ -786,22 +786,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
);
...
...
@@ -809,17 +809,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
);
...
...
@@ -827,27 +827,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
);
...
...
@@ -855,8 +855,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
);
...
...
@@ -864,23 +864,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
);
...
...
@@ -888,27 +888,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
]);
...
...
@@ -922,8 +922,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
]);
...
...
@@ -937,8 +937,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
);
...
...
@@ -957,7 +957,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
]);
...
...
@@ -970,8 +970,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
);
#ifdef YGOPRO_SERVER_MODE
NetServer
::
ReSendToPlayer
(
replay_recorder
);
...
...
@@ -990,8 +990,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
);
#ifdef YGOPRO_SERVER_MODE
NetServer
::
ReSendToPlayer
(
replay_recorder
);
...
...
@@ -1023,7 +1023,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
]);
...
...
@@ -1062,8 +1062,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
]);
...
...
@@ -1436,14 +1436,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
]);
...
...
@@ -1457,7 +1457,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
]);
...
...
@@ -1471,8 +1471,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
);
...
...
@@ -1698,8 +1698,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
]);
...
...
@@ -1713,8 +1713,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
]);
...
...
@@ -1728,7 +1728,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
;
...
...
@@ -1744,14 +1744,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
);
...
...
@@ -1759,7 +1759,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
);
...
...
@@ -1793,11 +1793,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 @
4a7147f3
...
...
@@ -223,7 +223,7 @@ end
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"
...
...
@@ -233,7 +233,7 @@ end
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 @
4a7147f3
...
...
@@ -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