mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
name old time/op new time/op delta JceWriter_WriteMap-8 2.34µs ± 2% 0.69µs ± 4% -70.63% (p=0.008 n=5+5) JceWriter_WriteJceStructRaw-8 1.28µs ± 1% 0.42µs ± 1% -66.86% (p=0.008 n=5+5) name old speed new speed delta JceWriter_WriteMap-8 39.7MB/s ± 2% 135.4MB/s ± 4% +240.56% (p=0.008 n=5+5) JceWriter_WriteJceStructRaw-8 82.3MB/s ± 1% 219.9MB/s ± 1% +167.32% (p=0.008 n=5+5) name old alloc/op new alloc/op delta JceWriter_WriteMap-8 1.30kB ± 0% 0.21kB ± 0% -84.05% (p=0.008 n=5+5) JceWriter_WriteJceStructRaw-8 640B ± 0% 208B ± 0% -67.50% (p=0.008 n=5+5) name old allocs/op new allocs/op delta JceWriter_WriteMap-8 30.0 ± 0% 2.0 ± 0% -93.33% (p=0.008 n=5+5) JceWriter_WriteJceStructRaw-8 15.0 ± 0% 2.0 ± 0% -86.67% (p=0.008 n=5+5)
206 lines
6.1 KiB
Go
206 lines
6.1 KiB
Go
// Code generated by structs_parser; DO NOT EDIT.
|
|
|
|
package jce
|
|
|
|
func (pkt *RequestPacket) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteInt16(int16(pkt.IVersion), 1)
|
|
w.WriteByte(byte(pkt.CPacketType), 2)
|
|
w.WriteInt32(int32(pkt.IMessageType), 3)
|
|
w.WriteInt32(int32(pkt.IRequestId), 4)
|
|
w.WriteString(pkt.SServantName, 5)
|
|
w.WriteString(pkt.SFuncName, 6)
|
|
w.WriteBytes(pkt.SBuffer, 7)
|
|
w.WriteInt32(int32(pkt.ITimeout), 8)
|
|
w.writeMapStrStr(pkt.Context, 9)
|
|
w.writeMapStrStr(pkt.Status, 10)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *RequestDataVersion3) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.writeMapStrBytes(pkt.Map, 0)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *RequestDataVersion2) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.writeMapStrMapStrBytes(pkt.Map, 0)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *SvcReqRegister) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteInt64(int64(pkt.Uin), 0)
|
|
w.WriteInt64(int64(pkt.Bid), 1)
|
|
w.WriteByte(byte(pkt.ConnType), 2)
|
|
w.WriteString(pkt.Other, 3)
|
|
w.WriteInt32(int32(pkt.Status), 4)
|
|
w.WriteByte(byte(pkt.OnlinePush), 5)
|
|
w.WriteByte(byte(pkt.IsOnline), 6)
|
|
w.WriteByte(byte(pkt.IsShowOnline), 7)
|
|
w.WriteByte(byte(pkt.KickPC), 8)
|
|
w.WriteByte(byte(pkt.KickWeak), 9)
|
|
w.WriteInt64(int64(pkt.Timestamp), 10)
|
|
w.WriteInt64(int64(pkt.IOSVersion), 11)
|
|
w.WriteByte(byte(pkt.NetType), 12)
|
|
w.WriteString(pkt.BuildVer, 13)
|
|
w.WriteByte(byte(pkt.RegType), 14)
|
|
w.WriteBytes(pkt.DevParam, 15)
|
|
w.WriteBytes(pkt.Guid, 16)
|
|
w.WriteInt32(int32(pkt.LocaleId), 17)
|
|
w.WriteByte(byte(pkt.SilentPush), 18)
|
|
w.WriteString(pkt.DevName, 19)
|
|
w.WriteString(pkt.DevType, 20)
|
|
w.WriteString(pkt.OSVer, 21)
|
|
w.WriteByte(byte(pkt.OpenPush), 22)
|
|
w.WriteInt64(int64(pkt.LargeSeq), 23)
|
|
w.WriteInt64(int64(pkt.LastWatchStartTime), 24)
|
|
w.WriteInt64(int64(pkt.OldSSOIp), 26)
|
|
w.WriteInt64(int64(pkt.NewSSOIp), 27)
|
|
w.WriteString(pkt.ChannelNo, 28)
|
|
w.WriteInt64(int64(pkt.CPID), 29)
|
|
w.WriteString(pkt.VendorName, 30)
|
|
w.WriteString(pkt.VendorOSName, 31)
|
|
w.WriteString(pkt.IOSIdfa, 32)
|
|
w.WriteBytes(pkt.B769, 33)
|
|
w.WriteByte(byte(pkt.IsSetStatus), 34)
|
|
w.WriteBytes(pkt.ServerBuf, 35)
|
|
w.WriteByte(byte(pkt.SetMute), 36)
|
|
w.WriteInt64(int64(pkt.ExtOnlineStatus), 38)
|
|
w.WriteInt32(int32(pkt.BatteryStatus), 39)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *FriendListRequest) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteInt32(int32(pkt.Reqtype), 0)
|
|
w.WriteByte(byte(pkt.IfReflush), 1)
|
|
w.WriteInt64(int64(pkt.Uin), 2)
|
|
w.WriteInt16(int16(pkt.StartIndex), 3)
|
|
w.WriteInt16(int16(pkt.FriendCount), 4)
|
|
w.WriteByte(byte(pkt.GroupId), 5)
|
|
w.WriteByte(byte(pkt.IfGetGroupInfo), 6)
|
|
w.WriteByte(byte(pkt.GroupStartIndex), 7)
|
|
w.WriteByte(byte(pkt.GroupCount), 8)
|
|
w.WriteByte(byte(pkt.IfGetMSFGroup), 9)
|
|
w.WriteByte(byte(pkt.IfShowTermType), 10)
|
|
w.WriteInt64(int64(pkt.Version), 11)
|
|
w.WriteInt64Slice(pkt.UinList, 12)
|
|
w.WriteInt32(int32(pkt.AppType), 13)
|
|
w.WriteByte(byte(pkt.IfGetDOVId), 14)
|
|
w.WriteByte(byte(pkt.IfGetBothFlag), 15)
|
|
w.WriteBytes(pkt.D50, 16)
|
|
w.WriteBytes(pkt.D6B, 17)
|
|
w.WriteInt64Slice(pkt.SnsTypeList, 18)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *SummaryCardReq) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteInt64(int64(pkt.Uin), 0)
|
|
w.WriteInt32(int32(pkt.ComeFrom), 1)
|
|
w.WriteInt64(int64(pkt.QzoneFeedTimestamp), 2)
|
|
w.WriteByte(byte(pkt.IsFriend), 3)
|
|
w.WriteInt64(int64(pkt.GroupCode), 4)
|
|
w.WriteInt64(int64(pkt.GroupUin), 5)
|
|
w.WriteInt64(int64(pkt.GetControl), 8)
|
|
w.WriteInt32(int32(pkt.AddFriendSource), 9)
|
|
w.WriteBytes(pkt.SecureSig, 10)
|
|
w.WriteBytesSlice(pkt.ReqServices, 14)
|
|
w.WriteInt64(int64(pkt.TinyId), 15)
|
|
w.WriteInt64(int64(pkt.LikeSource), 16)
|
|
w.WriteByte(byte(pkt.ReqMedalWallInfo), 18)
|
|
w.WriteInt64Slice(pkt.Req0x5ebFieldId, 19)
|
|
w.WriteByte(byte(pkt.ReqNearbyGodInfo), 20)
|
|
w.WriteByte(byte(pkt.ReqExtendCard), 22)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *SummaryCardReqSearch) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteString(pkt.Keyword, 0)
|
|
w.WriteString(pkt.CountryCode, 1)
|
|
w.WriteInt32(int32(pkt.Version), 2)
|
|
w.WriteBytesSlice(pkt.ReqServices, 3)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *TroopListRequest) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteInt64(int64(pkt.Uin), 0)
|
|
w.WriteByte(byte(pkt.GetMSFMsgFlag), 1)
|
|
w.WriteBytes(pkt.Cookies, 2)
|
|
w.WriteInt64Slice(pkt.GroupInfo, 3)
|
|
w.WriteByte(byte(pkt.GroupFlagExt), 4)
|
|
w.WriteInt32(int32(pkt.Version), 5)
|
|
w.WriteInt64(int64(pkt.CompanyId), 6)
|
|
w.WriteInt64(int64(pkt.VersionNum), 7)
|
|
w.WriteByte(byte(pkt.GetLongGroupName), 8)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *TroopMemberListRequest) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteInt64(int64(pkt.Uin), 0)
|
|
w.WriteInt64(int64(pkt.GroupCode), 1)
|
|
w.WriteInt64(int64(pkt.NextUin), 2)
|
|
w.WriteInt64(int64(pkt.GroupUin), 3)
|
|
w.WriteInt64(int64(pkt.Version), 4)
|
|
w.WriteInt64(int64(pkt.ReqType), 5)
|
|
w.WriteInt64(int64(pkt.GetListAppointTime), 6)
|
|
w.WriteByte(byte(pkt.RichCardNameVer), 7)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *SvcRespPushMsg) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteInt64(int64(pkt.Uin), 0)
|
|
w.WriteJceStructSlice(pkt.DelInfos, 1)
|
|
w.WriteInt32(int32(pkt.Svrip), 2)
|
|
w.WriteBytes(pkt.PushToken, 3)
|
|
w.WriteInt32(int32(pkt.ServiceType), 4)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *ModifyGroupCardRequest) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteInt64(int64(pkt.Zero), 0)
|
|
w.WriteInt64(int64(pkt.GroupCode), 1)
|
|
w.WriteInt64(int64(pkt.NewSeq), 2)
|
|
w.WriteJceStructSlice(pkt.UinInfo, 3)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *SvcReqGetDevLoginInfo) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteBytes(pkt.Guid, 0)
|
|
w.WriteString(pkt.AppName, 1)
|
|
w.WriteInt64(int64(pkt.LoginType), 2)
|
|
w.WriteInt64(int64(pkt.Timestamp), 3)
|
|
w.WriteInt64(int64(pkt.NextItemIndex), 4)
|
|
w.WriteInt64(int64(pkt.RequireMax), 5)
|
|
w.WriteInt64(int64(pkt.GetDevListType), 6)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *SvcReqRegisterNew) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteInt64(int64(pkt.RequestOptional), 0)
|
|
w.WriteByte(byte(pkt.DisGroupMsgFilter), 14)
|
|
w.WriteByte(byte(pkt.GroupMask), 15)
|
|
w.WriteInt64(int64(pkt.EndSeq), 16)
|
|
w.WriteBytes(pkt.O769Body, 20)
|
|
return w.Bytes()
|
|
}
|
|
|
|
func (pkt *DelFriendReq) ToBytes() []byte {
|
|
w := NewJceWriter()
|
|
w.WriteInt64(int64(pkt.Uin), 0)
|
|
w.WriteInt64(int64(pkt.DelUin), 1)
|
|
w.WriteByte(byte(pkt.DelType), 2)
|
|
w.WriteInt32(int32(pkt.Version), 3)
|
|
return w.Bytes()
|
|
}
|
|
|