func (struc *OutboundUpdateResponse) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.Index.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.File.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Size.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Chunk.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Data.Decode(buf, 500) if err != nil { return err } return err }
func (struc *FSBlock) Encode(buf io.Writer, flags interface{}) (err error) { err = struc.FileID.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.FilePosition.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.NextBlock.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Partition.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Data.Encode(buf, 512) if err != nil { return err } return err }
func (struc *TestFrame) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.Message.Decode(buf, 16) if err != nil { return err } for i := 0; i < 4; i++ { err = struc.Values8[i].Decode(buf, encoding.IntegerFlag(encoding.IntNegate)) if err != nil { return err } } for i := 0; i < 2; i++ { err = struc.Values16[i].Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } } err = struc.Struc1.Decode(buf, encoding.NilFlags) if err != nil { return err } for i := 0; i < 2; i++ { err = struc.Struc2[i].Decode(buf, encoding.NilFlags) if err != nil { return err } } return err }
func (struc *InboundSecureLoginBlock) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.Magic.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } for i := 0; i < 4; i++ { err = struc.ISAACSeed[i].Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } } err = struc.ClientUID.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Username.Decode(buf, 0) if err != nil { return err } err = struc.Password.Decode(buf, 0) if err != nil { return err } return err }
func (struc *FSIndex) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.Length.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.StartBlock.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } return err }
func (struc *anonymous_outbound_packets_bb_0) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.SectorX.Decode(buf, encoding.IntegerFlag(encoding.IntOffset128)) if err != nil { return err } err = struc.SectorY.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } return err }
func (struc *anonymous_outbound_packets_bb_2) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.Membership.Decode(buf, encoding.IntegerFlag(encoding.IntOffset128)) if err != nil { return err } err = struc.Index.Decode(buf, encoding.IntegerFlag(encoding.IntOffset128)) if err != nil { return err } return err }
func (struc *CRCFile) Decode(buf io.Reader, flags interface{}) (err error) { for i := 0; i < 9; i++ { err = struc.Archives[i].Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } } err = struc.Sum.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } return err }
func (struc *InboundGameHandshake) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.NameHash.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } return err }
func (struc *InboundServiceSelect) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.Service.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } return err }
func (struc *OutboundLoginResponseUnsuccessful) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.Response.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } return err }
func (struc *InboundUpdateRequest) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.Index.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.File.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Priority.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } return err }
func (struc *OutboundLoginResponse) Encode(buf io.Writer, flags interface{}) (err error) { err = struc.Response.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Rights.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Flagged.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } return err }
func (struc *EmbeddedStruct) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.A.Decode(buf, encoding.IntegerFlag(encoding.IntLittleEndian)) if err != nil { return err } err = struc.B.Decode(buf, encoding.IntegerFlag(encoding.IntPDPEndian|encoding.IntOffset128)) if err != nil { return err } err = struc.C.Decode(buf, encoding.IntegerFlag(encoding.IntRPDPEndian|encoding.IntInverse128)) if err != nil { return err } return err }
func (struc *OutboundUpdateHandshake) Decode(buf io.Reader, flags interface{}) (err error) { for i := 0; i < 8; i++ { err = struc.ignored[i].Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } } return err }
func (struc *InboundPlayerWalkBlock) Decode(buf io.Reader, flags interface{}) (err error) { header := flags.(*encoding.PacketHeader) if header.Number == InboundPlayerWalkMapDefinition.Number { // The map walk packet appends 14 extra bytes // Not sure what it is yet. Maybe anti-cheat stuff. It's in method92. Ignore it for now. header.Size -= 14 } waypointCount := int((header.Size - 5) / 2) struc.Waypoints = make([]Waypoint, waypointCount) err = struc.OriginX.Decode(buf, encoding.IntegerFlag(encoding.IntLittleEndian|encoding.IntOffset128)) if err != nil { return err } for i := 0; i < waypointCount; i++ { err = struc.Waypoints[i].X.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Waypoints[i].Y.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } } err = struc.OriginY.Decode(buf, encoding.IntegerFlag(encoding.IntLittleEndian)) if err != nil { return err } err = struc.Running.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } // ignore the extra 14 bytes for now buf.Read(make([]byte, 14)) return nil }
func (struc *OutboundGameHandshake) Decode(buf io.Reader, flags interface{}) (err error) { for i := 0; i < 8; i++ { err = struc.ignored[i].Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } } err = struc.loginRequest.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } for i := 0; i < 2; i++ { err = struc.ServerISAACSeed[i].Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } } return err }
func (struc *InboundLoginBlock) Decode(buf io.Reader, flags interface{}) (err error) { err = struc.LoginType.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.LoginLen.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Magic.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.Revision.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.MemType.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } for i := 0; i < 9; i++ { err = struc.ArchiveCRCs[i].Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } } err = struc.SecureBlockSize.Decode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } return err }
func (struc *OutboundPlayerAppearance) Encode(buf io.Writer, flags interface{}) (err error) { err = struc.Gender.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.HeadIcon.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.HelmModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.CapeModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.AmuletModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.RightWieldModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.TorsoModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.LeftWieldModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.ArmsModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.LegsModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.HeadModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.HandsModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.FeetModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.BeardModel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.HairColor.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.TorsoColor.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.LegColor.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.FeetColor.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.SkinColor.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.AnimIdle.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.AnimSpotRotate.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.AnimWalk.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.AnimRotate180.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.AnimRotateCCW.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.AnimRotateCW.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.AnimRun.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.NameHash.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.CombatLevel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } err = struc.SkillLevel.Encode(buf, encoding.IntegerFlag(encoding.IntNilFlag)) if err != nil { return err } return err }