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
bef24b52
Commit
bef24b52
authored
Apr 03, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use room.join_player
parent
0db7d4c2
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
173 deletions
+111
-173
ygopro-server.coffee
ygopro-server.coffee
+42
-72
ygopro-server.js
ygopro-server.js
+69
-101
No files found.
ygopro-server.coffee
View file @
bef24b52
...
...
@@ -1712,6 +1712,42 @@ class Room
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
player
.
name
}
${using_athletic_deck}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
))
await
return
join_post_watch
:
(
client
)
->
if
@
duel_stage
!=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
@
hostinfo
.
no_watch
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
this
)
client
.
is_post_watcher
=
true
ygopro
.
stoc_send_chat_to_room
(
this
,
"
#{
client
.
name
}
${watch_join}"
)
@
watchers
.
push
client
ygopro
.
stoc_send_chat
(
client
,
"${watch_watching}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
for
buffer
in
@
watcher_buffers
client
.
write
buffer
return
true
else
ygopro
.
stoc_die
(
client
,
"${watch_denied}"
)
return
false
else
return
false
join_player
:
(
client
)
->
if
@
error
ygopro
.
stoc_die
(
client
,
@
error
)
return
false
if
@
duel_stage
!=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
return
@
join_post_watch
(
client
)
if
@
hostinfo
.
no_watch
and
@
players
.
length
>=
(
if
@
hostinfo
.
mode
==
2
then
4
else
2
)
ygopro
.
stoc_die
(
client
,
"${watch_denied_room}"
)
return
true
if
@
challonge_info
for
player
in
@
get_playing_player
()
when
player
and
player
!=
client
and
player
.
challonge_info
.
id
==
client
.
challonge_info
.
id
ygopro
.
stoc_die
(
client
,
"${challonge_player_already_in}"
)
return
false
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
this
)
@
connect
(
client
)
return
true
# 网络连接
netRequestHandler
=
(
client
)
->
...
...
@@ -2144,27 +2180,8 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)->
if
!
room
ygopro
.
stoc_die
(
client
,
"${server_full}"
)
else
if
room
.
error
ygopro
.
stoc_die
(
client
,
room
.
error
)
else
if
room
.
duel_stage
!=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
room
.
hostinfo
.
no_watch
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
is_post_watcher
=
true
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
${watch_join}"
)
room
.
watchers
.
push
client
ygopro
.
stoc_send_chat
(
client
,
"${watch_watching}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
for
buffer
in
room
.
watcher_buffers
client
.
write
buffer
else
ygopro
.
stoc_die
(
client
,
"${watch_denied}"
)
else
if
room
.
hostinfo
.
no_watch
and
room
.
players
.
length
>=
(
if
room
.
hostinfo
.
mode
==
2
then
4
else
2
)
ygopro
.
stoc_die
(
client
,
"${watch_denied_room}"
)
else
#client.room = room
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
room
.
connect
(
client
)
else
room
.
join_player
(
client
)
return
_async
.
auto
({
...
...
@@ -2264,15 +2281,8 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)->
buffer
=
struct
.
buffer
pre_room
=
ROOM_find_by_name
(
info
.
pass
)
if
pre_room
and
pre_room
.
duel_stage
!=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
and
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
pre_room
.
hostinfo
.
no_watch
room
=
pre_room
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
is_post_watcher
=
true
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
${watch_join}"
)
room
.
watchers
.
push
client
ygopro
.
stoc_send_chat
(
client
,
"${watch_watching}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
for
buffer
in
room
.
watcher_buffers
client
.
write
buffer
pre_room
.
join_post_watch
(
client
)
return
else
ygopro
.
stoc_send_chat
(
client
,
'${loading_user_info}'
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
client
.
setTimeout
(
300000
)
#连接后超时5分钟
...
...
@@ -2329,30 +2339,8 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)->
room
.
welcome
=
"${challonge_match_created}"
if
!
room
ygopro
.
stoc_die
(
client
,
"${server_full}"
)
else
if
room
.
error
ygopro
.
stoc_die
(
client
,
room
.
error
)
else
if
room
.
duel_stage
!=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
room
.
hostinfo
.
no_watch
#client.setTimeout(300000) #连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
is_post_watcher
=
true
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
${watch_join}"
)
room
.
watchers
.
push
client
ygopro
.
stoc_send_chat
(
client
,
"${watch_watching}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
for
buffer
in
room
.
watcher_buffers
client
.
write
buffer
else
ygopro
.
stoc_die
(
client
,
"${watch_denied}"
)
else
if
room
.
hostinfo
.
no_watch
and
room
.
players
.
length
>=
(
if
room
.
hostinfo
.
mode
==
2
then
4
else
2
)
ygopro
.
stoc_die
(
client
,
"${watch_denied_room}"
)
else
for
player
in
room
.
get_playing_player
()
when
player
and
player
!=
client
and
player
.
challonge_info
.
id
==
client
.
challonge_info
.
id
ygopro
.
stoc_die
(
client
,
"${challonge_player_already_in}"
)
return
#client.room = room
#client.setTimeout(300000) #连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
room
.
connect
(
client
)
room
.
join_player
(
client
)
return
)
...
...
@@ -2399,26 +2387,8 @@ ygopro.ctos_follow 'JOIN_GAME', true, (buffer, info, client, server, datas)->
room
=
await
ROOM_find_or_create_by_name
(
info
.
pass
,
client
.
ip
)
if
!
room
ygopro
.
stoc_die
(
client
,
"${server_full}"
)
else
if
room
.
error
ygopro
.
stoc_die
(
client
,
room
.
error
)
else
if
room
.
duel_stage
!=
ygopro
.
constants
.
DUEL_STAGE
.
BEGIN
if
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
and
!
room
.
hostinfo
.
no_watch
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
is_post_watcher
=
true
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
${watch_join}"
)
room
.
watchers
.
push
client
ygopro
.
stoc_send_chat
(
client
,
"${watch_watching}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
for
buffer
in
room
.
watcher_buffers
client
.
write
buffer
else
ygopro
.
stoc_die
(
client
,
"${watch_denied}"
)
else
if
room
.
hostinfo
.
no_watch
and
room
.
players
.
length
>=
(
if
room
.
hostinfo
.
mode
==
2
then
4
else
2
)
ygopro
.
stoc_die
(
client
,
"${watch_denied_room}"
)
else
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
room
.
connect
(
client
)
room
.
join_player
(
client
)
await
return
ygopro
.
stoc_follow
'JOIN_GAME'
,
false
,
(
buffer
,
info
,
client
,
server
,
datas
)
->
...
...
ygopro-server.js
View file @
bef24b52
This diff is collapsed.
Click to expand it.
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