Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaoye
ygopro
Commits
7b1921aa
Commit
7b1921aa
authored
Jan 13, 2025
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into server-develop
parents
09035c3e
8b622643
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
82 additions
and
90 deletions
+82
-90
gframe/data_manager.cpp
gframe/data_manager.cpp
+6
-9
gframe/data_manager.h
gframe/data_manager.h
+1
-1
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+8
-10
gframe/duelclient.cpp
gframe/duelclient.cpp
+2
-2
gframe/duelclient.h
gframe/duelclient.h
+2
-2
gframe/game.cpp
gframe/game.cpp
+3
-3
gframe/game.h
gframe/game.h
+0
-13
gframe/netserver.cpp
gframe/netserver.cpp
+3
-1
gframe/network.h
gframe/network.h
+42
-22
gframe/single_duel.cpp
gframe/single_duel.cpp
+8
-14
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+7
-13
No files found.
gframe/data_manager.cpp
View file @
7b1921aa
...
...
@@ -8,9 +8,9 @@
namespace
ygo
{
const
wchar_t
*
DataManager
::
unknown_string
=
L"???"
;
unsigned
char
DataManager
::
scriptBuffer
[
0x
20000
]
;
unsigned
char
DataManager
::
scriptBuffer
[
0x
100000
]
=
{}
;
#if !defined(YGOPRO_SERVER_MODE) || defined(SERVER_ZIP_SUPPORT)
IFileSystem
*
DataManager
::
FileSystem
;
IFileSystem
*
DataManager
::
FileSystem
=
nullptr
;
#endif
DataManager
dataManager
;
...
...
@@ -467,14 +467,11 @@ unsigned char* DataManager::ScriptReader(const char* script_name, int* slen) {
#endif
if
(
!
reader
)
return
nullptr
;
size_t
size
=
reader
->
getSize
();
if
(
size
>
sizeof
scriptBuffer
)
{
reader
->
drop
();
return
nullptr
;
}
reader
->
read
(
scriptBuffer
,
size
);
int
size
=
reader
->
read
(
scriptBuffer
,
sizeof
scriptBuffer
);
reader
->
drop
();
*
slen
=
(
int
)
size
;
if
(
size
>=
(
int
)
sizeof
scriptBuffer
)
return
nullptr
;
*
slen
=
size
;
#endif //YGOPRO_SERVER_MODE
return
scriptBuffer
;
}
...
...
gframe/data_manager.h
View file @
7b1921aa
...
...
@@ -52,7 +52,7 @@ public:
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_sysStrings
;
char
errmsg
[
512
]{};
static
unsigned
char
scriptBuffer
[
0x
2
0000
];
static
unsigned
char
scriptBuffer
[
0x
10
0000
];
static
const
wchar_t
*
unknown_string
;
static
uint32_t
CardReader
(
uint32_t
,
card_data
*
);
static
unsigned
char
*
ScriptReaderEx
(
const
char
*
script_name
,
int
*
slen
);
...
...
gframe/deck_manager.cpp
View file @
7b1921aa
...
...
@@ -278,11 +278,11 @@ FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) {
}
IReadFile
*
DeckManager
::
OpenDeckReader
(
const
wchar_t
*
file
)
{
#ifdef _WIN32
IReadFile
*
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
file
);
IReadFile
*
reader
=
DataManager
::
FileSystem
->
createAndOpenFile
(
file
);
#else
char
file2
[
256
];
BufferIO
::
EncodeUTF8
(
file
,
file2
);
IReadFile
*
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
file2
);
IReadFile
*
reader
=
DataManager
::
FileSystem
->
createAndOpenFile
(
file2
);
#endif
return
reader
;
}
...
...
@@ -290,25 +290,23 @@ bool DeckManager::LoadCurrentDeck(const wchar_t* file, bool is_packlist) {
current_deck
.
clear
();
IReadFile
*
reader
=
OpenDeckReader
(
file
);
if
(
!
reader
)
{
wchar_t
localfile
[
64
];
wchar_t
localfile
[
256
];
myswprintf
(
localfile
,
L"./deck/%ls.ydk"
,
file
);
reader
=
OpenDeckReader
(
localfile
);
}
if
(
!
reader
&&
!
mywcsncasecmp
(
file
,
L"./pack"
,
6
))
{
wchar_t
zipfile
[
64
];
wchar_t
zipfile
[
256
];
myswprintf
(
zipfile
,
L"%ls"
,
file
+
2
);
reader
=
OpenDeckReader
(
zipfile
);
}
if
(
!
reader
)
return
false
;
auto
size
=
reader
->
getSize
();
if
(
size
>=
(
int
)
sizeof
deckBuffer
)
{
reader
->
drop
();
return
false
;
}
std
::
memset
(
deckBuffer
,
0
,
sizeof
deckBuffer
);
reader
->
read
(
deckBuffer
,
size
);
int
size
=
reader
->
read
(
deckBuffer
,
sizeof
deckBuffer
);
reader
->
drop
();
if
(
size
>=
(
int
)
sizeof
deckBuffer
)
{
return
false
;
}
std
::
istringstream
deckStream
(
deckBuffer
);
LoadDeck
(
current_deck
,
deckStream
,
is_packlist
);
return
true
;
// the above LoadDeck has return value but we ignore it here for now
...
...
gframe/duelclient.cpp
View file @
7b1921aa
...
...
@@ -26,7 +26,7 @@ bool DuelClient::is_swapping = false;
int
DuelClient
::
select_hint
=
0
;
int
DuelClient
::
select_unselect_hint
=
0
;
int
DuelClient
::
last_select_hint
=
0
;
unsigned
char
DuelClient
::
last_successful_msg
[
0x2000
];
unsigned
char
DuelClient
::
last_successful_msg
[
SIZE_NETWORK_BUFFER
];
size_t
DuelClient
::
last_successful_msg_length
=
0
;
wchar_t
DuelClient
::
event_string
[
256
];
mt19937
DuelClient
::
rnd
;
...
...
@@ -936,7 +936,7 @@ void DuelClient::HandleSTOCPacketLan(unsigned char* data, int len) {
}
}
// Analyze STOC_GAME_MSG packet
int
DuelClient
::
ClientAnalyze
(
unsigned
char
*
msg
,
unsigned
int
len
)
{
bool
DuelClient
::
ClientAnalyze
(
unsigned
char
*
msg
,
int
len
)
{
unsigned
char
*
pbuf
=
msg
;
wchar_t
textBuffer
[
256
];
mainGame
->
dInfo
.
curMsg
=
BufferIO
::
ReadUInt8
(
pbuf
);
...
...
gframe/duelclient.h
View file @
7b1921aa
...
...
@@ -23,7 +23,7 @@ private:
static
int
select_hint
;
static
int
select_unselect_hint
;
static
int
last_select_hint
;
static
unsigned
char
last_successful_msg
[
0x2000
];
static
unsigned
char
last_successful_msg
[
SIZE_NETWORK_BUFFER
];
static
size_t
last_successful_msg_length
;
static
wchar_t
event_string
[
256
];
static
mt19937
rnd
;
...
...
@@ -41,7 +41,7 @@ public:
static
void
ClientEvent
(
bufferevent
*
bev
,
short
events
,
void
*
ctx
);
static
int
ClientThread
();
static
void
HandleSTOCPacketLan
(
unsigned
char
*
data
,
int
len
);
static
int
ClientAnalyze
(
unsigned
char
*
msg
,
unsigned
int
len
);
static
bool
ClientAnalyze
(
unsigned
char
*
msg
,
int
len
);
static
void
SwapField
();
static
void
SetResponseI
(
int32_t
respI
);
static
void
SetResponseB
(
void
*
respB
,
size_t
len
);
...
...
gframe/game.cpp
View file @
7b1921aa
...
...
@@ -145,7 +145,7 @@ bool Game::Initialize() {
ErrorLog
(
"Failed to load textures!"
);
return
false
;
}
dataManager
.
FileSystem
=
device
->
getFileSystem
();
DataManager
::
FileSystem
=
device
->
getFileSystem
();
if
(
!
dataManager
.
LoadDB
(
L"cards.cdb"
))
{
ErrorLog
(
"Failed to load card database (cards.cdb)!"
);
return
false
;
...
...
@@ -1241,11 +1241,11 @@ void Game::LoadExpansions() {
#if defined(SERVER_ZIP_SUPPORT) || !defined(YGOPRO_SERVER_MODE)
if
(
!
isdir
&&
(
IsExtension
(
name
,
L".zip"
)
||
IsExtension
(
name
,
L".ypk"
)))
{
#ifdef _WIN32
dataManager
.
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
,
EFAT_ZIP
);
DataManager
::
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
,
EFAT_ZIP
);
#else
char
upath
[
1024
];
BufferIO
::
EncodeUTF8
(
fpath
,
upath
);
dataManager
.
FileSystem
->
addFileArchive
(
upath
,
true
,
false
,
EFAT_ZIP
);
DataManager
::
FileSystem
->
addFileArchive
(
upath
,
true
,
false
,
EFAT_ZIP
);
#endif
return
;
}
...
...
gframe/game.h
View file @
7b1921aa
...
...
@@ -858,19 +858,6 @@ extern unsigned int pre_seed[3];
#define BUTTON_BIG_CARD_ZOOM_OUT 382
#define BUTTON_BIG_CARD_ORIG_SIZE 383
//STOC_GAME_MSG messages
#define MSG_WAITING 3
#define MSG_START 4
#define MSG_UPDATE_DATA 6 // flag=0: clear
#define MSG_UPDATE_CARD 7 // flag=QUERY_CODE, code=0: clear
#define MSG_REQUEST_DECK 8
#define MSG_REFRESH_DECK 34
#define MSG_CARD_SELECTED 80
#define MSG_UNEQUIP 95
#define MSG_BE_CHAIN_TARGET 121
#define MSG_CREATE_RELATION 122
#define MSG_RELEASE_RELATION 123
#define AVAIL_OCG 0x1
#define AVAIL_TCG 0x2
#define AVAIL_CUSTOM 0x4
...
...
gframe/netserver.cpp
View file @
7b1921aa
...
...
@@ -301,7 +301,9 @@ void NetServer::HandleCTOSPacket(DuelPlayer* dp, unsigned char* data, int len) {
case
CTOS_UPDATE_DECK
:
{
if
(
!
dp
->
game
)
return
;
if
(
len
<
1
+
(
int
)
sizeof
(
unsigned
char
))
if
(
len
<
1
+
(
int
)
sizeof
(
int32_t
)
+
(
int
)
sizeof
(
int32_t
))
return
;
if
(
len
>
1
+
(
int
)
sizeof
(
CTOS_DeckData
))
return
;
duel_mode
->
UpdateDeck
(
dp
,
pdata
,
len
-
1
);
break
;
...
...
gframe/network.h
View file @
7b1921aa
...
...
@@ -20,16 +20,16 @@ namespace ygo {
struct
HostInfo
{
uint32_t
lflist
{};
u
nsigned
char
rule
{};
u
nsigned
char
mode
{};
u
nsigned
char
duel_rule
{};
u
nsigned
char
no_check_deck
{};
u
nsigned
char
no_shuffle_deck
{};
u
int8_t
rule
{};
u
int8_t
mode
{};
u
int8_t
duel_rule
{};
u
int8_t
no_check_deck
{};
u
int8_t
no_shuffle_deck
{};
// byte padding[3]
uint32_t
start_lp
{};
u
nsigned
char
start_hand
{};
u
nsigned
char
draw_count
{};
u
int8_t
start_hand
{};
u
int8_t
draw_count
{};
uint16_t
time_limit
{};
};
check_trivially_copyable
(
HostInfo
);
...
...
@@ -54,14 +54,21 @@ struct HostRequest {
check_trivially_copyable
(
HostRequest
);
static_assert
(
sizeof
(
HostRequest
)
==
2
,
"size mismatch: HostRequest"
);
struct
CTOS_DeckData
{
int32_t
mainc
{};
int32_t
sidec
{};
int32_t
list
[
MAINC_MAX
+
SIDEC_MAX
]{};
};
check_trivially_copyable
(
CTOS_DeckData
);
struct
CTOS_HandResult
{
u
nsigned
char
res
{};
u
int8_t
res
{};
};
check_trivially_copyable
(
CTOS_HandResult
);
static_assert
(
sizeof
(
CTOS_HandResult
)
==
1
,
"size mismatch: CTOS_HandResult"
);
struct
CTOS_TPResult
{
u
nsigned
char
res
{};
u
int8_t
res
{};
};
check_trivially_copyable
(
CTOS_TPResult
);
static_assert
(
sizeof
(
CTOS_TPResult
)
==
1
,
"size mismatch: CTOS_TPResult"
);
...
...
@@ -91,14 +98,14 @@ check_trivially_copyable(CTOS_JoinGame);
static_assert
(
sizeof
(
CTOS_JoinGame
)
==
48
,
"size mismatch: CTOS_JoinGame"
);
struct
CTOS_Kick
{
u
nsigned
char
pos
{};
u
int8_t
pos
{};
};
check_trivially_copyable
(
CTOS_Kick
);
static_assert
(
sizeof
(
CTOS_Kick
)
==
1
,
"size mismatch: CTOS_Kick"
);
// STOC
struct
STOC_ErrorMsg
{
u
nsigned
char
msg
{};
u
int8_t
msg
{};
// byte padding[3]
uint32_t
code
{};
...
...
@@ -107,8 +114,8 @@ check_trivially_copyable(STOC_ErrorMsg);
static_assert
(
sizeof
(
STOC_ErrorMsg
)
==
8
,
"size mismatch: STOC_ErrorMsg"
);
struct
STOC_HandResult
{
u
nsigned
char
res1
{};
u
nsigned
char
res2
{};
u
int8_t
res1
{};
u
int8_t
res2
{};
};
check_trivially_copyable
(
STOC_HandResult
);
static_assert
(
sizeof
(
STOC_HandResult
)
==
2
,
"size mismatch: STOC_HandResult"
);
...
...
@@ -127,20 +134,20 @@ check_trivially_copyable(STOC_JoinGame);
static_assert
(
sizeof
(
STOC_JoinGame
)
==
20
,
"size mismatch: STOC_JoinGame"
);
struct
STOC_TypeChange
{
u
nsigned
char
type
{};
u
int8_t
type
{};
};
check_trivially_copyable
(
STOC_TypeChange
);
static_assert
(
sizeof
(
STOC_TypeChange
)
==
1
,
"size mismatch: STOC_TypeChange"
);
// reserved for STOC_LEAVE_GAME
struct
STOC_ExitGame
{
u
nsigned
char
pos
{};
u
int8_t
pos
{};
};
check_trivially_copyable
(
STOC_ExitGame
);
static_assert
(
sizeof
(
STOC_ExitGame
)
==
1
,
"size mismatch: STOC_ExitGame"
);
struct
STOC_TimeLimit
{
u
nsigned
char
player
{};
u
int8_t
player
{};
// byte padding[1]
uint16_t
left_time
{};
...
...
@@ -159,7 +166,7 @@ constexpr int SIZE_STOC_CHAT = (LEN_CHAT_PLAYER + LEN_CHAT_MSG) * sizeof(uint16_
struct
STOC_HS_PlayerEnter
{
uint16_t
name
[
20
]{};
u
nsigned
char
pos
{};
u
int8_t
pos
{};
// byte padding[1]
};
check_trivially_copyable
(
STOC_HS_PlayerEnter
);
...
...
@@ -168,7 +175,7 @@ constexpr int STOC_HS_PlayerEnter_size = 41; //workwround
struct
STOC_HS_PlayerChange
{
//pos<<4 | state
u
nsigned
char
status
{};
u
int8_t
status
{};
};
check_trivially_copyable
(
STOC_HS_PlayerChange
);
static_assert
(
sizeof
(
STOC_HS_PlayerChange
)
==
1
,
"size mismatch: STOC_HS_PlayerChange"
);
...
...
@@ -182,10 +189,10 @@ static_assert(sizeof(STOC_HS_WatchChange) == 2, "size mismatch: STOC_HS_WatchCha
class
DuelMode
;
struct
DuelPlayer
{
u
nsigned
shor
t
name
[
20
]{};
u
int16_
t
name
[
20
]{};
DuelMode
*
game
{};
u
nsigned
char
type
{};
u
nsigned
char
state
{};
u
int8_t
type
{};
u
int8_t
state
{};
bufferevent
*
bev
{};
};
...
...
@@ -255,7 +262,7 @@ public:
#define NETPLAYER_TYPE_OBSERVER 7
#define CTOS_RESPONSE 0x1 // byte array
#define CTOS_UPDATE_DECK 0x2 //
mainc, sidec, int32_t[mainc + sidec]
#define CTOS_UPDATE_DECK 0x2 //
CTOS_DeckData
#define CTOS_HAND_RESULT 0x3 // CTOS_HandResult
#define CTOS_TP_RESULT 0x4 // CTOS_TPResult
#define CTOS_PLAYER_INFO 0x10 // CTOS_PlayerInfo
...
...
@@ -297,6 +304,19 @@ public:
#define STOC_TEAMMATE_SURRENDER 0x23 // no data
#define STOC_FIELD_FINISH 0x30
// STOC_GAME_MSG header
#define MSG_WAITING 3
#define MSG_START 4
#define MSG_UPDATE_DATA 6 // flag=0: clear
#define MSG_UPDATE_CARD 7 // flag=QUERY_CODE, code=0: clear
#define MSG_REQUEST_DECK 8
#define MSG_REFRESH_DECK 34
#define MSG_CARD_SELECTED 80
#define MSG_UNEQUIP 95
#define MSG_BE_CHAIN_TARGET 121
#define MSG_CREATE_RELATION 122
#define MSG_RELEASE_RELATION 123
#define PLAYERCHANGE_OBSERVE 0x8
#define PLAYERCHANGE_READY 0x9
#define PLAYERCHANGE_NOTREADY 0xa
...
...
gframe/single_duel.cpp
View file @
7b1921aa
...
...
@@ -392,22 +392,18 @@ void SingleDuel::PlayerKick(DuelPlayer* dp, unsigned char pos) {
void
SingleDuel
::
UpdateDeck
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
{
if
(
dp
->
type
>
1
||
ready
[
dp
->
type
])
return
;
if
(
len
<
8
)
return
;
bool
valid
=
true
;
auto
deckbuf
=
pdata
;
int
mainc
=
BufferIO
::
ReadInt32
(
deckbuf
);
int
sidec
=
BufferIO
::
ReadInt32
(
deckbuf
);
const
int
deck_size
=
len
-
2
*
sizeof
(
int32_t
);
if
(
mainc
<
0
||
mainc
>
MAINC_MAX
)
CTOS_DeckData
deckbuf
;
std
::
memcpy
(
&
deckbuf
,
pdata
,
len
);
if
(
deckbuf
.
mainc
<
0
||
deckbuf
.
mainc
>
MAINC_MAX
)
valid
=
false
;
else
if
(
sidec
<
0
||
sidec
>
SIDEC_MAX
)
else
if
(
deckbuf
.
sidec
<
0
||
deckbuf
.
sidec
>
SIDEC_MAX
)
valid
=
false
;
else
if
#ifdef YGOPRO_SERVER_MODE
(
deck_size
<
(
mainc
+
sidec
)
*
(
int
)
sizeof
(
int32_t
)
||
deck_size
>
MAINC_MAX
+
SIDEC_MAX
)
(
deck_size
<
(
deckbuf
.
mainc
+
deckbuf
.
sidec
)
*
(
int
)
sizeof
(
int32_t
)
||
deck_size
>
MAINC_MAX
+
SIDEC_MAX
)
#else
(
deck_size
!=
(
mainc
+
sidec
)
*
(
int
)
sizeof
(
int32_t
))
(
len
<
(
2
+
deckbuf
.
mainc
+
deckbuf
.
sidec
)
*
(
int
)
sizeof
(
int32_t
))
#endif
valid
=
false
;
if
(
!
valid
)
{
...
...
@@ -417,12 +413,10 @@ void SingleDuel::UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len) {
NetServer
::
SendPacketToPlayer
(
dp
,
STOC_ERROR_MSG
,
scem
);
return
;
}
int
deck_list
[
SIZE_NETWORK_BUFFER
/
sizeof
(
int32_t
)];
std
::
memcpy
(
deck_list
,
deckbuf
,
deck_size
);
if
(
duel_count
==
0
)
{
deck_error
[
dp
->
type
]
=
deckManager
.
LoadDeck
(
pdeck
[
dp
->
type
],
deck
_list
,
mainc
,
sidec
);
deck_error
[
dp
->
type
]
=
deckManager
.
LoadDeck
(
pdeck
[
dp
->
type
],
deck
buf
.
list
,
deckbuf
.
mainc
,
deckbuf
.
sidec
);
}
else
{
if
(
deckManager
.
LoadSide
(
pdeck
[
dp
->
type
],
deck
_list
,
mainc
,
sidec
))
{
if
(
deckManager
.
LoadSide
(
pdeck
[
dp
->
type
],
deck
buf
.
list
,
deckbuf
.
mainc
,
deckbuf
.
sidec
))
{
ready
[
dp
->
type
]
=
true
;
NetServer
::
SendPacketToPlayer
(
dp
,
STOC_DUEL_START
);
if
(
ready
[
0
]
&&
ready
[
1
])
{
...
...
gframe/tag_duel.cpp
View file @
7b1921aa
...
...
@@ -378,22 +378,18 @@ void TagDuel::PlayerKick(DuelPlayer* dp, unsigned char pos) {
void
TagDuel
::
UpdateDeck
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
{
if
(
dp
->
type
>
3
||
ready
[
dp
->
type
])
return
;
if
(
len
<
8
)
return
;
bool
valid
=
true
;
auto
deckbuf
=
pdata
;
int
mainc
=
BufferIO
::
ReadInt32
(
deckbuf
);
int
sidec
=
BufferIO
::
ReadInt32
(
deckbuf
);
const
int
deck_size
=
len
-
2
*
sizeof
(
int32_t
);
if
(
mainc
<
0
||
mainc
>
MAINC_MAX
)
CTOS_DeckData
deckbuf
;
std
::
memcpy
(
&
deckbuf
,
pdata
,
len
);
if
(
deckbuf
.
mainc
<
0
||
deckbuf
.
mainc
>
MAINC_MAX
)
valid
=
false
;
else
if
(
sidec
<
0
||
sidec
>
SIDEC_MAX
)
else
if
(
deckbuf
.
sidec
<
0
||
deckbuf
.
sidec
>
SIDEC_MAX
)
valid
=
false
;
else
if
#ifdef YGOPRO_SERVER_MODE
(
deck_size
<
(
mainc
+
sidec
)
*
(
int
)
sizeof
(
int32_t
)
||
deck_size
>
MAINC_MAX
+
SIDEC_MAX
)
(
deck_size
<
(
deckbuf
.
mainc
+
deckbuf
.
sidec
)
*
(
int
)
sizeof
(
int32_t
)
||
deck_size
>
MAINC_MAX
+
SIDEC_MAX
)
#else
(
deck_size
!=
(
mainc
+
sidec
)
*
(
int
)
sizeof
(
int32_t
))
(
len
<
(
2
+
deckbuf
.
mainc
+
deckbuf
.
sidec
)
*
(
int
)
sizeof
(
int32_t
))
#endif
valid
=
false
;
if
(
!
valid
)
{
...
...
@@ -403,9 +399,7 @@ void TagDuel::UpdateDeck(DuelPlayer* dp, unsigned char* pdata, int len) {
NetServer
::
SendPacketToPlayer
(
dp
,
STOC_ERROR_MSG
,
scem
);
return
;
}
int
deck_list
[
SIZE_NETWORK_BUFFER
/
sizeof
(
int32_t
)];
std
::
memcpy
(
deck_list
,
deckbuf
,
deck_size
);
deck_error
[
dp
->
type
]
=
deckManager
.
LoadDeck
(
pdeck
[
dp
->
type
],
deck_list
,
mainc
,
sidec
);
deck_error
[
dp
->
type
]
=
deckManager
.
LoadDeck
(
pdeck
[
dp
->
type
],
deckbuf
.
list
,
deckbuf
.
mainc
,
deckbuf
.
sidec
);
}
void
TagDuel
::
StartDuel
(
DuelPlayer
*
dp
)
{
if
(
dp
!=
host_player
)
...
...
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