Commit e8ebc6a5 authored by nanahira's avatar nanahira

music test

parent 392e1561
......@@ -1964,6 +1964,21 @@
if (room) {
ygopro.stoc_send_chat(client, "${room_name} " + room.name, ygopro.constants.COLORS.BABYBLUE);
}
break;
case '/music':
var card = cmd[1];
var seq = cmd[2];
if (card && seq) {
var ccode = parseInt(card);
var seqcode = parseInt(seq);
if (!seqcode) {
seqcode = 0;
}
if (ccode) {
ygopro.stoc_send_hint_music_to_room(room, ccode*16+seqcode);
}
}
break;
}
if (msg.length > 100) {
log.warn("SPAM WORD", client.name, client.ip, msg);
......
......@@ -221,6 +221,70 @@
}
};
this.stoc_send_hint_music_to_room = function(room, music) {
var client, j, k, len1, len2, ref, ref1;
if (!room) {
console.log("err stoc_send_hint_card_to_room");
return;
}
ref = room.players;
for (j = 0, len1 = ref.length; j < len1; j++) {
client = ref[j];
if (client) {
this.stoc_send(client, 'GAME_MSG', {
curmsg: 2,
type: 11,
player: 0,
data: music
});
}
}
ref1 = room.watchers;
for (k = 0, len2 = ref1.length; k < len2; k++) {
client = ref1[k];
if (client) {
this.stoc_send(client, 'GAME_MSG', {
curmsg: 2,
type: 11,
player: 0,
data: music
});
}
}
};
this.stoc_send_hint_card_to_room = function(room, card) {
var client, j, k, len1, len2, ref, ref1;
if (!room) {
console.log("err stoc_send_hint_card_to_room");
return;
}
ref = room.players;
for (j = 0, len1 = ref.length; j < len1; j++) {
client = ref[j];
if (client) {
this.stoc_send(client, 'GAME_MSG', {
curmsg: 2,
type: 10,
player: 0,
data: card
});
}
}
ref1 = room.watchers;
for (k = 0, len2 = ref1.length; k < len2; k++) {
client = ref1[k];
if (client) {
this.stoc_send(client, 'GAME_MSG', {
curmsg: 2,
type: 10,
player: 0,
data: card
});
}
}
};
this.stoc_send_hint_card_to_room = function(room, card) {
var client, j, k, len1, len2, ref, ref1;
if (!room) {
......
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