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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
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
5385b1a0
Commit
5385b1a0
authored
Oct 19, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update log & fix
parent
32c3fe81
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
52 deletions
+51
-52
ygopro-server.coffee
ygopro-server.coffee
+22
-22
ygopro-server.js
ygopro-server.js
+29
-30
No files found.
ygopro-server.coffee
View file @
5385b1a0
...
...
@@ -438,26 +438,26 @@ class Room
score_array
=
[]
for
name
,
score
of
@
scores
score_array
.
push
{
name
:
name
,
score
:
score
}
log
.
info
@
start_time
,
score_array
return
if
score_array
.
length
!=
2
request
.
post
{
url
:
settings
.
modules
.
arena_mode
.
post_score
,
form
:
{
accesskey
:
process
.
env
.
MYCARD_ARENA_KEY
,
usernameA
:
score_array
[
0
].
name
,
usernameB
:
score_array
[
1
].
name
,
userscoreA
:
score_array
[
0
].
score
,
userscoreB
:
score_array
[
1
].
score
,
start
:
@
start_time
,
end
:
moment
().
format
(),
arena
:
if
@
hostinfo
.
mode
==
1
then
'athletic'
else
'entertain'
#settings.modules.arena_mode.mode
}},
(
error
,
response
,
body
)
=>
if
error
log
.
warn
'SCORE POST ERROR'
,
error
,
response
else
if
response
.
statusCode
!=
204
log
.
warn
'SCORE POST'
,
response
.
statusCode
,
response
.
statusMessage
,
@
name
,
body
log
.
info
'SCORE'
,
score_array
,
@
start_time
if
score_array
.
length
==
2
request
.
post
{
url
:
settings
.
modules
.
arena_mode
.
post_score
,
form
:
{
accesskey
:
process
.
env
.
MYCARD_ARENA_KEY
,
usernameA
:
score_array
[
0
].
name
,
usernameB
:
score_array
[
1
].
name
,
userscoreA
:
score_array
[
0
].
score
,
userscoreB
:
score_array
[
1
].
score
,
start
:
@
start_time
,
end
:
moment
().
format
(),
arena
:
if
@
hostinfo
.
mode
==
1
then
'athletic'
else
'entertain'
#settings.modules.arena_mode.mode
}},
(
error
,
response
,
body
)
=>
if
error
log
.
warn
'SCORE POST ERROR'
,
error
,
response
.
statusCode
,
response
.
statusMessage
,
body
else
log
.
info
'SCORE POST'
,
response
.
statusCode
,
response
.
statusMessage
,
@
name
,
body
return
if
response
.
statusCode
!=
204
log
.
warn
'SCORE POST FAIL'
,
response
.
statusCode
,
response
.
statusMessage
,
@
name
,
body
else
log
.
info
'SCORE POST OK'
,
response
.
statusCode
,
response
.
statusMessage
,
@
name
,
body
return
if
@
player_datas
.
length
and
settings
.
modules
.
enable_cloud_replay
replay_id
=
@
cloud_replay_id
if
@
has_ygopro_error
...
...
@@ -1325,7 +1325,7 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
json
:
true
,
(
error
,
response
,
body
)
->
if
error
or
!
body
or
_
.
isString
body
log
.
warn
'LOAD SCORE ERROR'
,
client
.
name
,
error
,
response
,
body
log
.
warn
'LOAD SCORE ERROR'
,
client
.
name
,
error
,
response
.
statusCode
,
response
.
statusMessage
,
body
else
log
.
info
'LOAD SCORE'
,
client
.
name
,
body
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
#{
body
.
exp
}
点经验
#{
Math
.
round
(
body
.
pt
)
}
点战斗力 排名第
#{
body
.
arena_rank
}
(正式上线前这些积分可能被重置)"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
...
...
@@ -1349,9 +1349,9 @@ ygopro.stoc_follow 'DUEL_START', false, (buffer, info, client, server)->
log
.
warn
'DECK POST ERROR'
,
error
,
response
else
if
response
.
statusCode
!=
200
log
.
warn
'DECK POST'
,
response
.
statusCode
,
client
.
name
,
body
log
.
warn
'DECK POST
FAIL
'
,
response
.
statusCode
,
client
.
name
,
body
else
log
.
info
'DECK POST'
,
response
.
statusCode
,
client
.
name
,
body
log
.
info
'DECK POST
OK
'
,
response
.
statusCode
,
client
.
name
,
body
return
client
.
deck_saved
=
true
return
...
...
ygopro-server.js
View file @
5385b1a0
...
...
@@ -592,35 +592,34 @@
score
:
score
});
}
log
.
info
(
this
.
start_time
,
score_array
);
if
(
score_array
.
length
!==
2
)
{
return
;
}
request
.
post
({
url
:
settings
.
modules
.
arena_mode
.
post_score
,
form
:
{
accesskey
:
process
.
env
.
MYCARD_ARENA_KEY
,
usernameA
:
score_array
[
0
].
name
,
usernameB
:
score_array
[
1
].
name
,
userscoreA
:
score_array
[
0
].
score
,
userscoreB
:
score_array
[
1
].
score
,
start
:
this
.
start_time
,
end
:
moment
().
format
(),
arena
:
this
.
hostinfo
.
mode
===
1
?
'
athletic
'
:
'
entertain
'
}
},
(
function
(
_this
)
{
return
function
(
error
,
response
,
body
)
{
if
(
error
)
{
log
.
warn
(
'
SCORE POST ERROR
'
,
error
,
response
);
}
else
{
if
(
response
.
statusCode
!==
204
)
{
log
.
warn
(
'
SCORE POST
'
,
response
.
statusCode
,
response
.
statusMessage
,
_this
.
name
,
body
);
log
.
info
(
'
SCORE
'
,
score_array
,
this
.
start_time
);
if
(
score_array
.
length
===
2
)
{
request
.
post
({
url
:
settings
.
modules
.
arena_mode
.
post_score
,
form
:
{
accesskey
:
process
.
env
.
MYCARD_ARENA_KEY
,
usernameA
:
score_array
[
0
].
name
,
usernameB
:
score_array
[
1
].
name
,
userscoreA
:
score_array
[
0
].
score
,
userscoreB
:
score_array
[
1
].
score
,
start
:
this
.
start_time
,
end
:
moment
().
format
(),
arena
:
this
.
hostinfo
.
mode
===
1
?
'
athletic
'
:
'
entertain
'
}
},
(
function
(
_this
)
{
return
function
(
error
,
response
,
body
)
{
if
(
error
)
{
log
.
warn
(
'
SCORE POST ERROR
'
,
error
,
response
.
statusCode
,
response
.
statusMessage
,
body
);
}
else
{
log
.
info
(
'
SCORE POST
'
,
response
.
statusCode
,
response
.
statusMessage
,
_this
.
name
,
body
);
if
(
response
.
statusCode
!==
204
)
{
log
.
warn
(
'
SCORE POST FAIL
'
,
response
.
statusCode
,
response
.
statusMessage
,
_this
.
name
,
body
);
}
else
{
log
.
info
(
'
SCORE POST OK
'
,
response
.
statusCode
,
response
.
statusMessage
,
_this
.
name
,
body
);
}
}
}
};
}
)(
this
));
}
;
}
)(
this
))
;
}
}
if
(
this
.
player_datas
.
length
&&
settings
.
modules
.
enable_cloud_replay
)
{
replay_id
=
this
.
cloud_replay_id
;
...
...
@@ -1628,7 +1627,7 @@
json
:
true
},
function
(
error
,
response
,
body
)
{
if
(
error
||
!
body
||
_
.
isString
(
body
))
{
log
.
warn
(
'
LOAD SCORE ERROR
'
,
client
.
name
,
error
,
response
,
body
);
log
.
warn
(
'
LOAD SCORE ERROR
'
,
client
.
name
,
error
,
response
.
statusCode
,
response
.
statusMessage
,
body
);
}
else
{
log
.
info
(
'
LOAD SCORE
'
,
client
.
name
,
body
);
ygopro
.
stoc_send_chat_to_room
(
room
,
client
.
name
+
"
"
+
body
.
exp
+
"
点经验
"
+
(
Math
.
round
(
body
.
pt
))
+
"
点战斗力 排名第
"
+
body
.
arena_rank
+
"
(正式上线前这些积分可能被重置)
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
...
...
@@ -1660,9 +1659,9 @@
log
.
warn
(
'
DECK POST ERROR
'
,
error
,
response
);
}
else
{
if
(
response
.
statusCode
!==
200
)
{
log
.
warn
(
'
DECK POST
'
,
response
.
statusCode
,
client
.
name
,
body
);
log
.
warn
(
'
DECK POST
FAIL
'
,
response
.
statusCode
,
client
.
name
,
body
);
}
else
{
log
.
info
(
'
DECK POST
'
,
response
.
statusCode
,
client
.
name
,
body
);
log
.
info
(
'
DECK POST
OK
'
,
response
.
statusCode
,
client
.
name
,
body
);
}
}
});
...
...
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