mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 06:03:33 -04:00
Remove non-ES6 class field declarations (ES7 stage 1 proposal)
ES6 does not have support for class field declarations, although it is an experimental ES7 proposal: https://github.com/jeffmo/es-class-fields-and-static-properties For ES6, move the field/property declarations to the constructors.
This commit is contained in:
parent
3a246d1204
commit
91a404333e
@ -10,26 +10,25 @@ var createDeserializer=require("./transforms/serializer").createDeserializer;
|
|||||||
|
|
||||||
class Client extends EventEmitter
|
class Client extends EventEmitter
|
||||||
{
|
{
|
||||||
packetsToParse={};
|
|
||||||
serializer;
|
|
||||||
compressor=null;
|
|
||||||
framer=framing.createFramer();
|
|
||||||
cipher=null;
|
|
||||||
decipher=null;
|
|
||||||
splitter=framing.createSplitter();
|
|
||||||
decompressor=null;
|
|
||||||
deserializer;
|
|
||||||
isServer;
|
|
||||||
version;
|
|
||||||
protocolState=states.HANDSHAKING;
|
|
||||||
ended=true;
|
|
||||||
latency=0;
|
|
||||||
|
|
||||||
constructor(isServer,version) {
|
constructor(isServer,version) {
|
||||||
super();
|
super();
|
||||||
this.version=version;
|
this.version=version;
|
||||||
this.isServer = !!isServer;
|
this.isServer = !!isServer;
|
||||||
this.setSerializer(states.HANDSHAKING);
|
this.setSerializer(states.HANDSHAKING);
|
||||||
|
this.packetsToParse={};
|
||||||
|
this.serializer;
|
||||||
|
this.compressor=null;
|
||||||
|
this.framer=framing.createFramer();
|
||||||
|
this.cipher=null;
|
||||||
|
this.decipher=null;
|
||||||
|
this.splitter=framing.createSplitter();
|
||||||
|
this.decompressor=null;
|
||||||
|
this.deserializer;
|
||||||
|
this.isServer;
|
||||||
|
this.version;
|
||||||
|
this.protocolState=states.HANDSHAKING;
|
||||||
|
this.ended=true;
|
||||||
|
this.latency=0;
|
||||||
|
|
||||||
this.on('newListener', function(event, listener) {
|
this.on('newListener', function(event, listener) {
|
||||||
var direction = this.isServer ? 'toServer' : 'toClient';
|
var direction = this.isServer ? 'toServer' : 'toClient';
|
||||||
|
@ -5,14 +5,13 @@ var states = require("./states");
|
|||||||
|
|
||||||
class Server extends EventEmitter
|
class Server extends EventEmitter
|
||||||
{
|
{
|
||||||
socketServer=null;
|
|
||||||
cipher=null;
|
|
||||||
decipher=null;
|
|
||||||
clients={};
|
|
||||||
|
|
||||||
constructor(version) {
|
constructor(version) {
|
||||||
super();
|
super();
|
||||||
this.version=version;
|
this.version=version;
|
||||||
|
this.socketServer=null;
|
||||||
|
this.cipher=null;
|
||||||
|
this.decipher=null;
|
||||||
|
this.clients={};
|
||||||
}
|
}
|
||||||
|
|
||||||
listen(port, host) {
|
listen(port, host) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user