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
REIKAI
ygopro
Commits
f993a474
Commit
f993a474
authored
Feb 02, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add lflist param
parent
f645729a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
7 deletions
+9
-7
gframe/game.cpp
gframe/game.cpp
+2
-2
gframe/game.h
gframe/game.h
+1
-1
gframe/gframe.cpp
gframe/gframe.cpp
+1
-1
gframe/netserver.cpp
gframe/netserver.cpp
+4
-2
gframe/netserver.h
gframe/netserver.h
+1
-1
No files found.
gframe/game.cpp
View file @
f993a474
...
@@ -32,11 +32,11 @@ unsigned int start_lp;
...
@@ -32,11 +32,11 @@ unsigned int start_lp;
unsigned
char
start_hand
;
unsigned
char
start_hand
;
unsigned
char
draw_count
;
unsigned
char
draw_count
;
void
Game
::
MainServerLoop
(
int
bDuel_mode
)
{
void
Game
::
MainServerLoop
(
int
bDuel_mode
,
int
lflist
)
{
deckManager
.
LoadLFList
();
deckManager
.
LoadLFList
();
dataManager
.
LoadDB
(
"cards.cdb"
);
dataManager
.
LoadDB
(
"cards.cdb"
);
aServerPort
=
NetServer
::
StartServer
(
aServerPort
);
aServerPort
=
NetServer
::
StartServer
(
aServerPort
);
NetServer
::
Initduel
(
bDuel_mode
);
NetServer
::
Initduel
(
bDuel_mode
,
lflist
);
printf
(
"%u
\n
"
,
aServerPort
);
printf
(
"%u
\n
"
,
aServerPort
);
fflush
(
stdout
);
fflush
(
stdout
);
while
(
NetServer
::
net_evbase
)
{
while
(
NetServer
::
net_evbase
)
{
...
...
gframe/game.h
View file @
f993a474
...
@@ -77,7 +77,7 @@ class Game {
...
@@ -77,7 +77,7 @@ class Game {
public:
public:
bool
Initialize
();
bool
Initialize
();
void
MainLoop
();
void
MainLoop
();
void
MainServerLoop
(
int
bDuel_mode
);
void
MainServerLoop
(
int
bDuel_mode
,
int
lflist
);
/*
/*
void BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar);
void BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar);
void InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cHeight, irr::gui::CGUITTFont* font, const wchar_t* text);
void InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cHeight, irr::gui::CGUITTFont* font, const wchar_t* text);
...
...
gframe/gframe.cpp
View file @
f993a474
...
@@ -43,7 +43,7 @@ int main(int argc, char* argv[]) {
...
@@ -43,7 +43,7 @@ int main(int argc, char* argv[]) {
ygo
::
draw_count
=
atoi
(
argv
[
10
]);
ygo
::
draw_count
=
atoi
(
argv
[
10
]);
}
}
ygo
::
mainGame
=
&
_game
;
ygo
::
mainGame
=
&
_game
;
ygo
::
mainGame
->
MainServerLoop
(
ygo
::
mode
);
ygo
::
mainGame
->
MainServerLoop
(
ygo
::
mode
,
ygo
::
lflist
);
return
0
;
return
0
;
}
}
...
...
gframe/netserver.cpp
View file @
f993a474
...
@@ -14,7 +14,7 @@ char NetServer::net_server_write[0x2000];
...
@@ -14,7 +14,7 @@ char NetServer::net_server_write[0x2000];
unsigned
short
NetServer
::
last_sent
=
0
;
unsigned
short
NetServer
::
last_sent
=
0
;
void
NetServer
::
Initduel
(
int
bDuel_mode
)
void
NetServer
::
Initduel
(
int
bDuel_mode
,
int
lflist
)
{
{
CTOS_CreateGame
*
pkt
=
new
CTOS_CreateGame
;
CTOS_CreateGame
*
pkt
=
new
CTOS_CreateGame
;
pkt
->
info
.
mode
=
MODE_SINGLE
;
pkt
->
info
.
mode
=
MODE_SINGLE
;
...
@@ -36,7 +36,7 @@ void NetServer::Initduel(int bDuel_mode)
...
@@ -36,7 +36,7 @@ void NetServer::Initduel(int bDuel_mode)
pkt
->
info
.
mode
=
0
;
pkt
->
info
.
mode
=
0
;
unsigned
int
hash
=
0
;
unsigned
int
hash
=
0
;
//
pkt->info.lflist = deckManager._lfList[lflist].hash;
pkt
->
info
.
lflist
=
deckManager
.
_lfList
[
lflist
].
hash
;
for
(
auto
lfit
=
deckManager
.
_lfList
.
begin
();
lfit
!=
deckManager
.
_lfList
.
end
();
++
lfit
)
{
for
(
auto
lfit
=
deckManager
.
_lfList
.
begin
();
lfit
!=
deckManager
.
_lfList
.
end
();
++
lfit
)
{
if
(
pkt
->
info
.
lflist
==
lfit
->
hash
)
{
if
(
pkt
->
info
.
lflist
==
lfit
->
hash
)
{
...
@@ -47,6 +47,8 @@ void NetServer::Initduel(int bDuel_mode)
...
@@ -47,6 +47,8 @@ void NetServer::Initduel(int bDuel_mode)
if
(
!
hash
)
if
(
!
hash
)
pkt
->
info
.
lflist
=
deckManager
.
_lfList
[
0
].
hash
;
pkt
->
info
.
lflist
=
deckManager
.
_lfList
[
0
].
hash
;
if
(
lflist
==
-
1
)
pkt
->
info
.
lflist
=
0
;
duel_mode
->
host_info
=
pkt
->
info
;
duel_mode
->
host_info
=
pkt
->
info
;
BufferIO
::
CopyWStr
(
pkt
->
name
,
duel_mode
->
name
,
20
);
BufferIO
::
CopyWStr
(
pkt
->
name
,
duel_mode
->
name
,
20
);
BufferIO
::
CopyWStr
(
pkt
->
pass
,
duel_mode
->
pass
,
20
);
BufferIO
::
CopyWStr
(
pkt
->
pass
,
duel_mode
->
pass
,
20
);
...
...
gframe/netserver.h
View file @
f993a474
...
@@ -24,7 +24,7 @@ private:
...
@@ -24,7 +24,7 @@ private:
public:
public:
static
event_base
*
net_evbase
;
static
event_base
*
net_evbase
;
static
void
Initduel
(
int
duel_mode
);
static
void
Initduel
(
int
duel_mode
,
int
lflist
);
static
unsigned
short
StartServer
(
unsigned
short
port
);
static
unsigned
short
StartServer
(
unsigned
short
port
);
static
bool
StartBroadcast
();
static
bool
StartBroadcast
();
static
void
StopServer
();
static
void
StopServer
();
...
...
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