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
ef2d348d
Commit
ef2d348d
authored
Sep 16, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mc'
parents
976dfada
2562e9e8
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
202 additions
and
67 deletions
+202
-67
.dockerignore
.dockerignore
+1
-0
.travis.yml
.travis.yml
+19
-0
package-lock.json
package-lock.json
+163
-65
ygopro-server.coffee
ygopro-server.coffee
+9
-1
ygopro-server.js
ygopro-server.js
+10
-1
No files found.
.dockerignore
View file @
ef2d348d
...
@@ -37,6 +37,7 @@ $RECYCLE.BIN/
...
@@ -37,6 +37,7 @@ $RECYCLE.BIN/
.git*
.git*
.dockerignore
.dockerignore
.travis.yml
Dockerfile*
Dockerfile*
/docs
/docs
/README.md
/README.md
...
...
.travis.yml
0 → 100644
View file @
ef2d348d
services
:
-
docker
script
:
-
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
-
docker build -t mycard/ygopro-server:latest .
-
mkdir output dist
-
docker run --rm -v "$PWD/output:/output" mycard/ygopro-server:latest -e 'require("child_process").execSync("cp -rf ./* /output")'
-
cd output && tar -zcf ../dist/ygopro-server.tar.gz --format=posix --exclude='.git*' ./* && cd ..
-
docker push mycard/ygopro-server:latest
deploy
:
provider
:
s3
access_key_id
:
ztDf0fCxr0eCgSIi
secret_access_key
:
secure
:
Bm63Gi9Ok19pxhPiCbNnXlRYCmxxZWsj/PfxqGm1ruWLxinjJfpQHSRzSNTb/j0D8kK3uzUB+9MjrtcA5Nnfby4r+zuU+gvpW+3hOX2TiEtCSqYjenQmSsLD5WelMrBHXwfAQ5jOBzkdtC0vX4UTLAGcwJ8DhL9CbMJi0ZqDK9o=
bucket
:
mycard
skip_cleanup
:
true
local-dir
:
dist
upload-dir
:
srvpro
endpoint
:
https://minio.mycard.moe:9000
package-lock.json
View file @
ef2d348d
This diff is collapsed.
Click to expand it.
ygopro-server.coffee
View file @
ef2d348d
...
@@ -1120,6 +1120,7 @@ class Room
...
@@ -1120,6 +1120,7 @@ class Room
@
turn
=
0
@
turn
=
0
@
duel_stage
=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
@
duel_stage
=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
@
replays
=
[]
@
replays
=
[]
@
first_list
=
[]
ROOM_all
.
push
this
ROOM_all
.
push
this
@
hostinfo
||=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
))
@
hostinfo
||=
JSON
.
parse
(
JSON
.
stringify
(
settings
.
hostinfo
))
...
@@ -1328,6 +1329,7 @@ class Room
...
@@ -1328,6 +1329,7 @@ class Room
userscoreB
:
score_array
[
1
].
score
,
userscoreB
:
score_array
[
1
].
score
,
userdeckA
:
score_array
[
0
].
deck
,
userdeckA
:
score_array
[
0
].
deck
,
userdeckB
:
score_array
[
1
].
deck
,
userdeckB
:
score_array
[
1
].
deck
,
first
:
@
first_list
,
replays
:
formatted_replays
,
replays
:
formatted_replays
,
start
:
@
start_time
,
start
:
@
start_time
,
end
:
end_time
,
end
:
end_time
,
...
@@ -2157,7 +2159,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
...
@@ -2157,7 +2159,7 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
skip_track_visit
:
true
skip_track_visit
:
true
json
:
true
json
:
true
,
(
error
,
response
,
body
)
->
,
(
error
,
response
,
body
)
->
if
body
and
body
.
user
if
!
error
and
body
and
body
.
user
users_cache
[
client
.
name
]
=
body
.
user
.
id
users_cache
[
client
.
name
]
=
body
.
user
.
id
secret
=
body
.
user
.
id
%
65535
+
1
secret
=
body
.
user
.
id
%
65535
+
1
decrypted_buffer
=
Buffer
.
allocUnsafe
(
6
)
decrypted_buffer
=
Buffer
.
allocUnsafe
(
6
)
...
@@ -2165,6 +2167,10 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
...
@@ -2165,6 +2167,10 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server, datas)->
decrypted_buffer
.
writeUInt16LE
(
buffer
.
readUInt16LE
(
i
)
^
secret
,
i
)
decrypted_buffer
.
writeUInt16LE
(
buffer
.
readUInt16LE
(
i
)
^
secret
,
i
)
if
check_buffer_indentity
(
decrypted_buffer
)
if
check_buffer_indentity
(
decrypted_buffer
)
buffer
=
decrypted_buffer
buffer
=
decrypted_buffer
else
log
.
warn
(
"READ USER FAIL"
,
error
,
body
)
ygopro
.
stoc_die
(
client
,
"${create_room_failed}"
)
return
# buffer != decrypted_buffer ==> auth failed
# buffer != decrypted_buffer ==> auth failed
...
@@ -2553,6 +2559,8 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
...
@@ -2553,6 +2559,8 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server, datas)->
if
ygopro
.
constants
.
MSG
[
msg
]
==
'START'
if
ygopro
.
constants
.
MSG
[
msg
]
==
'START'
playertype
=
buffer
.
readUInt8
(
1
)
playertype
=
buffer
.
readUInt8
(
1
)
client
.
is_first
=
!
(
playertype
&
0xf
)
client
.
is_first
=
!
(
playertype
&
0xf
)
if
client
.
is_first
and
(
room
.
hostinfo
.
mode
!=
2
or
client
.
pos
==
0
or
client
.
pos
==
2
)
room
.
first_list
[
room
.
duel_count
-
1
]
=
client
.
name_vpass
client
.
lp
=
room
.
hostinfo
.
start_lp
client
.
lp
=
room
.
hostinfo
.
start_lp
client
.
card_count
=
0
if
room
.
hostinfo
.
mode
!=
2
client
.
card_count
=
0
if
room
.
hostinfo
.
mode
!=
2
room
.
duel_stage
=
ygopro
.
constants
.
DUEL_STAGE
.
DUELING
room
.
duel_stage
=
ygopro
.
constants
.
DUEL_STAGE
.
DUELING
...
...
ygopro-server.js
View file @
ef2d348d
...
@@ -1454,6 +1454,7 @@
...
@@ -1454,6 +1454,7 @@
this
.
turn
=
0
;
this
.
turn
=
0
;
this
.
duel_stage
=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
;
this
.
duel_stage
=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
;
this
.
replays
=
[];
this
.
replays
=
[];
this
.
first_list
=
[];
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
;
...
@@ -1737,6 +1738,7 @@
...
@@ -1737,6 +1738,7 @@
userscoreB
:
score_array
[
1
].
score
,
userscoreB
:
score_array
[
1
].
score
,
userdeckA
:
score_array
[
0
].
deck
,
userdeckA
:
score_array
[
0
].
deck
,
userdeckB
:
score_array
[
1
].
deck
,
userdeckB
:
score_array
[
1
].
deck
,
first
:
this
.
first_list
,
replays
:
formatted_replays
,
replays
:
formatted_replays
,
start
:
this
.
start_time
,
start
:
this
.
start_time
,
end
:
end_time
,
end
:
end_time
,
...
@@ -2747,7 +2749,7 @@
...
@@ -2747,7 +2749,7 @@
json
:
true
json
:
true
},
function
(
error
,
response
,
body
)
{
},
function
(
error
,
response
,
body
)
{
var
len3
,
n
,
ref4
;
var
len3
,
n
,
ref4
;
if
(
body
&&
body
.
user
)
{
if
(
!
error
&&
body
&&
body
.
user
)
{
users_cache
[
client
.
name
]
=
body
.
user
.
id
;
users_cache
[
client
.
name
]
=
body
.
user
.
id
;
secret
=
body
.
user
.
id
%
65535
+
1
;
secret
=
body
.
user
.
id
%
65535
+
1
;
decrypted_buffer
=
Buffer
.
allocUnsafe
(
6
);
decrypted_buffer
=
Buffer
.
allocUnsafe
(
6
);
...
@@ -2759,6 +2761,10 @@
...
@@ -2759,6 +2761,10 @@
if
(
check_buffer_indentity
(
decrypted_buffer
))
{
if
(
check_buffer_indentity
(
decrypted_buffer
))
{
buffer
=
decrypted_buffer
;
buffer
=
decrypted_buffer
;
}
}
}
else
{
log
.
warn
(
"
READ USER FAIL
"
,
error
,
body
);
ygopro
.
stoc_die
(
client
,
"
${create_room_failed}
"
);
return
;
}
}
if
(
!
check_buffer_indentity
(
buffer
))
{
if
(
!
check_buffer_indentity
(
buffer
))
{
ygopro
.
stoc_die
(
client
,
'
${invalid_password_checksum}
'
);
ygopro
.
stoc_die
(
client
,
'
${invalid_password_checksum}
'
);
...
@@ -3211,6 +3217,9 @@
...
@@ -3211,6 +3217,9 @@
if
(
ygopro
.
constants
.
MSG
[
msg
]
===
'
START
'
)
{
if
(
ygopro
.
constants
.
MSG
[
msg
]
===
'
START
'
)
{
playertype
=
buffer
.
readUInt8
(
1
);
playertype
=
buffer
.
readUInt8
(
1
);
client
.
is_first
=
!
(
playertype
&
0xf
);
client
.
is_first
=
!
(
playertype
&
0xf
);
if
(
client
.
is_first
&&
(
room
.
hostinfo
.
mode
!==
2
||
client
.
pos
===
0
||
client
.
pos
===
2
))
{
room
.
first_list
[
room
.
duel_count
-
1
]
=
client
.
name_vpass
;
}
client
.
lp
=
room
.
hostinfo
.
start_lp
;
client
.
lp
=
room
.
hostinfo
.
start_lp
;
if
(
room
.
hostinfo
.
mode
!==
2
)
{
if
(
room
.
hostinfo
.
mode
!==
2
)
{
client
.
card_count
=
0
;
client
.
card_count
=
0
;
...
...
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