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
61215b55
Commit
61215b55
authored
Feb 18, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix d3 rule
parent
bfd20499
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
ygopro-server.coffee
ygopro-server.coffee
+3
-5
ygopro-server.js
ygopro-server.js
+3
-5
No files found.
ygopro-server.coffee
View file @
61215b55
...
...
@@ -314,7 +314,6 @@ class Room
@
scores
=
{}
@
duel_count
=
0
@
death
=
0
@
dueling
=
false
ROOM_all
.
push
this
@
hostinfo
||=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
))
...
...
@@ -1250,7 +1249,6 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
client
.
lp
=
room
.
hostinfo
.
start_lp
if
client
.
pos
==
0
room
.
turn
=
0
room
.
dueling
=
true
room
.
duel_count
=
room
.
duel_count
+
1
if
room
.
death
if
settings
.
modules
.
http
.
quick_death_rule
and
room
.
duel_count
>
1
...
...
@@ -1283,10 +1281,10 @@ ygopro.stoc_follow 'GAME_MSG', false, (buffer, info, client, server)->
pos
=
buffer
.
readUInt8
(
1
)
pos
=
1
-
pos
unless
client
.
is_first
or
pos
==
2
reason
=
buffer
.
readUInt8
(
2
)
room
.
dueling
=
false
#log.info {winner: pos, reason: reason}
#room.duels.push {winner: pos, reason: reason}
room
.
winner
=
pos
room
.
turn
=
0
if
room
and
!
room
.
finished
and
room
.
dueling_players
[
pos
]
room
.
winner_name
=
room
.
dueling_players
[
pos
].
name
#log.info room.dueling_players, pos
...
...
@@ -1912,7 +1910,7 @@ if settings.modules.http
name
:
player
.
name
+
(
if
settings
.
modules
.
http
.
show_ip
and
pass_validated
and
player
.
ip
!=
'::ffff:127.0.0.1'
then
(
" (IP: "
+
player
.
ip
.
slice
(
7
)
+
")"
)
else
""
)
+
(
if
settings
.
modules
.
http
.
show_info
and
room
.
started
and
not
(
room
.
hostinfo
.
mode
==
2
and
player
.
pos
>
1
)
then
(
" (Score:"
+
room
.
scores
[
player
.
name
]
+
" LP:"
+
(
if
player
.
lp
?
then
player
.
lp
else
room
.
hostinfo
.
start_lp
)
+
")"
)
else
""
),
pos
:
player
.
pos
),
istart
:
if
room
.
started
then
(
if
settings
.
modules
.
http
.
show_info
then
(
"Duel:"
+
room
.
duel_count
+
"
Turn:"
+
(
if
room
.
turn
?
then
room
.
turn
else
0
)
+
(
if
room
.
death
then
"/"
+
(
if
room
.
death
>
0
then
room
.
death
-
1
else
"Death"
)
else
""
))
else
'start'
)
else
'wait'
istart
:
if
room
.
started
then
(
if
settings
.
modules
.
http
.
show_info
then
(
"Duel:"
+
room
.
duel_count
+
"
"
+
(
if
room
.
changing_side
then
"Siding"
else
"Turn:"
+
(
if
room
.
turn
?
then
room
.
turn
else
0
)
+
(
if
room
.
death
then
"/"
+
(
if
room
.
death
>
0
then
room
.
death
-
1
else
"Death"
)
else
""
)
))
else
'start'
)
else
'wait'
),
null
,
2
response
.
end
(
addCallback
(
u
.
query
.
callback
,
roomsjson
))
...
...
@@ -2044,7 +2042,7 @@ if settings.modules.http
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
())
death_room_found
=
true
if
room
.
dueling
or
!
room
.
duel_count
if
!
room
.
changing_side
room
.
death
=
(
if
room
.
turn
then
room
.
turn
+
4
else
5
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"${death_start}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
else
...
...
ygopro-server.js
View file @
61215b55
...
...
@@ -434,7 +434,6 @@
this
.
scores
=
{};
this
.
duel_count
=
0
;
this
.
death
=
0
;
this
.
dueling
=
false
;
ROOM_all
.
push
(
this
);
this
.
hostinfo
||
(
this
.
hostinfo
=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
)));
if
(
settings
.
lflist
.
length
)
{
...
...
@@ -1495,7 +1494,6 @@
client
.
lp
=
room
.
hostinfo
.
start_lp
;
if
(
client
.
pos
===
0
)
{
room
.
turn
=
0
;
room
.
dueling
=
true
;
room
.
duel_count
=
room
.
duel_count
+
1
;
if
(
room
.
death
)
{
if
(
settings
.
modules
.
http
.
quick_death_rule
&&
room
.
duel_count
>
1
)
{
...
...
@@ -1536,8 +1534,8 @@
pos
=
1
-
pos
;
}
reason
=
buffer
.
readUInt8
(
2
);
room
.
dueling
=
false
;
room
.
winner
=
pos
;
room
.
turn
=
0
;
if
(
room
&&
!
room
.
finished
&&
room
.
dueling_players
[
pos
])
{
room
.
winner_name
=
room
.
dueling_players
[
pos
].
name
;
room
.
scores
[
room
.
winner_name
]
=
room
.
scores
[
room
.
winner_name
]
+
1
;
...
...
@@ -2415,7 +2413,7 @@
}
return
results1
;
})(),
istart
:
room
.
started
?
(
settings
.
modules
.
http
.
show_info
?
"
Duel:
"
+
room
.
duel_count
+
"
Turn:
"
+
(
room
.
turn
!=
null
?
room
.
turn
:
0
)
+
(
room
.
death
?
"
/
"
+
(
room
.
death
>
0
?
room
.
death
-
1
:
"
Death
"
)
:
""
)
:
'
start
'
)
:
'
wait
'
istart
:
room
.
started
?
(
settings
.
modules
.
http
.
show_info
?
"
Duel:
"
+
room
.
duel_count
+
"
"
+
(
room
.
changing_side
?
"
Siding
"
:
"
Turn:
"
+
(
room
.
turn
!=
null
?
room
.
turn
:
0
)
+
(
room
.
death
?
"
/
"
+
(
room
.
death
>
0
?
room
.
death
-
1
:
"
Death
"
)
:
""
)
)
:
'
start
'
)
:
'
wait
'
});
}
}
...
...
@@ -2579,7 +2577,7 @@
continue
;
}
death_room_found
=
true
;
if
(
room
.
dueling
||
!
room
.
duel_count
)
{
if
(
!
room
.
changing_side
)
{
room
.
death
=
(
room
.
turn
?
room
.
turn
+
4
:
5
);
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${death_start}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
else
{
...
...
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