/// <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);
        }
Exemple #2
0
            static IPacketGCMsg GetPacketGCMsg(uint eMsg, byte[] data)
            {
                // strip off the protobuf flag
                uint realEMsg = MsgUtil.GetGCMsg(eMsg);

                if (MsgUtil.IsProtoBuf(eMsg))
                {
                    return(new PacketClientGCMsgProtobuf(realEMsg, data));
                }
                else
                {
                    return(new PacketClientGCMsg(realEMsg, data));
                }
            }
Exemple #3
0
        /// <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);
        }