#pragma warning disable 213
#pragma warning disable 220	

#if !defined MAX_SERVER_NAME
    #define MAX_SERVER_NAME (48)
#endif

#if !defined MAX_HOST_NAME
    #define MAX_HOST_NAME (64)
#endif

#if !defined MAX_MODE_NAME
    #define MAX_MODE_NAME (64)
#endif

#if !defined MAX_MAP_NAME
    #define MAX_MAP_NAME (64)
#endif

#if !defined MAX_SERVER_IP_LEN
    #define MAX_SERVER_IP_LEN (21)
#endif

#if !defined MAX_SITE_NAME
    #define MAX_SITE_NAME (32)
#endif

#if !defined MAX_FORUM_NAME
    #define MAX_FORUM_NAME (64)
#endif

#if !defined MAX_VK_NAME
    #define MAX_VK_NAME (32)
#endif

#if !defined MAX_MYSQL_HOST
    #define MAX_MYSQL_HOST (32)
#endif

#if !defined MAX_MYSQL_USER
    #define MAX_MYSQL_USER (32)
#endif

#if !defined MAX_MYSQL_PASS
    #define MAX_MYSQL_PASS (32)
#endif

#if !defined MAX_MYSQL_DB
    #define MAX_MYSQL_DB (32)
#endif

#if !defined MAX_SERVERS
    #define MAX_SERVERS (7)
#endif

new num_srv;

enum _srv_list {
    srv_Test,
    srv_Life,
    srv_Mega,
    srv_Onyx,
    srv_Empire,
    srv_Dubai,
    srv_AbuDabi
};

enum _srv_info {
    srvName[MAX_SERVER_NAME],
	srvHostName[MAX_HOST_NAME],
	srvModeName[MAX_MODE_NAME],
	srvMapName[MAX_MAP_NAME],
	srvIP[MAX_SERVER_IP_LEN],
	srvSite[MAX_SITE_NAME],
	srvForum[MAX_FORUM_NAME],
	srvVK[MAX_VK_NAME]
};

new const srvInfo[_srv_list][_srv_info] = {
	{
		"Test", // Название сервера
		"Eternity / Grand | Тестовый сервер", // Название при запуске сервера
		"•• ETERNITY ••", // Gamemode в клиенте
		"Russian", // Язык сервера
		"127.0.0.1:7777", // IP сервера
		"localhost", // Сайт сервера
		"forum", // Форум сервера
		"vk.com" // Группа сервера
	},
	{
		"Eternity",
		"Eternity RP | Life | Перезапуск игрового сервера...",
		"•• Eternity ••",
		"Russian.",
		"46.174.48.87:7777",
		"etrp.su",
		"forum.eternity-rp.ru", // Форум сервера
		"vk.com/etrp.life"
	},
	{
		"Eternity",
		"Eternity RP | Mega | Перезапуск игрового сервера...",
		"•• Eternity ••",
		"Russian.",
		"176.32.39.63:7777",
		"etrp.su",
		"forum.eternity-rp.ru", // Форум сервера
		"vk.com/etrp.life"
	},
	{
		"Eternity",
		"Eternity RP | Onyx | Перезапуск игрового сервера...",
		"•• Eternity ••",
		"Russian",
		"46.174.48.87:7772",
		"etrp.su",
		"forum.eternity-rp.ru", // Форум сервера
		"vk.com/etrp.life"
	},
	{
		"Eternity",
		"Eternity RP | Empire | Перезапуск игрового сервера...",
		"•• Eternity ••",
		"Russian",
		"176.32.39.128:7777",
		"etrp.su",
		"forum.eternity-rp.ru", // Форум сервера
		"vk.com/etrp.life"
	},
 	{
		"Grand",
		"Grand RP | Dubai | Перезапуск игрового сервера...",
		"•••• GRAND ••••",
		"Russian",
		"127.0.0.1:7772",
		"grand-rp.ru",
		"forum.grand-rp.ru", // Форум сервера
		"vk.com/grand_rp"
	},
    {
		"Grand",
		"Grand RP | Abu-Dabi | Перезапуск игрового сервера...",
		"•••• Grand ••••",
		"Russian",
		"127.0.0.1:7773",
		"grand-rp.ru",
		"forum.grand-rp.ru", // Форум сервера
		"vk.com/grand_rp"
	}
};

enum _srv_sql {
    srvHost[MAX_MYSQL_HOST],
    srvUser[MAX_MYSQL_USER],
    srvBase[MAX_MYSQL_DB],
    srvPass[MAX_MYSQL_PASS]
};

new const srvSql[_srv_list][_srv_sql] = {
    {
        "localhost",
        "root",
        "etrp",
        ""
    },
    {
        "db4.myarena.ru",
        "u25646_eternity",
        "u25646_eternity",
        "eternity-lw-rp-227"
    },
    {
        "db4.myarena.ru",
        "u25646_eternity",
        "u25646_mega",
        "eternity-lw-rp-227"
    },
    {
        "db4.myarena.ru",
        "u25646_eternity",
        "u25646_onyx",
        "eternity-lw-rp-227"
    },
    {
        "db4.myarena.ru",
        "u25646_eternity",
        "u25646_empire",
        "eternity-lw-rp-227"
    },
    {
        "localhost",
        "root",
        "grand",
        ""
    },
    {
        "localhost",
        "root",
        "grand",
        ""
    }
};

stock srv_ChooseSrv() {
	new srv_ip[21 + 1];

	GetConsoleVarAsString("bind", srv_ip, 16);
	format(srv_ip, sizeof srv_ip, "%s:%d", srv_ip, GetConsoleVarAsInt("port"));

	if(!strcmp("127.0.0.1:7777", srv_ip, false, MAX_SERVER_IP_LEN)) num_srv = srv_Test;
	if(!strcmp("46.174.48.87:7777", srv_ip, false, MAX_SERVER_IP_LEN)) num_srv = srv_Life;
	if(!strcmp("176.32.39.63:7777", srv_ip, false, MAX_SERVER_IP_LEN)) num_srv = srv_Mega;
	if(!strcmp("46.174.48.87:7772", srv_ip, false, MAX_SERVER_IP_LEN)) num_srv = srv_Onyx;
	if(!strcmp("176.32.39.128:7777", srv_ip, false, MAX_SERVER_IP_LEN)) num_srv = srv_Empire;
	if(!strcmp("127.0.0.1:7774", srv_ip, false, MAX_SERVER_IP_LEN)) num_srv = srv_Dubai;
	if(!strcmp("127.0.0.1:7775", srv_ip, false, MAX_SERVER_IP_LEN)) num_srv = srv_AbuDabi;
	
	return 1;
}
