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
31b14ae3
Commit
31b14ae3
authored
Jan 20, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
9c1aa24c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
16 deletions
+46
-16
i18n.json
i18n.json
+6
-6
ygopro-server.js
ygopro-server.js
+40
-10
No files found.
i18n.json
View file @
31b14ae3
...
@@ -86,9 +86,9 @@
...
@@ -86,9 +86,9 @@
"surrender_canceled"
:
"Surrender canceled."
,
"surrender_canceled"
:
"Surrender canceled."
,
"surrender_denied"
:
"Please use the Surrender button instead."
,
"surrender_denied"
:
"Please use the Surrender button instead."
,
"play_music"
:
"Playing music: "
,
"play_music"
:
"Playing music: "
,
"
play_music_user"
:
"The current music is played by:
"
,
"
stop_music"
:
"Music set back to default.
"
,
"
stop_music_user"
:
"The current music is stopped by:
"
,
"
music_not_found_1"
:
"Music
"
,
"music_not_found
"
:
"Cannot find music: "
,
"music_not_found
_2"
:
" not found."
,
"unwelcome_warn_part1"
:
"If you keep doing "
,
"unwelcome_warn_part1"
:
"If you keep doing "
,
"unwelcome_warn_part2"
:
", your opponent may leave you."
,
"unwelcome_warn_part2"
:
", your opponent may leave you."
,
"unwelcome_tip_part1"
:
"Your oppenent did "
,
"unwelcome_tip_part1"
:
"Your oppenent did "
,
...
@@ -183,9 +183,9 @@
...
@@ -183,9 +183,9 @@
"surrender_canceled"
:
"已取消投降,加油!"
,
"surrender_canceled"
:
"已取消投降,加油!"
,
"surrender_denied"
:
"为保证双方玩家的游戏体验,随机对战中3回合后才能投降。"
,
"surrender_denied"
:
"为保证双方玩家的游戏体验,随机对战中3回合后才能投降。"
,
"play_music"
:
"正在播放:"
,
"play_music"
:
"正在播放:"
,
"
play_music_user"
:
"当前音乐由以下玩家点选:
"
,
"
stop_music"
:
"已切换为默认音乐。
"
,
"
stop_music_user"
:
"当前音乐被以下玩家终止
:"
,
"
music_not_found_1"
:
"无法找到音乐
:"
,
"music_not_found
"
:
"找不到音乐文件:
"
,
"music_not_found
_2"
:
"。
"
,
"unwelcome_warn_part1"
:
"如果您经常"
,
"unwelcome_warn_part1"
:
"如果您经常"
,
"unwelcome_warn_part2"
:
",您的对手可能会离你而去。"
,
"unwelcome_warn_part2"
:
",您的对手可能会离你而去。"
,
"unwelcome_tip_part1"
:
"因为您的对手有"
,
"unwelcome_tip_part1"
:
"因为您的对手有"
,
...
...
ygopro-server.js
View file @
31b14ae3
...
@@ -1577,7 +1577,7 @@
...
@@ -1577,7 +1577,7 @@
pos
=
buffer
.
readUInt8
(
2
);
pos
=
buffer
.
readUInt8
(
2
);
var
music_id
=
buffer
.
readUInt32LE
(
3
);
var
music_id
=
buffer
.
readUInt32LE
(
3
);
if
(
hint_type
===
11
&&
music_list_rev
[
music_id
])
{
if
(
hint_type
===
11
&&
music_list_rev
[
music_id
])
{
ygopro
.
stoc_send_chat
(
client
,
"
${play_music}
"
+
music_list_rev
[
music_id
],
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ygopro
.
stoc_send_chat
(
client
,
"
${play_music}
"
+
music_list_rev
[
music_id
],
ygopro
.
constants
.
COLORS
.
PINK
);
}
}
}
}
}
}
...
@@ -2003,20 +2003,19 @@
...
@@ -2003,20 +2003,19 @@
}
}
break
;
break
;
case
'
/music
'
:
case
'
/music
'
:
var
music
=
cmd
[
1
]
;
var
music
=
msg
.
slice
(
7
,
msg
.
length
-
7
)
;
if
(
settings
.
modules
.
music
.
enabled
&&
music
)
{
if
(
settings
.
modules
.
music
.
enabled
)
{
if
(
music
===
"
stop
"
)
{
if
(
!
music
||
music
.
length
<=
0
)
{
ygopro
.
stoc_send_hint_music
_to_room
(
room
,
0
);
ygopro
.
stoc_send_hint_music
(
client
0
,
11
);
ygopro
.
stoc_send_chat
_to_room
(
room
,
"
${stop_music_user}
"
+
client
.
name
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ygopro
.
stoc_send_chat
(
client
,
"
${stop_music}
"
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
break
;
break
;
}
}
var
music_id
=
music_list
[
music
];
var
music_id
=
music_list
[
music
];
if
(
music_id
)
{
if
(
music_id
)
{
ygopro
.
stoc_send_hint_music_to_room
(
room
,
music_id
);
ygopro
.
stoc_send_hint_music
(
client
,
music_id
,
11
);
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${play_music}
"
+
music
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ygopro
.
stoc_send_chat
(
client
,
"
${play_music}
"
+
music
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
ygopro
.
stoc_send_chat_to_room
(
room
,
"
${play_music_user}
"
+
client
.
name
,
ygopro
.
constants
.
COLORS
.
BABYBLUE
);
}
else
{
}
else
{
ygopro
.
stoc_send_chat
(
client
,
"
${music_not_found
}
"
+
music
,
ygopro
.
constants
.
COLORS
.
RED
);
ygopro
.
stoc_send_chat
(
client
,
"
${music_not_found
_1}
"
+
music
+
"
${music_not_found_2}
"
,
ygopro
.
constants
.
COLORS
.
RED
);
}
}
}
}
break
;
break
;
...
@@ -2488,6 +2487,35 @@
...
@@ -2488,6 +2487,35 @@
return
;
return
;
}
}
if
(
u
.
query
.
shout
)
{
if
(
u
.
query
.
shout
)
{
if
(
u
.
query
.
shout
.
slice
(
0
,
7
)
===
"
/music
"
&&
settings
.
modules
.
music
.
enabled
)
{
var
music
=
u
.
query
.
shout
.
slice
.
slice
(
7
,
u
.
query
.
shout
.
slice
.
length
-
7
);
var
music_id
=
music_list
[
music
];
if
(
music_id
)
{
for
(
j
=
0
,
len
=
ROOM_all
.
length
;
j
<
len
;
j
++
)
{
room
=
ROOM_all
[
j
];
if
(
room
&&
room
.
established
)
{
ygopro
.
stoc_send_hint_music
(
client
,
music_id
,
11
);
ygopro
.
stoc_send_chat_to_room
(
client
,
"
${play_music}
"
+
music
,
ygopro
.
constants
.
COLORS
.
YELLOW
);
}
}
response
.
writeHead
(
200
);
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['music ok', '
"
+
music
+
"
']
"
));
}
else
{
response
.
writeHead
(
200
);
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['music not found', '
"
+
music
+
"
']
"
));
}
}
for
(
j
=
0
,
len
=
ROOM_all
.
length
;
j
<
len
;
j
++
)
{
room
=
ROOM_all
[
j
];
if
(
room
&&
room
.
established
)
{
ygopro
.
stoc_send_chat_to_room
(
room
,
u
.
query
.
shout
,
ygopro
.
constants
.
COLORS
.
YELLOW
);
}
}
response
.
writeHead
(
200
);
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['shout ok', '
"
+
u
.
query
.
shout
+
"
']
"
));
}
else
{
for
(
j
=
0
,
len
=
ROOM_all
.
length
;
j
<
len
;
j
++
)
{
for
(
j
=
0
,
len
=
ROOM_all
.
length
;
j
<
len
;
j
++
)
{
room
=
ROOM_all
[
j
];
room
=
ROOM_all
[
j
];
if
(
room
&&
room
.
established
)
{
if
(
room
&&
room
.
established
)
{
...
@@ -2496,6 +2524,8 @@
...
@@ -2496,6 +2524,8 @@
}
}
response
.
writeHead
(
200
);
response
.
writeHead
(
200
);
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['shout ok', '
"
+
u
.
query
.
shout
+
"
']
"
));
response
.
end
(
addCallback
(
u
.
query
.
callback
,
"
['shout ok', '
"
+
u
.
query
.
shout
+
"
']
"
));
}
}
else
if
(
u
.
query
.
stop
)
{
}
else
if
(
u
.
query
.
stop
)
{
if
(
u
.
query
.
stop
===
'
false
'
)
{
if
(
u
.
query
.
stop
===
'
false
'
)
{
u
.
query
.
stop
=
false
;
u
.
query
.
stop
=
false
;
...
...
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