當前位置: 首頁>>代碼示例>>Golang>>正文


Golang packet.Packet類代碼示例

本文整理匯總了Golang中packet.Packet的典型用法代碼示例。如果您正苦於以下問題:Golang Packet類的具體用法?Golang Packet怎麽用?Golang Packet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Packet類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: MsgFriendBaseAddDecode

func MsgFriendBaseAddDecode(pack *packet.Packet) *MsgFriendBaseAdd {
	msgFriendBaseAdd := &MsgFriendBaseAdd{}

	msgFriendBaseAdd.uid = pack.ReadUint32()
	msgFriendBaseAdd.uname = pack.ReadString()
	return msgFriendBaseAdd
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:7,代碼來源:msg_friend_base_add.go

示例2: MsgScenePlayerDecode

func MsgScenePlayerDecode(pack *packet.Packet) *MsgScenePlayer {
	msgScenePlayer := &MsgScenePlayer{}

	msgScenePlayer.uid = pack.ReadUint32()
	msgScenePlayer.sceneRotPos = MsgSceneRotPosDecode(pack)
	return msgScenePlayer
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:7,代碼來源:msg_scene_player.go

示例3: MsgRoleBaseDecode

func MsgRoleBaseDecode(pack *packet.Packet) *MsgRoleBase {
	msgRoleBase := &MsgRoleBase{}

	msgRoleBase.uid = pack.ReadUint32()
	msgRoleBase.uname = pack.ReadString()
	return msgRoleBase
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:7,代碼來源:msg_role_base.go

示例4: MsgSceneVector3Decode

func MsgSceneVector3Decode(pack *packet.Packet) *MsgSceneVector3 {
	msgSceneVector3 := &MsgSceneVector3{}

	msgSceneVector3.x = pack.ReadInt16()
	msgSceneVector3.y = pack.ReadInt16()
	msgSceneVector3.z = pack.ReadInt16()
	return msgSceneVector3
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:8,代碼來源:msg_scene_vector_3.go

示例5: ReqSceneMoveDecode

func ReqSceneMoveDecode(pack *packet.Packet) *ReqSceneMove {
	reqSceneMove := &ReqSceneMove{}

	reqSceneMove.sceneRotPos = MsgSceneRotPosDecode(pack)
	reqSceneMove.forward = MsgSceneVector3Decode(pack)
	reqSceneMove.aniName = pack.ReadString()
	reqSceneMove.xAxis = pack.ReadInt16()
	return reqSceneMove
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:9,代碼來源:req_scene_move.go

示例6: AckScenePlayersDecode

func AckScenePlayersDecode(pack *packet.Packet) *AckScenePlayers {
	ackScenePlayers := &AckScenePlayers{}

	playersCount := pack.ReadUint16()
	for ; playersCount > 0; playersCount-- {
		ackScenePlayers.players = append(ackScenePlayers.players, MsgScenePlayerDecode(pack))
	}
	return ackScenePlayers
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:9,代碼來源:ack_scene_players.go

示例7: MsgTestXXDecode

func MsgTestXXDecode(pack *packet.Packet) *MsgTestXX {
	msgTestXX := &MsgTestXX{}

	msgTestXX.idU8 = pack.ReadUint8()
	idF32Count := pack.ReadUint16()
	for ; idF32Count > 0; idF32Count-- {
		msgTestXX.idF32 = append(msgTestXX.idF32, pack.ReadFloat32())
	}
	msgTestXX.idOpU8Flag = pack.ReadUint8()
	if msgTestXX.idOpU8Flag == 1 {
		msgTestXX.idOpU8 = pack.ReadUint8()
	}
	return msgTestXX
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:14,代碼來源:msg_test_x_x.go

示例8: AckChatSendOkDecode

func AckChatSendOkDecode(pack *packet.Packet) *AckChatSendOk {
	ackChatSendOk := &AckChatSendOk{}

	ackChatSendOk.channel = pack.ReadUint8()
	ackChatSendOk.uid = pack.ReadUint32()
	ackChatSendOk.uname = pack.ReadString()
	ackChatSendOk.content = pack.ReadString()
	return ackChatSendOk
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:9,代碼來源:ack_chat_send_ok.go

示例9: ReqChatSendDecode

func ReqChatSendDecode(pack *packet.Packet) *ReqChatSend {
	reqChatSend := &ReqChatSend{}

	reqChatSend.channel = pack.ReadUint8()
	reqChatSend.destUid = pack.ReadUint32()
	reqChatSend.content = pack.ReadString()
	return reqChatSend
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:8,代碼來源:req_chat_send.go

示例10: AckTestPhpOkDecode

func AckTestPhpOkDecode(pack *packet.Packet) *AckTestPhpOk {
	ackTestPhpOk := &AckTestPhpOk{}

	ackTestPhpOk.u64 = pack.ReadUint64()
	ackTestPhpOk.strxx = pack.ReadString()
	ackTestPhpOk.msgReq = MsgTestPhpDecode(pack)
	ackTestPhpOk.msgOptFlag = pack.ReadUint8()
	if ackTestPhpOk.msgOptFlag == 1 {
		ackTestPhpOk.msgOpt = MsgTestPhpDecode(pack)
	}
	msgRepCount := pack.ReadUint16()
	for ; msgRepCount > 0; msgRepCount-- {
		ackTestPhpOk.msgRep = append(ackTestPhpOk.msgRep, MsgTestPhpDecode(pack))
	}
	return ackTestPhpOk
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:16,代碼來源:ack_test_php_ok.go

示例11: AckSceneMoveDecode

func AckSceneMoveDecode(pack *packet.Packet) *AckSceneMove {
	ackSceneMove := &AckSceneMove{}

	ackSceneMove.sceneRotPos = MsgSceneRotPosDecode(pack)
	ackSceneMove.forward = MsgSceneVector3Decode(pack)
	ackSceneMove.aniName = pack.ReadString()
	ackSceneMove.xAxis = pack.ReadInt16()
	ackSceneMove.uid = pack.ReadUint32()
	return ackSceneMove
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:10,代碼來源:ack_scene_move.go

示例12: MsgSceneRotPosDecode

func MsgSceneRotPosDecode(pack *packet.Packet) *MsgSceneRotPos {
	msgSceneRotPos := &MsgSceneRotPos{}

	msgSceneRotPos.rotX = pack.ReadInt16()
	msgSceneRotPos.rotY = pack.ReadInt16()
	msgSceneRotPos.rotZ = pack.ReadInt16()
	msgSceneRotPos.posX = pack.ReadInt16()
	msgSceneRotPos.posY = pack.ReadInt16()
	msgSceneRotPos.posZ = pack.ReadInt16()
	return msgSceneRotPos
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:11,代碼來源:msg_scene_rot_pos.go

示例13: ReqChatGmDecode

func ReqChatGmDecode(pack *packet.Packet) *ReqChatGm {
	reqChatGm := &ReqChatGm{}

	reqChatGm.content = pack.ReadString()
	return reqChatGm
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:6,代碼來源:req_chat_gm.go

示例14: AckTestSendOkDecode

func AckTestSendOkDecode(pack *packet.Packet) *AckTestSendOk {
	ackTestSendOk := &AckTestSendOk{}

	ackTestSendOk.idU8 = pack.ReadUint8()
	ackTestSendOk.roleBase = MsgRoleBaseDecode(pack)
	idF32Count := pack.ReadUint16()
	for ; idF32Count > 0; idF32Count-- {
		ackTestSendOk.idF32 = append(ackTestSendOk.idF32, pack.ReadFloat32())
	}
	ackTestSendOk.idOpU8Flag = pack.ReadUint8()
	if ackTestSendOk.idOpU8Flag == 1 {
		ackTestSendOk.idOpU8 = pack.ReadUint8()
	}
	ackTestSendOk.opRoleBaseFlag = pack.ReadUint8()
	if ackTestSendOk.opRoleBaseFlag == 1 {
		ackTestSendOk.opRoleBase = MsgRoleBaseDecode(pack)
	}
	return ackTestSendOk
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:19,代碼來源:ack_test_send_ok.go

示例15: ReqSceneEnterFlyDecode

func ReqSceneEnterFlyDecode(pack *packet.Packet) *ReqSceneEnterFly {
	reqSceneEnterFly := &ReqSceneEnterFly{}

	reqSceneEnterFly.mapId = pack.ReadUint32()
	return reqSceneEnterFly
}
開發者ID:mirahs,項目名稱:xxtools,代碼行數:6,代碼來源:req_scene_enter_fly.go


注:本文中的packet.Packet類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。