-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathusers.js
29 lines (29 loc) · 1.35 KB
/
users.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/** Configure User object as extension of Character */
module.exports.configUser = (world, ext, extConfig) => {
return {
tableName: `users`,
className: `User`,
extends: ext,
extendsConfig: extConfig,
otherSearchField: `name`,
properties: [
{ name: `addresses`, type: `array`, arrayOf: { type: `varchar`, length: 32 } },
{ name: `command`, type: `boolean`, store: false },
{ name: `equipment`, type: `Array`, arrayOf: { instanceOf: `ItemInstance` } },
{ name: `experience`, type: `int` },
{ name: `fightPromptFormat`, type: `varchar`, length: 64, default: `[$xpxp] <$hphp $mm $ee> ` },
{ name: `inventory`, type: `Array`, arrayOf: { instanceOf: `ItemInstance` } },
{ name: `outBuffer`, type: `text`, store: false },
{ name: `password`, type: `varchar`, length: 512 },
{ name: `promptFormat`, type: `varchar`, length: 64, default: `[$xpxp] <$hphp $mm $ee> ` },
{ name: `room`, instanceOf: `Room`, loadTransform: x => new world.Room({ id: x }) },
{ name: `salt`, type: `varchar`, length: 32 },
{ name: `socket`, instanceOf: `Socket`, store: false },
{ name: `state`, type: `int`, default: world.constants().states.NAME, store: false },
{ name: `title`, type: `varchar`, length: 32 }
],
indexes: [
{ name: `name`, type: `BTREE`, columns: [ `name` ] }
]
};
};