Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
bfda4280
Commit
bfda4280
authored
Jan 10, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network
parent
45a04f5f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
15 deletions
+39
-15
gframe/netserver.cpp
gframe/netserver.cpp
+11
-1
gframe/netserver.h
gframe/netserver.h
+3
-0
gframe/network.h
gframe/network.h
+25
-14
No files found.
gframe/netserver.cpp
View file @
bfda4280
...
...
@@ -119,7 +119,17 @@ void NetServer::HandleCTOSPacket(DuelPlayer& dp, char* data, unsigned int len) {
}
case
CTOS_EXIT_GAME
:
break
;
case
CTOS_HS_COMMAND
:
case
CTOS_HS_TODUELIST
:
break
;
case
CTOS_HS_TOOBSERVER
:
break
;
case
CTOS_HS_READY
:
break
;
case
CTOS_HS_KICK1
:
break
;
case
CTOS_HS_KICK2
:
break
;
case
CTOS_HS_START
:
break
;
}
}
...
...
gframe/netserver.h
View file @
bfda4280
...
...
@@ -8,6 +8,8 @@
#include <event2/buffer.h>
#include <event2/thread.h>
#include "network.h"
#include "data_manager.h"
#include "deck_manager.h"
#include <array>
#include <set>
#include <unordered_map>
...
...
@@ -59,6 +61,7 @@ public:
public:
DuelPlayer
*
players
[
6
];
bool
ready
[
6
];
Deck
pdeck
[
6
];
std
::
set
<
DuelPlayer
*>
observers
;
DuelPlayer
*
host_player
;
HostInfo
host_info
;
...
...
gframe/network.h
View file @
bfda4280
...
...
@@ -45,19 +45,28 @@ struct CTOS_CreateGame {
struct
CTOS_JoinGame
{
unsigned
int
gameid
;
};
struct
CTOS_ExitGame
{
};
struct
CTOS_HS_Command
{
unsigned
char
cmd
;
};
struct
STOC_CreateGame
{
unsigned
int
gameid
;
};
struct
STOC_JoinGame
{
HostInfo
info
;
bool
is_host
;
};
struct
STOC_ExitGame
{
};
struct
STOC_HS_PlayerEnter
{
unsigned
short
name
[
20
];
};
struct
STOC_HS_PlayerChange
{
unsigned
char
status
;
};
struct
STOC_HS_ReadyChange
{
unsigned
char
ready
;
};
struct
STOC_HS_WatchChange
{
unsigned
short
watch_count
;
};
class
NetManager
{
public:
...
...
@@ -138,18 +147,20 @@ extern const unsigned short PROTO_VERSION;
#define CTOS_CREATE_GAME 0x11
#define CTOS_JOIN_GAME 0x12
#define CTOS_EXIT_GAME 0x13
#define CTOS_HS_COMMAND 0x14
#define HS_COMMAND_TODUELIST 0x1
#define HS_COMMAND_TOOBSERVER 0x2
#define HS_COMMAND_READY 0x3
#define HS_COMMAND_KICK1 0x4
#define HS_COMMAND_KICK2 0x5
#define HS_COMMAND_START 0x6
#define CTOS_HS_TODUELIST 0x20
#define CTOS_HS_TOOBSERVER 0x21
#define CTOS_HS_READY 0x22
#define CTOS_HS_KICK1 0x23
#define CTOS_HS_KICK2 0x24
#define CTOS_HS_START 0x25
#define STOC_CREATE_GAME 0x11
#define STOC_J
IO
N_GAME 0x12
#define STOC_J
OI
N_GAME 0x12
#define STOC_EXIT_GAME 0x13
#define STOC_
#define STOC_HS_PLAYER_ENTER 0x20
#define STOC_HS_PLAYER_CHANGE 0x21
#define STOC_HS_READY_CHANGE 0x22
#define STOC_HS_WATCH_CHANGE 0x23
#define MODE_SINGLE 0x1
#define MODE_MATCH 0x2
...
...
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