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
738ca937
Commit
738ca937
authored
Aug 01, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix death kick ban
parent
940a74f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
ygopro-server.coffee
ygopro-server.coffee
+8
-3
ygopro-server.js
ygopro-server.js
+9
-3
No files found.
ygopro-server.coffee
View file @
738ca937
...
...
@@ -1057,9 +1057,10 @@ class Room
@
players
.
splice
(
index
,
1
)
unless
index
==
-
1
if
@
started
and
@
disconnector
!=
'server'
and
client
.
pos
<
4
@
finished
=
true
@
scores
[
client
.
name
]
=
-
9
if
@
random_type
and
not
client
.
flee_free
and
(
!
settings
.
modules
.
reconnect
.
enabled
or
@
get_disconnected_count
()
==
0
)
ROOM_ban_player
(
client
.
name
,
client
.
ip
,
"${random_ban_reason_flee}"
)
if
!
@
finished_by_death
@
scores
[
client
.
name
]
=
-
9
if
@
random_type
and
not
client
.
flee_free
and
(
!
settings
.
modules
.
reconnect
.
enabled
or
@
get_disconnected_count
()
==
0
)
ROOM_ban_player
(
client
.
name
,
client
.
ip
,
"${random_ban_reason_flee}"
)
if
@
players
.
length
and
!
(
@
windbot
and
client
.
is_host
)
and
!
(
@
arena
and
!
@
started
and
client
.
pos
<=
3
)
ygopro
.
stoc_send_chat_to_room
this
,
"
#{
client
.
name
}
${left_game}"
+
if
error
then
":
#{
error
}
"
else
''
roomlist
.
update
(
this
)
if
!
@
windbot
and
!
@
started
and
settings
.
modules
.
http
.
websocket_roomlist
...
...
@@ -1905,6 +1906,7 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server)->
win_pos
=
if
room
.
dueling_players
[
0
].
lp
>
room
.
dueling_players
[
oppo_pos
].
lp
then
0
else
oppo_pos
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_finish_part1}"
+
room
.
dueling_players
[
win_pos
].
name
+
"${death_finish_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
if
room
.
hostinfo
.
mode
==
2
room
.
finished_by_death
=
true
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
],
'DUEL_END'
)
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
+
1
],
'DUEL_END'
)
room
.
scores
[
room
.
dueling_players
[
oppo_pos
-
win_pos
].
name
]
=
-
1
...
...
@@ -1929,6 +1931,7 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server)->
win_pos
=
if
room
.
dueling_players
[
0
].
lp
>
room
.
dueling_players
[
oppo_pos
].
lp
then
0
else
oppo_pos
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_finish_part1}"
+
room
.
dueling_players
[
win_pos
].
name
+
"${death_finish_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
if
room
.
hostinfo
.
mode
==
2
room
.
finished_by_death
=
true
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
],
'DUEL_END'
)
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
+
1
],
'DUEL_END'
)
room
.
scores
[
room
.
dueling_players
[
oppo_pos
-
win_pos
].
name
]
=
-
1
...
...
@@ -2556,6 +2559,7 @@ ygopro.ctos_follow 'UPDATE_DECK', true, (buffer, info, client, server)->
oppo_pos
=
if
room
.
hostinfo
.
mode
==
2
then
2
else
1
if
settings
.
modules
.
http
.
quick_death_rule
>=
2
and
room
.
started
and
room
.
death
and
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
!=
room
.
scores
[
room
.
dueling_players
[
oppo_pos
].
name
]
win_pos
=
if
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
>
room
.
scores
[
room
.
dueling_players
[
oppo_pos
].
name
]
then
0
else
oppo_pos
room
.
finished_by_death
=
true
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death2_finish_part1}"
+
room
.
dueling_players
[
win_pos
].
name
+
"${death2_finish_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
],
'DUEL_END'
)
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
+
1
],
'DUEL_END'
)
if
room
.
hostinfo
.
mode
==
2
...
...
@@ -3093,6 +3097,7 @@ if settings.modules.http
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_start_siding}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
else
win_pos
=
if
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
>
room
.
scores
[
room
.
dueling_players
[
oppo_pos
].
name
]
then
0
else
oppo_pos
room
.
finished_by_death
=
true
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death2_finish_part1}"
+
room
.
dueling_players
[
win_pos
].
name
+
"${death2_finish_part2}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
],
'DUEL_END'
)
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
+
1
],
'DUEL_END'
)
if
room
.
hostinfo
.
mode
==
2
...
...
ygopro-server.js
View file @
738ca937
...
...
@@ -1379,9 +1379,11 @@
}
if
(
this
.
started
&&
this
.
disconnector
!==
'
server
'
&&
client
.
pos
<
4
)
{
this
.
finished
=
true
;
this
.
scores
[
client
.
name
]
=
-
9
;
if
(
this
.
random_type
&&
!
client
.
flee_free
&&
(
!
settings
.
modules
.
reconnect
.
enabled
||
this
.
get_disconnected_count
()
===
0
))
{
ROOM_ban_player
(
client
.
name
,
client
.
ip
,
"
${random_ban_reason_flee}
"
);
if
(
!
this
.
finished_by_death
)
{
this
.
scores
[
client
.
name
]
=
-
9
;
if
(
this
.
random_type
&&
!
client
.
flee_free
&&
(
!
settings
.
modules
.
reconnect
.
enabled
||
this
.
get_disconnected_count
()
===
0
))
{
ROOM_ban_player
(
client
.
name
,
client
.
ip
,
"
${random_ban_reason_flee}
"
);
}
}
}
if
(
this
.
players
.
length
&&
!
(
this
.
windbot
&&
client
.
is_host
)
&&
!
(
this
.
arena
&&
!
this
.
started
&&
client
.
pos
<=
3
))
{
...
...
@@ -2315,6 +2317,7 @@
win_pos
=
room
.
dueling_players
[
0
].
lp
>
room
.
dueling_players
[
oppo_pos
].
lp
?
0
:
oppo_pos
;
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_finish_part1}
"
+
room
.
dueling_players
[
win_pos
].
name
+
"
${death_finish_part2}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
if
(
room
.
hostinfo
.
mode
===
2
)
{
room
.
finished_by_death
=
true
;
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
],
'
DUEL_END
'
);
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
+
1
],
'
DUEL_END
'
);
room
.
scores
[
room
.
dueling_players
[
oppo_pos
-
win_pos
].
name
]
=
-
1
;
...
...
@@ -2345,6 +2348,7 @@
win_pos
=
room
.
dueling_players
[
0
].
lp
>
room
.
dueling_players
[
oppo_pos
].
lp
?
0
:
oppo_pos
;
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_finish_part1}
"
+
room
.
dueling_players
[
win_pos
].
name
+
"
${death_finish_part2}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
if
(
room
.
hostinfo
.
mode
===
2
)
{
room
.
finished_by_death
=
true
;
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
],
'
DUEL_END
'
);
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
+
1
],
'
DUEL_END
'
);
room
.
scores
[
room
.
dueling_players
[
oppo_pos
-
win_pos
].
name
]
=
-
1
;
...
...
@@ -3206,6 +3210,7 @@
oppo_pos
=
room
.
hostinfo
.
mode
===
2
?
2
:
1
;
if
(
settings
.
modules
.
http
.
quick_death_rule
>=
2
&&
room
.
started
&&
room
.
death
&&
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
!==
room
.
scores
[
room
.
dueling_players
[
oppo_pos
].
name
])
{
win_pos
=
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
>
room
.
scores
[
room
.
dueling_players
[
oppo_pos
].
name
]
?
0
:
oppo_pos
;
room
.
finished_by_death
=
true
;
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death2_finish_part1}
"
+
room
.
dueling_players
[
win_pos
].
name
+
"
${death2_finish_part2}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
],
'
DUEL_END
'
);
if
(
room
.
hostinfo
.
mode
===
2
)
{
...
...
@@ -3942,6 +3947,7 @@
}
}
else
{
win_pos
=
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
>
room
.
scores
[
room
.
dueling_players
[
oppo_pos
].
name
]
?
0
:
oppo_pos
;
room
.
finished_by_death
=
true
;
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death2_finish_part1}
"
+
room
.
dueling_players
[
win_pos
].
name
+
"
${death2_finish_part2}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ygopro
.
stoc_send
(
room
.
dueling_players
[
oppo_pos
-
win_pos
],
'
DUEL_END
'
);
if
(
room
.
hostinfo
.
mode
===
2
)
{
...
...
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