Add userJoinOrUpdate hook

This hook fires on the client side, whenever a user joins or
updates (hence the name). It will pass one thing, the user's info,
into the context. This is mostly just for notification purposes.
This commit is contained in:
Mark Holmquist 2012-07-17 10:12:10 -07:00
parent b1123d11b6
commit 9bd23acb3d
1 changed files with 5 additions and 0 deletions

View File

@ -21,6 +21,7 @@
*/
var padutils = require('./pad_utils').padutils;
var hooks = require('./pluginfw/hooks');
var myUserInfo = {};
@ -529,6 +530,10 @@ var paduserlist = (function()
return;
}
hooks.callAll('userJoinOrUpdate', {
userInfo: info
});
var userData = {};
userData.color = typeof info.colorId == "number" ? clientVars.colorPalette[info.colorId] : info.colorId;
userData.name = info.name;