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
5f586497
Commit
5f586497
authored
Nov 23, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
send deck to arena api
parent
2d71750c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
11 deletions
+34
-11
ygopro-server.coffee
ygopro-server.coffee
+13
-4
ygopro-server.js
ygopro-server.js
+21
-7
No files found.
ygopro-server.coffee
View file @
5f586497
...
...
@@ -812,6 +812,7 @@ class Room
@
random_type
=
''
@
welcome
=
''
@
scores
=
{}
@
decks
=
{}
@
duel_count
=
0
@
death
=
0
@
turn
=
0
...
...
@@ -961,7 +962,10 @@ class Room
#log.info 'room-delete', this.name, ROOM_all.length
score_array
=
[]
for
name
,
score
of
@
scores
score_array
.
push
{
name
:
name
,
score
:
score
}
score_form
=
{
name
:
name
,
score
:
score
,
deck
:
null
}
if
@
decks
[
name
]
score_form
.
deck
=
@
decks
[
name
]
score_array
.
push
score_form
if
settings
.
modules
.
arena_mode
.
enabled
and
@
arena
#log.info 'SCORE', score_array, @start_time
end_time
=
moment
().
format
()
...
...
@@ -969,9 +973,9 @@ class Room
@
start_time
=
end_time
if
score_array
.
length
!=
2
if
!
score_array
[
0
]
score_array
[
0
]
=
{
name
:
null
,
score
:
-
5
}
score_array
[
0
]
=
{
name
:
null
,
score
:
-
5
,
deck
:
null
}
if
!
score_array
[
1
]
score_array
[
1
]
=
{
name
:
null
,
score
:
-
5
}
score_array
[
1
]
=
{
name
:
null
,
score
:
-
5
,
deck
:
null
}
score_array
[
0
].
score
=
-
5
score_array
[
1
].
score
=
-
5
request
.
post
{
url
:
settings
.
modules
.
arena_mode
.
post_score
,
form
:
{
...
...
@@ -980,6 +984,8 @@ class Room
usernameB
:
score_array
[
1
].
name
,
userscoreA
:
score_array
[
0
].
score
,
userscoreB
:
score_array
[
1
].
score
,
userdeckA
:
score_array
[
0
].
deck
,
userdeckB
:
score_array
[
1
].
deck
,
start
:
@
start_time
,
end
:
end_time
,
arena
:
@
arena
...
...
@@ -2408,8 +2414,11 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
ROOM_players_oppentlist
[
player
.
ip
]
=
null
if
settings
.
modules
.
tips
.
enabled
ygopro
.
stoc_send_random_tip
(
client
)
if
settings
.
modules
.
deck_log
.
enabled
and
client
.
main
and
client
.
main
.
length
and
not
client
.
deck_saved
and
not
room
.
windbot
deck_text
=
null
if
client
.
main
and
client
.
main
.
length
deck_text
=
'#ygopro-server deck log
\n
#main
\n
'
+
client
.
main
.
join
(
'
\n
'
)
+
'
\n
!side
\n
'
+
client
.
side
.
join
(
'
\n
'
)
+
'
\n
'
room
.
decks
[
client
.
name
]
=
deck_text
if
settings
.
modules
.
deck_log
.
enabled
and
deck_text
and
not
client
.
deck_saved
and
not
room
.
windbot
deck_arena
=
settings
.
modules
.
deck_log
.
arena
+
'-'
if
room
.
arena
deck_arena
=
deck_arena
+
room
.
arena
...
...
ygopro-server.js
View file @
5f586497
...
...
@@ -1022,6 +1022,7 @@
this
.
random_type
=
''
;
this
.
welcome
=
''
;
this
.
scores
=
{};
this
.
decks
=
{};
this
.
duel_count
=
0
;
this
.
death
=
0
;
this
.
turn
=
0
;
...
...
@@ -1207,7 +1208,7 @@
}
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
end_time
,
index
,
log_rep_id
,
name
,
player_ips
,
player_names
,
recorder_buffer
,
ref2
,
replay_id
,
score
,
score_array
,
score_form
;
if
(
this
.
deleted
)
{
return
;
}
...
...
@@ -1215,10 +1216,15 @@
ref2
=
this
.
scores
;
for
(
name
in
ref2
)
{
score
=
ref2
[
name
];
score_
array
.
push
(
{
score_
form
=
{
name
:
name
,
score
:
score
});
score
:
score
,
deck
:
null
};
if
(
this
.
decks
[
name
])
{
score_form
.
deck
=
this
.
decks
[
name
];
}
score_array
.
push
(
score_form
);
}
if
(
settings
.
modules
.
arena_mode
.
enabled
&&
this
.
arena
)
{
end_time
=
moment
().
format
();
...
...
@@ -1229,13 +1235,15 @@
if
(
!
score_array
[
0
])
{
score_array
[
0
]
=
{
name
:
null
,
score
:
-
5
score
:
-
5
,
deck
:
null
};
}
if
(
!
score_array
[
1
])
{
score_array
[
1
]
=
{
name
:
null
,
score
:
-
5
score
:
-
5
,
deck
:
null
};
}
score_array
[
0
].
score
=
-
5
;
...
...
@@ -1249,6 +1257,8 @@
usernameB
:
score_array
[
1
].
name
,
userscoreA
:
score_array
[
0
].
score
,
userscoreB
:
score_array
[
1
].
score
,
userdeckA
:
score_array
[
0
].
deck
,
userdeckB
:
score_array
[
1
].
deck
,
start
:
this
.
start_time
,
end
:
end_time
,
arena
:
this
.
arena
...
...
@@ -2976,8 +2986,12 @@
if
(
settings
.
modules
.
tips
.
enabled
)
{
ygopro
.
stoc_send_random_tip
(
client
);
}
if
(
settings
.
modules
.
deck_log
.
enabled
&&
client
.
main
&&
client
.
main
.
length
&&
!
client
.
deck_saved
&&
!
room
.
windbot
)
{
deck_text
=
null
;
if
(
client
.
main
&&
client
.
main
.
length
)
{
deck_text
=
'
#ygopro-server deck log
\n
#main
\n
'
+
client
.
main
.
join
(
'
\n
'
)
+
'
\n
!side
\n
'
+
client
.
side
.
join
(
'
\n
'
)
+
'
\n
'
;
room
.
decks
[
client
.
name
]
=
deck_text
;
}
if
(
settings
.
modules
.
deck_log
.
enabled
&&
deck_text
&&
!
client
.
deck_saved
&&
!
room
.
windbot
)
{
deck_arena
=
settings
.
modules
.
deck_log
.
arena
+
'
-
'
;
if
(
room
.
arena
)
{
deck_arena
=
deck_arena
+
room
.
arena
;
...
...
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