1234567891011121314151617181920212223242526272829 |
- module.exports = class WebsocketLogin {
- constructor(socket) {
- this.socket = socket;
- this.player = new world.Player();
- }
- attach() {
- this.player.socket = this.socket;
- core.attachPlayer(this.player);
- }
- receive(data) {
- core.handleInput(this.player, data);
- }
- disconnect() {
- core.removePlayer(this.player);
- }
- setConnectionTimeout(time) {
- console.log("gotta handle connection timeout");
- //this.socket.setTimeout(time);
- }
- logout() {
- this.socket.close();
- }
- };
-
|