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
7187de54
Commit
7187de54
authored
Jun 03, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check standard-layout class
parent
a8a1bac7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
41 deletions
+43
-41
gframe/network.h
gframe/network.h
+43
-41
No files found.
gframe/network.h
View file @
7187de54
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#include <event2/thread.h>
#include <event2/thread.h>
#include <type_traits>
#include <type_traits>
#define check_trivially_copyable(T) static_assert(std::is_trivially_copyable<T>::value == true, "not trivially copyable")
#define check_trivially_copyable(T) static_assert(std::is_trivially_copyable<T>::value == true
&& std::is_standard_layout<T>::value == true
, "not trivially copyable")
namespace
ygo
{
namespace
ygo
{
constexpr
int
SIZE_NETWORK_BUFFER
=
0x2000
;
constexpr
int
SIZE_NETWORK_BUFFER
=
0x2000
;
...
@@ -113,6 +113,7 @@ struct STOC_HandResult {
...
@@ -113,6 +113,7 @@ struct STOC_HandResult {
check_trivially_copyable
(
STOC_HandResult
);
check_trivially_copyable
(
STOC_HandResult
);
static_assert
(
sizeof
(
STOC_HandResult
)
==
2
,
"size mismatch: STOC_HandResult"
);
static_assert
(
sizeof
(
STOC_HandResult
)
==
2
,
"size mismatch: STOC_HandResult"
);
// reserved for STOC_CREATE_GAME
struct
STOC_CreateGame
{
struct
STOC_CreateGame
{
uint32_t
gameid
;
uint32_t
gameid
;
};
};
...
@@ -131,6 +132,7 @@ struct STOC_TypeChange {
...
@@ -131,6 +132,7 @@ struct STOC_TypeChange {
check_trivially_copyable
(
STOC_TypeChange
);
check_trivially_copyable
(
STOC_TypeChange
);
static_assert
(
sizeof
(
STOC_TypeChange
)
==
1
,
"size mismatch: STOC_TypeChange"
);
static_assert
(
sizeof
(
STOC_TypeChange
)
==
1
,
"size mismatch: STOC_TypeChange"
);
// reserved for STOC_LEAVE_GAME
struct
STOC_ExitGame
{
struct
STOC_ExitGame
{
unsigned
char
pos
;
unsigned
char
pos
;
};
};
...
@@ -250,46 +252,46 @@ public:
...
@@ -250,46 +252,46 @@ public:
#define NETPLAYER_TYPE_PLAYER6 5
#define NETPLAYER_TYPE_PLAYER6 5
#define NETPLAYER_TYPE_OBSERVER 7
#define NETPLAYER_TYPE_OBSERVER 7
#define CTOS_RESPONSE 0x1
#define CTOS_RESPONSE 0x1
// byte array
#define CTOS_UPDATE_DECK 0x2
#define CTOS_UPDATE_DECK 0x2
// int32_t array
#define CTOS_HAND_RESULT 0x3
#define CTOS_HAND_RESULT 0x3
// CTOS_HandResult
#define CTOS_TP_RESULT 0x4
#define CTOS_TP_RESULT 0x4
// CTOS_TPResult
#define CTOS_PLAYER_INFO 0x10
#define CTOS_PLAYER_INFO 0x10
// CTOS_PlayerInfo
#define CTOS_CREATE_GAME 0x11
#define CTOS_CREATE_GAME 0x11
// CTOS_CreateGame
#define CTOS_JOIN_GAME 0x12
#define CTOS_JOIN_GAME 0x12
// CTOS_JoinGame
#define CTOS_LEAVE_GAME 0x13
#define CTOS_LEAVE_GAME 0x13
// no data
#define CTOS_SURRENDER 0x14
#define CTOS_SURRENDER 0x14
// no data
#define CTOS_TIME_CONFIRM 0x15
#define CTOS_TIME_CONFIRM 0x15
// no data
#define CTOS_CHAT 0x16
#define CTOS_CHAT 0x16
// uint16_t array
#define CTOS_HS_TODUELIST 0x20
#define CTOS_HS_TODUELIST 0x20
// no data
#define CTOS_HS_TOOBSERVER 0x21
#define CTOS_HS_TOOBSERVER 0x21
// no data
#define CTOS_HS_READY 0x22
#define CTOS_HS_READY 0x22
// no data
#define CTOS_HS_NOTREADY 0x23
#define CTOS_HS_NOTREADY 0x23
// no data
#define CTOS_HS_KICK 0x24
#define CTOS_HS_KICK 0x24
// CTOS_Kick
#define CTOS_HS_START 0x25
#define CTOS_HS_START 0x25
// no data
#define STOC_GAME_MSG 0x1
#define STOC_GAME_MSG 0x1
// byte array
#define STOC_ERROR_MSG 0x2
#define STOC_ERROR_MSG 0x2
// STOC_ErrorMsg
#define STOC_SELECT_HAND 0x3
#define STOC_SELECT_HAND 0x3
// no data
#define STOC_SELECT_TP 0x4
#define STOC_SELECT_TP 0x4
// no data
#define STOC_HAND_RESULT 0x5
#define STOC_HAND_RESULT 0x5
// STOC_HandResult
#define STOC_TP_RESULT 0x6
#define STOC_TP_RESULT 0x6
// reserved
#define STOC_CHANGE_SIDE 0x7
#define STOC_CHANGE_SIDE 0x7
// no data
#define STOC_WAITING_SIDE 0x8
#define STOC_WAITING_SIDE 0x8
// no data
#define STOC_DECK_COUNT 0x9
#define STOC_DECK_COUNT 0x9
// int16_t[6]
#define STOC_CREATE_GAME 0x11
#define STOC_CREATE_GAME 0x11
// reserved
#define STOC_JOIN_GAME 0x12
#define STOC_JOIN_GAME 0x12
// STOC_JoinGame
#define STOC_TYPE_CHANGE 0x13
#define STOC_TYPE_CHANGE 0x13
// STOC_TypeChange
#define STOC_LEAVE_GAME 0x14
#define STOC_LEAVE_GAME 0x14
// reserved
#define STOC_DUEL_START 0x15
#define STOC_DUEL_START 0x15
// no data
#define STOC_DUEL_END 0x16
#define STOC_DUEL_END 0x16
// no data
#define STOC_REPLAY 0x17
#define STOC_REPLAY 0x17
// ReplayHeader + byte array
#define STOC_TIME_LIMIT 0x18
#define STOC_TIME_LIMIT 0x18
// STOC_TimeLimit
#define STOC_CHAT 0x19
#define STOC_CHAT 0x19
// uint16_t + uint16_t array
#define STOC_HS_PLAYER_ENTER 0x20
#define STOC_HS_PLAYER_ENTER 0x20
// STOC_HS_PlayerEnter
#define STOC_HS_PLAYER_CHANGE 0x21
#define STOC_HS_PLAYER_CHANGE 0x21
// STOC_HS_PlayerChange
#define STOC_HS_WATCH_CHANGE 0x22
#define STOC_HS_WATCH_CHANGE 0x22
// STOC_HS_WatchChange
#define STOC_TEAMMATE_SURRENDER 0x23
#define STOC_TEAMMATE_SURRENDER 0x23
// no data
#define PLAYERCHANGE_OBSERVE 0x8
#define PLAYERCHANGE_OBSERVE 0x8
#define PLAYERCHANGE_READY 0x9
#define PLAYERCHANGE_READY 0x9
...
...
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