Guest User

Untitled

a guest
May 26th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import {promisify} from 'util';
  2.  
  3. // ...
  4.  
  5. const register = promisify(mage.auth.register);
  6.  
  7. export class PlayerModule {
  8. async create(state: mage.core.IState, username: string, password: string, weapon: PlayerWeapon) {
  9. const options = {
  10. acl: ['user']
  11. };
  12.  
  13. const playerId: string = await register(state, username, password, options);
  14.  
  15. const player: Player = await Player.create(state, { playerId: playerId });
  16.  
  17.  
  18. // ...
  19. }
  20. }
Add Comment
Please, Sign In to add comment