func (m *FriendUpdateMessage) ReadPacket(_packet pnet.IPacket) (err error) { if m.Name, err = _packet.ReadString(); err != nil { return } removed, errRem := _packet.ReadUint8() if errRem != nil { return errRem } m.Removed = int(removed) return nil }
// ReadPacket reads all data from a packet and puts it in the object func (m *LoginMessage) ReadPacket(_packet pnet.IPacket) error { var err error if m.Username, err = _packet.ReadString(); err != nil { return err } if m.Password, err = _packet.ReadString(); err != nil { return err } clientVersion, err := _packet.ReadUint16() if err != nil { return err } m.ClientVersion = int(clientVersion) return nil }
func (m *ChatMessage) ReadPacket(_packet pnet.IPacket) (err error) { speaktype, err := _packet.ReadUint8() if err != nil { return } m.SpeakType = int(speaktype) channelId, err := _packet.ReadUint16() if err != nil { return } m.ChannelId = int(channelId) if m.Receiver, err = _packet.ReadString(); err != nil { return } if m.Text, err = _packet.ReadString(); err != nil { return } return nil }