Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
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
srvpro
Commits
2a5a6d42
Commit
2a5a6d42
authored
Dec 27, 2023
by
IamIpanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add extra_mode_list to allow plugin add modes
parent
df938b16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
ygopro-server.coffee
ygopro-server.coffee
+8
-3
ygopro-server.js
ygopro-server.js
+13
-6
No files found.
ygopro-server.coffee
View file @
2a5a6d42
...
...
@@ -201,6 +201,7 @@ geoip = null
dataManager
=
null
windbots
=
[]
disconnect_list
=
{}
# {old_client, old_server, room_id, timeout, deckbuf}
extra_mode_list
=
global
.
extra_mode_list
=
[]
# (rule) => void, with 'this' is ROOM
moment_now
=
global
.
moment_now
=
null
moment_now_string
=
global
.
moment_now_string
=
null
...
...
@@ -627,9 +628,10 @@ init = () ->
plugin_list
=
await
fs
.
promises
.
readdir
(
"./plugins"
)
for
plugin_filename
in
plugin_list
plugin_path
=
process
.
cwd
()
+
"/plugins/"
+
plugin_filename
require
(
plugin_path
)
log
.
info
(
"Plugin loaded:"
,
plugin_filename
)
if
plugin_filename
.
endsWith
'.js'
plugin_path
=
process
.
cwd
()
+
"/plugins/"
+
plugin_filename
require
(
plugin_path
)
log
.
info
(
"Plugin loaded:"
,
plugin_filename
)
return
...
...
@@ -1279,6 +1281,9 @@ class Room
lflist
=
parseInt
(
param
[
3
])
-
1
@
hostinfo
.
lflist
=
lflist
for
extra_mode_func
from
extra_mode_list
extra_mode_func
rule
if
(
rule
.
match
/(^|,|,)(NOLFLIST|NF)(,|,|$)/
)
@
hostinfo
.
lflist
=
-
1
...
...
ygopro-server.js
View file @
2a5a6d42
// Generated by CoffeeScript 2.
7.0
// Generated by CoffeeScript 2.
6.1
(
function
()
{
// 标准库
var
CLIENT_get_authorize_key
,
CLIENT_get_kick_reconnect_target
,
CLIENT_heartbeat_register
,
CLIENT_heartbeat_unregister
,
CLIENT_import_data
,
CLIENT_is_able_to_kick_reconnect
,
CLIENT_is_able_to_reconnect
,
CLIENT_is_banned_by_mc
,
CLIENT_is_player
,
CLIENT_kick
,
CLIENT_kick_reconnect
,
CLIENT_pre_reconnect
,
CLIENT_reconnect
,
CLIENT_reconnect_register
,
CLIENT_reconnect_unregister
,
CLIENT_send_pre_reconnect_info
,
CLIENT_send_reconnect_info
,
CLIENT_send_replays
,
CLIENT_send_replays_and_kick
,
Q
,
ROOM_all
,
ROOM_bad_ip
,
ROOM_ban_player
,
ROOM_clear_disconnect
,
ROOM_connected_ip
,
ROOM_find_by_name
,
ROOM_find_by_pid
,
ROOM_find_by_port
,
ROOM_find_by_title
,
ROOM_find_or_create_ai
,
ROOM_find_or_create_by_name
,
ROOM_find_or_create_random
,
ROOM_kick
,
ROOM_player_flee
,
ROOM_player_get_score
,
ROOM_player_lose
,
ROOM_player_win
,
ROOM_players_oppentlist
,
ROOM_unwelcome
,
ROOM_validate
,
ReplayParser
,
ResolveData
,
Room
,
SERVER_clear_disconnect
,
SERVER_kick
,
SOCKET_flush_data
,
_
,
_async
,
addCallback
,
athleticChecker
,
auth
,
axios
,
badwordR
,
badwords
,
ban_user
,
bunyan
,
challonge
,
checkFileExists
,
createDirectoryIfNotExists
,
crypto
,
dataManager
,
deck_name_match
,
dialogues
,
disconnect_list
,
exec
,
execFile
,
fs
,
geoip
,
getDuelLogQueryFromQs
,
getSeedTimet
,
get_memory_usage
,
http
,
httpRequestListener
,
importOldConfig
,
import_datas
,
init
,
ip6addr
,
lflists
,
loadJSON
,
loadJSONAsync
,
loadLFList
,
loadRemoteData
,
load_dialogues
,
load_tips
,
log
,
long_resolve_cards
,
memory_usage
,
merge
,
moment
,
moment_long_ago_string
,
moment_now
,
moment_now_string
,
neosRequestListener
,
net
,
netRequestHandler
,
os
,
osu
,
path
,
qs
,
real_windbot_server_ip
,
release_disconnect
,
report_to_big_brother
,
request
,
roomlist
,
rooms_count
,
setting_change
,
setting_get
,
setting_save
,
settings
,
spawn
,
spawnSync
,
spawn_windbot
,
tips
,
url
,
users_cache
,
util
,
wait_room_start
,
wait_room_start_arena
,
windbot_looplimit
,
windbot_process
,
windbots
,
ygopro
,
zlib
;
var
CLIENT_get_authorize_key
,
CLIENT_get_kick_reconnect_target
,
CLIENT_heartbeat_register
,
CLIENT_heartbeat_unregister
,
CLIENT_import_data
,
CLIENT_is_able_to_kick_reconnect
,
CLIENT_is_able_to_reconnect
,
CLIENT_is_banned_by_mc
,
CLIENT_is_player
,
CLIENT_kick
,
CLIENT_kick_reconnect
,
CLIENT_pre_reconnect
,
CLIENT_reconnect
,
CLIENT_reconnect_register
,
CLIENT_reconnect_unregister
,
CLIENT_send_pre_reconnect_info
,
CLIENT_send_reconnect_info
,
CLIENT_send_replays
,
CLIENT_send_replays_and_kick
,
Q
,
ROOM_all
,
ROOM_bad_ip
,
ROOM_ban_player
,
ROOM_clear_disconnect
,
ROOM_connected_ip
,
ROOM_find_by_name
,
ROOM_find_by_pid
,
ROOM_find_by_port
,
ROOM_find_by_title
,
ROOM_find_or_create_ai
,
ROOM_find_or_create_by_name
,
ROOM_find_or_create_random
,
ROOM_kick
,
ROOM_player_flee
,
ROOM_player_get_score
,
ROOM_player_lose
,
ROOM_player_win
,
ROOM_players_oppentlist
,
ROOM_unwelcome
,
ROOM_validate
,
ReplayParser
,
ResolveData
,
Room
,
SERVER_clear_disconnect
,
SERVER_kick
,
SOCKET_flush_data
,
_
,
_async
,
addCallback
,
athleticChecker
,
auth
,
axios
,
badwordR
,
badwords
,
ban_user
,
bunyan
,
challonge
,
checkFileExists
,
createDirectoryIfNotExists
,
crypto
,
dataManager
,
deck_name_match
,
dialogues
,
disconnect_list
,
exec
,
execFile
,
extra_mode_list
,
fs
,
geoip
,
getDuelLogQueryFromQs
,
getSeedTimet
,
get_memory_usage
,
http
,
httpRequestListener
,
importOldConfig
,
import_datas
,
init
,
ip6addr
,
lflists
,
loadJSON
,
loadJSONAsync
,
loadLFList
,
loadRemoteData
,
load_dialogues
,
load_tips
,
log
,
long_resolve_cards
,
memory_usage
,
merge
,
moment
,
moment_long_ago_string
,
moment_now
,
moment_now_string
,
neosRequestListener
,
net
,
netRequestHandler
,
os
,
osu
,
path
,
qs
,
real_windbot_server_ip
,
release_disconnect
,
report_to_big_brother
,
request
,
roomlist
,
rooms_count
,
setting_change
,
setting_get
,
setting_save
,
settings
,
spawn
,
spawnSync
,
spawn_windbot
,
tips
,
url
,
users_cache
,
util
,
wait_room_start
,
wait_room_start_arena
,
windbot_looplimit
,
windbot_process
,
windbots
,
ygopro
,
zlib
;
net
=
require
(
'
net
'
);
...
...
@@ -248,6 +248,8 @@
disconnect_list
=
{};
// {old_client, old_server, room_id, timeout, deckbuf}
extra_mode_list
=
global
.
extra_mode_list
=
[];
// (rule) => void, with 'this' is ROOM
moment_now
=
global
.
moment_now
=
null
;
moment_now_string
=
global
.
moment_now_string
=
null
;
...
...
@@ -799,9 +801,11 @@
plugin_list
=
(
await
fs
.
promises
.
readdir
(
"
./plugins
"
));
for
(
m
=
0
,
len2
=
plugin_list
.
length
;
m
<
len2
;
m
++
)
{
plugin_filename
=
plugin_list
[
m
];
plugin_path
=
process
.
cwd
()
+
"
/plugins/
"
+
plugin_filename
;
require
(
plugin_path
);
log
.
info
(
"
Plugin loaded:
"
,
plugin_filename
);
if
(
plugin_filename
.
endsWith
(
'
.js
'
))
{
plugin_path
=
process
.
cwd
()
+
"
/plugins/
"
+
plugin_filename
;
require
(
plugin_path
);
log
.
info
(
"
Plugin loaded:
"
,
plugin_filename
);
}
}
};
...
...
@@ -1553,7 +1557,7 @@
Room
=
class
Room
{
constructor
(
name
,
hostinfo
)
{
var
death_time
,
draw_count
,
duel_rule
,
lflist
,
param
,
rule
,
start_hand
,
start_lp
,
time_limit
;
var
death_time
,
draw_count
,
duel_rule
,
extra_mode_func
,
lflist
,
param
,
rule
,
start_hand
,
start_lp
,
time_limit
;
this
.
hostinfo
=
hostinfo
;
this
.
name
=
name
;
//@alive = true
...
...
@@ -1676,6 +1680,9 @@
lflist
=
parseInt
(
param
[
3
])
-
1
;
this
.
hostinfo
.
lflist
=
lflist
;
}
for
(
extra_mode_func
of
extra_mode_list
)
{
extra_mode_func
(
rule
);
}
if
(
rule
.
match
(
/
(
^|,|,
)(
NOLFLIST|NF
)(
,|,|$
)
/
))
{
this
.
hostinfo
.
lflist
=
-
1
;
}
...
...
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