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
Commits
8b622643
Commit
8b622643
authored
Jan 12, 2025
by
Chen Bill
Committed by
GitHub
Jan 12, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use uint8_t in network.h (#2646)
parent
18a801c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
gframe/network.h
gframe/network.h
+21
-21
No files found.
gframe/network.h
View file @
8b622643
...
...
@@ -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
);
...
...
@@ -62,13 +62,13 @@ struct CTOS_DeckData {
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"
);
...
...
@@ -98,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
{};
...
...
@@ -114,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"
);
...
...
@@ -134,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
{};
...
...
@@ -166,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
);
...
...
@@ -175,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"
);
...
...
@@ -189,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
{};
};
...
...
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