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
YGOPRO-520DIY
ygopro
Commits
4ef45c84
Commit
4ef45c84
authored
Dec 14, 2024
by
salix5
Committed by
GitHub
Dec 14, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update DuelClient (#2634)
parent
ced64065
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
gframe/duelclient.cpp
gframe/duelclient.cpp
+5
-5
gframe/duelclient.h
gframe/duelclient.h
+4
-4
No files found.
gframe/duelclient.cpp
View file @
4ef45c84
...
@@ -14,7 +14,7 @@ namespace ygo {
...
@@ -14,7 +14,7 @@ namespace ygo {
unsigned
DuelClient
::
connect_state
=
0
;
unsigned
DuelClient
::
connect_state
=
0
;
unsigned
char
DuelClient
::
response_buf
[
SIZE_RETURN_VALUE
];
unsigned
char
DuelClient
::
response_buf
[
SIZE_RETURN_VALUE
];
unsigned
in
t
DuelClient
::
response_len
=
0
;
size_
t
DuelClient
::
response_len
=
0
;
unsigned
int
DuelClient
::
watching
=
0
;
unsigned
int
DuelClient
::
watching
=
0
;
unsigned
char
DuelClient
::
selftype
=
0
;
unsigned
char
DuelClient
::
selftype
=
0
;
bool
DuelClient
::
is_host
=
false
;
bool
DuelClient
::
is_host
=
false
;
...
@@ -27,7 +27,7 @@ int DuelClient::select_hint = 0;
...
@@ -27,7 +27,7 @@ int DuelClient::select_hint = 0;
int
DuelClient
::
select_unselect_hint
=
0
;
int
DuelClient
::
select_unselect_hint
=
0
;
int
DuelClient
::
last_select_hint
=
0
;
int
DuelClient
::
last_select_hint
=
0
;
unsigned
char
DuelClient
::
last_successful_msg
[
0x2000
];
unsigned
char
DuelClient
::
last_successful_msg
[
0x2000
];
unsigned
in
t
DuelClient
::
last_successful_msg_length
=
0
;
size_
t
DuelClient
::
last_successful_msg_length
=
0
;
wchar_t
DuelClient
::
event_string
[
256
];
wchar_t
DuelClient
::
event_string
[
256
];
mt19937
DuelClient
::
rnd
;
mt19937
DuelClient
::
rnd
;
...
@@ -4000,11 +4000,11 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
...
@@ -4000,11 +4000,11 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
void
DuelClient
::
SwapField
()
{
void
DuelClient
::
SwapField
()
{
is_swapping
=
true
;
is_swapping
=
true
;
}
}
void
DuelClient
::
SetResponseI
(
int
respI
)
{
void
DuelClient
::
SetResponseI
(
int
32_t
respI
)
{
std
::
memcpy
(
response_buf
,
&
respI
,
sizeof
respI
);
std
::
memcpy
(
response_buf
,
&
respI
,
sizeof
respI
);
response_len
=
4
;
response_len
=
sizeof
respI
;
}
}
void
DuelClient
::
SetResponseB
(
void
*
respB
,
unsigned
in
t
len
)
{
void
DuelClient
::
SetResponseB
(
void
*
respB
,
size_
t
len
)
{
if
(
len
>
SIZE_RETURN_VALUE
)
if
(
len
>
SIZE_RETURN_VALUE
)
len
=
SIZE_RETURN_VALUE
;
len
=
SIZE_RETURN_VALUE
;
std
::
memcpy
(
response_buf
,
respB
,
len
);
std
::
memcpy
(
response_buf
,
respB
,
len
);
...
...
gframe/duelclient.h
View file @
4ef45c84
...
@@ -16,7 +16,7 @@ class DuelClient {
...
@@ -16,7 +16,7 @@ class DuelClient {
private:
private:
static
unsigned
int
connect_state
;
static
unsigned
int
connect_state
;
static
unsigned
char
response_buf
[
SIZE_RETURN_VALUE
];
static
unsigned
char
response_buf
[
SIZE_RETURN_VALUE
];
static
unsigned
in
t
response_len
;
static
size_
t
response_len
;
static
unsigned
int
watching
;
static
unsigned
int
watching
;
static
bool
is_host
;
static
bool
is_host
;
static
event_base
*
client_base
;
static
event_base
*
client_base
;
...
@@ -28,7 +28,7 @@ private:
...
@@ -28,7 +28,7 @@ private:
static
int
select_unselect_hint
;
static
int
select_unselect_hint
;
static
int
last_select_hint
;
static
int
last_select_hint
;
static
unsigned
char
last_successful_msg
[
0x2000
];
static
unsigned
char
last_successful_msg
[
0x2000
];
static
unsigned
in
t
last_successful_msg_length
;
static
size_
t
last_successful_msg_length
;
static
wchar_t
event_string
[
256
];
static
wchar_t
event_string
[
256
];
static
mt19937
rnd
;
static
mt19937
rnd
;
static
bool
is_refreshing
;
static
bool
is_refreshing
;
...
@@ -47,8 +47,8 @@ public:
...
@@ -47,8 +47,8 @@ public:
static
void
HandleSTOCPacketLan
(
unsigned
char
*
data
,
int
len
);
static
void
HandleSTOCPacketLan
(
unsigned
char
*
data
,
int
len
);
static
int
ClientAnalyze
(
unsigned
char
*
msg
,
unsigned
int
len
);
static
int
ClientAnalyze
(
unsigned
char
*
msg
,
unsigned
int
len
);
static
void
SwapField
();
static
void
SwapField
();
static
void
SetResponseI
(
int
respI
);
static
void
SetResponseI
(
int
32_t
respI
);
static
void
SetResponseB
(
void
*
respB
,
unsigned
in
t
len
);
static
void
SetResponseB
(
void
*
respB
,
size_
t
len
);
static
void
SendResponse
();
static
void
SendResponse
();
static
void
SendPacketToServer
(
unsigned
char
proto
)
{
static
void
SendPacketToServer
(
unsigned
char
proto
)
{
auto
p
=
duel_client_write
;
auto
p
=
duel_client_write
;
...
...
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