user.ops functions can now send multiple messages at once. Clearer messages are sent when equipping/unequipping two-handed weapons.

This commit is contained in:
Oliver Eyton-Williams
2015-12-01 18:24:23 +01:00
parent ee7bfece06
commit da35eb6067
2 changed files with 26 additions and 12 deletions

View File

@@ -107,10 +107,14 @@ angular.module('habitrpg')
if (err) {
var message = err.code ? err.message : err;
console.log(message);
if (MOBILE_APP) Notification.push({type:'text',text:message});
else Notification.text(message);
// In the case of 200s, they're friendly alert messages like "Your pet has hatched!" - still send the op
if ((err.code && err.code >= 400) || !err.code) return;
if (typeof message === 'string')
message = [message];
_.each(message, (msg) => {
if (MOBILE_APP) Notification.push({type:'text',text:msg});
else Notification.text(msg);
// In the case of 200s, they're friendly alert messages like "Your pet has hatched!" - still send the op
if ((err.code && err.code >= 400) || !err.code) return;
});
}
userServices.log({op:k, params: req.params, query:req.query, body:req.body});
});