當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。