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
b06297ba
Commit
b06297ba
authored
Oct 20, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
play words in watching
parent
77d3151d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
15 deletions
+72
-15
ygopro-server.coffee
ygopro-server.coffee
+18
-0
ygopro-server.js
ygopro-server.js
+54
-15
No files found.
ygopro-server.coffee
View file @
b06297ba
...
@@ -1754,6 +1754,12 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
...
@@ -1754,6 +1754,12 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
is_post_watcher
=
true
client
.
is_post_watcher
=
true
if
settings
.
modules
.
vip
.
enabled
and
client
.
vip
and
vip_info
.
players
[
client
.
name
].
words
for
line
in
_
.
lines
vip_info
.
players
[
client
.
name
].
words
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
)
else
if
settings
.
modules
.
words
.
enabled
and
words
.
words
[
client
.
name
]
for
line
in
_
.
lines
words
.
words
[
client
.
name
][
Math
.
floor
(
Math
.
random
()
*
words
.
words
[
client
.
name
].
length
)]
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
${watch_join}"
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
${watch_join}"
)
room
.
watchers
.
push
client
room
.
watchers
.
push
client
ygopro
.
stoc_send_chat
(
client
,
"${watch_watching}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
ygopro
.
stoc_send_chat
(
client
,
"${watch_watching}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
...
@@ -1874,6 +1880,12 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
...
@@ -1874,6 +1880,12 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
#client.setTimeout(300000) #连接后超时5分钟
#client.setTimeout(300000) #连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
is_post_watcher
=
true
client
.
is_post_watcher
=
true
if
settings
.
modules
.
vip
.
enabled
and
client
.
vip
and
vip_info
.
players
[
client
.
name
].
words
for
line
in
_
.
lines
vip_info
.
players
[
client
.
name
].
words
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
)
else
if
settings
.
modules
.
words
.
enabled
and
words
.
words
[
client
.
name
]
for
line
in
_
.
lines
words
.
words
[
client
.
name
][
Math
.
floor
(
Math
.
random
()
*
words
.
words
[
client
.
name
].
length
)]
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
${watch_join}"
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
${watch_join}"
)
room
.
watchers
.
push
client
room
.
watchers
.
push
client
ygopro
.
stoc_send_chat
(
client
,
"${watch_watching}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
ygopro
.
stoc_send_chat
(
client
,
"${watch_watching}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
...
@@ -1957,6 +1969,12 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
...
@@ -1957,6 +1969,12 @@ ygopro.ctos_follow 'JOIN_GAME', false, (buffer, info, client, server)->
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
setTimeout
(
300000
)
#连接后超时5分钟
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
)
client
.
is_post_watcher
=
true
client
.
is_post_watcher
=
true
if
settings
.
modules
.
vip
.
enabled
and
client
.
vip
and
vip_info
.
players
[
client
.
name
].
words
for
line
in
_
.
lines
vip_info
.
players
[
client
.
name
].
words
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
)
else
if
settings
.
modules
.
words
.
enabled
and
words
.
words
[
client
.
name
]
for
line
in
_
.
lines
words
.
words
[
client
.
name
][
Math
.
floor
(
Math
.
random
()
*
words
.
words
[
client
.
name
].
length
)]
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
${watch_join}"
)
ygopro
.
stoc_send_chat_to_room
(
room
,
"
#{
client
.
name
}
${watch_join}"
)
room
.
watchers
.
push
client
room
.
watchers
.
push
client
ygopro
.
stoc_send_chat
(
client
,
"${watch_watching}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
ygopro
.
stoc_send_chat
(
client
,
"${watch_watching}"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
)
...
...
ygopro-server.js
View file @
b06297ba
...
@@ -2006,7 +2006,7 @@
...
@@ -2006,7 +2006,7 @@
});
});
ygopro
.
ctos_follow
(
'
JOIN_GAME
'
,
false
,
function
(
buffer
,
info
,
client
,
server
)
{
ygopro
.
ctos_follow
(
'
JOIN_GAME
'
,
false
,
function
(
buffer
,
info
,
client
,
server
)
{
var
check
,
decrypted_buffer
,
finish
,
i
,
id
,
len2
,
len3
,
len4
,
m
,
n
,
name
,
o
,
pre_room
,
ref3
,
ref4
,
ref5
,
replay_id
,
room
,
secret
;
var
check
,
decrypted_buffer
,
finish
,
i
,
id
,
len2
,
len3
,
len4
,
len5
,
len6
,
line
,
m
,
n
,
name
,
o
,
p
,
pre_room
,
q
,
ref3
,
ref4
,
ref5
,
ref6
,
ref7
,
replay_id
,
room
,
secret
;
info
.
pass
=
info
.
pass
.
trim
();
info
.
pass
=
info
.
pass
.
trim
();
client
.
pass
=
info
.
pass
;
client
.
pass
=
info
.
pass
;
if
(
CLIENT_is_able_to_reconnect
(
client
)
||
CLIENT_is_able_to_kick_reconnect
(
client
))
{
if
(
CLIENT_is_able_to_reconnect
(
client
)
||
CLIENT_is_able_to_kick_reconnect
(
client
))
{
...
@@ -2088,7 +2088,7 @@
...
@@ -2088,7 +2088,7 @@
return
(
checksum
&
0xFF
)
===
0
;
return
(
checksum
&
0xFF
)
===
0
;
};
};
finish
=
function
(
buffer
)
{
finish
=
function
(
buffer
)
{
var
action
,
len2
,
m
,
name
,
opt1
,
opt2
,
opt3
,
options
,
ref3
,
room
,
title
;
var
action
,
len2
,
len3
,
len4
,
line
,
m
,
n
,
name
,
o
,
opt1
,
opt2
,
opt3
,
options
,
ref3
,
ref4
,
ref5
,
room
,
title
;
if
(
client
.
closed
)
{
if
(
client
.
closed
)
{
return
;
return
;
}
}
...
@@ -2169,12 +2169,25 @@
...
@@ -2169,12 +2169,25 @@
client
.
setTimeout
(
300000
);
client
.
setTimeout
(
300000
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
is_post_watcher
=
true
;
client
.
is_post_watcher
=
true
;
if
(
settings
.
modules
.
vip
.
enabled
&&
client
.
vip
&&
vip_info
.
players
[
client
.
name
].
words
)
{
ref3
=
_
.
lines
(
vip_info
.
players
[
client
.
name
].
words
);
for
(
m
=
0
,
len2
=
ref3
.
length
;
m
<
len2
;
m
++
)
{
line
=
ref3
[
m
];
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
);
}
}
else
if
(
settings
.
modules
.
words
.
enabled
&&
words
.
words
[
client
.
name
])
{
ref4
=
_
.
lines
(
words
.
words
[
client
.
name
][
Math
.
floor
(
Math
.
random
()
*
words
.
words
[
client
.
name
].
length
)]);
for
(
n
=
0
,
len3
=
ref4
.
length
;
n
<
len3
;
n
++
)
{
line
=
ref4
[
n
];
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
);
}
}
ygopro
.
stoc_send_chat_to_room
(
room
,
client
.
name
+
"
${watch_join}
"
);
ygopro
.
stoc_send_chat_to_room
(
room
,
client
.
name
+
"
${watch_join}
"
);
room
.
watchers
.
push
(
client
);
room
.
watchers
.
push
(
client
);
ygopro
.
stoc_send_chat
(
client
,
"
${watch_watching}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ygopro
.
stoc_send_chat
(
client
,
"
${watch_watching}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ref
3
=
room
.
watcher_buffers
;
ref
5
=
room
.
watcher_buffers
;
for
(
m
=
0
,
len2
=
ref3
.
length
;
m
<
len2
;
m
++
)
{
for
(
o
=
0
,
len4
=
ref5
.
length
;
o
<
len4
;
o
++
)
{
buffer
=
ref
3
[
m
];
buffer
=
ref
5
[
o
];
client
.
write
(
buffer
);
client
.
write
(
buffer
);
}
}
}
else
{
}
else
{
...
@@ -2278,7 +2291,7 @@
...
@@ -2278,7 +2291,7 @@
challonge
.
matches
.
_index
({
challonge
.
matches
.
_index
({
id
:
settings
.
modules
.
challonge
.
tournament_id
,
id
:
settings
.
modules
.
challonge
.
tournament_id
,
callback
:
function
(
err
,
data
)
{
callback
:
function
(
err
,
data
)
{
var
len4
,
len5
,
match
,
o
,
p
,
player
,
ref5
,
ref6
;
var
len4
,
len5
,
len6
,
len7
,
line
,
match
,
o
,
p
,
player
,
q
,
r
,
ref5
,
ref6
,
ref7
,
ref8
;
if
(
client
.
closed
)
{
if
(
client
.
closed
)
{
return
;
return
;
}
}
...
@@ -2314,12 +2327,25 @@
...
@@ -2314,12 +2327,25 @@
if
(
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
room
.
no_watch
)
{
if
(
settings
.
modules
.
cloud_replay
.
enable_halfway_watch
&&
!
room
.
no_watch
)
{
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
is_post_watcher
=
true
;
client
.
is_post_watcher
=
true
;
if
(
settings
.
modules
.
vip
.
enabled
&&
client
.
vip
&&
vip_info
.
players
[
client
.
name
].
words
)
{
ref5
=
_
.
lines
(
vip_info
.
players
[
client
.
name
].
words
);
for
(
o
=
0
,
len4
=
ref5
.
length
;
o
<
len4
;
o
++
)
{
line
=
ref5
[
o
];
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
);
}
}
else
if
(
settings
.
modules
.
words
.
enabled
&&
words
.
words
[
client
.
name
])
{
ref6
=
_
.
lines
(
words
.
words
[
client
.
name
][
Math
.
floor
(
Math
.
random
()
*
words
.
words
[
client
.
name
].
length
)]);
for
(
p
=
0
,
len5
=
ref6
.
length
;
p
<
len5
;
p
++
)
{
line
=
ref6
[
p
];
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
);
}
}
ygopro
.
stoc_send_chat_to_room
(
room
,
client
.
name
+
"
${watch_join}
"
);
ygopro
.
stoc_send_chat_to_room
(
room
,
client
.
name
+
"
${watch_join}
"
);
room
.
watchers
.
push
(
client
);
room
.
watchers
.
push
(
client
);
ygopro
.
stoc_send_chat
(
client
,
"
${watch_watching}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ygopro
.
stoc_send_chat
(
client
,
"
${watch_watching}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ref
5
=
room
.
watcher_buffers
;
ref
7
=
room
.
watcher_buffers
;
for
(
o
=
0
,
len4
=
ref5
.
length
;
o
<
len4
;
o
++
)
{
for
(
q
=
0
,
len6
=
ref7
.
length
;
q
<
len6
;
q
++
)
{
buffer
=
ref
5
[
o
];
buffer
=
ref
7
[
q
];
client
.
write
(
buffer
);
client
.
write
(
buffer
);
}
}
}
else
{
}
else
{
...
@@ -2328,9 +2354,9 @@
...
@@ -2328,9 +2354,9 @@
}
else
if
(
room
.
no_watch
&&
room
.
players
.
length
>=
(
room
.
hostinfo
.
mode
===
2
?
4
:
2
))
{
}
else
if
(
room
.
no_watch
&&
room
.
players
.
length
>=
(
room
.
hostinfo
.
mode
===
2
?
4
:
2
))
{
ygopro
.
stoc_die
(
client
,
"
${watch_denied_room}
"
);
ygopro
.
stoc_die
(
client
,
"
${watch_denied_room}
"
);
}
else
{
}
else
{
ref
6
=
room
.
get_playing_player
();
ref
8
=
room
.
get_playing_player
();
for
(
p
=
0
,
len5
=
ref6
.
length
;
p
<
len5
;
p
++
)
{
for
(
r
=
0
,
len7
=
ref8
.
length
;
r
<
len7
;
r
++
)
{
player
=
ref
6
[
p
];
player
=
ref
8
[
r
];
if
(
!
(
player
&&
player
!==
client
&&
player
.
challonge_info
.
id
===
client
.
challonge_info
.
id
))
{
if
(
!
(
player
&&
player
!==
client
&&
player
.
challonge_info
.
id
===
client
.
challonge_info
.
id
))
{
continue
;
continue
;
}
}
...
@@ -2392,12 +2418,25 @@
...
@@ -2392,12 +2418,25 @@
client
.
setTimeout
(
300000
);
client
.
setTimeout
(
300000
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
rid
=
_
.
indexOf
(
ROOM_all
,
room
);
client
.
is_post_watcher
=
true
;
client
.
is_post_watcher
=
true
;
if
(
settings
.
modules
.
vip
.
enabled
&&
client
.
vip
&&
vip_info
.
players
[
client
.
name
].
words
)
{
ref5
=
_
.
lines
(
vip_info
.
players
[
client
.
name
].
words
);
for
(
o
=
0
,
len4
=
ref5
.
length
;
o
<
len4
;
o
++
)
{
line
=
ref5
[
o
];
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
);
}
}
else
if
(
settings
.
modules
.
words
.
enabled
&&
words
.
words
[
client
.
name
])
{
ref6
=
_
.
lines
(
words
.
words
[
client
.
name
][
Math
.
floor
(
Math
.
random
()
*
words
.
words
[
client
.
name
].
length
)]);
for
(
p
=
0
,
len5
=
ref6
.
length
;
p
<
len5
;
p
++
)
{
line
=
ref6
[
p
];
ygopro
.
stoc_send_chat_to_room
(
room
,
line
,
ygopro
.
constants
.
COLORS
.
PINK
);
}
}
ygopro
.
stoc_send_chat_to_room
(
room
,
client
.
name
+
"
${watch_join}
"
);
ygopro
.
stoc_send_chat_to_room
(
room
,
client
.
name
+
"
${watch_join}
"
);
room
.
watchers
.
push
(
client
);
room
.
watchers
.
push
(
client
);
ygopro
.
stoc_send_chat
(
client
,
"
${watch_watching}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ygopro
.
stoc_send_chat
(
client
,
"
${watch_watching}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ref
5
=
room
.
watcher_buffers
;
ref
7
=
room
.
watcher_buffers
;
for
(
o
=
0
,
len4
=
ref5
.
length
;
o
<
len4
;
o
++
)
{
for
(
q
=
0
,
len6
=
ref7
.
length
;
q
<
len6
;
q
++
)
{
buffer
=
ref
5
[
o
];
buffer
=
ref
7
[
q
];
client
.
write
(
buffer
);
client
.
write
(
buffer
);
}
}
}
else
{
}
else
{
...
...
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