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
1
Merge Requests
1
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
nanahira
ygopro
Commits
d8c1eea2
Commit
d8c1eea2
authored
Jul 30, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'server' into server-develop
parents
84beb267
b45cce4f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
23 deletions
+60
-23
.gitlab-ci.yml
.gitlab-ci.yml
+23
-0
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+1
-2
gframe/game.cpp
gframe/game.cpp
+2
-4
gframe/netserver.cpp
gframe/netserver.cpp
+1
-1
gframe/premake5.lua
gframe/premake5.lua
+3
-1
gframe/serverapi.cpp
gframe/serverapi.cpp
+10
-2
gframe/serverapi.h
gframe/serverapi.h
+16
-13
premake/lua/premake5.lua
premake/lua/premake5.lua
+4
-0
No files found.
.gitlab-ci.yml
View file @
d8c1eea2
...
@@ -124,6 +124,15 @@ exec_windows:
...
@@ -124,6 +124,15 @@ exec_windows:
-
mkdir dist\windows
-
mkdir dist\windows
-
copy bin\release\x64\ygopro.exe dist\windows\ygopro.exe
-
copy bin\release\x64\ygopro.exe dist\windows\ygopro.exe
exec_windows_pro2
:
extends
:
.exec_windows
script
:
-
'
.\premake5.exe
vs2019
--server-pro2-support'
-
cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\YGOPro.sln /m /p:Configuration=Release /p:Platform=x64'
-
mkdir dist
-
mkdir dist\windows
-
copy bin\release\x64\AI.Server.exe dist\windows\AI.Server.exe
exec_windows_pro3
:
exec_windows_pro3
:
extends
:
.exec_windows
extends
:
.exec_windows
script
:
script
:
...
@@ -133,12 +142,24 @@ exec_windows_pro3:
...
@@ -133,12 +142,24 @@ exec_windows_pro3:
-
mkdir dist\windows
-
mkdir dist\windows
-
copy bin\release\x64\ygoserver.dll dist\windows\ygoserver.dll
-
copy bin\release\x64\ygoserver.dll dist\windows\ygoserver.dll
exec_windows_mdpro2
:
extends
:
.exec_windows
script
:
-
'
.\premake5.exe
vs2019
--server-pro3-support
--log-in-chat
--server-pro2-support'
-
cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\YGOPro.sln /m /p:Configuration=Release /p:Platform=x64'
-
mkdir dist
-
mkdir dist\windows
-
copy bin\release\x64\ygoserver.dll dist\windows\ygoserver-mdpro2.dll
.exec_unix_common
:
.exec_unix_common
:
extends
:
._exec_build
extends
:
._exec_build
variables
:
variables
:
RELEASE_DIR
:
'
'
RELEASE_DIR
:
'
'
TARGET_FILE
:
ygopro
TARGET_FILE
:
ygopro
PREMAKE5_BIN
:
premake5
PREMAKE5_BIN
:
premake5
BUILD_EVENT
:
'
1'
BUILD_IRRLICHT
:
'
1'
BUILD_SQLITE
:
'
1'
script
:
script
:
-
./.ci/configure-libevent.sh
-
./.ci/configure-libevent.sh
-
$PREMAKE5_BIN gmake
-
$PREMAKE5_BIN gmake
...
@@ -318,6 +339,8 @@ upload_to_minio:
...
@@ -318,6 +339,8 @@ upload_to_minio:
-
exec_linux
-
exec_linux
-
exec_linuxarm
-
exec_linuxarm
-
exec_windows_pro3
-
exec_windows_pro3
-
exec_windows_pro2
-
exec_windows_mdpro2
-
exec_linux_pro3
-
exec_linux_pro3
-
exec_linuxarm_pro3
-
exec_linuxarm_pro3
-
exec_debian
-
exec_debian
...
...
gframe/deck_manager.cpp
View file @
d8c1eea2
...
@@ -50,8 +50,7 @@ void DeckManager::LoadLFListSingle(irr::io::IReadFile* reader, bool insert) {
...
@@ -50,8 +50,7 @@ void DeckManager::LoadLFListSingle(irr::io::IReadFile* reader, bool insert) {
void
DeckManager
::
LoadLFList
()
{
void
DeckManager
::
LoadLFList
()
{
#ifdef SERVER_PRO2_SUPPORT
#ifdef SERVER_PRO2_SUPPORT
LoadLFListSingle
(
"config/lflist.conf"
);
LoadLFListSingle
(
"config/lflist.conf"
);
#endif
#elif defined(SERVER_PRO3_SUPPORT)
#ifdef SERVER_PRO3_SUPPORT
LoadLFListSingle
(
"Data/lflist.conf"
);
LoadLFListSingle
(
"Data/lflist.conf"
);
#endif
#endif
LoadLFListSingle
(
"specials/lflist.conf"
);
LoadLFListSingle
(
"specials/lflist.conf"
);
...
...
gframe/game.cpp
View file @
d8c1eea2
...
@@ -101,8 +101,7 @@ void Game::MainServerLoop() {
...
@@ -101,8 +101,7 @@ void Game::MainServerLoop() {
LoadExpansionsAll
();
LoadExpansionsAll
();
#ifdef SERVER_PRO2_SUPPORT
#ifdef SERVER_PRO2_SUPPORT
DataManager
::
FileSystem
->
addFileArchive
(
"data/script.zip"
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
DataManager
::
FileSystem
->
addFileArchive
(
"data/script.zip"
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
#endif
#elif defined(SERVER_PRO3_SUPPORT)
#ifdef SERVER_PRO3_SUPPORT
DataManager
::
FileSystem
->
addFileArchive
(
"Data/script.zip"
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
DataManager
::
FileSystem
->
addFileArchive
(
"Data/script.zip"
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
#endif
#endif
...
@@ -1419,8 +1418,7 @@ void Game::LoadExpansionsAll() {
...
@@ -1419,8 +1418,7 @@ void Game::LoadExpansionsAll() {
dataManager
.
LoadDB
(
fpath
);
dataManager
.
LoadDB
(
fpath
);
}
}
});
});
#endif // SERVER_PRO2_SUPPORT
#elif defined(SERVER_PRO3_SUPPORT)
#ifdef SERVER_PRO3_SUPPORT
FileSystem
::
TraversalDir
(
L"./Data/locales/zh-CN"
,
[](
const
wchar_t
*
name
,
bool
isdir
)
{
FileSystem
::
TraversalDir
(
L"./Data/locales/zh-CN"
,
[](
const
wchar_t
*
name
,
bool
isdir
)
{
wchar_t
fpath
[
1024
];
wchar_t
fpath
[
1024
];
myswprintf
(
fpath
,
L"./Data/locales/zh-CN/%ls"
,
name
);
myswprintf
(
fpath
,
L"./Data/locales/zh-CN/%ls"
,
name
);
...
...
gframe/netserver.cpp
View file @
d8c1eea2
...
@@ -95,7 +95,7 @@ bool NetServer::StartServer(unsigned short port) {
...
@@ -95,7 +95,7 @@ bool NetServer::StartServer(unsigned short port) {
std
::
memset
(
&
sin
,
0
,
sizeof
sin
);
std
::
memset
(
&
sin
,
0
,
sizeof
sin
);
server_port
=
port
;
server_port
=
port
;
sin
.
sin_family
=
AF_INET
;
sin
.
sin_family
=
AF_INET
;
#if
def SERVER_PRO2_SUPPORT
#if
defined(SERVER_PRO2_SUPPORT) && !defined(SERVER_PRO3_SUPPORT)
sin
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
);
sin
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
);
#else
#else
sin
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
sin
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
...
...
gframe/premake5.lua
View file @
d8c1eea2
...
@@ -114,10 +114,12 @@ end
...
@@ -114,10 +114,12 @@ end
end
end
filter
"system:windows"
filter
"system:windows"
if
not
SERVER_PRO3_SUPPORT
then
entrypoint
"mainCRTStartup"
entrypoint
"mainCRTStartup"
end
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
files
"ygopro.rc"
files
"ygopro.rc"
if
SERVER_PRO2_SUPPORT
then
if
SERVER_PRO2_SUPPORT
and
not
SERVER_PRO3_SUPPORT
then
targetname
(
"AI.Server"
)
targetname
(
"AI.Server"
)
end
end
if
SERVER_MODE
then
if
SERVER_MODE
then
...
...
gframe/serverapi.cpp
View file @
d8c1eea2
#include "serverapi.h"
#include "serverapi.h"
#include "game.h"
#include "netserver.h"
#include "network.h"
#include "config.h"
#include "data_manager.h"
#include "gframe.h"
#include <event2/thread.h>
#include <memory>
namespace
ygo
{
namespace
ygo
{
extern
"C"
DECL_DLLEXPORT
int
start_server
(
const
char
*
args
)
{
YGOSERVER_API
int
start_server
(
const
char
*
args
)
{
int
argc
=
1
;
int
argc
=
1
;
char
**
argv
=
new
char
*
[
13
];
char
**
argv
=
new
char
*
[
13
];
const
char
*
server_name
=
"ygoserver"
;
const
char
*
server_name
=
"ygoserver"
;
...
@@ -36,7 +44,7 @@ namespace ygo {
...
@@ -36,7 +44,7 @@ namespace ygo {
return
result
;
return
result
;
}
}
extern
"C"
DECL_DLLEXPORT
void
stop_server
()
{
YGOSERVER_API
void
stop_server
()
{
NetServer
::
StopServer
();
NetServer
::
StopServer
();
}
}
}
}
gframe/serverapi.h
View file @
d8c1eea2
#ifndef SERVERAPI_H
#ifndef SERVERAPI_H
#define SERVERAPI_H
#define SERVERAPI_H
#include "game.h"
#ifdef __cplusplus
#include "netserver.h"
#define EXTERN_C extern "C"
#include "network.h"
#else
#include "config.h"
#define EXTERN_C
#include "data_manager.h"
#endif
#include "gframe.h"
#include <event2/thread.h>
#include <memory>
#ifdef WIN32
#ifndef YGOSERVER_API
#define DECL_DLLEXPORT __declspec(dllexport)
#if defined(__EMSCRIPTEN__)
#include <emscripten/emscripten.h>
#define YGOSERVER_API EXTERN_C EMSCRIPTEN_KEEPALIVE
#elif defined(_WIN32)
#define YGOSERVER_API EXTERN_C __declspec(dllexport)
#else
#else
#define
DECL_DLLEXPORT
#define
YGOSERVER_API EXTERN_C __attribute__ ((visibility ("default")))
#endif
#endif
#endif
namespace
ygo
{
namespace
ygo
{
extern
"C"
DECL_DLLEXPORT
int
start_server
(
const
char
*
args
);
YGOSERVER_API
int
start_server
(
const
char
*
args
);
extern
"C"
DECL_DLLEXPORT
void
stop_server
();
YGOSERVER_API
void
stop_server
();
}
}
#endif // !SERVERAPI_H
#endif // !SERVERAPI_H
premake/lua/premake5.lua
View file @
d8c1eea2
...
@@ -8,6 +8,10 @@ project "lua"
...
@@ -8,6 +8,10 @@ project "lua"
if
not
GetParam
(
"no-lua-safe"
)
then
if
not
GetParam
(
"no-lua-safe"
)
then
removefiles
{
"src/linit.c"
}
removefiles
{
"src/linit.c"
}
end
end
if
SERVER_PRO3_SUPPORT
then
defines
{
"LUA_USE_LONGJMP"
}
end
filter
"configurations:Debug"
filter
"configurations:Debug"
defines
{
"LUA_USE_APICHECK"
}
defines
{
"LUA_USE_APICHECK"
}
...
...
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