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
MobiusMei
ygopro
Commits
7f727569
Commit
7f727569
authored
Oct 04, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into server
parents
bb4a7207
1111ae48
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+6
-0
gframe/duelclient.h
gframe/duelclient.h
+9
-0
script
script
+1
-1
No files found.
gframe/duelclient.cpp
View file @
7f727569
...
...
@@ -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 @
7f727569
...
...
@@ -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
);
}
...
...
script
@
38c7e077
Subproject commit
f6d075baab757900f16210b77e47149319c4fc4e
Subproject commit
38c7e0776bcef0da934b1686cefec2692bcf4d66
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