public string guild;                    //var_89;

        public TowerInitMessage(Reader reader)
        {
            this._version = reader.ReadShort();
            this._version = 65535 & ((65535 & this._version) >> 3 | (65535 & this._version) << 13);
            this._version = this._version > 32767 ? (int)(this._version - 65536) : (int)(this._version);
            reader.ReadShort();
            this.targetAction = new EntityTargetAction(reader);
            this.position     = new PositionStub(0, 0);
            this.position.X   = reader.ReadShort();
            this.position.X   = 65535 & ((65535 & this.position.X) >> 3 | (65535 & this.position.X) << 13);
            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) << 8 | (65535 & this.position.Y) >> 8);
            this.position.Y   = this.position.Y > 32767 ? (int)(this.position.Y - 65536) : (int)(this.position.Y);
            reader.ReadShort();
            this.pointsMax            = new ShipPointsStub(reader);
            this.entityInfo           = new EntityInfo(0, 0);
            this.entityInfo.projectId = reader.ReadShort();
            this.entityInfo.projectId = 65535 & ((65535 & this.entityInfo.projectId) >> 12 | (65535 & this.entityInfo.projectId) << 4);
            this.entityInfo.projectId = this.entityInfo.projectId > 32767 ? (int)(this.entityInfo.projectId - 65536) : (int)(this.entityInfo.projectId);
            this.entityInfo.entityId  = reader.ReadDouble();
            this.designID             = reader.ReadShort();
            this.designID             = 65535 & ((65535 & this.designID) >> 15 | (65535 & this.designID) << 1);
            this.designID             = this.designID > 32767 ? (int)(this.designID - 65536) : (int)(this.designID);
            reader.ReadShort();
            this.pointsCurrent = new ShipPointsStub(reader);
            this.name_28       = reader.ReadInt();
            this.name_28       = this.name_28 >> 15 | this.name_28 << 27;
            this.guild         = reader.ReadString();
            this.towerId       = reader.ReadByte();
            this.towerId       = 255 & ((255 & this.towerId) << 2 | (255 & this.towerId) >> 6);
            this.towerId       = this.towerId > 127 ? (int)(this.towerId - 256) : (int)(this.towerId);
        }
        public PlayerInitMessage(Reader reader)
        {
            this._version = reader.ReadShort();
            this._version = (65535 & ((65535 & this._version) << 10 | (int)((uint)(65535 & this._version) >> 6)));
            this._version = ((this._version > 32767) ? (this._version - 65536) : this._version);
            this.route    = new List <PositionStub>();
            var i   = 0;
            var num = reader.ReadShort();

            while (i < num)
            {
                reader.ReadShort();
                this.route.Add(new PositionStub(reader));
                i++;
            }
            this.username = reader.ReadString();
            reader.ReadShort();             //ID
            this.targetAction         = new EntityTargetAction(reader);
            this.var_25               = reader.ReadByte();
            this.var_25               = (255 & ((255 & this.var_25) << 4 | (int)((uint)(255 & this.var_25) >> 4)));
            this.var_25               = ((this.var_25 > 127) ? (this.var_25 - 256) : this.var_25);
            this.var_53               = reader.ReadByte();
            this.var_53               = (int)(255u & ((uint)(255 & this.var_53) >> 0 | (uint)((uint)(255 & this.var_53) << 8)));
            this.var_53               = ((this.var_53 > 127) ? (this.var_53 - 256) : this.var_53);
            this.guild                = reader.ReadString();
            this.entityInfo           = new EntityInfo(0, 0);
            this.entityInfo.projectId = reader.ReadShort();
            this.entityInfo.projectId = (int)(65535u & ((uint)(65535 & this.entityInfo.projectId) >> 12 | (uint)((uint)(65535 & this.entityInfo.projectId) << 4)));
            this.entityInfo.projectId = ((this.entityInfo.projectId > 32767) ? (this.entityInfo.projectId - 65536) : this.entityInfo.projectId);
            this.entityInfo.entityId  = reader.ReadDouble();
            this.designId             = reader.ReadShort();
            this.designId             = (int)(65535u & ((uint)(65535 & this.designId) << 9 | (uint)((uint)(65535 & this.designId) >> 7)));
            this.designId             = ((this.designId > 32767) ? (this.designId - 65536) : this.designId);
            this.var_30               = reader.ReadByte();
            this.var_30               = (255 & ((255 & this.var_30) << 6 | (int)((uint)(255 & this.var_30) >> 2)));
            this.var_30               = ((this.var_30 > 127) ? (this.var_30 - 256) : this.var_30);
            this.position             = new PositionStub(0, 0);
            this.position.X           = reader.ReadShort();
            this.position.X           = (65535 & ((65535 & this.position.X) << 4 | (65535 & this.position.X) >> 12));
            this.position.X           = ((this.position.X > 32767) ? (this.position.X - 65536) : this.position.X);
            this.position.Y           = reader.ReadShort();
            this.position.Y           = (65535 & ((65535 & this.position.Y) << 3 | (int)((uint)(65535 & this.position.Y) >> 13)));
            this.position.Y           = ((this.position.Y > 32767) ? (this.position.Y - 65536) : this.position.Y);
            this.list_1               = new List <int>();
            i   = 0;
            num = reader.ReadByte();
            while (i < num)
            {
                list_1.Add(reader.ReadShort());
                i++;
            }
        }
 public UserInitMessage(Reader reader)
 {
     this._version             = reader.ReadShort();
     this._version             = (int)(65535u & ((uint)(65535 & this._version) >> 7 | (uint)((uint)(65535 & this._version) << 9)));
     this._version             = ((this._version > 32767) ? (this._version - 65536) : this._version);
     this.var_53               = reader.ReadByte();
     this.var_53               = (int)(255u & ((uint)(255 & this.var_53) >> 0 | (uint)((uint)(255 & this.var_53) << 8)));
     this.var_53               = ((this.var_53 > 127) ? (this.var_53 - 256) : this.var_53);
     this.entityInfo           = new EntityInfo(0, 0);
     this.entityInfo.projectId = reader.ReadShort();
     this.entityInfo.projectId = (65535 & ((65535 & this.entityInfo.projectId) << 7 | (int)((uint)(65535 & this.entityInfo.projectId) >> 9)));
     this.entityInfo.projectId = ((this.entityInfo.projectId > 32767) ? (this.entityInfo.projectId - 65536) : this.entityInfo.projectId);
     this.entityInfo.entityId  = reader.ReadDouble();
     this.bp                = reader.ReadInt();
     this.bp                = (int)((uint)this.bp << 3 | (uint)((uint)this.bp >> 29));
     this.position          = new PositionStub(0, 0);
     this.position.X        = reader.ReadShort();
     this.position.X        = (65535 & ((65535 & this.position.X) << 13 | (int)((uint)(65535 & this.position.X) >> 3)));
     this.position.X        = ((this.position.X > 32767) ? (this.position.X - 65536) : this.position.X);
     this.position.Y        = reader.ReadShort();
     this.position.Y        = (int)(65535u & ((uint)(65535 & this.position.Y) >> 9 | (uint)((uint)(65535 & this.position.Y) << 7)));
     this.position.Y        = ((this.position.Y > 32767) ? (this.position.Y - 65536) : this.position.Y);
     this.level             = reader.ReadByte();
     this.level             = (255 & ((255 & this.level) << 0 | (int)((uint)(255 & this.level) >> 8)));
     this.level             = ((this.level > 127) ? (this.level - 256) : this.level);
     this.designId          = reader.ReadShort();
     this.designId          = (int)(65535u & ((uint)(65535 & this.designId) << 11 | (uint)((uint)(65535 & this.designId) >> 5)));
     this.designId          = ((this.designId > 32767) ? (this.designId - 65536) : this.designId);
     this.carpenterType     = reader.ReadByte();
     this.carpenterType     = (255 & ((255 & this.carpenterType) << 5 | (int)((uint)(255 & this.carpenterType) >> 3)));
     this.carpenterType     = ((this.carpenterType > 127) ? (this.carpenterType - 256) : this.carpenterType);
     this.xp                = reader.ReadDouble();
     this.hasTreasureHunter = reader.ReadBool();
     reader.ReadShort();
     this.currentHealth = new ShipPointsStub(reader);
     this.guild         = reader.ReadString();
     this.username      = reader.ReadString();
     this.maxXp         = reader.ReadDouble();
     this.maxBp         = reader.ReadInt();
     this.maxBp         = (int)((uint)this.maxBp << 14 | (uint)((uint)this.maxBp >> 18));
     this.hasPremium    = reader.ReadBool();
     this.medallionId   = reader.ReadByte();
     this.medallionId   = (255 & ((255 & this.medallionId) >> 6 | (int)((uint)(255 & this.medallionId) << 2)));
     this.medallionId   = ((this.medallionId > 127) ? (this.medallionId - 256) : this.medallionId);
     reader.ReadShort();             //ID
     this.targetAction = new EntityTargetAction(reader);
     this.var_30       = reader.ReadByte();
     this.var_30       = (255 & ((255 & this.var_30) >> 2 | (int)((uint)(255 & this.var_30) << 6)));
     this.var_30       = ((this.var_30 > 127) ? (this.var_30 - 256) : this.var_30);
     this.isRepairing  = reader.ReadBool();
 }