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


Golang bsn_common.TMsgType函数代码示例

本文整理汇总了Golang中github.com/bsn069/go/bsn_common.TMsgType函数的典型用法代码示例。如果您正苦于以下问题:Golang TMsgType函数的具体用法?Golang TMsgType怎么用?Golang TMsgType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: IsMsgGate

func IsMsgGate(vTMsgType bsn_common.TMsgType) bool {
	if vTMsgType < bsn_common.TMsgType(bsn_msg_gate_server.ECmdGate2Server_CmdGate2Server_Min) {
		return false
	}
	if vTMsgType > bsn_common.TMsgType(bsn_msg_gate_server.ECmdGate2Server_CmdGate2Server_Max) {
		return false
	}
	return true
}
开发者ID:bsn069,项目名称:go,代码行数:9,代码来源:common.go

示例2: IsMsgEchoServer

func IsMsgEchoServer(vTMsgType bsn_common.TMsgType) bool {
	if vTMsgType < bsn_common.TMsgType(bsn_msg_client_echo_server.ECmdEchoServe2Client_CmdEchoServer2Client_Min) {
		return false
	}
	if vTMsgType > bsn_common.TMsgType(bsn_msg_client_echo_server.ECmdEchoServe2Client_CmdEchoServer2Client_Max) {
		return false
	}
	return true
}
开发者ID:bsn069,项目名称:go,代码行数:9,代码来源:server_user_gate_msg.go

示例3: IsMsgSys

func IsMsgSys(vTMsgType bsn_common.TMsgType) bool {
	if vTMsgType < bsn_common.TMsgType(bsn_define.ECmd_Cmd_Min) {
		return false
	}
	if vTMsgType > bsn_common.TMsgType(bsn_define.ECmd_Cmd_Max) {
		return false
	}
	return true
}
开发者ID:bsn069,项目名称:go,代码行数:9,代码来源:common.go

示例4: IsMsgGate

func IsMsgGate(vTMsgType bsn_common.TMsgType) bool {
	if vTMsgType < bsn_common.TMsgType(bsn_msg_gate_gateconfig.ECmdGate2GateConfig_CmdGate2GateConfig_Min) {
		return false
	}
	if vTMsgType > bsn_common.TMsgType(bsn_msg_gate_gateconfig.ECmdGate2GateConfig_CmdGate2GateConfig_Max) {
		return false
	}
	return true
}
开发者ID:bsn069,项目名称:go,代码行数:9,代码来源:client_user_msg.go

示例5: IsMsgClient

func IsMsgClient(vTMsgType bsn_common.TMsgType) bool {
	if vTMsgType < bsn_common.TMsgType(bsn_msg_client_gate.ECmdClient2Gate_CmdClient2Gate_Min) {
		return false
	}
	if vTMsgType > bsn_common.TMsgType(bsn_msg_client_gate.ECmdClient2Gate_CmdClient2Gate_Max) {
		return false
	}
	return true
}
开发者ID:bsn069,项目名称:go,代码行数:9,代码来源:client_user_msg.go

示例6: ProcMsg_CmdServer2Gate_GetClientMsgRangeRes

func (this *SServerUser) ProcMsg_CmdServer2Gate_GetClientMsgRangeRes() (err error) {
	GSLog.Debugln("ProcMsg_CmdServer2Gate_GetClientMsgRangeRes")

	recvMsg := new(bsn_msg_gate_server.SGetClientMsgRangeRes)
	if err = proto.Unmarshal(this.M_by2MsgBody, recvMsg); err != nil {
		return
	}
	GSLog.Debugln(recvMsg.GetVu32MsgTypeMin(), recvMsg.GetVu32MsgTypeMax())

	this.M_MsgTypeMin = bsn_common.TMsgType(recvMsg.GetVu32MsgTypeMin())
	this.M_MsgTypeMax = bsn_common.TMsgType(recvMsg.GetVu32MsgTypeMax())

	return
}
开发者ID:bsn069,项目名称:go,代码行数:14,代码来源:server_user_msg_server.go

