ironbane / IronbaneServerLegacy

A 3D MMO written using pure javascript.
http://www.ironbane.com/
GNU General Public License v3.0
175 stars 41 forks source link

Guest's name color in chat when logging in isn't orange #442

Closed eric-ycw closed 10 years ago

eric-ycw commented 10 years ago

When you have the message "Guest has joined the game!" The guest name is blue, not orange.

Guigo91 commented 10 years ago

In IronbaneServer / Engine / SocketHandler.js, when chatMessahe is emited, rank is not given in user object :

        req.io.emit('chatMessage', {
            type: 'welcome',
            user: {
                id: unit.id,
                name: unit.name,

// =========== ADD rank: unit.isGuest ? 'guest' : (unit.editor ? 'gm' : 'user') // =========== }, online: socketHandler.onlinePlayers });

Not tested yet

msouth commented 10 years ago

Thanks @Guigo91 . I think I'm going to take a shot a eliminating the need for repeating that rank computation everywhere.

We'll see how it goes :).

ingmargoudt commented 10 years ago

The guest name is now listed in orange as of Guigo91's PR