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
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
6e47b638
Commit
6e47b638
authored
Jun 23, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
10e0ae03
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
66 deletions
+96
-66
ygopro-server.coffee
ygopro-server.coffee
+40
-27
ygopro-server.js
ygopro-server.js
+56
-39
No files found.
ygopro-server.coffee
View file @
6e47b638
...
@@ -656,8 +656,6 @@ class Room
...
@@ -656,8 +656,6 @@ class Room
@
duel_count
=
0
@
duel_count
=
0
@
death
=
0
@
death
=
0
@
turn
=
0
@
turn
=
0
if
settings
.
modules
.
challonge
.
enabled
@
challonge_duel_log
=
{}
ROOM_all
.
push
this
ROOM_all
.
push
this
@
hostinfo
||=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
))
@
hostinfo
||=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
))
...
@@ -826,10 +824,32 @@ class Room
...
@@ -826,10 +824,32 @@ class Room
# log.info 'SCORE POST OK', response.statusCode, response.statusMessage, @name, body
# log.info 'SCORE POST OK', response.statusCode, response.statusMessage, @name, body
return
return
if
settings
.
modules
.
challonge
.
enabled
and
@
started
if
settings
.
modules
.
challonge
.
enabled
and
@
started
challonge_duel_log
=
{}
if
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
>
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
challonge_duel_log
.
winnerId
=
room
.
dueling_players
[
0
].
challonge_info
.
id
else
if
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
<
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
challonge_duel_log
.
winnerId
=
room
.
dueling_players
[
1
].
challonge_info
.
id
else
if
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
>
0
and
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
challonge_duel_log
.
winnerId
=
"tie"
if
settings
.
modules
.
challonge
.
post_detailed_score
if
room
.
dueling_players
[
0
].
challonge_info
.
id
==
room
.
challonge_info
.
player1Id
and
room
.
dueling_players
[
1
].
challonge_info
.
id
==
room
.
challonge_info
.
player2Id
challonge_duel_log
.
scoresCsv
=
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
+
"-"
+
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
else
if
room
.
dueling_players
[
1
].
challonge_info
.
id
==
room
.
challonge_info
.
player1Id
and
room
.
dueling_players
[
0
].
challonge_info
.
id
==
room
.
challonge_info
.
player2Id
challonge_duel_log
.
scoresCsv
=
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
+
"-"
+
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
else
challonge_duel_log
.
scoresCsv
=
"0-0"
log
.
warn
(
"Score mismatch."
,
room
.
name
)
else
if
challonge_duel_log
.
winnerId
==
room
.
challonge_info
.
player1Id
challonge_duel_log
.
scoresCsv
=
"1-0"
else
if
challonge_duel_log
.
winnerId
==
room
.
challonge_info
.
player2Id
challonge_duel_log
.
scoresCsv
=
"0-1"
else
challonge_duel_log
.
scoresCsv
=
"0-0"
challonge
.
matches
.
update
({
challonge
.
matches
.
update
({
id
:
settings
.
modules
.
challonge
.
tournament_id
,
id
:
settings
.
modules
.
challonge
.
tournament_id
,
matchId
:
@
challonge_info
.
id
,
matchId
:
@
challonge_info
.
id
,
match
:
@
challonge_duel_log
,
match
:
challonge_duel_log
,
callback
:
(
err
,
data
)
->
callback
:
(
err
,
data
)
->
if
err
if
err
log
.
warn
(
"Errored pushing scores to Challonge."
,
err
)
log
.
warn
(
"Errored pushing scores to Challonge."
,
err
)
...
@@ -1504,7 +1524,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
...
@@ -1504,7 +1524,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
return
return
found
=
false
found
=
false
for
k
,
match
of
data
for
k
,
match
of
data
if
match
and
match
.
match
and
!
match
.
match
.
winnerId
and
(
match
.
match
.
player1Id
==
client
.
challonge_info
.
id
or
match
.
match
.
player2Id
==
client
.
challonge_info
.
id
)
if
match
and
match
.
match
and
!
match
.
match
.
winnerId
and
match
.
match
.
player1Id
and
match
.
match
.
player2Id
and
(
match
.
match
.
player1Id
==
client
.
challonge_info
.
id
or
match
.
match
.
player2Id
==
client
.
challonge_info
.
id
)
found
=
match
.
match
found
=
match
.
match
break
break
if
!
found
if
!
found
...
@@ -2510,28 +2530,6 @@ ygopro.stoc_follow 'REPLAY', true, (buffer, info, client, server)->
...
@@ -2510,28 +2530,6 @@ ygopro.stoc_follow 'REPLAY', true, (buffer, info, client, server)->
return
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
and
settings
.
modules
.
tournament_mode
.
block_replay_to_player
unless
room
return
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
and
settings
.
modules
.
tournament_mode
.
block_replay_to_player
unless
room
if
settings
.
modules
.
cloud_replay
.
enabled
and
room
.
random_type
if
settings
.
modules
.
cloud_replay
.
enabled
and
room
.
random_type
Cloud_replay_ids
.
push
room
.
cloud_replay_id
Cloud_replay_ids
.
push
room
.
cloud_replay_id
if
settings
.
modules
.
challonge
.
enabled
and
client
.
pos
==
0
if
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
>
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
room
.
challonge_duel_log
.
winnerId
=
room
.
dueling_players
[
0
].
challonge_info
.
id
else
if
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
<
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
room
.
challonge_duel_log
.
winnerId
=
room
.
dueling_players
[
1
].
challonge_info
.
id
else
room
.
challonge_duel_log
.
winnerId
=
"tie"
if
settings
.
modules
.
challonge
.
post_detailed_score
if
room
.
dueling_players
[
0
].
challonge_info
.
id
==
room
.
challonge_info
.
player1Id
and
room
.
dueling_players
[
1
].
challonge_info
.
id
==
room
.
challonge_info
.
player2Id
room
.
challonge_duel_log
.
scoresCsv
=
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
+
"-"
+
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
else
if
room
.
dueling_players
[
1
].
challonge_info
.
id
==
room
.
challonge_info
.
player1Id
and
room
.
dueling_players
[
0
].
challonge_info
.
id
==
room
.
challonge_info
.
player2Id
room
.
challonge_duel_log
.
scoresCsv
=
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
+
"-"
+
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
else
room
.
challonge_duel_log
.
scoresCsv
=
"0-0"
log
.
warn
(
"Score mismatch."
,
room
.
name
)
else
if
room
.
challonge_duel_log
.
winnerId
==
room
.
challonge_info
.
player1Id
room
.
challonge_duel_log
.
scoresCsv
=
"1-0"
else
if
room
.
challonge_duel_log
.
winnerId
==
room
.
challonge_info
.
player2Id
room
.
challonge_duel_log
.
scoresCsv
=
"0-1"
else
room
.
challonge_duel_log
.
scoresCsv
=
"0-0"
if
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
if
settings
.
modules
.
tournament_mode
.
enabled
and
settings
.
modules
.
tournament_mode
.
replay_safe
if
client
.
pos
==
0
if
client
.
pos
==
0
dueltime
=
moment
().
format
(
'YYYY-MM-DD HH-mm-ss'
)
dueltime
=
moment
().
format
(
'YYYY-MM-DD HH-mm-ss'
)
...
@@ -2787,9 +2785,24 @@ if settings.modules.http
...
@@ -2787,9 +2785,24 @@ if settings.modules.http
response
.
writeHead
(
200
)
response
.
writeHead
(
200
)
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['ban ok', '"
+
u
.
query
.
ban
+
"']"
))
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['ban ok', '"
+
u
.
query
.
ban
+
"']"
))
else
if
u
.
query
.
kick
kick_room_found
=
false
for
room
in
ROOM_all
when
room
and
room
.
established
and
(
u
.
query
.
kick
==
"all"
or
u
.
query
.
kick
==
room
.
port
.
toString
()
or
u
.
query
.
kick
==
room
.
name
)
kick_room_found
=
true
if
room
.
started
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
=
0
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
=
0
room
.
process
.
kill
()
room
.
delete
()
response
.
writeHead
(
200
)
if
kick_room_found
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['kick ok', '"
+
u
.
query
.
kick
+
"']"
))
else
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"['room not found', '"
+
u
.
query
.
kick
+
"']"
))
else
if
u
.
query
.
death
else
if
u
.
query
.
death
death_room_found
=
false
death_room_found
=
false
for
room
in
ROOM_all
when
room
and
room
.
established
and
room
.
started
and
!
room
.
death
and
(
u
.
query
.
death
==
"all"
or
u
.
query
.
death
==
room
.
port
.
toString
())
for
room
in
ROOM_all
when
room
and
room
.
established
and
room
.
started
and
!
room
.
death
and
(
u
.
query
.
death
==
"all"
or
u
.
query
.
death
==
room
.
port
.
toString
()
or
u
.
query
.
death
==
room
.
name
)
death_room_found
=
true
death_room_found
=
true
oppo_pos
=
if
room
.
hostinfo
.
mode
==
2
then
2
else
1
oppo_pos
=
if
room
.
hostinfo
.
mode
==
2
then
2
else
1
if
!
room
.
changing_side
and
(
!
room
.
duel_count
or
room
.
turn
)
if
!
room
.
changing_side
and
(
!
room
.
duel_count
or
room
.
turn
)
...
...
ygopro-server.js
View file @
6e47b638
...
@@ -841,9 +841,6 @@
...
@@ -841,9 +841,6 @@
this
.
duel_count
=
0
;
this
.
duel_count
=
0
;
this
.
death
=
0
;
this
.
death
=
0
;
this
.
turn
=
0
;
this
.
turn
=
0
;
if
(
settings
.
modules
.
challonge
.
enabled
)
{
this
.
challonge_duel_log
=
{};
}
ROOM_all
.
push
(
this
);
ROOM_all
.
push
(
this
);
this
.
hostinfo
||
(
this
.
hostinfo
=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
)));
this
.
hostinfo
||
(
this
.
hostinfo
=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
)));
delete
this
.
hostinfo
.
comment
;
delete
this
.
hostinfo
.
comment
;
...
@@ -1022,7 +1019,7 @@
...
@@ -1022,7 +1019,7 @@
}
}
Room
.
prototype
[
"
delete
"
]
=
function
()
{
Room
.
prototype
[
"
delete
"
]
=
function
()
{
var
end_time
,
index
,
log_rep_id
,
name
,
player_ips
,
player_names
,
recorder_buffer
,
ref2
,
replay_id
,
score
,
score_array
;
var
challonge_duel_log
,
end_time
,
index
,
log_rep_id
,
name
,
player_ips
,
player_names
,
recorder_buffer
,
ref2
,
replay_id
,
score
,
score_array
;
if
(
this
.
deleted
)
{
if
(
this
.
deleted
)
{
return
;
return
;
}
}
...
@@ -1067,10 +1064,36 @@
...
@@ -1067,10 +1064,36 @@
}
}
}
}
if
(
settings
.
modules
.
challonge
.
enabled
&&
this
.
started
)
{
if
(
settings
.
modules
.
challonge
.
enabled
&&
this
.
started
)
{
challonge_duel_log
=
{};
if
(
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
>
room
.
scores
[
room
.
dueling_players
[
1
].
name
])
{
challonge_duel_log
.
winnerId
=
room
.
dueling_players
[
0
].
challonge_info
.
id
;
}
else
if
(
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
<
room
.
scores
[
room
.
dueling_players
[
1
].
name
])
{
challonge_duel_log
.
winnerId
=
room
.
dueling_players
[
1
].
challonge_info
.
id
;
}
else
if
(
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
>
0
&&
room
.
scores
[
room
.
dueling_players
[
1
].
name
])
{
challonge_duel_log
.
winnerId
=
"
tie
"
;
}
if
(
settings
.
modules
.
challonge
.
post_detailed_score
)
{
if
(
room
.
dueling_players
[
0
].
challonge_info
.
id
===
room
.
challonge_info
.
player1Id
&&
room
.
dueling_players
[
1
].
challonge_info
.
id
===
room
.
challonge_info
.
player2Id
)
{
challonge_duel_log
.
scoresCsv
=
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
+
"
-
"
+
room
.
scores
[
room
.
dueling_players
[
1
].
name
];
}
else
if
(
room
.
dueling_players
[
1
].
challonge_info
.
id
===
room
.
challonge_info
.
player1Id
&&
room
.
dueling_players
[
0
].
challonge_info
.
id
===
room
.
challonge_info
.
player2Id
)
{
challonge_duel_log
.
scoresCsv
=
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
+
"
-
"
+
room
.
scores
[
room
.
dueling_players
[
0
].
name
];
}
else
{
challonge_duel_log
.
scoresCsv
=
"
0-0
"
;
log
.
warn
(
"
Score mismatch.
"
,
room
.
name
);
}
}
else
{
if
(
challonge_duel_log
.
winnerId
===
room
.
challonge_info
.
player1Id
)
{
challonge_duel_log
.
scoresCsv
=
"
1-0
"
;
}
else
if
(
challonge_duel_log
.
winnerId
===
room
.
challonge_info
.
player2Id
)
{
challonge_duel_log
.
scoresCsv
=
"
0-1
"
;
}
else
{
challonge_duel_log
.
scoresCsv
=
"
0-0
"
;
}
}
challonge
.
matches
.
update
({
challonge
.
matches
.
update
({
id
:
settings
.
modules
.
challonge
.
tournament_id
,
id
:
settings
.
modules
.
challonge
.
tournament_id
,
matchId
:
this
.
challonge_info
.
id
,
matchId
:
this
.
challonge_info
.
id
,
match
:
this
.
challonge_duel_log
,
match
:
challonge_duel_log
,
callback
:
function
(
err
,
data
)
{
callback
:
function
(
err
,
data
)
{
if
(
err
)
{
if
(
err
)
{
log
.
warn
(
"
Errored pushing scores to Challonge.
"
,
err
);
log
.
warn
(
"
Errored pushing scores to Challonge.
"
,
err
);
...
@@ -1843,7 +1866,7 @@
...
@@ -1843,7 +1866,7 @@
found
=
false
;
found
=
false
;
for
(
k
in
data
)
{
for
(
k
in
data
)
{
match
=
data
[
k
];
match
=
data
[
k
];
if
(
match
&&
match
.
match
&&
!
match
.
match
.
winnerId
&&
(
match
.
match
.
player1Id
===
client
.
challonge_info
.
id
||
match
.
match
.
player2Id
===
client
.
challonge_info
.
id
))
{
if
(
match
&&
match
.
match
&&
!
match
.
match
.
winnerId
&&
match
.
match
.
player1Id
&&
match
.
match
.
player2Id
&&
(
match
.
match
.
player1Id
===
client
.
challonge_info
.
id
||
match
.
match
.
player2Id
===
client
.
challonge_info
.
id
))
{
found
=
match
.
match
;
found
=
match
.
match
;
break
;
break
;
}
}
...
@@ -3163,33 +3186,6 @@
...
@@ -3163,33 +3186,6 @@
if
(
settings
.
modules
.
cloud_replay
.
enabled
&&
room
.
random_type
)
{
if
(
settings
.
modules
.
cloud_replay
.
enabled
&&
room
.
random_type
)
{
Cloud_replay_ids
.
push
(
room
.
cloud_replay_id
);
Cloud_replay_ids
.
push
(
room
.
cloud_replay_id
);
}
}
if
(
settings
.
modules
.
challonge
.
enabled
&&
client
.
pos
===
0
)
{
if
(
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
>
room
.
scores
[
room
.
dueling_players
[
1
].
name
])
{
room
.
challonge_duel_log
.
winnerId
=
room
.
dueling_players
[
0
].
challonge_info
.
id
;
}
else
if
(
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
<
room
.
scores
[
room
.
dueling_players
[
1
].
name
])
{
room
.
challonge_duel_log
.
winnerId
=
room
.
dueling_players
[
1
].
challonge_info
.
id
;
}
else
{
room
.
challonge_duel_log
.
winnerId
=
"
tie
"
;
}
if
(
settings
.
modules
.
challonge
.
post_detailed_score
)
{
if
(
room
.
dueling_players
[
0
].
challonge_info
.
id
===
room
.
challonge_info
.
player1Id
&&
room
.
dueling_players
[
1
].
challonge_info
.
id
===
room
.
challonge_info
.
player2Id
)
{
room
.
challonge_duel_log
.
scoresCsv
=
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
+
"
-
"
+
room
.
scores
[
room
.
dueling_players
[
1
].
name
];
}
else
if
(
room
.
dueling_players
[
1
].
challonge_info
.
id
===
room
.
challonge_info
.
player1Id
&&
room
.
dueling_players
[
0
].
challonge_info
.
id
===
room
.
challonge_info
.
player2Id
)
{
room
.
challonge_duel_log
.
scoresCsv
=
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
+
"
-
"
+
room
.
scores
[
room
.
dueling_players
[
0
].
name
];
}
else
{
room
.
challonge_duel_log
.
scoresCsv
=
"
0-0
"
;
log
.
warn
(
"
Score mismatch.
"
,
room
.
name
);
}
}
else
{
if
(
room
.
challonge_duel_log
.
winnerId
===
room
.
challonge_info
.
player1Id
)
{
room
.
challonge_duel_log
.
scoresCsv
=
"
1-0
"
;
}
else
if
(
room
.
challonge_duel_log
.
winnerId
===
room
.
challonge_info
.
player2Id
)
{
room
.
challonge_duel_log
.
scoresCsv
=
"
0-1
"
;
}
else
{
room
.
challonge_duel_log
.
scoresCsv
=
"
0-0
"
;
}
}
}
if
(
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
replay_safe
)
{
if
(
settings
.
modules
.
tournament_mode
.
enabled
&&
settings
.
modules
.
tournament_mode
.
replay_safe
)
{
if
(
client
.
pos
===
0
)
{
if
(
client
.
pos
===
0
)
{
dueltime
=
moment
().
format
(
'
YYYY-MM-DD HH-mm-ss
'
);
dueltime
=
moment
().
format
(
'
YYYY-MM-DD HH-mm-ss
'
);
...
@@ -3326,7 +3322,7 @@
...
@@ -3326,7 +3322,7 @@
return
callback
+
"
(
"
+
text
+
"
);
"
;
return
callback
+
"
(
"
+
text
+
"
);
"
;
};
};
requestListener
=
function
(
request
,
response
)
{
requestListener
=
function
(
request
,
response
)
{
var
archive_args
,
archive_name
,
archive_process
,
check
,
death_room_found
,
duellog
,
error
,
filename
,
getpath
,
len2
,
len3
,
len4
,
len5
,
m
,
n
,
o
,
oppo_pos
,
p
,
parseQueryString
,
pass_validated
,
player
,
ref2
,
replay
,
room
,
roomsjson
,
u
,
win_pos
;
var
archive_args
,
archive_name
,
archive_process
,
check
,
death_room_found
,
duellog
,
error
,
filename
,
getpath
,
kick_room_found
,
len2
,
len3
,
len4
,
len5
,
len6
,
m
,
n
,
o
,
oppo_pos
,
p
,
parseQueryString
,
pass_validated
,
player
,
q
,
ref2
,
replay
,
room
,
roomsjson
,
u
,
win_pos
;
parseQueryString
=
true
;
parseQueryString
=
true
;
u
=
url
.
parse
(
request
.
url
,
parseQueryString
);
u
=
url
.
parse
(
request
.
url
,
parseQueryString
);
pass_validated
=
u
.
query
.
pass
===
settings
.
modules
.
http
.
password
;
pass_validated
=
u
.
query
.
pass
===
settings
.
modules
.
http
.
password
;
...
@@ -3528,11 +3524,32 @@
...
@@ -3528,11 +3524,32 @@
ban_user
(
u
.
query
.
ban
);
ban_user
(
u
.
query
.
ban
);
response
.
writeHead
(
200
);
response
.
writeHead
(
200
);
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['ban ok', '
"
+
u
.
query
.
ban
+
"
']
"
));
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['ban ok', '
"
+
u
.
query
.
ban
+
"
']
"
));
}
else
if
(
u
.
query
.
death
)
{
}
else
if
(
u
.
query
.
kick
)
{
death
_room_found
=
false
;
kick
_room_found
=
false
;
for
(
o
=
0
,
len4
=
ROOM_all
.
length
;
o
<
len4
;
o
++
)
{
for
(
o
=
0
,
len4
=
ROOM_all
.
length
;
o
<
len4
;
o
++
)
{
room
=
ROOM_all
[
o
];
room
=
ROOM_all
[
o
];
if
(
!
(
room
&&
room
.
established
&&
room
.
started
&&
!
room
.
death
&&
(
u
.
query
.
death
===
"
all
"
||
u
.
query
.
death
===
room
.
port
.
toString
())))
{
if
(
!
(
room
&&
room
.
established
&&
(
u
.
query
.
kick
===
"
all
"
||
u
.
query
.
kick
===
room
.
port
.
toString
()
||
u
.
query
.
kick
===
room
.
name
)))
{
continue
;
}
kick_room_found
=
true
;
if
(
room
.
started
)
{
room
.
scores
[
room
.
dueling_players
[
0
].
name
]
=
0
;
room
.
scores
[
room
.
dueling_players
[
1
].
name
]
=
0
;
}
room
.
process
.
kill
();
room
[
"
delete
"
]();
}
response
.
writeHead
(
200
);
if
(
kick_room_found
)
{
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['kick ok', '
"
+
u
.
query
.
kick
+
"
']
"
));
}
else
{
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['room not found', '
"
+
u
.
query
.
kick
+
"
']
"
));
}
}
else
if
(
u
.
query
.
death
)
{
death_room_found
=
false
;
for
(
p
=
0
,
len5
=
ROOM_all
.
length
;
p
<
len5
;
p
++
)
{
room
=
ROOM_all
[
p
];
if
(
!
(
room
&&
room
.
established
&&
room
.
started
&&
!
room
.
death
&&
(
u
.
query
.
death
===
"
all
"
||
u
.
query
.
death
===
room
.
port
.
toString
()
||
u
.
query
.
death
===
room
.
name
)))
{
continue
;
continue
;
}
}
death_room_found
=
true
;
death_room_found
=
true
;
...
@@ -3591,8 +3608,8 @@
...
@@ -3591,8 +3608,8 @@
}
}
}
else
if
(
u
.
query
.
deathcancel
)
{
}
else
if
(
u
.
query
.
deathcancel
)
{
death_room_found
=
false
;
death_room_found
=
false
;
for
(
p
=
0
,
len5
=
ROOM_all
.
length
;
p
<
len5
;
p
++
)
{
for
(
q
=
0
,
len6
=
ROOM_all
.
length
;
q
<
len6
;
q
++
)
{
room
=
ROOM_all
[
p
];
room
=
ROOM_all
[
q
];
if
(
!
(
room
&&
room
.
established
&&
room
.
started
&&
room
.
death
&&
(
u
.
query
.
deathcancel
===
"
all
"
||
u
.
query
.
deathcancel
===
room
.
port
.
toString
())))
{
if
(
!
(
room
&&
room
.
established
&&
room
.
started
&&
room
.
death
&&
(
u
.
query
.
deathcancel
===
"
all
"
||
u
.
query
.
deathcancel
===
room
.
port
.
toString
())))
{
continue
;
continue
;
}
}
...
...
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