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
ed52f897
Commit
ed52f897
authored
Jun 18, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add reconnect
parent
5c4550cb
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
883 additions
and
234 deletions
+883
-234
data/constants.json
data/constants.json
+4
-2
data/default_config.json
data/default_config.json
+4
-0
data/i18n.json
data/i18n.json
+8
-0
data/structs.json
data/structs.json
+1
-1
ygopro-server.coffee
ygopro-server.coffee
+341
-65
ygopro-server.js
ygopro-server.js
+511
-165
ygopro.coffee
ygopro.coffee
+7
-1
ygopro.js
ygopro.js
+7
-0
No files found.
data/constants.json
View file @
ed52f897
...
...
@@ -29,7 +29,8 @@
"34"
:
"HS_READY"
,
"35"
:
"HS_NOTREADY"
,
"36"
:
"HS_KICK"
,
"37"
:
"HS_START"
"37"
:
"HS_START"
,
"48"
:
"REQUEST_FIELD"
},
"STOC"
:
{
"1"
:
"GAME_MSG"
,
...
...
@@ -51,7 +52,8 @@
"25"
:
"CHAT"
,
"32"
:
"HS_PLAYER_ENTER"
,
"33"
:
"HS_PLAYER_CHANGE"
,
"34"
:
"HS_WATCH_CHANGE"
"34"
:
"HS_WATCH_CHANGE"
,
"48"
:
"FIELD_FINISH"
},
"PLAYERCHANGE"
:{
"8"
:
"OBSERVE"
,
...
...
data/default_config.json
View file @
ed52f897
...
...
@@ -86,6 +86,10 @@
"enabled"
:
true
,
"max_retry_count"
:
false
},
"reconnect"
:
{
"enabled"
:
true
,
"wait_time"
:
300000
},
"mycard"
:
{
"enabled"
:
false
,
"auth_base_url"
:
"https://ygobbs.com"
,
...
...
data/i18n.json
View file @
ed52f897
...
...
@@ -131,6 +131,10 @@
"retry_too_much_part2"
:
" times."
,
"retry_too_much_room_part1"
:
" was kicked from the room for performing an illegal operation "
,
"retry_too_much_room_part2"
:
" times."
,
"pre_reconnecting_to_room"
:
"You will be reconnected to your previous game. Please pick your Previous deck."
,
"deck_incorrect_reconnect"
:
"Please pick your Previous deck."
,
"reconnect_failed"
:
"Reconnect failed."
,
"reconnecting_to_room"
:
"Reconnecting to server..."
,
"athletic_arena_tip"
:
"During an athletic match, a game quit behavior is regarded as a surrender."
},
"es-es"
:
{
...
...
@@ -398,6 +402,10 @@
"retry_too_much_part2"
:
"次,已被请出房间。"
,
"retry_too_much_room_part1"
:
" 由于在决斗中违规操作"
,
"retry_too_much_room_part2"
:
"次,已被请出房间。"
,
"pre_reconnecting_to_room"
:
"你有未完成的对局,即将重新连接,请选择你在本局决斗中使用的卡组并准备。"
,
"deck_incorrect_reconnect"
:
"请选择你在本局决斗中使用的卡组。"
,
"reconnect_failed"
:
"重新连接失败。"
,
"reconnecting_to_room"
:
"正在重新连接到服务器……"
,
"athletic_arena_tip"
:
"在竞技匹配中,比赛开始前退出游戏也会视为投降。"
},
"ko-kr"
:
{
...
...
data/structs.json
View file @
ed52f897
...
...
@@ -3,7 +3,7 @@
{
"name"
:
"lflist"
,
"type"
:
"unsigned int"
},
{
"name"
:
"rule"
,
"type"
:
"unsigned char"
},
{
"name"
:
"mode"
,
"type"
:
"unsigned char"
},
{
"name"
:
"
enable_priority"
,
"type"
:
"bool
"
},
{
"name"
:
"
duel_rule"
,
"type"
:
"unsigned char
"
},
{
"name"
:
"no_check_deck"
,
"type"
:
"bool"
},
{
"name"
:
"no_shuffle_deck"
,
"type"
:
"bool"
},
{
"name"
:
"start_lp"
,
"type"
:
"unsigned int"
},
...
...
ygopro-server.coffee
View file @
ed52f897
This diff is collapsed.
Click to expand it.
ygopro-server.js
View file @
ed52f897
This diff is collapsed.
Click to expand it.
ygopro.coffee
View file @
ed52f897
...
...
@@ -60,6 +60,8 @@ for name, declaration of structs_declaration
#消息发送函数,至少要把俩合起来....
@
stoc_send
=
(
socket
,
proto
,
info
)
->
if
socket
.
closed
return
#console.log proto, proto_structs.STOC[proto], structs[proto_structs.STOC[proto]]
if
typeof
info
==
'undefined'
buffer
=
""
...
...
@@ -86,6 +88,8 @@ for name, declaration of structs_declaration
return
@
ctos_send
=
(
socket
,
proto
,
info
)
->
if
socket
.
closed
return
#console.log proto, proto_structs.CTOS[proto], structs[proto_structs.CTOS[proto]]
if
typeof
info
==
'undefined'
buffer
=
""
...
...
@@ -164,5 +168,7 @@ for name, declaration of structs_declaration
msg
:
1
code
:
9
}
if
client
client
.
destroy
()
if
client
if
client
client
.
system_kicked
=
true
client
.
destroy
()
return
\ No newline at end of file
ygopro.js
View file @
ed52f897
...
...
@@ -104,6 +104,9 @@
this
.
stoc_send
=
function
(
socket
,
proto
,
info
)
{
var
buffer
,
header
,
key
,
ref
,
struct
,
value
;
if
(
socket
.
closed
)
{
return
;
}
if
(
typeof
info
===
'
undefined
'
)
{
buffer
=
""
;
}
else
if
(
Buffer
.
isBuffer
(
info
))
{
...
...
@@ -138,6 +141,9 @@
this
.
ctos_send
=
function
(
socket
,
proto
,
info
)
{
var
buffer
,
header
,
key
,
ref
,
struct
,
value
;
if
(
socket
.
closed
)
{
return
;
}
if
(
typeof
info
===
'
undefined
'
)
{
buffer
=
""
;
}
else
if
(
Buffer
.
isBuffer
(
info
))
{
...
...
@@ -264,6 +270,7 @@
});
}
if
(
client
)
{
client
.
system_kicked
=
true
;
client
.
destroy
();
}
};
...
...
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