示例7: send_CmdServer2Gate_LoginRes

func (this *SClientUser) send_CmdServer2Gate_LoginRes(vResult bsn_msg_gate_server.SLoginRes_EResult) error {
	sendMsg := &bsn_msg_gate_server.SLoginRes{
		Result:     vResult.Enum(),
		ServerType: bsn_define.EServerType_ServerType_Echo.Enum(),
	}
	return this.SendPbMsgWithSMsgHeader(bsn_common.TMsgType(bsn_msg_gate_server.ECmdServe2Gate_CmdServer2Gate_LoginRes), sendMsg)
}
开发者ID:bsn069,项目名称:go,代码行数:7,代码来源:client_user_send.go

示例8: send_CmdServer2Gate_GetClientMsgRangeRes

func (this *SClientUser) send_CmdServer2Gate_GetClientMsgRangeRes() error {
	sendMsg := &bsn_msg_gate_server.SGetClientMsgRangeRes{
		Vu32MsgTypeMin: proto.Uint32(uint32(bsn_msg_client_echo_server.ECmdClient2EchoServer_CmdClient2EchoServer_Min)),
		Vu32MsgTypeMax: proto.Uint32(uint32(bsn_msg_client_echo_server.ECmdClient2EchoServer_CmdClient2EchoServer_Max)),
	}
	return this.SendPbMsgWithSMsgHeader(bsn_common.TMsgType(bsn_msg_gate_server.ECmdServe2Gate_CmdServer2Gate_GetClientMsgRangeRes), sendMsg)
}
开发者ID:bsn069,项目名称:go,代码行数:7,代码来源:client_user_send.go

示例9: send_CmdGate2Server_ClientMsg

func (this *SServerUser) send_CmdGate2Server_ClientMsg(vSClientUser *SClientUser) bool {
	vSMsg_Gate2Server_ClientMsg := new(bsn_msg.SMsg_Gate2Server_ClientMsg)
	vSMsg_Gate2Server_ClientMsg.Fill(uint16(vSClientUser.Id()), vSClientUser.M_SMsgHeader, vSClientUser.M_by2MsgBody)
	this.SendMsgWithSMsgHeader(bsn_common.TMsgType(bsn_msg_gate_server.ECmdGate2Server_CmdGate2Server_ClientMsg), vSMsg_Gate2Server_ClientMsg.Serialize())

	return true
}
开发者ID:bsn069,项目名称:go,代码行数:7,代码来源:server_user_send.go

示例10: SendPb2Client

func (this *SClientUser) SendPb2Client(vTClientId TClientId, msgType bsn_msg_client_echo_server.ECmdEchoServe2Client, iMessage proto.Message) error {
	byMsg, err := proto.Marshal(iMessage)
	if err != nil {
		GSLog.Errorln(err)
		return err
	}

	byData := bsn_msg.NewMsgWithMsgHeader(bsn_common.TMsgType(msgType), byMsg)
	return this.Send2Client(vTClientId, byData)
}
开发者ID:bsn069,项目名称:go,代码行数:10,代码来源:client_user.go

示例11: send_CmdGate2Server_LoginReq

func (this *SServerUser) send_CmdGate2Server_LoginReq(vEServerType bsn_define.EServerType) (err error) {
	vSApp := this.UserMgr().UserMgr().App()

	sendMsg := &bsn_msg_gate_server.SLoginReq{
		Id:         proto.Uint32(vSApp.Id()),
		ServerType: vEServerType.Enum(),
	}

	return this.SendPbMsgWithSMsgHeader(bsn_common.TMsgType(bsn_msg_gate_server.ECmdGate2Server_CmdGate2Server_LoginReq), sendMsg)
}
开发者ID:bsn069,项目名称:go,代码行数:10,代码来源:server_user_send.go

示例12: DeSerialize

