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
1b17e6ca
Commit
1b17e6ca
authored
Jun 20, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0f5c4d51
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
16 deletions
+39
-16
ygopro-server.coffee
ygopro-server.coffee
+19
-5
ygopro-server.js
ygopro-server.js
+20
-11
No files found.
ygopro-server.coffee
View file @
1b17e6ca
...
...
@@ -442,9 +442,9 @@ CLIENT_reconnect_register = (client, room_id, error) ->
return
false
if
!
settings
.
modules
.
reconnect
.
enabled
or
!
room
or
client
.
system_kicked
or
disconnect_list
[
CLIENT_get_authorize_key
(
client
)]
or
client
.
is_post_watcher
or
!
CLIENT_is_player
(
client
,
room
)
or
!
room
.
started
or
(
room
.
windbot
and
client
.
is_local
)
or
(
settings
.
modules
.
reconnect
.
auto_surrender_after_disconnect
and
room
.
hostinfo
.
mode
!=
1
)
return
false
for
player
in
room
.
players
if
player
!=
client
and
CLIENT_get_authorize_key
(
player
)
==
CLIENT_get_authorize_key
(
client
)
return
false
# some issues may occur in this case, so return false
#
for player in room.players
#
if player != client and CLIENT_get_authorize_key(player) == CLIENT_get_authorize_key(client)
#
return false # some issues may occur in this case, so return false
dinfo
=
{
room_id
:
room_id
,
old_client
:
client
,
...
...
@@ -497,6 +497,7 @@ CLIENT_import_data = (client, old_client, room) ->
client
.
selected_preduel
=
old_client
.
selected_preduel
client
.
last_game_msg
=
old_client
.
last_game_msg
client
.
last_game_msg_title
=
old_client
.
last_game_msg_title
client
.
last_hint_msg
=
old_client
.
last_hint_msg
client
.
start_deckbuf
=
old_client
.
start_deckbuf
old_client
.
had_new_reconnection
=
true
return
...
...
@@ -1621,14 +1622,18 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server)->
ygopro
.
stoc_send_chat
(
client
,
"${retry_part1}"
+
client
.
retry_count
+
"${retry_part2}"
+
settings
.
modules
.
retry_handle
.
max_retry_count
+
"${retry_part3}"
,
ygopro
.
constants
.
COLORS
.
RED
)
else
ygopro
.
stoc_send_chat
(
client
,
"${retry_not_counted}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
if
client
.
last_hint_msg
ygopro
.
stoc_send
(
client
,
'GAME_MSG'
,
client
.
last_hint_msg
)
ygopro
.
stoc_send
(
client
,
'GAME_MSG'
,
client
.
last_game_msg
)
return
true
else
client
.
last_game_msg
=
buffer
client
.
last_game_msg_title
=
ygopro
.
constants
.
MSG
[
msg
]
# log.info(client.name, client.last_game_msg_title)
else
if
ygopro
.
constants
.
MSG
[
msg
]
!=
'RETRY'
client
.
last_game_msg
=
buffer
client
.
last_game_msg_title
=
ygopro
.
constants
.
MSG
[
msg
]
# log.info(client.name, client.last_game_msg_title)
if
(
msg
>=
10
and
msg
<
30
)
or
msg
==
132
or
(
msg
>=
140
and
msg
<
144
)
#SELECT和ANNOUNCE开头的消息
room
.
waiting_for_player
=
client
...
...
@@ -1655,6 +1660,11 @@ ygopro.stoc_follow 'GAME_MSG', true, (buffer, info, client, server)->
client
.
last_game_msg
=
null
#ygopro.stoc_send_chat_to_room(room, "LP跟踪调试信息: #{client.name} 初始LP #{client.lp}")
if
ygopro
.
constants
.
MSG
[
msg
]
==
'HINT'
hint_type
=
buffer
.
readUInt8
(
1
)
if
hint_type
=
3
client
.
last_hint_msg
=
buffer
if
ygopro
.
constants
.
MSG
[
msg
]
==
'NEW_TURN'
if
client
.
pos
==
0
...
...
@@ -1872,11 +1882,15 @@ ygopro.stoc_follow 'FIELD_FINISH', true, (buffer, info, client, server)->
room
=
ROOM_all
[
client
.
rid
]
return
unless
room
client
.
reconnecting
=
false
if
client
.
last_game_msg
and
client
.
last_game_msg_title
!=
'WAITING'
if
!
client
.
last_game_msg
return
true
if
client
.
last_game_msg_title
!=
'WAITING'
setTimeout
(
()
->
if
client
.
last_hint_msg
ygopro
.
stoc_send
(
client
,
'GAME_MSG'
,
client
.
last_hint_msg
)
ygopro
.
stoc_send
(
client
,
'GAME_MSG'
,
client
.
last_game_msg
)
return
,
20
0
)
,
5
0
)
return
true
wait_room_start
=
(
room
,
time
)
->
...
...
ygopro-server.js
View file @
1b17e6ca
...
...
@@ -601,7 +601,7 @@
};
CLIENT_reconnect_register
=
function
(
client
,
room_id
,
error
)
{
var
dinfo
,
len2
,
m
,
player
,
ref2
,
room
,
tmot
;
var
dinfo
,
room
,
tmot
;
room
=
ROOM_all
[
room_id
];
if
(
client
.
had_new_reconnection
)
{
return
false
;
...
...
@@ -609,13 +609,6 @@
if
(
!
settings
.
modules
.
reconnect
.
enabled
||
!
room
||
client
.
system_kicked
||
disconnect_list
[
CLIENT_get_authorize_key
(
client
)]
||
client
.
is_post_watcher
||
!
CLIENT_is_player
(
client
,
room
)
||
!
room
.
started
||
(
room
.
windbot
&&
client
.
is_local
)
||
(
settings
.
modules
.
reconnect
.
auto_surrender_after_disconnect
&&
room
.
hostinfo
.
mode
!==
1
))
{
return
false
;
}
ref2
=
room
.
players
;
for
(
m
=
0
,
len2
=
ref2
.
length
;
m
<
len2
;
m
++
)
{
player
=
ref2
[
m
];
if
(
player
!==
client
&&
CLIENT_get_authorize_key
(
player
)
===
CLIENT_get_authorize_key
(
client
))
{
return
false
;
}
}
dinfo
=
{
room_id
:
room_id
,
old_client
:
client
,
...
...
@@ -675,6 +668,7 @@
client
.
selected_preduel
=
old_client
.
selected_preduel
;
client
.
last_game_msg
=
old_client
.
last_game_msg
;
client
.
last_game_msg_title
=
old_client
.
last_game_msg_title
;
client
.
last_hint_msg
=
old_client
.
last_hint_msg
;
client
.
start_deckbuf
=
old_client
.
start_deckbuf
;
old_client
.
had_new_reconnection
=
true
;
};
...
...
@@ -1957,7 +1951,7 @@
}
ygopro
.
stoc_follow
(
'
GAME_MSG
'
,
true
,
function
(
buffer
,
info
,
client
,
server
)
{
var
card
,
count
,
len2
,
line
,
loc
,
m
,
msg
,
oppo_pos
,
phase
,
playertype
,
pos
,
reason
,
ref2
,
ref3
,
ref4
,
room
,
trigger_location
,
val
,
win_pos
;
var
card
,
count
,
hint_type
,
len2
,
line
,
loc
,
m
,
msg
,
oppo_pos
,
phase
,
playertype
,
pos
,
reason
,
ref2
,
ref3
,
ref4
,
room
,
trigger_location
,
val
,
win_pos
;
room
=
ROOM_all
[
client
.
rid
];
if
(
!
(
room
&&
!
client
.
reconnecting
))
{
return
;
...
...
@@ -1982,6 +1976,9 @@
}
else
{
ygopro
.
stoc_send_chat
(
client
,
"
${retry_not_counted}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
if
(
client
.
last_hint_msg
)
{
ygopro
.
stoc_send
(
client
,
'
GAME_MSG
'
,
client
.
last_hint_msg
);
}
ygopro
.
stoc_send
(
client
,
'
GAME_MSG
'
,
client
.
last_game_msg
);
return
true
;
}
...
...
@@ -2021,6 +2018,12 @@
client
.
last_game_msg
=
null
;
}
}
if
(
ygopro
.
constants
.
MSG
[
msg
]
===
'
HINT
'
)
{
hint_type
=
buffer
.
readUInt8
(
1
);
if
(
hint_type
=
3
)
{
client
.
last_hint_msg
=
buffer
;
}
}
if
(
ygopro
.
constants
.
MSG
[
msg
]
===
'
NEW_TURN
'
)
{
if
(
client
.
pos
===
0
)
{
room
.
turn
=
room
.
turn
+
1
;
...
...
@@ -2331,10 +2334,16 @@
return
;
}
client
.
reconnecting
=
false
;
if
(
client
.
last_game_msg
&&
client
.
last_game_msg_title
!==
'
WAITING
'
)
{
if
(
!
client
.
last_game_msg
)
{
return
true
;
}
if
(
client
.
last_game_msg_title
!==
'
WAITING
'
)
{
setTimeout
(
function
()
{
if
(
client
.
last_hint_msg
)
{
ygopro
.
stoc_send
(
client
,
'
GAME_MSG
'
,
client
.
last_hint_msg
);
}
ygopro
.
stoc_send
(
client
,
'
GAME_MSG
'
,
client
.
last_game_msg
);
},
20
0
);
},
5
0
);
}
return
true
;
});
...
...
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