/// <summary> /// Sends a game coordinator message for a specific appid. /// </summary> /// <param name="msg">The GC message to send.</param> /// <param name="appId">The app id of the game coordinator to send to.</param> public void Send(IClientGCMsg msg, uint appId) { var clientMsg = new ClientMsgProtobuf <CMsgGCClient>(EMsg.ClientToGC); clientMsg.Body.msgtype = MsgUtil.MakeGCMsg(msg.MsgType, msg.IsProto); clientMsg.Body.appid = appId; clientMsg.Body.payload = msg.Serialize(); this.Client.Send(clientMsg); }
/// <summary> /// Sends a game coordinator message for a specific appid. /// </summary> /// <param name="msg">The GC message to send.</param> /// <param name="appId">The app id of the game coordinator to send to.</param> public void Send( IClientGCMsg msg, uint appId ) { var clientMsg = new ClientMsgProtobuf<CMsgGCClient>( EMsg.ClientToGC ); clientMsg.Body.msgtype = MsgUtil.MakeGCMsg( msg.MsgType, msg.IsProto ); clientMsg.Body.appid = appId; clientMsg.Body.payload = msg.Serialize(); this.Client.Send( clientMsg ); }
/// <summary> /// Sends a game coordinator message for a specific appid. /// </summary> /// <param name="msg">The GC message to send.</param> /// <param name="appId">The app id of the game coordinator to send to.</param> public void Send(IClientGCMsg msg, uint appId) { if (msg == null) { throw new ArgumentNullException(nameof(msg)); } var clientMsg = new ClientMsgProtobuf <CMsgGCClient>(EMsg.ClientToGC); clientMsg.ProtoHeader.routing_appid = appId; clientMsg.Body.msgtype = MsgUtil.MakeGCMsg(msg.MsgType, msg.IsProto); clientMsg.Body.appid = appId; clientMsg.Body.payload = msg.Serialize(); this.Client.Send(clientMsg); }
public bool sendMsg(IClientGCMsg msg, bool fixit = true) { if (!connected) { return(false); } byte[] buffer = msg.Serialize(); uint mask = 0; if (fixit) { mask = 0x80000000; } return(_send(interfacePtr, msg.MsgType | mask, buffer, (uint)buffer.Length)); }