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
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
nanahira
srvpro
Commits
30ff09b1
Commit
30ff09b1
authored
Jul 24, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mc'
parents
d152f1fe
7d44961e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
38 deletions
+9
-38
data/default_config.json
data/default_config.json
+0
-4
data/i18n.json
data/i18n.json
+0
-2
ygopro-server.coffee
ygopro-server.coffee
+2
-11
ygopro-server.js
ygopro-server.js
+7
-21
No files found.
data/default_config.json
View file @
30ff09b1
...
@@ -185,10 +185,6 @@
...
@@ -185,10 +185,6 @@
"log_save_path"
:
"./config/"
,
"log_save_path"
:
"./config/"
,
"port"
:
7933
"port"
:
7933
},
},
"side_restrict"
:
{
"enabled"
:
false
,
"restrict_cards"
:
[]
},
"test_mode"
:
{
"test_mode"
:
{
"watch_public_hand"
:
false
,
"watch_public_hand"
:
false
,
"no_connect_count_limit"
:
false
,
"no_connect_count_limit"
:
false
,
...
...
data/i18n.json
View file @
30ff09b1
...
@@ -188,7 +188,6 @@
...
@@ -188,7 +188,6 @@
"vip_player_name_too_long"
:
"Your username or password is too long to log in. Please change your username and try again."
,
"vip_player_name_too_long"
:
"Your username or password is too long to log in. Please change your username and try again."
,
"replay_hint_part1"
:
"Sending the replay of the duel number "
,
"replay_hint_part1"
:
"Sending the replay of the duel number "
,
"replay_hint_part2"
:
"."
,
"replay_hint_part2"
:
"."
,
"invalid_side_rule"
:
"Illegal cards are contained in your side deck."
,
"arena_wait_hint"
:
"If you opponent does not appear within 25 seconds, you may quit without any penalty."
,
"arena_wait_hint"
:
"If you opponent does not appear within 25 seconds, you may quit without any penalty."
,
"arena_wait_timeout"
:
"Your opponent did not appear, you may quit without any penalty."
,
"arena_wait_timeout"
:
"Your opponent did not appear, you may quit without any penalty."
,
"auto_death_part1"
:
"This room is an auto-extra-duel room. The Extra Duel will begin after "
,
"auto_death_part1"
:
"This room is an auto-extra-duel room. The Extra Duel will begin after "
,
...
@@ -529,7 +528,6 @@
...
@@ -529,7 +528,6 @@
"vip_player_name_too_long"
:
"你的用户名或设置的密码太长,使用此用户名可能会无法登陆。请更换用户名重试。"
,
"vip_player_name_too_long"
:
"你的用户名或设置的密码太长,使用此用户名可能会无法登陆。请更换用户名重试。"
,
"replay_hint_part1"
:
"正在发送第"
,
"replay_hint_part1"
:
"正在发送第"
,
"replay_hint_part2"
:
"局决斗的录像。"
,
"replay_hint_part2"
:
"局决斗的录像。"
,
"invalid_side_rule"
:
"副卡组中包含不允许换入副卡组的卡。"
,
"arena_wait_hint"
:
"若对手在25秒内不进入游戏,您退房时不会进行扣分。"
,
"arena_wait_hint"
:
"若对手在25秒内不进入游戏,您退房时不会进行扣分。"
,
"arena_wait_timeout"
:
"由于对手未能在30秒内进入游戏,此时您退出游戏不会扣分。"
,
"arena_wait_timeout"
:
"由于对手未能在30秒内进入游戏,此时您退出游戏不会扣分。"
,
"auto_death_part1"
:
"本房间为自动加时赛房间。比赛开始"
,
"auto_death_part1"
:
"本房间为自动加时赛房间。比赛开始"
,
...
...
ygopro-server.coffee
View file @
30ff09b1
...
@@ -3479,22 +3479,13 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
...
@@ -3479,22 +3479,13 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server, datas)->
CLIENT_kick
(
room
.
dueling_players
[
oppo_pos
-
win_pos
])
CLIENT_kick
(
room
.
dueling_players
[
oppo_pos
-
win_pos
])
CLIENT_kick
(
room
.
dueling_players
[
oppo_pos
-
win_pos
+
1
])
if
room
.
hostinfo
.
mode
==
2
CLIENT_kick
(
room
.
dueling_players
[
oppo_pos
-
win_pos
+
1
])
if
room
.
hostinfo
.
mode
==
2
return
true
return
true
if
settings
.
modules
.
side_restrict
.
enabled
and
room
.
duel_stage
!=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
for
code
in
settings
.
modules
.
side_restrict
.
restrict_cards
if
_
.
indexOf
(
buff_side
,
code
)
>
-
1
ygopro
.
stoc_send_chat_to_room
(
room
,
"${invalid_side_rule}"
,
ygopro
.
constants
.
COLORS
.
RED
)
ygopro
.
stoc_send
client
,
'ERROR_MSG'
,
{
msg
:
3
code
:
0
}
return
true
struct
=
ygopro
.
structs
[
"deck"
]
struct
.
_setBuff
(
buffer
)
if
room
.
random_type
or
room
.
arena
if
room
.
random_type
or
room
.
arena
if
client
.
pos
==
0
if
client
.
pos
==
0
room
.
waiting_for_player
=
room
.
waiting_for_player2
room
.
waiting_for_player
=
room
.
waiting_for_player2
room
.
last_active_time
=
moment
()
room
.
last_active_time
=
moment
()
else
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
deck_check
and
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
).
length
else
if
room
.
duel_stage
==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
deck_check
and
fs
.
readdirSync
(
settings
.
modules
.
tournament_mode
.
deck_path
).
length
struct
=
ygopro
.
structs
[
"deck"
]
struct
.
_setBuff
(
buffer
)
struct
.
set
(
"mainc"
,
1
)
struct
.
set
(
"mainc"
,
1
)
struct
.
set
(
"sidec"
,
1
)
struct
.
set
(
"sidec"
,
1
)
struct
.
set
(
"deckbuf"
,
[
4392470
,
4392470
])
struct
.
set
(
"deckbuf"
,
[
4392470
,
4392470
])
...
...
ygopro-server.js
View file @
30ff09b1
...
@@ -4424,7 +4424,7 @@
...
@@ -4424,7 +4424,7 @@
});
});
ygopro.ctos_follow('UPDATE_DECK', true, function(buffer, info, client, server, datas) {
ygopro.ctos_follow('UPDATE_DECK', true, function(buffer, info, client, server, datas) {
var
buff_main
,
buff_side
,
card
,
c
ode
,
current_deck
,
deck
,
deck_array
,
deck_main
,
deck_side
,
deck_text
,
deckbuf
,
decks
,
found_deck
,
i
,
len2
,
len3
,
len4
,
line
,
m
,
n
,
o
,
oppo_pos
,
ref3
,
room
,
struct
,
win_pos
;
var buff_main, buff_side, card, c
urrent_deck, deck, deck_array, deck_main, deck_side, deck_text, deckbuf, decks, found_deck, i, len2, len3, line, m, n, oppo_pos
, room, struct, win_pos;
if (settings.modules.reconnect.enabled && client.pre_reconnecting) {
if (settings.modules.reconnect.enabled && client.pre_reconnecting) {
if (!CLIENT_is_able_to_reconnect(client) && !CLIENT_is_able_to_kick_reconnect(client)) {
if (!CLIENT_is_able_to_reconnect(client) && !CLIENT_is_able_to_kick_reconnect(client)) {
ygopro.stoc_send_chat(client, "${reconnect_failed}", ygopro.constants.COLORS.RED);
ygopro.stoc_send_chat(client, "${reconnect_failed}", ygopro.constants.COLORS.RED);
...
@@ -4500,36 +4500,22 @@
...
@@ -4500,36 +4500,22 @@
}
}
return true;
return true;
}
}
if
(
settings
.
modules
.
side_restrict
.
enabled
&&
room
.
duel_stage
!==
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
)
{
ref3
=
settings
.
modules
.
side_restrict
.
restrict_cards
;
for
(
m
=
0
,
len2
=
ref3
.
length
;
m
<
len2
;
m
++
)
{
code
=
ref3
[
m
];
if
(
_
.
indexOf
(
buff_side
,
code
)
>
-
1
)
{
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${invalid_side_rule}
"
,
ygopro
.
constants
.
COLORS
.
RED
);
ygopro
.
stoc_send
(
client
,
'
ERROR_MSG
'
,
{
msg
:
3
,
code
:
0
});
return
true
;
}
}
}
struct
=
ygopro
.
structs
[
"
deck
"
];
struct
.
_setBuff
(
buffer
);
if (room.random_type || room.arena) {
if (room.random_type || room.arena) {
if (client.pos === 0) {
if (client.pos === 0) {
room.waiting_for_player = room.waiting_for_player2;
room.waiting_for_player = room.waiting_for_player2;
}
}
room.last_active_time = moment();
room.last_active_time = moment();
} else if (room.duel_stage === ygopro.constants.DUEL_STAGE.BEGIN && settings.modules.tournament_mode.enabled && settings.modules.tournament_mode.deck_check && fs.readdirSync(settings.modules.tournament_mode.deck_path).length) {
} else if (room.duel_stage === ygopro.constants.DUEL_STAGE.BEGIN && settings.modules.tournament_mode.enabled && settings.modules.tournament_mode.deck_check && fs.readdirSync(settings.modules.tournament_mode.deck_path).length) {
struct = ygopro.structs["deck"];
struct._setBuff(buffer);
struct.set("mainc", 1);
struct.set("mainc", 1);
struct.set("sidec", 1);
struct.set("sidec", 1);
struct.set("deckbuf", [4392470, 4392470]);
struct.set("deckbuf", [4392470, 4392470]);
buffer = struct.buffer;
buffer = struct.buffer;
found_deck = false;
found_deck = false;
decks = fs.readdirSync(settings.modules.tournament_mode.deck_path);
decks = fs.readdirSync(settings.modules.tournament_mode.deck_path);
for
(
n
=
0
,
len3
=
decks
.
length
;
n
<
len3
;
n
++
)
{
for (
m = 0, len2 = decks.length; m < len2; m
++) {
deck
=
decks
[
n
];
deck = decks[
m
];
if (_.endsWith(deck, client.name + ".ydk")) {
if (_.endsWith(deck, client.name + ".ydk")) {
found_deck = deck;
found_deck = deck;
}
}
...
@@ -4545,8 +4531,8 @@
...
@@ -4545,8 +4531,8 @@
deck_main = [];
deck_main = [];
deck_side = [];
deck_side = [];
current_deck = deck_main;
current_deck = deck_main;
for
(
o
=
0
,
len4
=
deck_array
.
length
;
o
<
len4
;
o
++
)
{
for (
n = 0, len3 = deck_array.length; n < len3; n
++) {
line
=
deck_array
[
o
];
line = deck_array[
n
];
if (line.indexOf("!side") >= 0) {
if (line.indexOf("!side") >= 0) {
current_deck = deck_side;
current_deck = deck_side;
}
}
...
...
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