func (this *SMsgHeader) DeSerialize(byDatas []byte) bsn_common.TMsgLen {
	var vTMsgLen bsn_common.TMsgLen = 0

	this.M_TMsgType = bsn_common.TMsgType(binary.LittleEndian.Uint16(byDatas[vTMsgLen:]))
	vTMsgLen += 2
	this.M_TMsgLen = bsn_common.TMsgLen(binary.LittleEndian.Uint16(byDatas[vTMsgLen:]))
	vTMsgLen += 2

	return vTMsgLen
}
开发者ID:bsn069,项目名称:go,代码行数:10,代码来源:msg_header.go

示例13: NewClient2GateMsg

func NewClient2GateMsg(vu8ServerType, vu8ServerId uint8, u16Type uint16, byMsg []byte) []byte {
	vTMsgLen := bsn_common.TMsgLen(len(byMsg))
	vSMsgHeader := NewMsgHeader(bsn_common.TMsgType(u16Type), vTMsgLen)
	vSMsgHeaderGateClient := NewMsgHeaderGateClient(vu8ServerType, vu8ServerId, vTMsgLen+bsn_common.TMsgLen(unsafe.Sizeof(*vSMsgHeader)))

	byData := make([]byte, vSMsgHeaderGateClient.Len()+bsn_common.TMsgLen(unsafe.Sizeof(*vSMsgHeaderGateClient)))
	copy(byData, vSMsgHeaderGateClient.Serialize())
	copy(byData[int(unsafe.Sizeof(*vSMsgHeaderGateClient)):], vSMsgHeader.Serialize())
	copy(byData[int(unsafe.Sizeof(*vSMsgHeaderGateClient))+int(unsafe.Sizeof(*vSMsgHeader)):], byMsg)
	GSLog.Debugln("byData= ", byData)
	return byData
}
开发者ID:bsn069,项目名称:go,代码行数:12,代码来源:msg_header_gate_client.go

示例14: ProcMsg_CmdGate2Client_TestReq

func (this *SServerUserGate) ProcMsg_CmdGate2Client_TestReq() (err error) {
	GSLog.Debugln("ProcMsg_CmdGate2Client_TestReq")

	recvMsg := new(bsn_msg_client_gate.STestReq)
	if err = proto.Unmarshal(this.M_by2MsgBody, recvMsg); err != nil {
		return
	}
	GSLog.Debugln(*recvMsg.VstrInfo)

	sendMsg := &bsn_msg_client_gate.STestRes{
		VstrInfo: proto.String("client test res"),
	}
	this.SendPbMsgWithSMsgHeader(bsn_common.TMsgType(bsn_msg_client_gate.ECmdClient2Gate_CmdClient2Gate_TestRes), sendMsg)

	return
}
开发者ID:bsn069,项目名称:go,代码行数:16,代码来源:server_user_gate_msg_gate.go

示例15: ProcMsg_CmdGate2GateConfig_GetServerConfigReq

func (this *SClientUser) ProcMsg_CmdGate2GateConfig_GetServerConfigReq() (err error) {
	GSLog.Debugln("ProcMsg_CmdGate2GateConfig_GetServerConfigReq")

	recvMsg := new(bsn_msg_gate_gateconfig.SGate2GateConfig_GetServerConfigReq)
	if err = proto.Unmarshal(this.M_by2MsgBody, recvMsg); err != nil {
		return
	}

	sendMsg := &bsn_msg_gate_gateconfig.SGateConfig2Gate_GetServerConfigRes{
		VSServerConfigs: []*bsn_msg_gate_gateconfig.SServerConfig{
			&bsn_msg_gate_gateconfig.SServerConfig{
				Vcommon_EServerType: bsn_define.EServerType_ServerType_Echo.Enum(),
				VstrAddr:            proto.String("localhost:" + strconv.Itoa(int(bsn_common.ServerPort(uint32(bsn_define.EServerType_ServerType_Echo), this.UserMgr().UserMgr().App().Id())))),
			},
		},
	}
	return this.SendPbMsgWithSMsgHeader(bsn_common.TMsgType(bsn_msg_gate_gateconfig.ECmdGateConfig2Gate_CmdGateConfig2Gate_GetServerConfigRes), sendMsg)
}
开发者ID:bsn069,项目名称:go,代码行数:18,代码来源:client_user_msg_gate.go


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