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
bb22aa46
Commit
bb22aa46
authored
Dec 17, 2015
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
91a665a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
ygopro-server.coffee
ygopro-server.coffee
+4
-4
ygopro-server.js
ygopro-server.js
+4
-4
No files found.
ygopro-server.coffee
View file @
bb22aa46
...
...
@@ -459,7 +459,7 @@ ygopro.stoc_follow 'TYPE_CHANGE', false, (buffer, info, client, server)->
return
ygopro
.
stoc_follow
'HS_PLAYER_CHANGE'
,
false
,
(
buffer
,
info
,
client
,
server
)
->
return
unless
client
.
room
and
client
.
room
.
max_player
return
unless
client
.
room
and
client
.
room
.
max_player
and
client
.
is_host
pos
=
info
.
status
>>
4
;
is_ready
=
(
info
.
status
&
0xf
)
==
9
;
if
pos
<
client
.
room
.
max_player
...
...
@@ -469,7 +469,7 @@ ygopro.stoc_follow 'HS_PLAYER_CHANGE', false, (buffer, info, client, server)->
player
.
is_ready
=
is_ready
unless
player
.
is_host
client
.
room
.
ready_player_count_without_host
+=
player
.
is_ready
if
client
.
is_host
and
client
.
room
.
ready_player_count_without_host
>=
client
.
room
.
max_player
-
1
if
client
.
room
.
ready_player_count_without_host
>=
client
.
room
.
max_player
-
1
#log.info "all ready"
setTimeout
(()
->
wait_room_start
(
client
.
room
,
20
);
return
),
1000
return
...
...
@@ -479,13 +479,13 @@ wait_room_start = (room,time)->
time
-=
1
if
time
unless
time
%
5
ygopro
.
stoc_send_chat_to_room
room
,
"
#{
if
time
<=
9
then
' '
else
''
}#{
time
}
秒后
若房主
不开始游戏将被请出房间"
,
if
time
<=
9
then
11
else
8
ygopro
.
stoc_send_chat_to_room
room
,
"
#{
if
time
<=
9
then
' '
else
''
}#{
time
}
秒后
房主若
不开始游戏将被请出房间"
,
if
time
<=
9
then
11
else
8
setTimeout
(()
->
wait_room_start
(
room
,
time
);
return
),
1000
else
for
player
in
room
.
players
if
player
.
is_host
Room
.
ban_player
(
player
.
name
,
player
.
ip
,
"挂机"
)
ygopro
.
stoc_send_chat_to_room
room
,
"
#{
player
.
name
}
被请出了房间"
,
11
ygopro
.
stoc_send_chat_to_room
room
,
"
#{
player
.
name
}
被
系统
请出了房间"
,
11
player
.
end
()
return
...
...
ygopro-server.js
View file @
bb22aa46
...
...
@@ -509,7 +509,7 @@
ygopro
.
stoc_follow
(
'
HS_PLAYER_CHANGE
'
,
false
,
function
(
buffer
,
info
,
client
,
server
)
{
var
is_ready
,
k
,
len
,
player
,
pos
,
ref
;
if
(
!
(
client
.
room
&&
client
.
room
.
max_player
))
{
if
(
!
(
client
.
room
&&
client
.
room
.
max_player
&&
client
.
is_host
))
{
return
;
}
pos
=
info
.
status
>>
4
;
...
...
@@ -526,7 +526,7 @@
client
.
room
.
ready_player_count_without_host
+=
player
.
is_ready
;
}
}
if
(
client
.
is_host
&&
client
.
room
.
ready_player_count_without_host
>=
client
.
room
.
max_player
-
1
)
{
if
(
client
.
room
.
ready_player_count_without_host
>=
client
.
room
.
max_player
-
1
)
{
setTimeout
((
function
()
{
wait_room_start
(
client
.
room
,
20
);
}),
1000
);
...
...
@@ -540,7 +540,7 @@
time
-=
1
;
if
(
time
)
{
if
(
!
(
time
%
5
))
{
ygopro
.
stoc_send_chat_to_room
(
room
,
""
+
(
time
<=
9
?
'
'
:
''
)
+
time
+
"
秒后
若房主
不开始游戏将被请出房间
"
,
time
<=
9
?
11
:
8
);
ygopro
.
stoc_send_chat_to_room
(
room
,
""
+
(
time
<=
9
?
'
'
:
''
)
+
time
+
"
秒后
房主若
不开始游戏将被请出房间
"
,
time
<=
9
?
11
:
8
);
}
setTimeout
((
function
()
{
wait_room_start
(
room
,
time
);
...
...
@@ -551,7 +551,7 @@
player
=
ref
[
k
];
if
(
player
.
is_host
)
{
Room
.
ban_player
(
player
.
name
,
player
.
ip
,
"
挂机
"
);
ygopro
.
stoc_send_chat_to_room
(
room
,
player
.
name
+
"
被请出了房间
"
,
11
);
ygopro
.
stoc_send_chat_to_room
(
room
,
player
.
name
+
"
被
系统
请出了房间
"
,
11
);
player
.
end
();
}
}
...
...
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