bool CDeathMatchMissionMgr::StartGame(ILTMessage_Read& msg ) { ServerGameOptions& sgo = g_pGameServerShell->GetServerGameOptions( ); ServerMissionSettings sms = GetServerSettings(); sms.m_bUseSkills = false; sms.m_bFriendlyFire = true; sms.m_nRunSpeed = sgo.GetDeathmatch().m_nRunSpeed; sms.m_nScoreLimit = sgo.GetDeathmatch().m_nScoreLimit; sms.m_nTimeLimit = sgo.GetDeathmatch().m_nTimeLimit; sms.m_nRounds = sgo.GetDeathmatch().m_nRounds; sms.m_nFragScore = sgo.GetDeathmatch().m_nFragScore; sms.m_nTagScore = sgo.GetDeathmatch().m_nTagScore; SetServerSettings(sms); if( !g_pMissionButeMgr->Init( MISSION_DM_FILE )) return false; if( !CServerMissionMgr::StartGame( msg )) return false; return true; }
bool CServerMissionMgr::HandleStartGame( HCLIENT hSender, ILTMessage_Read& msg ) { // Initialize the bute file the client wants. ServerGameOptions const& serverGameOptions = g_pGameServerShell->GetServerGameOptions( ); m_sCampaignFile = serverGameOptions.GetCampaignName(); ServerMissionSettings ss = m_ServerSettings; ss.m_nMPDifficulty = (uint8)g_pGameServerShell->GetDifficulty(); SetServerSettings(ss); // Start the game. if( !StartGame( msg )) return false; return true; }
bool CDeathMatchMissionMgr::HandleMultiplayerOptions( HCLIENT hSender, ILTMessage_Read& msg ) { ServerGameOptions& sgo = g_pGameServerShell->GetServerGameOptions( ); sgo.GetDeathmatch().Read(&msg); ServerMissionSettings sms = GetServerSettings(); sms.m_bUseSkills = false; sms.m_bFriendlyFire = true; sms.m_nRunSpeed = sgo.GetDeathmatch().m_nRunSpeed; sms.m_nScoreLimit = sgo.GetDeathmatch().m_nScoreLimit; sms.m_nTimeLimit = sgo.GetDeathmatch().m_nTimeLimit; sms.m_nRounds = sgo.GetDeathmatch().m_nRounds; sms.m_nFragScore = sgo.GetDeathmatch().m_nFragScore; sms.m_nTagScore = sgo.GetDeathmatch().m_nTagScore; SetServerSettings(sms); return true; }
bool CServerMissionMgr::Load( ILTMessage_Read& msg, uint32 dwSaveFlags ) { msg.ReadString( m_sCampaignFile.GetBuffer( MAX_PATH ), MAX_PATH ); m_sCampaignFile.ReleaseBuffer( ); m_Campaign.clear( ); int nNumCampaignEntries = msg.Readuint8( ); for( int nCampaignIndex = 0; nCampaignIndex < nNumCampaignEntries; ++nCampaignIndex ) { m_Campaign.push_back( msg.Readuint8( )); } m_nCurCampaignIndex = msg.Readuint8( ); ServerMissionSettings ss = m_ServerSettings; ss.m_bUseSkills = msg.Readbool(); ss.m_bFriendlyFire = msg.Readbool(); ss.m_nMPDifficulty = msg.Readuint8(); ss.m_fPlayerDiffFactor = msg.Readfloat(); SetServerSettings(ss); return true; }
bool Database::CreateServerSettings() { std::string query; std::string query2; server_log->Log(log_database_trace, "Entering Server Settings database setup."); query = StringFormat("SHOW TABLES LIKE 'tblloginserversettings'"); auto results = QueryDatabase(query); if (!results.Success()) { server_log->Log(log_database_error, "CreateServerSettings Mysql query failed to search for table: %s", query.c_str()); return false; } server_log->Log(log_database, "CreateServerSettings: table does not exist, creating: %s", query.c_str()); if (results.RowCount() <= 0) { server_log->Log(log_database, "Server Settings table does not exist, creating."); query = StringFormat( "CREATE TABLE `tblloginserversettings` (" "`type` varchar(50) NOT NULL," "`value` varchar(50)," "`category` varchar(20) NOT NULL," "`description` varchar(99) NOT NULL," "`defaults` varchar(50)" ") ENGINE=InnoDB DEFAULT CHARSET=latin1"); auto results = QueryDatabase(query); if (!results.Success()) { server_log->Log(log_database_error, "CreateServerSettings Mysql query failed to create table: %s", query.c_str()); return false; } query2 = StringFormat( "INSERT INTO `tblloginserversettings` (type, value, category, description, defaults)" "VALUES" "('access_log_table', '', 'schema', 'location for access logs, failed logins and goodIP.', 'tblaccountaccesslog')," "('account_table', '', 'schema', 'location of all client account info for login server only.', 'tblLoginServerAccounts')," "('auto_account_activate', '', 'options', 'set this to TRUE to allow new accounts to log in.', 'TRUE')," "('auto_account_create', '', 'options', 'set this to TRUE to auto create accounts on player first log in.', 'TRUE')," "('port', '', 'Old', 'port for clients to connect to.', '6000')," "('dump_packets_in', '', 'options', 'debugging', 'FALSE')," "('dump_packets_out', '', 'options', 'debugging', 'FALSE')," "('failed_login_log', '', 'options', 'set this to TRUE to log failed log in attempts.', 'TRUE')," "('good_loginIP_log', '', 'options', 'set this to TRUE to log successful account log ins.', 'TRUE')," "('listen_port', '', 'options', 'this is the port we listen on for world connection.', '5998')," "('local_network', '', 'options', 'set to the network ip that world server is on.', '127.0.0.1')," "('mode', '', 'security', 'encryption mode the plugin uses.', '5')," "('network_ip', '', 'options', 'set to the network ip that world server is on.', '127.0.0.1')," "('opcodes', '', 'Old', 'opcode file for client compatibility. (Old means classic/mac)', 'login_opcodes_oldver.conf')," "('plugin', '', 'security', 'the encryption type the login server uses.', 'EQEmuAuthCrypto')," "('pop_count', '', 'options', '0 to only display UP or DOWN or 1 to show population count in server select.', '0')," "('reject_duplicate_servers', '', 'options', 'set this to TRUE to force unique server name connections.', 'TRUE')," "('salt', '', 'options', 'for account security make this a numeric random number.', '12345678')," "('ticker', '', 'options', 'Sets the welcome message in server select.', 'Welcome to EQMacEmu')," "('trace', '', 'options', 'debugging', 'FALSE')," "('unregistered_allowed', '', 'options', 'set this to TRUE to allow any server to connect.', 'TRUE')," "('world_admin_registration_table', '', 'schema', 'location of administrator account info for this login server.', 'tblServerAdminRegistration')," "('world_registration_table', '', 'schema', 'location of registered or connection records of servers connecting to this loginserver.', 'tblWorldServerRegistration')," "('world_server_type_table', '', 'schema', 'location of server type descriptions.', 'tblServerListType')," "('world_trace', '', 'options', 'debugging', 'FALSE');"); auto results2 = QueryDatabase(query2); if (!results2.Success()) { server_log->Log(log_database_error, "CreateServerSettings Mysql query failed: %s", query2.c_str()); return false; } // type, category, default bool failed = false; failed |= !SetServerSettings("access_log_table", "schema", "tblaccountaccesslog"); failed |= !SetServerSettings("account_table", "schema", "tblLoginServerAccounts"); failed |= !SetServerSettings("auto_account_activate", "options", "TRUE"); failed |= !SetServerSettings("auto_account_create", "options", "TRUE"); failed |= !SetServerSettings("port", "Old", "6000"); failed |= !SetServerSettings("dump_packets_in", "options", "FALSE"); failed |= !SetServerSettings("dump_packets_out", "options", "FALSE"); failed |= !SetServerSettings("failed_login_log", "options", "TRUE"); failed |= !SetServerSettings("good_loginIP_log", "options", "TRUE"); failed |= !SetServerSettings("listen_port", "options", "5998"); failed |= !SetServerSettings("local_network", "options", "127.0.0.1"); failed |= !SetServerSettings("mode", "security", "5"); failed |= !SetServerSettings("network_ip", "options", "127.0.0.1"); failed |= !SetServerSettings("opcodes", "Old", "login_opcodes_oldver.conf"); failed |= !SetServerSettings("plugin", "security", "EQEmuAuthCrypto"); failed |= !SetServerSettings("pop_count", "options", "0"); failed |= !SetServerSettings("reject_duplicate_servers", "options", "TRUE"); failed |= !SetServerSettings("salt", "options", "12345678"); failed |= !SetServerSettings("ticker", "options", "Welcome to EQMacEmu"); failed |= !SetServerSettings("trace", "options", "FALSE"); failed |= !SetServerSettings("unregistered_allowed", "options", "TRUE"); failed |= !SetServerSettings("world_admin_registration_table", "schema", "tblServerAdminRegistration"); failed |= !SetServerSettings("world_registration_table", "schema", "tblWorldServerRegistration"); failed |= !SetServerSettings("world_server_type_table", "schema", "tblServerListType"); failed |= !SetServerSettings("world_trace", "options", "FALSE"); if (failed) { return false; } server_log->Log(log_database_trace, "Server Settings table created, continuing."); } else { server_log->Log(log_database_trace, "CreateServerSettings found existing settings, continuing on."); } if (GetServerSettings()) { return true; } return false; }