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-520DIY
ygopro
Commits
fa3ae9ad
Commit
fa3ae9ad
authored
Sep 07, 2015
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add lflist param
parent
40fae330
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
7 deletions
+10
-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
+5
-2
gframe/netserver.h
gframe/netserver.h
+1
-1
No files found.
gframe/game.cpp
View file @
fa3ae9ad
...
...
@@ -35,13 +35,13 @@ unsigned short time_limit;
unsigned
char
start_hand
;
unsigned
char
draw_count
;
void
Game
::
MainServerLoop
(
int
bDuel_mode
)
{
void
Game
::
MainServerLoop
(
int
bDuel_mode
,
int
lflist
)
{
deckManager
.
LoadLFList
();
dataManager
.
LoadDB
(
"cards.cdb"
);
aServerPort
=
NetServer
::
StartServer
(
aServerPort
);
printf
(
"%u
\n
"
,
aServerPort
);
fflush
(
stdout
);
NetServer
::
Initduel
(
bDuel_mode
);
NetServer
::
Initduel
(
bDuel_mode
,
lflist
);
while
(
NetServer
::
net_evbase
)
{
#ifdef WIN32
Sleep
(
200
);
...
...
gframe/game.h
View file @
fa3ae9ad
...
...
@@ -68,7 +68,7 @@ class Game {
public:
bool
Initialize
();
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
InitStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
u32
cHeight
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
);
void
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
=
0
);
...
...
gframe/gframe.cpp
View file @
fa3ae9ad
...
...
@@ -44,7 +44,7 @@ int main(int argc, char* argv[]) {
ygo
::
time_limit
=
atoi
(
argv
[
11
]);
}
ygo
::
mainGame
=
&
_game
;
ygo
::
mainGame
->
MainServerLoop
(
ygo
::
mode
);
ygo
::
mainGame
->
MainServerLoop
(
ygo
::
mode
,
ygo
::
lflist
);
return
0
;
}
...
...
gframe/netserver.cpp
View file @
fa3ae9ad
...
...
@@ -14,7 +14,7 @@ char NetServer::net_server_write[0x2000];
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
;
pkt
->
info
.
mode
=
MODE_SINGLE
;
...
...
@@ -36,7 +36,7 @@ void NetServer::Initduel(int bDuel_mode)
pkt
->
info
.
mode
=
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
)
{
if
(
pkt
->
info
.
lflist
==
lfit
->
hash
)
{
...
...
@@ -47,6 +47,9 @@ void NetServer::Initduel(int bDuel_mode)
if
(
!
hash
)
pkt
->
info
.
lflist
=
deckManager
.
_lfList
[
0
].
hash
;
if
(
lflist
==
-
1
)
pkt
->
info
.
lflist
=
0
;
duel_mode
->
host_info
=
pkt
->
info
;
BufferIO
::
CopyWStr
(
pkt
->
name
,
duel_mode
->
name
,
20
);
BufferIO
::
CopyWStr
(
pkt
->
pass
,
duel_mode
->
pass
,
20
);
...
...
gframe/netserver.h
View file @
fa3ae9ad
...
...
@@ -24,7 +24,7 @@ private:
public:
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
bool
StartBroadcast
();
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