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
6cb8c84a
Commit
6cb8c84a
authored
Jan 06, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recon
parent
1ed80e02
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
0 deletions
+86
-0
gframe/netserver.cpp
gframe/netserver.cpp
+2
-0
gframe/netserver.h
gframe/netserver.h
+69
-0
gframe/single_duel.h
gframe/single_duel.h
+15
-0
No files found.
gframe/netserver.cpp
0 → 100644
View file @
6cb8c84a
#include "netserver.h"
gframe/netserver.h
0 → 100644
View file @
6cb8c84a
#ifndef NETSERVER_H
#define NETSERVER_H
#include "config.h"
#include <event2/event.h>
#include <unordered_map>
#define NETPLAYER_TYPE_PLAYER1 0
#define NETPLAYER_TYPE_PLAYER2 1
#define NETPLAYER_TYPE_PLAYER3 2
#define NETPLAYER_TYPE_PLAYER4 3
#define NETPLAYER_TYPE_PLAYER5 4
#define NETPLAYER_TYPE_PLAYER6 5
#define NETPLAYER_TYPE_OBSERVER 7
namespace
ygo
{
class
DuelMode
;
struct
DuelPlayer
{
DuelMode
*
game
;
unsigned
char
type
;
unsigned
char
state
;
unsigned
char
pos
;
unsigned
int
uid
;
DuelPlayer
()
{
uid
=
0
;
pos
=
0
;
game
=
0
;
type
=
0
;
state
=
0
;
}
};
class
DuelMode
{
private:
std
::
array
<
DuelPlayer
*
,
6
>
players
;
std
::
vector
<
DuelPlayer
*>
observers
;
bool
ready
[
6
];
unsigned
int
host_uid
;
unsigned
long
pduel
;
public:
DuelMode
()
{
for
(
int
i
=
0
;
i
<
6
;
++
i
){
players
[
i
]
=
0
;
ready
[
i
]
=
false
;
}
for
(
int
i
=
0
;
i
<
8
;
++
i
)
observers
[
i
]
=
0
;
host_uid
=
0
;
pduel
=
0
;
}
void
Start
();
void
Process
();
void
End
();
};
class
NetServer
{
private:
static
std
::
unordered_map
<
int
,
DuelPlayer
>
users
;
static
bool
server_started
;
static
unsigned
int
uid
;
public:
static
bool
StartServer
(
unsigned
short
port
);
};
}
#endif //NETSERVER_H
gframe/single_duel.h
0 → 100644
View file @
6cb8c84a
#ifndef SINGLE_DUEL_H
#define SINGLE_DUEL_H
#include "config.h"
namespace
ygo
{
class
SingleDuel
{
};
}
#endif //SINGLE_DUEL_H
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