             socket.join(room.name)
             socket.join(hero.displayname)
             if data.is_master
-                data.displayname = "<span class='master'>"+hero.displayname+'</span>'
+                data.displayname = f "<span class='master'>%s</span>", hero.displayname
             else
                 data.displayname = hero.displayname
             socket.broadcast.to(data.room.name).emit "new_player",

_ = require("underscore")
dateFormat = require('dateformat')
mongoose = require 'mongoose'

User = mongoose.model 'User'
Hero = mongoose.model 'Hero'

        message.text = "Wrong /roll format"
        message.allow_send = false
        
    cb message
    
    
player_event = (message, cb)->
    message.event_type = "event"
    message.text = message.text.slice(4)
    cb message


master_event = (message, cb)->
    message.event_type = "master_event"
    message.text = message.text.slice(7)
    cb message

master_as = (message, cb)->
    words = message.text.split ' '
    message.username = f "<span class='npc'>%s</span>", words[1]
    message.text = words.slice(2).join " "
    cb message

help = (message, is_master, cb)->
    message.event_type = "system_message"
    message.text = "<strong>Command list:</strong><ul>"
    message.text += "<li><strong>/me</strong> blah-blah &mdash; you do blah-blah as event</li>"
    message.text += "<li><strong>/roll</strong> XdY+Z &mdash; you roll dice</li>"
    if is_master
        message.text += "<li><strong>/event</strong> blah-blah &mdash; show blah-blah as global event</li>"
        message.text += "<li><strong>/as</strong> Name blah-blah &mdash; say blah-blah as Name</li>"
        message.text += "<li><strong>/kick</strong> Player &mdash; kick player from room</li>"
    message.text += "</ul>"
    message.allow_send = false
    cb message
    
show_stats = (message, player, cb)->
    message.allow_send = false
