本文整理汇总了Golang中packet.NewWriteBuff函数的典型用法代码示例。如果您正苦于以下问题:Golang NewWriteBuff函数的具体用法?Golang NewWriteBuff怎么用?Golang NewWriteBuff使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewWriteBuff函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Encode
func (this *AckRoleLoginOk) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteString(this.uname)
return pack.Encode(P_ACK_ROLE_LOGIN_OK)
}
示例2: Encode
func (this *AckSceneEnter) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteBytes(this.player.Encode())
return pack.Encode(P_ACK_SCENE_ENTER)
}
示例3: Encode
func (this *MsgTestPhp) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteUint16(this.u16)
return pack.ReadBytes()
}
示例4: Encode
func (this *AckSceneExit) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteUint32(this.uid)
return pack.Encode(P_ACK_SCENE_EXIT)
}
示例5: Encode
func (this *ReqChatGm) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteString(this.content)
return pack.Encode(P_REQ_CHAT_GM)
}
示例6: Encode
func (this *AckRoleRandNameOk) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteString(this.uname)
return pack.Encode(P_ACK_ROLE_RAND_NAME_OK)
}
示例7: Encode
func (this *ReqSceneEnterFly) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteUint32(this.mapId)
return pack.Encode(P_REQ_SCENE_ENTER_FLY)
}
示例8: Encode
func (this *MsgScenePlayer) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteUint32(this.uid)
pack.WriteBytes(this.sceneRotPos.Encode())
return pack.ReadBytes()
}
示例9: Encode
func (this *MsgFriendBaseAdd) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteUint32(this.uid)
pack.WriteString(this.uname)
return pack.ReadBytes()
}
示例10: Encode
func (this *ReqChatSend) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteUint8(this.channel)
pack.WriteUint32(this.destUid)
pack.WriteString(this.content)
return pack.Encode(P_REQ_CHAT_SEND)
}
示例11: Encode
func (this *MsgSceneVector3) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteInt16(this.x)
pack.WriteInt16(this.y)
pack.WriteInt16(this.z)
return pack.ReadBytes()
}
示例12: Encode
func (this *ReqSceneMove) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteBytes(this.sceneRotPos.Encode())
pack.WriteBytes(this.forward.Encode())
pack.WriteString(this.aniName)
pack.WriteInt16(this.xAxis)
return pack.Encode(P_REQ_SCENE_MOVE)
}
示例13: Encode
func (this *AckChatSendOk) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteUint8(this.channel)
pack.WriteUint32(this.uid)
pack.WriteString(this.uname)
pack.WriteString(this.content)
return pack.Encode(P_ACK_CHAT_SEND_OK)
}
示例14: Encode
func (this *AckScenePlayers) Encode() []byte {
pack := packet.NewWriteBuff(64)
playersCount := uint16(len(this.players))
pack.WriteUint16(playersCount)
for i := uint16(0); i < playersCount; i++ {
pack.WriteBytes(this.players[i].Encode())
}
return pack.Encode(P_ACK_SCENE_PLAYERS)
}
示例15: Encode
func (this *MsgSceneRotPos) Encode() []byte {
pack := packet.NewWriteBuff(64)
pack.WriteInt16(this.rotX)
pack.WriteInt16(this.rotY)
pack.WriteInt16(this.rotZ)
pack.WriteInt16(this.posX)
pack.WriteInt16(this.posY)
pack.WriteInt16(this.posZ)
return pack.ReadBytes()
}