示例#1
0
        /// <summary>
        /// This method sends a GameSpy server status acknowledgement back to
        /// a GameSpy client, informing the client that GameSpy services should
        /// be considered as available and operational.
        /// </summary>
        /// <param name="Address">Supplies the recipient address.</param>
        public void SendGameSpyCheckServerStatusResponse(IPEndPoint Address)
        {
            using (ExoBuildBuffer Builder = new ExoBuildBuffer())
            {
                Builder.WriteWORD(0xFDFE);
                Builder.WriteBYTE((byte)GameSpyCmd.CheckServerStatus);
                Builder.WriteDWORD(0);

                Logger.Log(LogLevel.Verbose, "NWMasterServer.SendGameSpyCheckServerStatusResponse(): Sending GameSpy aliveness acknowledgement to {0}.", Address);

                SendRawDataToGameSpyClient(Address, Builder);
            }
        }
示例#2
0
        /// <summary>
        /// This method sends a server description request to a server.
        /// </summary>
        /// <param name="Address">Supplies the game server address.</param>
        public void SendServerDescriptionRequest(IPEndPoint Address)
        {
            using (ExoBuildBuffer Builder = new ExoBuildBuffer())
            {
                Builder.WriteDWORD((uint)ConnAuthCmd.ServerDescriptionRequest);
                Builder.WriteWORD((ushort)MasterServerPort);

                Logger.Log(LogLevel.Verbose, "NWMasterServer.SendServerDescriptionRequest(): Sending server description request to {0}.", Address);

                SendRawDataToMstClientNATDuplicate(Address, Builder);
            }
        }
示例#3
0
        /// <summary>
        /// This method sends a CD-Key authorization response to a game server,
        /// or game client (for initial login).
        /// </summary>
        /// <param name="Address">Supplies the message recipient.</param>
        /// <param name="CDKeys">Supplies the CD-Key list.</param>
        public void SendMstCDKeyAuthorization(IPEndPoint Address, IList<CDKeyInfo> CDKeys)
        {
            using (ExoBuildBuffer Builder = new ExoBuildBuffer())
            {
                Builder.WriteDWORD((uint)MstCmd.CDKeyAuthorization);
                Builder.WriteWORD((ushort)CDKeys.Count);

                foreach (CDKeyInfo CDKey in CDKeys)
                {
                    Builder.WriteSmallString(CDKey.PublicCDKey, 16);
                    Builder.WriteWORD(CDKey.AuthStatus);
                    Builder.WriteWORD(CDKey.Product);
                }

                Logger.Log(LogLevel.Verbose, "NWMasterServer.SendMstCDKeyAuthorization(): Authorizing {0} CD-Keys for server {1}.", CDKeys, Address);

                SendRawDataToMstClient(Address, Builder);
            }
        }
示例#4
0
        /// <summary>
        /// This method sends a server name request to a server.
        /// </summary>
        /// <param name="Address">Supplies the game server address.</param>
        public void SendServerNameRequest(IPEndPoint Address)
        {
            using (ExoBuildBuffer Builder = new ExoBuildBuffer())
            {
                Builder.WriteDWORD((uint)ConnAuthCmd.ServerNameRequest);
                Builder.WriteWORD((ushort)MasterServerPort);
                Builder.WriteBYTE(0); // Request correlation cookie.

                Logger.Log(LogLevel.Verbose, "NWMasterServer.SendServerNameRequest(): Sending server name request to {0}.", Address);

                SendRawDataToMstClientNATDuplicate(Address, Builder);
            }
        }
示例#5
0
        /// <summary>
        /// This method sends a community account authorization response to a
        /// game server, or game client (for initial login).
        /// </summary>
        /// <param name="Address">Supplies the message recipient.</param>
        /// <param name="AccountName">Supplies the account name.</param>
        /// <param name="Status">Supplies the authorization status
        /// code.</param>
        public void SendMstCommunityAccountAuthorization(IPEndPoint Address, string AccountName, ConnectStatus Status)
        {
            using (ExoBuildBuffer Builder = new ExoBuildBuffer())
            {
                Builder.WriteDWORD((uint)MstCmd.CommunityAuthorization);
                Builder.WriteSmallString(AccountName, 16);
                Builder.WriteWORD((ushort)Status);

                Logger.Log(LogLevel.Verbose, "NWMasterServer.SendMstCommunityAccountAuthorization(): Authorizing account {0} for server {1} with status {2}.", AccountName, Address, Status);

                SendRawDataToMstClient(Address, Builder);
            }
        }