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
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
MyCard
ygopro
Commits
3472f1a2
Commit
3472f1a2
authored
May 04, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'fh/master' into develop
parents
197fd3de
3d8c3621
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
748 additions
and
730 deletions
+748
-730
gframe/bufferio.h
gframe/bufferio.h
+7
-8
gframe/client_card.cpp
gframe/client_card.cpp
+8
-8
gframe/client_field.cpp
gframe/client_field.cpp
+5
-5
gframe/data_manager.cpp
gframe/data_manager.cpp
+5
-5
gframe/data_manager.h
gframe/data_manager.h
+5
-3
gframe/deck_con.h
gframe/deck_con.h
+37
-37
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+1
-1
gframe/deck_manager.h
gframe/deck_manager.h
+1
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+368
-360
gframe/game.cpp
gframe/game.cpp
+4
-3
gframe/game.h
gframe/game.h
+1
-1
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+59
-59
gframe/single_duel.cpp
gframe/single_duel.cpp
+85
-85
gframe/single_mode.cpp
gframe/single_mode.cpp
+62
-62
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+90
-90
premake5.lua
premake5.lua
+2
-2
strings.conf
strings.conf
+8
-0
No files found.
gframe/bufferio.h
View file @
3472f1a2
#ifndef BUFFERIO_H
#define BUFFERIO_H
#ifdef _MSC_VER
#pragma warning(disable: 4244)
#endif
class
BufferIO
{
public:
...
...
@@ -53,7 +50,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
;
...
...
@@ -63,7 +60,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
;
...
...
@@ -75,7 +72,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
;
...
...
@@ -141,12 +138,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 @
3472f1a2
...
...
@@ -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 @
3472f1a2
...
...
@@ -197,7 +197,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
)
{
...
...
@@ -212,7 +212,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
:
{
...
...
@@ -225,18 +225,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 @
3472f1a2
...
...
@@ -197,7 +197,7 @@ code_pointer DataManager::GetCodePointer(unsigned int code) const {
string_pointer
DataManager
::
GetStringPointer
(
unsigned
int
code
)
const
{
return
_strings
.
find
(
code
);
}
bool
DataManager
::
GetString
(
int
code
,
CardString
*
pStr
)
{
bool
DataManager
::
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
{
pStr
->
name
=
unknown_string
;
...
...
@@ -207,7 +207,7 @@ bool DataManager::GetString(int code, CardString* pStr) {
*
pStr
=
csit
->
second
;
return
true
;
}
const
wchar_t
*
DataManager
::
GetName
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetName
(
unsigned
int
code
)
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
...
...
@@ -215,7 +215,7 @@ const wchar_t* DataManager::GetName(int code) {
return
csit
->
second
.
name
.
c_str
();
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetText
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetText
(
unsigned
int
code
)
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
...
...
@@ -224,7 +224,7 @@ const wchar_t* DataManager::GetText(int code) {
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetDesc
(
unsigned
int
strCode
)
{
if
(
strCode
<
10000u
)
if
(
strCode
<
(
MIN_CARD_ID
<<
4
)
)
return
GetSysString
(
strCode
);
unsigned
int
code
=
(
strCode
>>
4
)
&
0x0fffffff
;
unsigned
int
offset
=
strCode
&
0xf
;
...
...
@@ -236,7 +236,7 @@ const wchar_t* DataManager::GetDesc(unsigned int strCode) {
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
{
if
(
code
<
0
||
code
>=
2048
)
if
(
code
<
0
||
code
>
MAX_STRING_ID
)
return
unknown_string
;
auto
csit
=
_sysStrings
.
find
(
code
);
if
(
csit
==
_sysStrings
.
end
())
...
...
gframe/data_manager.h
View file @
3472f1a2
...
...
@@ -8,6 +8,8 @@
#include <unordered_map>
namespace
ygo
{
constexpr
int
MAX_STRING_ID
=
0x7ff
;
constexpr
unsigned
int
MIN_CARD_ID
=
(
unsigned
int
)(
MAX_STRING_ID
+
1
)
>>
4
;
class
DataManager
{
public:
...
...
@@ -20,9 +22,9 @@ public:
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
);
code_pointer
GetCodePointer
(
unsigned
int
code
)
const
;
string_pointer
GetStringPointer
(
unsigned
int
code
)
const
;
bool
GetString
(
int
code
,
CardString
*
pStr
);
const
wchar_t
*
GetName
(
int
code
);
const
wchar_t
*
GetText
(
int
code
);
bool
GetString
(
unsigned
int
code
,
CardString
*
pStr
);
const
wchar_t
*
GetName
(
unsigned
int
code
);
const
wchar_t
*
GetText
(
unsigned
int
code
);
const
wchar_t
*
GetDesc
(
unsigned
int
strCode
);
const
wchar_t
*
GetSysString
(
int
code
);
const
wchar_t
*
GetVictoryString
(
int
code
);
...
...
gframe/deck_con.h
View file @
3472f1a2
...
...
@@ -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 @
3472f1a2
...
...
@@ -6,7 +6,7 @@
namespace
ygo
{
char
DeckManager
::
deckBuffer
[
0x10000
];
char
DeckManager
::
deckBuffer
[
0x10000
]
{}
;
DeckManager
deckManager
;
void
DeckManager
::
LoadLFListSingle
(
const
char
*
path
)
{
...
...
gframe/deck_manager.h
View file @
3472f1a2
...
...
@@ -10,7 +10,7 @@
namespace
ygo
{
struct
LFList
{
unsigned
int
hash
;
unsigned
int
hash
{}
;
std
::
wstring
listName
;
std
::
unordered_map
<
int
,
int
>
content
;
};
...
...
gframe/duelclient.cpp
View file @
3472f1a2
...
...
@@ -1131,8 +1131,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
.
isReplaySkiping
)
return
true
;
...
...
@@ -1311,8 +1311,8 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
dField
.
RefreshAllCards
();
mainGame
->
gMutex
.
unlock
();
}
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
;
...
...
@@ -1362,7 +1362,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
;
...
...
@@ -1372,7 +1372,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
]);
...
...
@@ -1400,36 +1400,37 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_UPDATE_DATA
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
location
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
int
location
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
gMutex
.
lock
();
mainGame
->
dField
.
UpdateFieldCard
(
player
,
location
,
pbuf
);
mainGame
->
gMutex
.
unlock
();
return
true
;
}
case
MSG_UPDATE_CARD
:
{
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
loc
=
BufferIO
::
Read
Int8
(
pbuf
);
int
seq
=
BufferIO
::
ReadInt8
(
pbuf
);
int
player
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
unsigned
int
loc
=
BufferIO
::
ReadU
Int8
(
pbuf
);
int
seq
=
BufferIO
::
Read
U
Int8
(
pbuf
);
mainGame
->
gMutex
.
lock
();
mainGame
->
dField
.
UpdateCard
(
player
,
loc
,
seq
,
pbuf
);
mainGame
->
gMutex
.
unlock
();
break
;
}
case
MSG_SELECT_BATTLECMD
:
{
/*int selecting_player = */
BufferIO
::
ReadInt8
(
pbuf
);
int
code
,
desc
,
count
,
con
,
loc
,
seq
/*, diratt*/
;
/*int selecting_player = */
BufferIO
::
ReadUInt8
(
pbuf
);
int
desc
,
count
,
con
,
seq
/*, diratt*/
;
unsigned
int
code
,
loc
;
ClientCard
*
pcard
;
mainGame
->
dField
.
activatable_cards
.
clear
();
mainGame
->
dField
.
activatable_descs
.
clear
();
mainGame
->
dField
.
conti_cards
.
clear
();
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
BufferIO
::
ReadInt32
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
loc
=
BufferIO
::
Read
Int8
(
pbuf
);
seq
=
BufferIO
::
Read
Int8
(
pbuf
);
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
con
=
mainGame
->
LocalPlayer
(
BufferIO
::
Read
U
Int8
(
pbuf
));
loc
=
BufferIO
::
ReadU
Int8
(
pbuf
);
seq
=
BufferIO
::
ReadU
Int8
(
pbuf
);
desc
=
BufferIO
::
ReadInt32
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
con
,
loc
,
seq
);
int
flag
=
0
;
if
(
code
&
0x80000000
)
{
...
...
@@ -1455,25 +1456,25 @@ 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
->
dField
.
RefreshCardCountDisplay
();
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
);
...
...
@@ -1482,27 +1483,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
;
...
...
@@ -1522,34 +1524,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
;
...
...
@@ -1557,12 +1559,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
;
...
...
@@ -1588,17 +1590,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
);
...
...
@@ -1606,15 +1608,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
;
...
...
@@ -1640,7 +1642,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
();
...
...
@@ -1650,8 +1652,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
));
...
...
@@ -1660,14 +1662,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
()
};
...
...
@@ -1676,11 +1679,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
if
(
l
==
0
)
{
...
...
@@ -1727,16 +1730,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
()
};
...
...
@@ -1745,10 +1749,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
if
(
l
==
0
)
{
...
...
@@ -1770,13 +1774,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
if
(
l
==
0
)
{
...
...
@@ -1829,13 +1833,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
;
...
...
@@ -1845,12 +1850,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
);
...
...
@@ -1925,8 +1930,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
;
...
...
@@ -2010,9 +2015,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
;
...
...
@@ -2053,26 +2058,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
);
...
...
@@ -2098,18 +2103,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
);
...
...
@@ -2124,21 +2130,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
);
...
...
@@ -2146,12 +2152,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
);
...
...
@@ -2175,19 +2181,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
);
...
...
@@ -2201,9 +2207,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
)
{
...
...
@@ -2248,9 +2254,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
)
{
...
...
@@ -2294,9 +2300,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
;
...
...
@@ -2309,9 +2316,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
);
if
(
l
==
0
)
{
pcard
=
new
ClientCard
();
mainGame
->
dField
.
limbo_temp
.
push_back
(
pcard
);
...
...
@@ -2416,7 +2423,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
;
...
...
@@ -2455,8 +2462,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
.
isReplaySkiping
)
{
if
(
count
>
1
)
soundManager
.
PlaySoundEffect
(
SOUND_SHUFFLE
);
...
...
@@ -2498,8 +2505,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
.
isReplaySkiping
)
{
...
...
@@ -2527,11 +2534,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
.
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
)
...
...
@@ -2585,9 +2592,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
;
...
...
@@ -2599,20 +2606,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
.
isReplaySkiping
)
{
...
...
@@ -2625,10 +2633,10 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
if
(
!
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
];
...
...
@@ -2650,7 +2658,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
return
true
;
}
case
MSG_NEW_TURN
:
{
int
r_player
=
BufferIO
::
ReadInt8
(
pbuf
);
int
r_player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
int
player
=
mainGame
->
LocalPlayer
(
r_player
&
0x1
);
mainGame
->
dInfo
.
turn
++
;
if
(
r_player
&
0x2
)
{
...
...
@@ -2737,15 +2745,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
.
isReplaySkiping
)
{
if
(
cl
&
LOCATION_REMOVED
&&
pl
!=
cl
)
...
...
@@ -2871,7 +2879,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
);
...
...
@@ -2880,7 +2888,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
);
...
...
@@ -2901,7 +2909,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
);
...
...
@@ -2910,7 +2918,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
();
...
...
@@ -2927,21 +2935,21 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
if
(
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
);
...
...
@@ -2953,12 +2961,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
();
...
...
@@ -2976,10 +2984,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
.
isReplaySkiping
)
soundManager
.
PlaySoundEffect
(
SOUND_SET
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1601
));
...
...
@@ -2987,15 +2995,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
);
...
...
@@ -3029,11 +3037,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
.
isReplaySkiping
)
{
soundManager
.
PlaySoundEffect
(
SOUND_SUMMON
);
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1603
),
dataManager
.
GetName
(
code
));
...
...
@@ -3052,11 +3060,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
.
isReplaySkiping
)
{
CardData
cd
;
if
(
dataManager
.
GetData
(
code
,
&
cd
)
&&
(
cd
.
type
&
TYPE_TOKEN
))
...
...
@@ -3078,11 +3086,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
;
...
...
@@ -3106,16 +3114,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
.
isReplaySkiping
)
return
true
;
soundManager
.
PlaySoundEffect
(
SOUND_ACTIVATE
);
...
...
@@ -3168,7 +3176,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
.
isReplaySkiping
)
return
true
;
myswprintf
(
event_string
,
dataManager
.
GetSysString
(
1609
),
dataManager
.
GetName
(
mainGame
->
dField
.
current_chain
.
code
));
...
...
@@ -3181,7 +3189,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
.
isReplaySkiping
)
return
true
;
if
(
auto_watch_mode
&&
mainGame
->
dField
.
chains
.
size
()
>
1
)
{
...
...
@@ -3210,7 +3218,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
:
{
...
...
@@ -3224,7 +3232,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
.
isReplaySkiping
)
{
soundManager
.
PlaySoundEffect
(
SOUND_NEGATE
);
mainGame
->
showcardcode
=
mainGame
->
dField
.
chains
[
ct
-
1
].
code
;
...
...
@@ -3239,8 +3247,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
.
isReplaySkiping
)
{
pbuf
+=
count
*
4
;
return
true
;
...
...
@@ -3248,10 +3256,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
...
...
@@ -3265,16 +3273,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
.
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
);
if
(
auto_watch_mode
&&
pcard
->
code
>
0
)
{
mainGame
->
showcardcode
=
pcard
->
code
;
...
...
@@ -3312,11 +3320,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
);
...
...
@@ -3346,7 +3354,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
)
...
...
@@ -3377,7 +3385,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
.
isReplaySkiping
)
{
...
...
@@ -3406,14 +3414,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
.
isReplaySkiping
)
{
...
...
@@ -3440,7 +3448,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
.
isReplaySkiping
)
{
mainGame
->
dInfo
.
lp
[
player
]
=
val
;
...
...
@@ -3458,10 +3466,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
.
isReplaySkiping
)
{
pc
->
equipTarget
->
equipped
.
erase
(
pc
);
...
...
@@ -3479,14 +3487,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
.
isReplaySkiping
)
{
...
...
@@ -3505,14 +3513,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
.
isReplaySkiping
)
{
...
...
@@ -3531,7 +3539,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
)
...
...
@@ -3559,9 +3567,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
))
...
...
@@ -3582,9 +3590,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
;
...
...
@@ -3604,15 +3612,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
.
isReplaySkiping
)
return
true
;
float
sy
;
...
...
@@ -3667,20 +3675,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
.
isReplaySkiping
)
return
true
;
mainGame
->
gMutex
.
lock
();
...
...
@@ -3719,18 +3727,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']'
;
...
...
@@ -3748,12 +3756,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']'
;
...
...
@@ -3771,7 +3779,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
.
isReplaySkiping
)
return
true
;
mainGame
->
gMutex
.
lock
();
...
...
@@ -3781,7 +3789,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_HAND_RES
:
{
int
res
=
BufferIO
::
ReadInt8
(
pbuf
);
if
(
mainGame
->
dInfo
.
isReplaySkiping
)
if
(
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
isReplay
Skiping
)
return
true
;
mainGame
->
stHintMsg
->
setVisible
(
false
);
int
res1
=
(
res
&
0x3
)
-
1
;
...
...
@@ -3797,8 +3805,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
);
...
...
@@ -3817,8 +3825,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
);
...
...
@@ -3837,7 +3845,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
)
...
...
@@ -3855,7 +3863,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
();
...
...
@@ -3907,11 +3915,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
)
...
...
@@ -3944,8 +3952,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
)
{
...
...
@@ -3969,11 +3977,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
.
isReplaySkiping
)
{
for
(
auto
cit
=
mainGame
->
dField
.
deck
[
player
].
begin
();
cit
!=
mainGame
->
dField
.
deck
[
player
].
end
();
++
cit
)
{
...
...
@@ -4013,7 +4021,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
);
}
}
...
...
@@ -4028,7 +4036,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
);
}
}
...
...
@@ -4043,7 +4051,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
);
}
}
...
...
@@ -4085,19 +4093,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
;
...
...
@@ -4105,7 +4113,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
;
}
...
...
@@ -4113,52 +4121,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 @
3472f1a2
...
...
@@ -1139,7 +1139,7 @@ void Game::MainLoop() {
SingleMode
::
StopPlay
(
true
);
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
500
));
SaveConfig
();
//
device->drop();
device
->
drop
();
}
void
Game
::
RefreshTimeDisplay
()
{
for
(
int
i
=
0
;
i
<
2
;
++
i
)
{
...
...
@@ -2078,8 +2078,9 @@ void Game::CloseDuelWindow() {
ClearTextures
();
closeDoneSignal
.
Set
();
}
int
Game
::
LocalPlayer
(
int
player
)
{
return
dInfo
.
isFirst
?
player
:
1
-
player
;
int
Game
::
LocalPlayer
(
int
player
)
const
{
int
pid
=
player
?
1
:
0
;
return
dInfo
.
isFirst
?
pid
:
1
-
pid
;
}
const
wchar_t
*
Game
::
LocalName
(
int
local_player
)
{
return
local_player
==
0
?
dInfo
.
hostname
:
dInfo
.
clientname
;
...
...
gframe/game.h
View file @
3472f1a2
...
...
@@ -206,7 +206,7 @@ public:
void
CloseGameWindow
();
void
CloseDuelWindow
();
int
LocalPlayer
(
int
player
);
int
LocalPlayer
(
int
player
)
const
;
const
wchar_t
*
LocalName
(
int
local_player
);
const
char
*
GetLocaleDir
(
const
char
*
dir
);
const
wchar_t
*
GetLocaleDirWide
(
const
char
*
dir
);
...
...
gframe/replay_mode.cpp
View file @
3472f1a2
...
...
@@ -370,141 +370,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
;
...
...
@@ -515,7 +515,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
;
...
...
@@ -533,7 +533,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
;
...
...
@@ -547,7 +547,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
;
}
...
...
@@ -671,22 +671,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
;
...
...
@@ -779,21 +779,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
:
{
...
...
@@ -802,18 +802,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
();
...
...
@@ -845,12 +845,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 @
3472f1a2
...
...
@@ -89,7 +89,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
])
...
...
@@ -123,7 +123,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
);
}
}
...
...
@@ -135,7 +135,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
])
...
...
@@ -201,7 +201,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
])
{
...
...
@@ -324,12 +324,12 @@ void SingleDuel::StartDuel(DuelPlayer* dp) {
}
unsigned
char
deckbuff
[
12
];
auto
pbuf
=
deckbuff
;
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
1
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
1
].
side
.
size
());
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
char
tempbuff
[
6
];
memcpy
(
tempbuff
,
deckbuff
,
6
);
...
...
@@ -602,8 +602,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
:
...
...
@@ -639,8 +639,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
)
...
...
@@ -659,10 +659,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
);
...
...
@@ -675,18 +675,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
);
...
...
@@ -699,22 +699,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
);
...
...
@@ -722,17 +722,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
);
...
...
@@ -740,27 +740,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
);
...
...
@@ -768,8 +768,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
);
...
...
@@ -777,23 +777,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
);
...
...
@@ -801,27 +801,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
]);
...
...
@@ -830,8 +830,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
]);
...
...
@@ -840,8 +840,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
);
...
...
@@ -855,7 +855,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
)
...
...
@@ -863,8 +863,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_HAND
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
(
pbuf
-
offset
)
+
count
*
4
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
BufferIO
::
WriteInt32
(
pbuf
,
0
);
...
...
@@ -875,8 +875,8 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_EXTRA
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
(
pbuf
-
offset
)
+
count
*
4
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
BufferIO
::
WriteInt32
(
pbuf
,
0
);
...
...
@@ -895,7 +895,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
)
...
...
@@ -919,8 +919,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
]);
...
...
@@ -1167,14 +1167,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
]);
...
...
@@ -1183,7 +1183,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
]);
...
...
@@ -1192,8 +1192,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
);
...
...
@@ -1336,8 +1336,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
]);
...
...
@@ -1346,8 +1346,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
]);
...
...
@@ -1356,7 +1356,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
;
...
...
@@ -1370,14 +1370,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
);
...
...
@@ -1385,7 +1385,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 @
3472f1a2
...
...
@@ -199,8 +199,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
);
...
...
@@ -212,10 +212,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
))
{
...
...
@@ -225,18 +225,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
))
{
...
...
@@ -246,7 +246,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
))
{
...
...
@@ -256,7 +256,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
();
...
...
@@ -265,8 +265,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
();
...
...
@@ -276,9 +276,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
();
...
...
@@ -287,11 +287,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
();
...
...
@@ -300,8 +300,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
();
...
...
@@ -311,7 +311,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
();
...
...
@@ -320,7 +320,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
();
...
...
@@ -329,9 +329,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
();
...
...
@@ -341,11 +341,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
();
...
...
@@ -354,8 +354,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
();
...
...
@@ -364,42 +364,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
;
...
...
@@ -410,7 +410,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
;
...
...
@@ -428,13 +428,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
;
}
...
...
@@ -550,21 +550,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
;
...
...
@@ -649,21 +649,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
();
...
...
@@ -676,7 +676,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
();
...
...
@@ -685,7 +685,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
();
...
...
@@ -695,7 +695,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
))
{
...
...
@@ -731,18 +731,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 @
3472f1a2
...
...
@@ -87,7 +87,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
);
...
...
@@ -110,7 +110,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
);
}
}
...
...
@@ -122,7 +122,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
);
...
...
@@ -167,7 +167,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
);
...
...
@@ -288,12 +288,12 @@ void TagDuel::StartDuel(DuelPlayer* dp) {
}
unsigned
char
deckbuff
[
12
];
auto
pbuf
=
deckbuff
;
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
pdeck
[
2
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
0
].
side
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
main
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
extra
.
size
());
BufferIO
::
WriteInt16
(
pbuf
,
(
short
)
pdeck
[
2
].
side
.
size
());
NetServer
::
SendBufferToPlayer
(
players
[
0
],
STOC_DECK_COUNT
,
deckbuff
,
12
);
NetServer
::
ReSendToPlayer
(
players
[
1
]);
char
tempbuff
[
6
];
...
...
@@ -565,8 +565,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
:
...
...
@@ -604,8 +604,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
]);
...
...
@@ -616,10 +616,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
);
...
...
@@ -632,18 +632,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
);
...
...
@@ -656,22 +656,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
);
...
...
@@ -679,17 +679,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
);
...
...
@@ -697,27 +697,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
);
...
...
@@ -725,8 +725,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
);
...
...
@@ -734,23 +734,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
);
...
...
@@ -758,27 +758,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
]);
...
...
@@ -789,8 +789,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
]);
...
...
@@ -801,8 +801,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
);
...
...
@@ -818,7 +818,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
]);
...
...
@@ -828,8 +828,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_HAND
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
(
pbuf
-
offset
)
+
count
*
4
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
BufferIO
::
WriteInt32
(
pbuf
,
0
);
...
...
@@ -842,8 +842,8 @@ int TagDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
break
;
}
case
MSG_SHUFFLE_EXTRA
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
(
pbuf
-
offset
)
+
count
*
4
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
BufferIO
::
WriteInt32
(
pbuf
,
0
);
...
...
@@ -866,7 +866,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
]);
...
...
@@ -896,8 +896,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
]);
...
...
@@ -1195,14 +1195,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
]);
...
...
@@ -1213,7 +1213,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
]);
...
...
@@ -1224,8 +1224,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
);
...
...
@@ -1400,8 +1400,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
]);
...
...
@@ -1412,8 +1412,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
]);
...
...
@@ -1424,7 +1424,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
;
...
...
@@ -1440,14 +1440,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
);
...
...
@@ -1455,7 +1455,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
);
...
...
@@ -1483,11 +1483,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 @
3472f1a2
...
...
@@ -255,7 +255,7 @@ workspace "YGOPro"
filter
{
"configurations:Release"
,
"action:vs*"
}
flags
{
"LinkTimeOptimization"
}
staticruntime
"On"
disablewarnings
{
"4244"
,
"4267"
,
"4838"
,
"4577"
,
"4
819"
,
"4018"
,
"4996"
,
"4477"
,
"4091"
,
"4828
"
,
"4800"
,
"6011"
,
"6031"
,
"6054"
,
"6262"
}
disablewarnings
{
"4244"
,
"4267"
,
"4838"
,
"4577"
,
"4
018"
,
"4996"
,
"4477"
,
"4091
"
,
"4800"
,
"6011"
,
"6031"
,
"6054"
,
"6262"
}
filter
{
"configurations:Release"
,
"not action:vs*"
}
symbols
"On"
...
...
@@ -265,7 +265,7 @@ workspace "YGOPro"
end
filter
{
"configurations:Debug"
,
"action:vs*"
}
disablewarnings
{
"
4819"
,
"4828"
,
"
6011"
,
"6031"
,
"6054"
,
"6262"
}
disablewarnings
{
"6011"
,
"6031"
,
"6054"
,
"6262"
}
filter
"action:vs*"
vectorextensions
"SSE2"
...
...
strings.conf
View file @
3472f1a2
...
...
@@ -665,6 +665,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
次世代 ジェネクス
...
...
@@ -1220,3 +1222,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