Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-----------------------------------------------------------------------------
- // Torque
- // Copyright GarageGames, LLC 2011
- //-----------------------------------------------------------------------------
- // First we execute the core default preferences.
- exec( "core/scripts/server/defaults.cs" );
- // Now add your own game specific server preferences as
- // well as any overloaded core defaults here.
- $Pref::Server::DB::Software = 5; // 0 - MySQL Local, 1 - MySQL Remote, 2 - SQL Serv 2000, 3 - SQL Serv 2005, 4 - Oracle
- $Pref::Server::DB::Port = "3306"; // DB Port number
- $Pref::Server::DB::Server = "localhost"; // Server's url or ip
- $Pref::Server::DB::Database = "NOME_DATABASE"; // Database name
- $Pref::Server::DB::User = "root"; // username
- $Pref::Server::DB::Password = "PASSWORD"; // password
- //check platform for which driver to use
- if ($platform $= "windows")
- {
- //check database they are using
- switch($Pref::Server::DB::Software)
- {
- case 0:
- $Pref::Server::DB::Driver = "MySQL ODBC 3.51 Driver";
- case 1:
- $Pref::Server::DB::Driver = "MySQL ODBC 3.51 Driver";
- case 2:
- $Pref::Server::DB::Driver = "SQL Server";
- case 3:
- $Pref::Server::DB::Driver = "SQL Native Client";
- case 4:
- $Pref::Server::DB::Driver = "Microsoft ODBC for Oracle";
- case 5:
- $Pref::Server::DB::Driver = "MySQL ODBC 5.1 Driver";
- default:
- $Pref::Server::DB::Driver = "ERROR: UNKNOWN DATABASE:" SPC $Pref::Server::DB::Database;
- }
- }
- else
- {
- //check database they are using
- switch($Pref::Server::DB::Software)
- {
- case 0:
- $Pref::Server::DB::Driver = "MySQL";
- case 1:
- $Pref::Server::DB::Driver = "MySQL";
- case 2:
- $Pref::Server::DB::Driver = "ERROR: SQL SERVER NOT SUPPORTED BY LINUX";
- case 3:
- $Pref::Server::DB::Driver = "ERROR: SQL SERVER NOT SUPPORTED BY LINUX";
- case 4:
- $Pref::Server::DB::Driver = "Oracle";
- case 5:
- $Pref::Server::DB::Driver = "MySQL";
- default:
- $Pref::Server::DB::Driver = "ERROR: UNKNOWN DATABASE:" SPC $Pref::Server::DB::Database;
- }
- }
- // Finally load the preferences saved from the last
- // game execution if they exist.
Add Comment
Please, Sign In to add comment