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
292a50d9
Commit
292a50d9
authored
Nov 30, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'server' of
https://github.com/purerosefallen/ygopro
parents
7c423440
cda071c5
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
84 additions
and
7 deletions
+84
-7
cards.cdb
cards.cdb
+0
-0
gframe/bufferio.h
gframe/bufferio.h
+10
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+59
-0
gframe/duelclient.h
gframe/duelclient.h
+2
-0
gframe/game.cpp
gframe/game.cpp
+1
-1
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+4
-0
gframe/network.h
gframe/network.h
+1
-0
premake/gframe/ygopro.rc
premake/gframe/ygopro.rc
+4
-4
strings.conf
strings.conf
+2
-1
system.conf
system.conf
+1
-1
No files found.
cards.cdb
View file @
292a50d9
No preview for this file type
gframe/bufferio.h
View file @
292a50d9
...
...
@@ -12,11 +12,21 @@ public:
p
+=
4
;
return
ret
;
}
inline
static
unsigned
int
ReadUInt32
(
char
*&
p
)
{
unsigned
int
ret
=
*
(
unsigned
int
*
)
p
;
p
+=
4
;
return
ret
;
}
inline
static
short
ReadInt16
(
char
*&
p
)
{
short
ret
=
*
(
short
*
)
p
;
p
+=
2
;
return
ret
;
}
inline
static
unsigned
short
ReadUInt16
(
char
*&
p
)
{
unsigned
short
ret
=
*
(
unsigned
short
*
)
p
;
p
+=
2
;
return
ret
;
}
inline
static
char
ReadInt8
(
char
*&
p
)
{
char
ret
=
*
(
char
*
)
p
;
p
++
;
...
...
gframe/duelclient.cpp
View file @
292a50d9
...
...
@@ -31,12 +31,14 @@ mtrandom DuelClient::rnd;
bool
DuelClient
::
is_refreshing
=
false
;
int
DuelClient
::
match_kill
=
0
;
std
::
vector
<
HostPacket
>
DuelClient
::
hosts
;
std
::
vector
<
std
::
wstring
>
DuelClient
::
hosts_srvpro
;
std
::
set
<
unsigned
int
>
DuelClient
::
remotes
;
event
*
DuelClient
::
resp_event
=
0
;
unsigned
int
DuelClient
::
temp_ip
=
0
;
unsigned
short
DuelClient
::
temp_port
=
0
;
unsigned
short
DuelClient
::
temp_ver
=
0
;
bool
DuelClient
::
try_needed
=
false
;
bool
DuelClient
::
is_srvpro
=
false
;
bool
DuelClient
::
StartClient
(
unsigned
int
ip
,
unsigned
short
port
,
bool
create_game
)
{
if
(
connect_state
)
...
...
@@ -357,6 +359,62 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
}
break
;
}
case
STOC_SRVPRO_ROOMLIST
:
{
is_srvpro
=
true
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
lstHostList
->
clear
();
hosts_srvpro
.
clear
();
unsigned
short
count
=
BufferIO
::
ReadUInt16
(
pdata
);
char
temp1
[
64
];
char
temp2
[
128
];
for
(
unsigned
short
i
=
0
;
i
<
count
;
++
i
)
{
wchar_t
roomname
[
32
];
wchar_t
player1
[
64
];
wchar_t
player2
[
64
];
wchar_t
hoststr
[
1024
];
memcpy
(
temp1
,
pdata
,
64
);
pdata
+=
64
;
BufferIO
::
DecodeUTF8
(
temp1
,
roomname
);
unsigned
char
room_status
=
BufferIO
::
ReadUInt8
(
pdata
);
char
room_duel_count
=
BufferIO
::
ReadInt8
(
pdata
);
char
room_turn_count
=
BufferIO
::
ReadInt8
(
pdata
);
memcpy
(
temp2
,
pdata
,
128
);
pdata
+=
128
;
BufferIO
::
DecodeUTF8
(
temp2
,
player1
);
char
player1_score
=
BufferIO
::
ReadInt8
(
pdata
);
int
player1_lp
=
BufferIO
::
ReadInt32
(
pdata
);
memcpy
(
temp2
,
pdata
,
128
);
pdata
+=
128
;
BufferIO
::
DecodeUTF8
(
temp2
,
player2
);
char
player2_score
=
BufferIO
::
ReadInt8
(
pdata
);
int
player2_lp
=
BufferIO
::
ReadInt32
(
pdata
);
hosts_srvpro
.
push_back
(
std
::
wstring
(
roomname
));
switch
(
room_status
)
{
case
0
:
{
myswprintf
(
hoststr
,
L"[SRVPro][Waiting][%ls] %ls VS %ls"
,
roomname
,
player1
,
player2
);
break
;
}
case
1
:
{
myswprintf
(
hoststr
,
L"[SRVPro][G%d,T%d][%ls] (%d,LP%d) %ls VS %ls (%d,LP%d)"
,
room_duel_count
,
room_turn_count
,
roomname
,
player1_score
,
player1_lp
,
player1
,
player2
,
player2_score
,
player2_lp
);
break
;
}
case
2
:
{
myswprintf
(
hoststr
,
L"[SRVPro][G%d,Siding][%ls] (%d) %ls VS %ls (%d)"
,
room_duel_count
,
roomname
,
player1_score
,
player1
,
player2
,
player2_score
);
break
;
}
}
mainGame
->
lstHostList
->
addItem
(
hoststr
);
}
mainGame
->
gMutex
.
Unlock
();
break
;
}
case
STOC_SELECT_HAND
:
{
mainGame
->
wHand
->
setVisible
(
true
);
break
;
...
...
@@ -3922,6 +3980,7 @@ void DuelClient::BeginRefreshHost() {
if
(
is_refreshing
)
return
;
is_refreshing
=
true
;
DuelClient
::
is_srvpro
=
false
;
mainGame
->
btnLanRefresh
->
setEnabled
(
false
);
mainGame
->
lstHostList
->
clear
();
remotes
.
clear
();
...
...
gframe/duelclient.h
View file @
292a50d9
...
...
@@ -79,6 +79,8 @@ protected:
static
std
::
set
<
unsigned
int
>
remotes
;
public:
static
std
::
vector
<
HostPacket
>
hosts
;
static
std
::
vector
<
std
::
wstring
>
hosts_srvpro
;
static
bool
is_srvpro
;
static
void
BeginRefreshHost
();
static
int
RefreshThread
(
void
*
arg
);
static
void
BroadcastReply
(
evutil_socket_t
fd
,
short
events
,
void
*
arg
);
...
...
gframe/game.cpp
View file @
292a50d9
...
...
@@ -18,7 +18,7 @@
#include <regex>
#endif //YGOPRO_SERVER_MODE
unsigned
short
PRO_VERSION
=
0x134
7
;
unsigned
short
PRO_VERSION
=
0x134
8
;
namespace
ygo
{
...
...
gframe/menu_handler.cpp
View file @
292a50d9
...
...
@@ -456,6 +456,10 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
int
sel
=
mainGame
->
lstHostList
->
getSelected
();
if
(
sel
==
-
1
)
break
;
if
(
DuelClient
::
is_srvpro
)
{
mainGame
->
ebJoinPass
->
setText
(
DuelClient
::
hosts_srvpro
[
sel
].
c_str
());
break
;
}
int
addr
=
DuelClient
::
hosts
[
sel
].
ipaddr
;
int
port
=
DuelClient
::
hosts
[
sel
].
port
;
wchar_t
buf
[
20
];
...
...
gframe/network.h
View file @
292a50d9
...
...
@@ -208,6 +208,7 @@ public:
#ifdef YGOPRO_SERVER_MODE
#define STOC_FIELD_FINISH 0x30
#endif
#define STOC_SRVPRO_ROOMLIST 0x31
#define PLAYERCHANGE_OBSERVE 0x8
#define PLAYERCHANGE_READY 0x9
...
...
premake/gframe/ygopro.rc
View file @
292a50d9
1 ICON "ygopro.ico"
1 VERSIONINFO
FILEVERSION 1, 0, 34,
7
PRODUCTVERSION 1, 0, 34,
7
FILEVERSION 1, 0, 34,
8
PRODUCTVERSION 1, 0, 34,
8
FILEOS 0x4
FILETYPE 0x1
...
...
@@ -16,8 +16,8 @@ VALUE "InternalName", "YGOPRO Server Mode"
VALUE "LegalCopyright", "Copyright (C) 2018 Nanahira"
VALUE "OriginalFilename", "ygopro.exe"
VALUE "ProductName", "YGOPRO Server Mode"
VALUE "FileVersion", "1.034.
7
.Koishi"
VALUE "ProductVersion", "1.034.
7
.Koishi"
VALUE "FileVersion", "1.034.
8
.Koishi"
VALUE "ProductVersion", "1.034.
8
.Koishi"
END
END
BLOCK "VarFileInfo"
...
...
strings.conf
View file @
292a50d9
...
...
@@ -755,7 +755,7 @@
!
setname
0
x82
怒怒怒 ドドド
!
setname
0
x83
机关傀儡 ギミック・パペット
!
setname
0
x84
燃烧拳击手
BK
(バーニングナックラー)
!
setname
0
x85
超级防
御
机器人
SD
ロボ
!
setname
0
x85
超级防
卫
机器人
SD
ロボ
!
setname
0
x86
光天使
!
setname
0
x87
阴影 アンブラル
!
setname
0
x88
武神
...
...
@@ -833,6 +833,7 @@
!
setname
0
xbf
灵使 霊使い
!
setname
0
xc0
凭依装着 憑依装着
!
setname
0
xc1
PSY
骨架
PSY
フレーム
!
setname
0
x10c1
PSY
骨架装备
PSY
フレームギア
!
setname
0
xc2
动力工具 パワー・ツール
!
setname
0
xc3
锋利小鬼 エッジインプ
!
setname
0
xc4
神数 セフィラ
...
...
system.conf
View file @
292a50d9
...
...
@@ -2,7 +2,7 @@
#nickname & gamename should be less than 20 characters
use_d3d
=
0
use_image_scale
=
1
pro_version
=
493
5
pro_version
=
493
6
antialias
=
2
errorlog
=
3
nickname
=
Komeiji
Koishi
...
...
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