Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {promisify} from 'util';
- // ...
- const register = promisify(mage.auth.register);
- export class PlayerModule {
- async create(state: mage.core.IState, username: string, password: string, weapon: PlayerWeapon) {
- const options = {
- acl: ['user']
- };
- const playerId: string = await register(state, username, password, options);
- const player: Player = await Player.create(state, { playerId: playerId });
- // ...
- }
- }
Add Comment
Please, Sign In to add comment