public ClientInitMessage(Reader reader)
 {
     this._version = reader.ReadShort();
     this._version = 65535 & ((65535 & this._version) << 8 | (65535 & this._version) >> 8);
     this._version = this._version > 32767 ? (int)(this._version - 65536) : (int)(this._version);
     this.var_481  = reader.ReadByte();
     this.var_481  = 255 & ((255 & this.var_481) << 7 | (255 & this.var_481) >> 1);
     this.var_481  = this.var_481 > 127 ? (this.var_481 - 256) : (this.var_481);
     reader.ReadShort();
     this.mapInfo   = new MapStub(reader);
     this.timeout   = reader.ReadShort();
     this.timeout   = 65535 & ((65535 & this.timeout) << 0 | (65535 & this.timeout) >> 16);
     this.timeout   = this.timeout > 32767 ? (this.timeout - 65536) : (this.timeout);
     this.var_433   = reader.ReadByte();
     this.var_433   = 255 & ((255 & this.var_433) >> 3 | (255 & this.var_433) << 5);
     this.var_433   = this.var_433 > 127 ? (this.var_433 - 256) : (this.var_433);
     this.var_469   = reader.ReadByte();
     this.var_469   = 255 & ((255 & this.var_469) << 3 | (255 & this.var_469) >> 5);
     this.var_469   = this.var_469 > 127 ? (this.var_469 - 256) : (this.var_469);
     this.var_454   = reader.ReadByte();
     this.var_454   = 255 & ((255 & this.var_454) >> 7 | (255 & this.var_454) << 1);
     this.var_454   = this.var_454 > 127 ? (this.var_454 - 256) : (this.var_454);
     this.var_496   = reader.ReadShort();
     this.var_496   = 65535 & ((65535 & this.var_496) << 10 | (65535 & this.var_496) >> 6);
     this.var_496   = this.var_496 > 32767 ? (this.var_496 - 65536) : (this.var_496);
     this.loginTime = reader.ReadDouble();
 }
Esempio n. 2
0
 public MapChangeMessage(Reader reader)
 {
     this._version = reader.ReadShort();
     this._version = (65535 & ((65535 & this._version) << 3 | (int)((uint)(65535 & this._version) >> 13)));
     this._version = ((this._version > 32767) ? (this._version - 65536) : this._version);
     reader.ReadShort(); //ID
     this.mapInfo     = new MapStub(reader);
     this.animationID = reader.ReadShort();
     this.animationID = 65535 & ((65535 & this.animationID) << 15 | (65535 & this.animationID) << 10);
     this.animationID = this.animationID > 32767 ? (int)(this.animationID - 65536) : (int)(this.animationID);
     this.position    = new PositionStub(0, 0);
     this.position.X  = reader.ReadShort();
     this.position.X  = 65535 & ((65535 & this.position.X) << 10 | (65535 & this.position.X) >> 6);
     this.position.X  = this.position.X > 32767 ? (int)(this.position.X - 65536) : (int)(this.position.X);
     this.position.Y  = reader.ReadShort();
     this.position.Y  = 65535 & ((65535 & this.position.Y) >> 3 | (65535 & this.position.Y) << 13);
     this.position.Y  = this.position.Y > 32767 ? (int)(this.position.Y - 65536) : (int)(this.position.Y);
 }