当前位置: 首页>>代码示例>>Golang>>正文


Golang packet.NewWriteBuff函数代码示例

本文整理汇总了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)
}
开发者ID:mirahs,项目名称:xxtools,代码行数:7,代码来源:ack_role_login_ok.go

示例2: Encode

func (this *AckSceneEnter) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteBytes(this.player.Encode())

	return pack.Encode(P_ACK_SCENE_ENTER)
}
开发者ID:mirahs,项目名称:xxtools,代码行数:7,代码来源:ack_scene_enter.go

示例3: Encode

func (this *MsgTestPhp) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint16(this.u16)

	return pack.ReadBytes()
}
开发者ID:mirahs,项目名称:xxtools,代码行数:7,代码来源:msg_test_php.go

示例4: Encode

func (this *AckSceneExit) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint32(this.uid)

	return pack.Encode(P_ACK_SCENE_EXIT)
}
开发者ID:mirahs,项目名称:xxtools,代码行数:7,代码来源:ack_scene_exit.go

示例5: Encode

func (this *ReqChatGm) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteString(this.content)

	return pack.Encode(P_REQ_CHAT_GM)
}
开发者ID:mirahs,项目名称:xxtools,代码行数:7,代码来源:req_chat_gm.go

示例6: Encode

func (this *AckRoleRandNameOk) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteString(this.uname)

	return pack.Encode(P_ACK_ROLE_RAND_NAME_OK)
}
开发者ID:mirahs,项目名称:xxtools,代码行数:7,代码来源:ack_role_rand_name_ok.go

示例7: Encode

func (this *ReqSceneEnterFly) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint32(this.mapId)

	return pack.Encode(P_REQ_SCENE_ENTER_FLY)
}
开发者ID:mirahs,项目名称:xxtools,代码行数:7,代码来源:req_scene_enter_fly.go

示例8: Encode

func (this *MsgScenePlayer) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint32(this.uid)
	pack.WriteBytes(this.sceneRotPos.Encode())

	return pack.ReadBytes()
}
开发者ID:mirahs,项目名称:xxtools,代码行数:8,代码来源:msg_scene_player.go

示例9: Encode

func (this *MsgFriendBaseAdd) Encode() []byte {
	pack := packet.NewWriteBuff(64)

	pack.WriteUint32(this.uid)
	pack.WriteString(this.uname)

	return pack.ReadBytes()
}
开发者ID:mirahs,项目名称:xxtools,代码行数:8,代码来源:msg_friend_base_add.go

示例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)
}
开发者ID:mirahs,项目名称:xxtools,代码行数:9,代码来源:req_chat_send.go

示例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()
}
开发者ID:mirahs,项目名称:xxtools,代码行数:9,代码来源:msg_scene_vector_3.go

示例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)
}
开发者ID:mirahs,项目名称:xxtools,代码行数:10,代码来源:req_scene_move.go

示例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)
}
开发者ID:mirahs,项目名称:xxtools,代码行数:10,代码来源:ack_chat_send_ok.go

示例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)
}
开发者ID:mirahs,项目名称:xxtools,代码行数:11,代码来源:ack_scene_players.go

示例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()
}
开发者ID:mirahs,项目名称:xxtools,代码行数:12,代码来源:msg_scene_rot_pos.go


注:本文中的packet.NewWriteBuff函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。