Commit ae8ee1a4 authored by mercury233's avatar mercury233

clean code

parent a0863d1f
This diff is collapsed.
This diff is collapsed.
_ = require 'underscore'
_.str = require 'underscore.string'
_.mixin(_.str.exports());
_.mixin(_.str.exports())
Struct = require('struct').Struct
......@@ -137,17 +137,26 @@ for name, declaration of structs_declaration
console.log "err stoc_send_hint_card_to_room"
return
for client in room.players
@stoc_send client, 'GAME_MSG',{
curmsg: 2,
type: 10,
player: 0,
data: card
} if client
@stoc_send client, 'GAME_MSG', {
curmsg: 2,
type: 10,
player: 0,
data: card
} if client
for client in room.watchers
@stoc_send client, 'GAME_MSG',{
curmsg: 2,
type: 10,
player: 0,
data: card
} if client
@stoc_send client, 'GAME_MSG', {
curmsg: 2,
type: 10,
player: 0,
data: card
} if client
return
@stoc_die = (client, msg)->
@stoc_send_chat(client, msg, @constants.COLORS.RED)
@stoc_send client, 'ERROR_MSG', {
msg: 1
code: 2
} if client
client.end() if client
return
\ No newline at end of file
......@@ -245,4 +245,17 @@
}
};
this.stoc_die = function(client, msg) {
this.stoc_send_chat(client, msg, this.constants.COLORS.RED);
if (client) {
this.stoc_send(client, 'ERROR_MSG', {
msg: 1,
code: 2
});
}
if (client) {
client.end();
}
};
}).call(this);
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