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
Commits
a04d54c6
Commit
a04d54c6
authored
Apr 03, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add server log in chat, now for mdpro3
parent
8a592296
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
1 deletion
+20
-1
.gitlab-ci.yml
.gitlab-ci.yml
+3
-1
gframe/game.cpp
gframe/game.cpp
+11
-0
gframe/netserver.h
gframe/netserver.h
+5
-0
premake5.lua
premake5.lua
+1
-0
No files found.
.gitlab-ci.yml
View file @
a04d54c6
...
@@ -129,7 +129,7 @@ exec_windows:
...
@@ -129,7 +129,7 @@ exec_windows:
exec_windows_pro3
:
exec_windows_pro3
:
extends
:
.exec_windows
extends
:
.exec_windows
script
:
script
:
-
'
.\premake5.exe
vs2019
--server-pro3-support'
-
'
.\premake5.exe
vs2019
--server-pro3-support
--log-in-chat
'
-
cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\YGOPro.sln /m /p:Configuration=Release'
-
cmd /c '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe" build\YGOPro.sln /m /p:Configuration=Release'
-
mkdir dist
-
mkdir dist
-
mkdir dist\windows
-
mkdir dist\windows
...
@@ -191,11 +191,13 @@ exec_windows_pro3:
...
@@ -191,11 +191,13 @@ exec_windows_pro3:
image
:
git-registry.moenext.com/mycard/docker-ygopro-builder:fpic
image
:
git-registry.moenext.com/mycard/docker-ygopro-builder:fpic
variables
:
variables
:
SERVER_PRO3_SUPPORT
:
'
1'
SERVER_PRO3_SUPPORT
:
'
1'
LOG_IN_CHAT
:
'
1'
TARGET_FILE
:
libygoserver.so
TARGET_FILE
:
libygoserver.so
.use_pro3_macos
:
.use_pro3_macos
:
variables
:
variables
:
SERVER_PRO3_SUPPORT
:
'
1'
SERVER_PRO3_SUPPORT
:
'
1'
LOG_IN_CHAT
:
'
1'
TARGET_FILE
:
libygoserver.dylib
TARGET_FILE
:
libygoserver.dylib
LIBEVENT_PREBUILD_FLAGS
:
'
-fPIC'
LIBEVENT_PREBUILD_FLAGS
:
'
-fPIC'
...
...
gframe/game.cpp
View file @
a04d54c6
...
@@ -2072,6 +2072,17 @@ void Game::ClearChatMsg() {
...
@@ -2072,6 +2072,17 @@ void Game::ClearChatMsg() {
}
}
#endif //YGOPRO_SERVER_MODE
#endif //YGOPRO_SERVER_MODE
void
Game
::
AddDebugMsg
(
const
char
*
msg
)
{
void
Game
::
AddDebugMsg
(
const
char
*
msg
)
{
#ifdef YGOPRO_LOG_IN_CHAT
wchar_t
msgbuf_w
[
1024
];
wchar_t
msgbuf_w2
[
1024
];
uint16_t
msgbuf_u16
[
LEN_CHAT_MSG
];
BufferIO
::
DecodeUTF8
(
msg
,
msgbuf_w
);
myswprintf
(
msgbuf_w2
,
L"[Script Error]: %ls"
,
msgbuf_w
);
// prefix for debug messages
auto
len
=
BufferIO
::
CopyCharArray
(
msgbuf_w2
,
msgbuf_u16
);
DuelPlayer
tmp_dp
;
tmp_dp
.
type
=
11
;
NetServer
::
duel_mode
->
Chat
(
&
tmp_dp
,
(
unsigned
char
*
)
msgbuf_u16
,
(
len
+
1
)
*
sizeof
(
uint16_t
));
// send to chat log
#endif
#ifdef YGOPRO_SERVER_MODE
#ifdef YGOPRO_SERVER_MODE
fprintf
(
stderr
,
"%s
\n
"
,
msg
);
fprintf
(
stderr
,
"%s
\n
"
,
msg
);
#else
#else
...
...
gframe/netserver.h
View file @
a04d54c6
...
@@ -15,11 +15,16 @@ private:
...
@@ -15,11 +15,16 @@ private:
#endif
#endif
static
event
*
broadcast_ev
;
static
event
*
broadcast_ev
;
static
evconnlistener
*
listener
;
static
evconnlistener
*
listener
;
#ifndef YGOPRO_LOG_IN_CHAT
static
DuelMode
*
duel_mode
;
static
DuelMode
*
duel_mode
;
#endif
static
unsigned
char
net_server_write
[
SIZE_NETWORK_BUFFER
];
static
unsigned
char
net_server_write
[
SIZE_NETWORK_BUFFER
];
static
size_t
last_sent
;
static
size_t
last_sent
;
public:
public:
#ifdef YGOPRO_LOG_IN_CHAT
static
DuelMode
*
duel_mode
;
#endif
#ifdef YGOPRO_SERVER_MODE
#ifdef YGOPRO_SERVER_MODE
static
event_base
*
net_evbase
;
static
event_base
*
net_evbase
;
static
void
InitDuel
();
static
void
InitDuel
();
...
...
premake5.lua
View file @
a04d54c6
...
@@ -113,6 +113,7 @@ boolOptions = {
...
@@ -113,6 +113,7 @@ boolOptions = {
"no-side-check"
,
"no-side-check"
,
"enable-debug-func"
,
"enable-debug-func"
,
"log-lua-memory-size"
,
"log-lua-memory-size"
,
"log-in-chat"
,
}
}
for
_
,
boolOption
in
ipairs
(
boolOptions
)
do
for
_
,
boolOption
in
ipairs
(
boolOptions
)
do
...
...
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