ACR_ServerCommunicator.GameServer.PopulateFromDatabase C# (CSharp) Method

PopulateFromDatabase() public method

Retrieve the properties of the server from the database.
public PopulateFromDatabase ( IALFADatabase Database ) : void
Database IALFADatabase Supplies the database connection to use for /// queries, if required. The active rowset may be consumed.
return void
        public void PopulateFromDatabase(IALFADatabase Database)
        {
            Database.ACR_SQLQuery(String.Format(
                "SELECT `Name`, `IPAddress`, `IsPublic` FROM `servers` WHERE `ID` = {0}",
                ServerId));

            if (!Database.ACR_SQLFetch())
            {
                throw new ApplicationException("Failed to populate data for server " + ServerId);
            }

            ServerName = Database.ACR_SQLGetData(0);
            SetHostnameAndPort(Database.ACR_SQLGetData(1));
            Public = GameWorldManager.ConvertToBoolean(Database.ACR_SQLGetData(2));
        }