Beispiel #1
0
        /// <summary>
        /// This method sends the current build number to a game server, or
        /// game client.
        /// </summary>
        /// <param name="Address">Supplies the message recipient.</param>
        /// <param name="BuildNumber">Supplies the build number string.</param>
        public void SendMstVersion(IPEndPoint Address, string BuildNumber)
        {
            using (ExoBuildBuffer Builder = new ExoBuildBuffer())
            {
                Builder.WriteDWORD((uint)MstCmd.VersionResponse);
                Builder.WriteSmallString(BuildNumber, 16);

                Logger.Log(LogLevel.Verbose, "NWMasterServer.SendMstVersion(): Sending version to {0}.", Address);

                SendRawDataToMstClient(Address, Builder);
            }
        }
Beispiel #2
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);
            }
        }
Beispiel #3
0
        /// <summary>
        /// This method sends the message of the day to a game server, or game
        /// client.
        /// </summary>
        /// <param name="Address">Supplies the message recipient.</param>
        /// <param name="Message">Supplies the announcement message.</param>
        public void SendMstMOTD(IPEndPoint Address, string Message)
        {
            using (ExoBuildBuffer Builder = new ExoBuildBuffer())
            {
                Builder.WriteDWORD((uint)MstCmd.MOTDResponse);
                Builder.WriteSmallString(Message, 16);

                Logger.Log(LogLevel.Verbose, "NWMasterServer.SendMstMOTD(): Sending MOTD to {0}.", Address);

                SendRawDataToMstClient(Address, Builder);
            }
        }
Beispiel #4
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);
            }
        }