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


Golang Packet.ReadUint16方法代码示例

本文整理汇总了Golang中packet.Packet.ReadUint16方法的典型用法代码示例。如果您正苦于以下问题:Golang Packet.ReadUint16方法的具体用法?Golang Packet.ReadUint16怎么用?Golang Packet.ReadUint16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在packet.Packet的用法示例。


在下文中一共展示了Packet.ReadUint16方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: 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

示例2: 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

示例3: ReqRoleLoginDecode

func ReqRoleLoginDecode(pack *packet.Packet) *ReqRoleLogin {
	reqRoleLogin := &ReqRoleLogin{}

	reqRoleLogin.uid = pack.ReadUint32()
	reqRoleLogin.uuid = pack.ReadUint32()
	reqRoleLogin.sid = pack.ReadUint16()
	reqRoleLogin.cid = pack.ReadUint16()
	reqRoleLogin.loginTime = pack.ReadUint32()
	reqRoleLogin.pwd = pack.ReadString()
	reqRoleLogin.relink = pack.ReadUint8()
	reqRoleLogin.debug = pack.ReadUint8()
	reqRoleLogin.os = pack.ReadString()
	reqRoleLogin.version = pack.ReadString()
	return reqRoleLogin
}
开发者ID:mirahs,项目名称:xxtools,代码行数:15,代码来源:req_role_login.go

示例4: ReqRoleCreateDecode

func ReqRoleCreateDecode(pack *packet.Packet) *ReqRoleCreate {
	reqRoleCreate := &ReqRoleCreate{}

	reqRoleCreate.uid = pack.ReadUint32()
	reqRoleCreate.uuid = pack.ReadUint32()
	reqRoleCreate.sid = pack.ReadUint16()
	reqRoleCreate.cid = pack.ReadUint16()
	reqRoleCreate.os = pack.ReadString()
	reqRoleCreate.version = pack.ReadString()
	reqRoleCreate.uname = pack.ReadString()
	reqRoleCreate.source = pack.ReadString()
	reqRoleCreate.sourceSub = pack.ReadString()
	reqRoleCreate.loginTime = pack.ReadUint32()
	return reqRoleCreate
}
开发者ID:mirahs,项目名称:xxtools,代码行数:15,代码来源:req_role_create.go

示例5: 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

示例6: AckTestXXDecode

func AckTestXXDecode(pack *packet.Packet) *AckTestXX {
	ackTestXX := &AckTestXX{}

	ackTestXX.idU8 = pack.ReadUint8()
	ackTestXX.idU16 = pack.ReadUint16()
	ackTestXX.idU32 = pack.ReadUint32()
	repeatIdU8Count := pack.ReadUint16()
	for ; repeatIdU8Count > 0; repeatIdU8Count-- {
		ackTestXX.repeatIdU8 = append(ackTestXX.repeatIdU8, pack.ReadUint8())
	}
	ackTestXX.optionalIdU8Flag = pack.ReadUint8()
	if ackTestXX.optionalIdU8Flag == 1 {
		ackTestXX.optionalIdU8 = pack.ReadUint8()
	}
	return ackTestXX
}
开发者ID:mirahs,项目名称:xxtools,代码行数:16,代码来源:ack_test_x_x.go

示例7: 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

示例8: MsgTestSendDecode

func MsgTestSendDecode(pack *packet.Packet) *MsgTestSend {
	msgTestSend := &MsgTestSend{}

	msgTestSend.idU8 = pack.ReadUint8()
	msgTestSend.roleBase = MsgRoleBaseDecode(pack)
	idF32Count := pack.ReadUint16()
	for ; idF32Count > 0; idF32Count-- {
		msgTestSend.idF32 = append(msgTestSend.idF32, pack.ReadFloat32())
	}
	msgTestSend.idOpU8Flag = pack.ReadUint8()
	if msgTestSend.idOpU8Flag == 1 {
		msgTestSend.idOpU8 = pack.ReadUint8()
	}
	msgTestSend.opRoleBaseFlag = pack.ReadUint8()
	if msgTestSend.opRoleBaseFlag == 1 {
		msgTestSend.opRoleBase = MsgRoleBaseDecode(pack)
	}
	return msgTestSend
}
开发者ID:mirahs,项目名称:xxtools,代码行数:19,代码来源:msg_test_send.go

示例9: ReqTestSendDecode

func ReqTestSendDecode(pack *packet.Packet) *ReqTestSend {
	reqTestSend := &ReqTestSend{}

	reqTestSend.idU8 = pack.ReadUint8()
	reqTestSend.roleBase = MsgRoleBaseDecode(pack)
	idF32Count := pack.ReadUint16()
	for ; idF32Count > 0; idF32Count-- {
		reqTestSend.idF32 = append(reqTestSend.idF32, pack.ReadFloat32())
	}
	reqTestSend.idOpU8Flag = pack.ReadUint8()
	if reqTestSend.idOpU8Flag == 1 {
		reqTestSend.idOpU8 = pack.ReadUint8()
	}
	reqTestSend.opRoleBaseFlag = pack.ReadUint8()
	if reqTestSend.opRoleBaseFlag == 1 {
		reqTestSend.opRoleBase = MsgRoleBaseDecode(pack)
	}
	return reqTestSend
}
开发者ID:mirahs,项目名称:xxtools,代码行数:19,代码来源:req_test_send.go

示例10: MsgTestPhpDecode

func MsgTestPhpDecode(pack *packet.Packet) *MsgTestPhp {
	msgTestPhp := &MsgTestPhp{}

	msgTestPhp.u16 = pack.ReadUint16()
	return msgTestPhp
}
开发者ID:mirahs,项目名称:xxtools,代码行数:6,代码来源:msg_test_php.go


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