Commit 31b14ae3 authored by nanahira's avatar nanahira

update

parent 9c1aa24c
...@@ -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": "因为您的对手有",
......
...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment