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
29dd8186
Commit
29dd8186
authored
Oct 02, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add debug param for message
parent
22c0da77
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+6
-0
gframe/duelclient.h
gframe/duelclient.h
+9
-0
gframe/premake4.lua
gframe/premake4.lua
+3
-0
No files found.
gframe/duelclient.cpp
View file @
29dd8186
...
...
@@ -253,6 +253,9 @@ int DuelClient::ClientThread() {
void
DuelClient
::
HandleSTOCPacketLan
(
char
*
data
,
unsigned
int
len
)
{
char
*
pdata
=
data
;
unsigned
char
pktType
=
BufferIO
::
ReadUInt8
(
pdata
);
#ifdef YGOPRO_MESSAGE_DEBUG
printf
(
"STOC: %d Length: %d
\n
"
,
pktType
,
len
);
#endif
switch
(
pktType
)
{
case
STOC_GAME_MSG
:
{
ClientAnalyze
(
pdata
,
len
-
1
);
...
...
@@ -960,6 +963,9 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
char
*
pbuf
=
msg
;
wchar_t
textBuffer
[
256
];
mainGame
->
dInfo
.
curMsg
=
BufferIO
::
ReadUInt8
(
pbuf
);
#ifdef YGOPRO_MESSAGE_DEBUG
printf
(
"MSG: %d Length: %d
\n
"
,
mainGame
->
dInfo
.
curMsg
,
len
);
#endif
if
(
mainGame
->
dInfo
.
curMsg
!=
MSG_RETRY
)
{
memcpy
(
last_successful_msg
,
msg
,
len
);
last_successful_msg_length
=
len
;
...
...
gframe/duelclient.h
View file @
29dd8186
...
...
@@ -59,6 +59,9 @@ public:
char
*
p
=
duel_client_write
;
BufferIO
::
WriteInt16
(
p
,
1
);
BufferIO
::
WriteInt8
(
p
,
proto
);
#ifdef YGOPRO_MESSAGE_DEBUG
printf
(
"CTOS: %d
\n
"
,
proto
);
#endif
bufferevent_write
(
client_bev
,
duel_client_write
,
3
);
}
template
<
typename
ST
>
...
...
@@ -67,6 +70,9 @@ public:
BufferIO
::
WriteInt16
(
p
,
1
+
sizeof
(
ST
));
BufferIO
::
WriteInt8
(
p
,
proto
);
memcpy
(
p
,
&
st
,
sizeof
(
ST
));
#ifdef YGOPRO_MESSAGE_DEBUG
printf
(
"CTOS: %d Length: %d
\n
"
,
proto
,
sizeof
(
ST
));
#endif
bufferevent_write
(
client_bev
,
duel_client_write
,
sizeof
(
ST
)
+
3
);
}
static
void
SendBufferToServer
(
unsigned
char
proto
,
void
*
buffer
,
size_t
len
)
{
...
...
@@ -74,6 +80,9 @@ public:
BufferIO
::
WriteInt16
(
p
,
1
+
len
);
BufferIO
::
WriteInt8
(
p
,
proto
);
memcpy
(
p
,
buffer
,
len
);
#ifdef YGOPRO_MESSAGE_DEBUG
printf
(
"CTOS: %d Length: %d
\n
"
,
proto
,
len
);
#endif
bufferevent_write
(
client_bev
,
duel_client_write
,
len
+
3
);
}
...
...
gframe/premake4.lua
View file @
29dd8186
...
...
@@ -19,6 +19,9 @@ project "ygopro"
if
os.getenv
(
"YGOPRO_COMPAT_MYCARD"
)
then
defines
{
"YGOPRO_COMPAT_MYCARD"
}
end
if
os.getenv
(
"YGOPRO_MESSAGE_DEBUG"
)
then
defines
{
"YGOPRO_MESSAGE_DEBUG"
}
end
local
mr
=
os.getenv
(
"YGOPRO_DEFAULT_DUEL_RULE"
)
if
mr
and
tonumber
(
mr
)
then
defines
{
"DEFAULT_DUEL_RULE="
..
tonumber
(
mr
)
}
end
...
...
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