aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/options.cmake2
-rw-r--r--cmake/showoptions.cmake2
-rw-r--r--contrib/conf_merge/README2
-rw-r--r--doc/UnixInstall.txt2
-rw-r--r--sql/base/auth_database.sql86
-rw-r--r--sql/updates/auth/2014_11_10_00_auth_from_335.sql7
-rw-r--r--sql/updates/auth/2014_11_10_01_auth.sql9
-rw-r--r--sql/updates/world/2014_11_10_03_world.sql4
-rw-r--r--sql/updates/world/2014_11_10_04_world.sql8
-rw-r--r--sql/updates/world/2014_11_10_05_world.sql5
-rw-r--r--src/server/CMakeLists.txt1
-rw-r--r--src/server/authserver/Authentication/AuthCodes.cpp87
-rw-r--r--src/server/authserver/Authentication/AuthCodes.h132
-rw-r--r--src/server/authserver/Authentication/TOTP.cpp95
-rw-r--r--src/server/authserver/CMakeLists.txt112
-rw-r--r--src/server/authserver/Main.cpp233
-rw-r--r--src/server/authserver/PrecompiledHeaders/authPCH.cpp1
-rw-r--r--src/server/authserver/PrecompiledHeaders/authPCH.h7
-rw-r--r--src/server/authserver/Realms/RealmList.cpp188
-rw-r--r--src/server/authserver/Realms/RealmList.h99
-rw-r--r--src/server/authserver/Server/AuthSession.cpp902
-rw-r--r--src/server/authserver/Server/AuthSession.h96
-rw-r--r--src/server/authserver/Server/AuthSocketMgr.h61
-rw-r--r--src/server/authserver/authserver.conf.dist250
-rw-r--r--src/server/authserver/authserver.icobin136606 -> 0 bytes
-rw-r--r--src/server/authserver/authserver.rc94
-rw-r--r--src/server/authserver/resource.h15
-rw-r--r--src/server/bnetserver/bnetserver.conf.dist4
-rw-r--r--src/server/game/Accounts/RBAC.h2
-rw-r--r--src/server/game/Entities/Player/Player.cpp2
-rw-r--r--src/server/game/Miscellaneous/Language.h4
-rw-r--r--src/server/scripts/Commands/cs_account.cpp2
-rw-r--r--src/server/scripts/Commands/cs_battlenet_account.cpp2
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp30
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp32
-rw-r--r--src/server/shared/CMakeLists.txt2
-rw-r--r--src/server/shared/Configuration/Config.h2
-rw-r--r--src/server/shared/Database/DatabaseEnv.h2
-rw-r--r--src/server/shared/Database/Implementation/CharacterDatabase.cpp1
-rw-r--r--src/server/shared/Database/Implementation/CharacterDatabase.h1
-rw-r--r--src/server/shared/Database/Implementation/HotfixDatabase.cpp (renamed from src/server/authserver/Authentication/TOTP.h)13
-rw-r--r--src/server/shared/Database/Implementation/HotfixDatabase.h48
-rw-r--r--src/server/worldserver/CMakeLists.txt4
-rw-r--r--src/server/worldserver/Main.cpp26
-rw-r--r--src/server/worldserver/worldserver.conf.dist8
-rw-r--r--src/tools/map_extractor/loadlib/DBFilesClientList.h1
-rw-r--r--src/tools/vmap4_extractor/vmapexport.cpp2
47 files changed, 221 insertions, 2467 deletions
diff --git a/cmake/options.cmake b/cmake/options.cmake
index d4fc2f3b2d0..3002658a729 100644
--- a/cmake/options.cmake
+++ b/cmake/options.cmake
@@ -8,7 +8,7 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-option(SERVERS "Build worldserver and authserver" 1)
+option(SERVERS "Build worldserver and bnetserver" 1)
option(SCRIPTS "Build core with scripts included" 1)
option(TOOLS "Build map/vmap/mmap extraction/assembler tools" 0)
option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" 1)
diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake
index ea4820a01f0..44d161cab8d 100644
--- a/cmake/showoptions.cmake
+++ b/cmake/showoptions.cmake
@@ -20,7 +20,7 @@ message("")
if( SERVERS )
message("* Build world/auth : Yes (default)")
else()
- message("* Build world/authserver : No")
+ message("* Build world/bnetserver : No")
endif()
if( SCRIPTS )
diff --git a/contrib/conf_merge/README b/contrib/conf_merge/README
index 974c1063064..9e6b1e1546c 100644
--- a/contrib/conf_merge/README
+++ b/contrib/conf_merge/README
@@ -1,6 +1,6 @@
==== PHP merger (index.php + merge.php) ====
-This is a PHP script for merging a new .dist file with your existing .conf file (worldserver.conf.dist and authserver.conf.dist)
+This is a PHP script for merging a new .dist file with your existing .conf file (worldserver.conf.dist and bnetserver.conf.dist)
It should also work with mangos dist/conf files as well.
It uses sessions so it is multi user safe, it adds any options that are removed to the bottom of the file,
diff --git a/doc/UnixInstall.txt b/doc/UnixInstall.txt
index 94b25c58352..043994c856f 100644
--- a/doc/UnixInstall.txt
+++ b/doc/UnixInstall.txt
@@ -49,7 +49,7 @@ than where to install using flags built into our cmake files. Just open
up CMakeLists.txt in the main folder and take a look at some of the
flags like
- SERVERS Build worldserver and authserver
+ SERVERS Build worldserver and bnetserver
SCRIPTS Build core with scripts included
TOOLS Build map/vmap extraction/assembler tools
USE_SCRIPTPCH Use precompiled headers when compiling scripts
diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql
index 4610af447d9..180597a938e 100644
--- a/sql/base/auth_database.sql
+++ b/sql/base/auth_database.sql
@@ -51,8 +51,8 @@ CREATE TABLE `account` (
`battlenet_index` tinyint(3) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_username` (`username`),
- UNIQUE KEY `uk_bnet_acc` (`battlenet_account`, `battlenet_index`),
- CONSTRAINT `fk_bnet_acc` FOREIGN KEY (`battlenet_account`) REFERENCES `battlenet_accounts` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
+ UNIQUE KEY `uk_bnet_acc` (`battlenet_account`,`battlenet_index`),
+ CONSTRAINT `fk_bnet_acc` FOREIGN KEY (`battlenet_account`) REFERENCES `battlenet_accounts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Account System';
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -222,6 +222,16 @@ CREATE TABLE `battlenet_accounts` (
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='Account System';
/*!40101 SET character_set_client = @saved_cs_client */;
+--
+-- Dumping data for table `battlenet_accounts`
+--
+
+LOCK TABLES `battlenet_accounts` WRITE;
+/*!40000 ALTER TABLE `battlenet_accounts` DISABLE KEYS */;
+/*!40000 ALTER TABLE `battlenet_accounts` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
-- Table structure for table `battlenet_components`
--
@@ -242,24 +252,7 @@ CREATE TABLE `battlenet_components` (
LOCK TABLES `battlenet_components` WRITE;
/*!40000 ALTER TABLE `battlenet_components` DISABLE KEYS */;
-INSERT INTO `battlenet_components` VALUES
-('Bnet','Mc64',37165),
-('Bnet','Win',37165),
-('Bnet','Wn64',37165),
-('WoW','base',19057),
-('WoW','deDE',0),
-('WoW','enGB',0),
-('WoW','enUS',0),
-('WoW','esES',0),
-('WoW','esMX',0),
-('WoW','frFR',0),
-('WoW','koKR',0),
-('WoW','Mc64',19116),
-('WoW','ruRU',0),
-('WoW','Win',19116),
-('WoW','Wn64',19116),
-('WoW','zhCN',0),
-('WoW','zhTW',0);
+INSERT INTO `battlenet_components` VALUES ('Bnet','Mc64',37165),('Bnet','Win',37165),('Bnet','Wn64',37165),('WoW','base',19057),('WoW','deDE',0),('WoW','enGB',0),('WoW','enUS',0),('WoW','esES',0),('WoW','esMX',0),('WoW','frFR',0),('WoW','koKR',0),('WoW','Mc64',19116),('WoW','ruRU',0),('WoW','Win',19116),('WoW','Wn64',19116),('WoW','zhCN',0),('WoW','zhTW',0);
/*!40000 ALTER TABLE `battlenet_components` ENABLE KEYS */;
UNLOCK TABLES;
@@ -287,50 +280,7 @@ CREATE TABLE `battlenet_modules` (
LOCK TABLES `battlenet_modules` WRITE;
/*!40000 ALTER TABLE `battlenet_modules` DISABLE KEYS */;
-INSERT INTO `battlenet_modules` VALUES
-('19c91b68752b7826df498bf73aca1103c86962a9a55a0a7033e5ad895f4d927c','Password','auth','Mc64',NULL),
-('1af5418a448f8ad05451e3f7dbb2d9af9cb13458eea2368ebfc539476b954f1c','RiskFingerprint','auth','Mc64',NULL),
-('207640724f4531d3b2a21532224d1486e8c4d2d805170381cbc3093264157960','SelectGameAccount','auth','Mac',NULL),
-('2e6d53adab37a41542b38e01f62cd365eab8805ed0de73c307cc6d9d1dfe478c','Password','auth','Win',NULL),
-('36b27cd911b33c61730a8b82c8b2495fd16e8024fc3b2dde08861c77a852941c','Thumbprint','auth','Win','E716F4F0A01EB9C032A6C1393356A4F766F067949D71023C0CFC0613718966EF814E65CC6EE70C432A7F8AFD8A062B52603A2697E851D231D72C0277614181D713369B1E8E4BEEAB72045A9AAD45F319DB918ECDDB83C8EF8B7510600D391D45E7FEC0BEEAE904A5F9FA620F1CCDAD699D84A4739CE669B5A551831E396214E13B4C88F573F5CDC784CD01530C086B674C03BEB66403A0F87ED17ABBB403DE54CF31BE828A20C566C22E4D4263AA77220B0644D99245345BCAC276EA06925EB984D664725C3CB757140AFE12E27CB996F17159B1057E9B58B78BBB5A139C9FF6215A0D250B75FC9DD435655DDEADCD6CFD84800792C146B3633188ECEB53D2038C185E0BD51A9E6C70FD38ADF530F8DF50FB62053C5E894897AB7DD65C7AC80665F18E7989BE6E30F15E939751123D6D8A44F033175301D15AAAD2AEA06FAC60BA4065846AE938F32B1CB15F16DC0E76792A7332346896048065D17C059899E1D2300E402BD0EA74265DA6A42B1C854E2470D7B21AE4A2DAE90E602A759B2CA0EE610B50D5389DB89335D5451FE76DD85B09FD5297D6F9EFB6C34CE885007F7DF20D6A524E0C3E772FA04B3DD2E014D3A337A790943DAD523CBB5453F4FDF8E74DFE361BD5F25AB31952B478148B570DF5762643F32B994FEC99A747E4A265A66EE84A53509EC285C84679606049314FC526C61B537AC8061C788F8B86F52208'),
-('393ca8d75aff6f04f79532cf95a88b91e5743bc59121520ac31fc4508019fe60','Token','auth','Mac',NULL),
-('3c2f63e5949aa6fd6cf330b109ca5b9adcd215beac846b7462ed3aa01d5ad6bb','Password','auth','Mac',NULL),
-('52e2978db6468dfade7c61da89513f443c9225692b5085fbe956749870993703','SelectGameAccount','auth','Mc64',NULL),
-('548b5ef9e0dd5c2f89f59c3e0979249b27505c51f0c77d2b27133726eaee0ad0','Thumbprint','auth','Mac','E716F4F0A01EB9C032A6C1393356A4F766F067949D71023C0CFC0613718966EF814E65CC6EE70C432A7F8AFD8A062B52603A2697E851D231D72C0277614181D713369B1E8E4BEEAB72045A9AAD45F319DB918ECDDB83C8EF8B7510600D391D45E7FEC0BEEAE904A5F9FA620F1CCDAD699D84A4739CE669B5A551831E396214E13B4C88F573F5CDC784CD01530C086B674C03BEB66403A0F87ED17ABBB403DE54CF31BE828A20C566C22E4D4263AA77220B0644D99245345BCAC276EA06925EB984D664725C3CB757140AFE12E27CB996F17159B1057E9B58B78BBB5A139C9FF6215A0D250B75FC9DD435655DDEADCD6CFD84800792C146B3633188ECEB53D2038C185E0BD51A9E6C70FD38ADF530F8DF50FB62053C5E894897AB7DD65C7AC80665F18E7989BE6E30F15E939751123D6D8A44F033175301D15AAAD2AEA06FAC60BA4065846AE938F32B1CB15F16DC0E76792A7332346896048065D17C059899E1D2300E402BD0EA74265DA6A42B1C854E2470D7B21AE4A2DAE90E602A759B2CA0EE610B50D5389DB89335D5451FE76DD85B09FD5297D6F9EFB6C34CE885007F7DF20D6A524E0C3E772FA04B3DD2E014D3A337A790943DAD523CBB5453F4FDF8E74DFE361BD5F25AB31952B478148B570DF5762643F32B994FEC99A747E4A265A66EE84A53509EC285C84679606049314FC526C61B537AC8061C788F8B86F52208'),
-('5e298e530698af905e1247e51ef0b109b352ac310ce7802a1f63613db980ed17','RiskFingerprint','auth','Win',NULL),
-('851c1d2ef926e9b9a345a460874e65517195129b9e3bdec7cc77710fa0b1fad6','Password','auth','Wn64',NULL),
-('894d25d3219d97d085ea5a8b98e66df5bd9f460ec6f104455246a12b8921409d','SelectGameAccount','auth','Wn64',NULL),
-('8c43bda10be33a32abbc09fb2279126c7f5953336391276cff588565332fcd40','RiskFingerprint','auth','Wn64',NULL),
-('a1edab845d9e13e9c84531369be2f61b930a37c8e7a9c66d11ef8963380e178a','Token','auth','Mc64',NULL),
-('a330f388b6687f8a42fe8fbb592a3df724b20b65fb0989342bb8261f2f452318','Token','auth','Wn64',NULL),
-('abc6bb719a73ec1055296001910e26afa561f701ad9995b1ecd7f55f9d3ca37c','SelectGameAccount','auth','Win',NULL),
-('b37136b39add83cfdbafa81857de3dd8f15b34e0135ec6cd9c3131d3a578d8c2','Thumbprint','auth','Mc64','E716F4F0A01EB9C032A6C1393356A4F766F067949D71023C0CFC0613718966EF814E65CC6EE70C432A7F8AFD8A062B52603A2697E851D231D72C0277614181D713369B1E8E4BEEAB72045A9AAD45F319DB918ECDDB83C8EF8B7510600D391D45E7FEC0BEEAE904A5F9FA620F1CCDAD699D84A4739CE669B5A551831E396214E13B4C88F573F5CDC784CD01530C086B674C03BEB66403A0F87ED17ABBB403DE54CF31BE828A20C566C22E4D4263AA77220B0644D99245345BCAC276EA06925EB984D664725C3CB757140AFE12E27CB996F17159B1057E9B58B78BBB5A139C9FF6215A0D250B75FC9DD435655DDEADCD6CFD84800792C146B3633188ECEB53D2038C185E0BD51A9E6C70FD38ADF530F8DF50FB62053C5E894897AB7DD65C7AC80665F18E7989BE6E30F15E939751123D6D8A44F033175301D15AAAD2AEA06FAC60BA4065846AE938F32B1CB15F16DC0E76792A7332346896048065D17C059899E1D2300E402BD0EA74265DA6A42B1C854E2470D7B21AE4A2DAE90E602A759B2CA0EE610B50D5389DB89335D5451FE76DD85B09FD5297D6F9EFB6C34CE885007F7DF20D6A524E0C3E772FA04B3DD2E014D3A337A790943DAD523CBB5453F4FDF8E74DFE361BD5F25AB31952B478148B570DF5762643F32B994FEC99A747E4A265A66EE84A53509EC285C84679606049314FC526C61B537AC8061C788F8B86F52208'),
-('c0f38d05aa1b83065e839c9bd96c831e9f7e42477085138752657a6a9bb9c520','RiskFingerprint','auth','Mac',NULL),
-('c3a1ac0694979e709c3b5486927e558af1e2be02ca96e5615c5a65aacc829226','Thumbprint','auth','Wn64','E716F4F0A01EB9C032A6C1393356A4F766F067949D71023C0CFC0613718966EF814E65CC6EE70C432A7F8AFD8A062B52603A2697E851D231D72C0277614181D713369B1E8E4BEEAB72045A9AAD45F319DB918ECDDB83C8EF8B7510600D391D45E7FEC0BEEAE904A5F9FA620F1CCDAD699D84A4739CE669B5A551831E396214E13B4C88F573F5CDC784CD01530C086B674C03BEB66403A0F87ED17ABBB403DE54CF31BE828A20C566C22E4D4263AA77220B0644D99245345BCAC276EA06925EB984D664725C3CB757140AFE12E27CB996F17159B1057E9B58B78BBB5A139C9FF6215A0D250B75FC9DD435655DDEADCD6CFD84800792C146B3633188ECEB53D2038C185E0BD51A9E6C70FD38ADF530F8DF50FB62053C5E894897AB7DD65C7AC80665F18E7989BE6E30F15E939751123D6D8A44F033175301D15AAAD2AEA06FAC60BA4065846AE938F32B1CB15F16DC0E76792A7332346896048065D17C059899E1D2300E402BD0EA74265DA6A42B1C854E2470D7B21AE4A2DAE90E602A759B2CA0EE610B50D5389DB89335D5451FE76DD85B09FD5297D6F9EFB6C34CE885007F7DF20D6A524E0C3E772FA04B3DD2E014D3A337A790943DAD523CBB5453F4FDF8E74DFE361BD5F25AB31952B478148B570DF5762643F32B994FEC99A747E4A265A66EE84A53509EC285C84679606049314FC526C61B537AC8061C788F8B86F52208'),
-('fbe675a99fb5f4b7fb3eb5e5a22add91a4cabf83e3c5930c6659ad13c457ba18','Token','auth','Win',NULL),
-('bfe4ceb47700aa872e815e007e27df955d4cd4bc1fe731039ee6498ce209f368','Resume','auth','Win',NULL),
-('00ffd88a437afbb88d7d4b74be2e3b43601605ee229151aa9f4bebb29ef66280','Resume','auth','Mac',NULL),
-('898166926805f897804bdbbf40662c9d768590a51a0b26c40dbcdf332ba11974','Resume','auth','Wn64',NULL),
-('304627d437c38500c0b5ca0c6220eeade91390e52a2b005ff3f7754afa1f93cd','Resume','auth','Mc64',NULL),
-('cc654428261322763f4cada5b7f4b3b67660e85639bea916986b3f366fe8adc2','ERRS','xml','enGB','AA6C50D3'),
-('2753d31092f1978bdd78ebd4fae2d189364ad7108ceb22fbf1413be1f43bef04','PFTY','pfty','zhCN','DF6C50D3'),
-('5813f318f7e40a07a7cdfeeec9827942e6fdc5ccee0d4171148443e429ad0ead','PFTY','pfty','ruRU','DF6C50D3'),
-('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enSG','DF6C50D3'),
-('870f53d10b4e1b09d6b622cd5671ba4ff1ad69512dfa2c676072c52e45c7f0f9','PFTY','pfty','esES','DF6C50D3'),
-('305bbdab1953e65974a249e276867e13ad2c3cabca3668983cb5ed406251bb7b','PFTY','pfty','frFR','DF6C50D3'),
-('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enGB','DF6C50D3'),
-('a2ec4b41148214037a2e89a2e557af716d085241b81f5244494bdc77a891ca38','PFTY','pfty','csCZ','DF6C50D3'),
-('a8c77051991b1a6c5dfe412e9f46d8f584349996fbde37c4f2a527c192163502','PFTY','pfty','plPL','DF6C50D3'),
-('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enUS','DF6C50D3'),
-('7466b2db3f03768aa2527535d4b3c6c9ef9e8fb07c6db88b1019f3d25a2942e8','PFTY','pfty','koKR','DF6C50D3'),
-('a2ec4b41148214037a2e89a2e557af716d085241b81f5244494bdc77a891ca38','PFTY','pfty','jaJP','DF6C50D3'),
-('3e381d4f83201f4e3c482eb74da12e5ff9dd924da2413d8fb33f5eea9a02c2c2','PFTY','pfty','zhTW','DF6C50D3'),
-('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enTH','DF6C50D3'),
-('b72e65b6b34d8f859e79b5f28952e26553a796d5e1d75c2b5930bc0daeaa728c','PFTY','pfty','itIT','DF6C50D3'),
-('e8b82becbe0a0a1bbb5561df69320edbd770897a8deaab23caa6736255e0dc33','PFTY','pfty','esMX','DF6C50D3'),
-('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enAU','DF6C50D3'),
-('0a3f6f3f0535ea21dbe620085192afc796203047e270e0e1b76f15a739fe1797','PFTY','pfty','ptBR','DF6C50D3'),
-('047329d08d433da2622e9fc2ee96c8dd8f35e7770699d07cf74855b9c8ea9125','PFTY','pfty','deDE','DF6C50D3');
+INSERT INTO `battlenet_modules` VALUES ('cc654428261322763f4cada5b7f4b3b67660e85639bea916986b3f366fe8adc2','ERRS','xml','enGB','AA6C50D3'),('3c2f63e5949aa6fd6cf330b109ca5b9adcd215beac846b7462ed3aa01d5ad6bb','Password','auth','Mac',NULL),('19c91b68752b7826df498bf73aca1103c86962a9a55a0a7033e5ad895f4d927c','Password','auth','Mc64',NULL),('2e6d53adab37a41542b38e01f62cd365eab8805ed0de73c307cc6d9d1dfe478c','Password','auth','Win',NULL),('851c1d2ef926e9b9a345a460874e65517195129b9e3bdec7cc77710fa0b1fad6','Password','auth','Wn64',NULL),('a2ec4b41148214037a2e89a2e557af716d085241b81f5244494bdc77a891ca38','PFTY','pfty','csCZ','DF6C50D3'),('047329d08d433da2622e9fc2ee96c8dd8f35e7770699d07cf74855b9c8ea9125','PFTY','pfty','deDE','DF6C50D3'),('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enAU','DF6C50D3'),('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enGB','DF6C50D3'),('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enSG','DF6C50D3'),('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enTH','DF6C50D3'),('83663d54444eadad40d43725e59bde8eda10276e76fc3c4e6f2ca56332ee8f03','PFTY','pfty','enUS','DF6C50D3'),('870f53d10b4e1b09d6b622cd5671ba4ff1ad69512dfa2c676072c52e45c7f0f9','PFTY','pfty','esES','DF6C50D3'),('e8b82becbe0a0a1bbb5561df69320edbd770897a8deaab23caa6736255e0dc33','PFTY','pfty','esMX','DF6C50D3'),('305bbdab1953e65974a249e276867e13ad2c3cabca3668983cb5ed406251bb7b','PFTY','pfty','frFR','DF6C50D3'),('b72e65b6b34d8f859e79b5f28952e26553a796d5e1d75c2b5930bc0daeaa728c','PFTY','pfty','itIT','DF6C50D3'),('a2ec4b41148214037a2e89a2e557af716d085241b81f5244494bdc77a891ca38','PFTY','pfty','jaJP','DF6C50D3'),('7466b2db3f03768aa2527535d4b3c6c9ef9e8fb07c6db88b1019f3d25a2942e8','PFTY','pfty','koKR','DF6C50D3'),('a8c77051991b1a6c5dfe412e9f46d8f584349996fbde37c4f2a527c192163502','PFTY','pfty','plPL','DF6C50D3'),('0a3f6f3f0535ea21dbe620085192afc796203047e270e0e1b76f15a739fe1797','PFTY','pfty','ptBR','DF6C50D3'),('5813f318f7e40a07a7cdfeeec9827942e6fdc5ccee0d4171148443e429ad0ead','PFTY','pfty','ruRU','DF6C50D3'),('2753d31092f1978bdd78ebd4fae2d189364ad7108ceb22fbf1413be1f43bef04','PFTY','pfty','zhCN','DF6C50D3'),('3e381d4f83201f4e3c482eb74da12e5ff9dd924da2413d8fb33f5eea9a02c2c2','PFTY','pfty','zhTW','DF6C50D3'),('00ffd88a437afbb88d7d4b74be2e3b43601605ee229151aa9f4bebb29ef66280','Resume','auth','Mac',NULL),('304627d437c38500c0b5ca0c6220eeade91390e52a2b005ff3f7754afa1f93cd','Resume','auth','Mc64',NULL),('bfe4ceb47700aa872e815e007e27df955d4cd4bc1fe731039ee6498ce209f368','Resume','auth','Win',NULL),('898166926805f897804bdbbf40662c9d768590a51a0b26c40dbcdf332ba11974','Resume','auth','Wn64',NULL),('c0f38d05aa1b83065e839c9bd96c831e9f7e42477085138752657a6a9bb9c520','RiskFingerprint','auth','Mac',NULL),('1af5418a448f8ad05451e3f7dbb2d9af9cb13458eea2368ebfc539476b954f1c','RiskFingerprint','auth','Mc64',NULL),('5e298e530698af905e1247e51ef0b109b352ac310ce7802a1f63613db980ed17','RiskFingerprint','auth','Win',NULL),('8c43bda10be33a32abbc09fb2279126c7f5953336391276cff588565332fcd40','RiskFingerprint','auth','Wn64',NULL),('207640724f4531d3b2a21532224d1486e8c4d2d805170381cbc3093264157960','SelectGameAccount','auth','Mac',NULL),('52e2978db6468dfade7c61da89513f443c9225692b5085fbe956749870993703','SelectGameAccount','auth','Mc64',NULL),('abc6bb719a73ec1055296001910e26afa561f701ad9995b1ecd7f55f9d3ca37c','SelectGameAccount','auth','Win',NULL),('894d25d3219d97d085ea5a8b98e66df5bd9f460ec6f104455246a12b8921409d','SelectGameAccount','auth','Wn64',NULL),('548b5ef9e0dd5c2f89f59c3e0979249b27505c51f0c77d2b27133726eaee0ad0','Thumbprint','auth','Mac','E716F4F0A01EB9C032A6C1393356A4F766F067949D71023C0CFC0613718966EF814E65CC6EE70C432A7F8AFD8A062B52603A2697E851D231D72C0277614181D713369B1E8E4BEEAB72045A9AAD45F319DB918ECDDB83C8EF8B7510600D391D45E7FEC0BEEAE904A5F9FA620F1CCDAD699D84A4739CE669B5A551831E396214E13B4C88F573F5CDC784CD01530C086B674C03BEB66403A0F87ED17ABBB403DE54CF31BE828A20C566C22E4D4263AA77220B0644D99245345BCAC276EA06925EB984D664725C3CB757140AFE12E27CB996F17159B1057E9B58B78BBB5A139C9FF6215A0D250B75FC9DD435655DDEADCD6CFD84800792C146B3633188ECEB53D2038C185E0BD51A9E6C70FD38ADF530F8DF50FB62053C5E894897AB7DD65C7AC80665F18E7989BE6E30F15E939751123D6D8A44F033175301D15AAAD2AEA06FAC60BA4065846AE938F32B1CB15F16DC0E76792A7332346896048065D17C059899E1D2300E402BD0EA74265DA6A42B1C854E2470D7B21AE4A2DAE90E602A759B2CA0EE610B50D5389DB89335D5451FE76DD85B09FD5297D6F9EFB6C34CE885007F7DF20D6A524E0C3E772FA04B3DD2E014D3A337A790943DAD523CBB5453F4FDF8E74DFE361BD5F25AB31952B478148B570DF5762643F32B994FEC99A747E4A265A66EE84A53509EC285C84679606049314FC526C61B537AC8061C788F8B86F52208'),('b37136b39add83cfdbafa81857de3dd8f15b34e0135ec6cd9c3131d3a578d8c2','Thumbprint','auth','Mc64','E716F4F0A01EB9C032A6C1393356A4F766F067949D71023C0CFC0613718966EF814E65CC6EE70C432A7F8AFD8A062B52603A2697E851D231D72C0277614181D713369B1E8E4BEEAB72045A9AAD45F319DB918ECDDB83C8EF8B7510600D391D45E7FEC0BEEAE904A5F9FA620F1CCDAD699D84A4739CE669B5A551831E396214E13B4C88F573F5CDC784CD01530C086B674C03BEB66403A0F87ED17ABBB403DE54CF31BE828A20C566C22E4D4263AA77220B0644D99245345BCAC276EA06925EB984D664725C3CB757140AFE12E27CB996F17159B1057E9B58B78BBB5A139C9FF6215A0D250B75FC9DD435655DDEADCD6CFD84800792C146B3633188ECEB53D2038C185E0BD51A9E6C70FD38ADF530F8DF50FB62053C5E894897AB7DD65C7AC80665F18E7989BE6E30F15E939751123D6D8A44F033175301D15AAAD2AEA06FAC60BA4065846AE938F32B1CB15F16DC0E76792A7332346896048065D17C059899E1D2300E402BD0EA74265DA6A42B1C854E2470D7B21AE4A2DAE90E602A759B2CA0EE610B50D5389DB89335D5451FE76DD85B09FD5297D6F9EFB6C34CE885007F7DF20D6A524E0C3E772FA04B3DD2E014D3A337A790943DAD523CBB5453F4FDF8E74DFE361BD5F25AB31952B478148B570DF5762643F32B994FEC99A747E4A265A66EE84A53509EC285C84679606049314FC526C61B537AC8061C788F8B86F52208'),('36b27cd911b33c61730a8b82c8b2495fd16e8024fc3b2dde08861c77a852941c','Thumbprint','auth','Win','E716F4F0A01EB9C032A6C1393356A4F766F067949D71023C0CFC0613718966EF814E65CC6EE70C432A7F8AFD8A062B52603A2697E851D231D72C0277614181D713369B1E8E4BEEAB72045A9AAD45F319DB918ECDDB83C8EF8B7510600D391D45E7FEC0BEEAE904A5F9FA620F1CCDAD699D84A4739CE669B5A551831E396214E13B4C88F573F5CDC784CD01530C086B674C03BEB66403A0F87ED17ABBB403DE54CF31BE828A20C566C22E4D4263AA77220B0644D99245345BCAC276EA06925EB984D664725C3CB757140AFE12E27CB996F17159B1057E9B58B78BBB5A139C9FF6215A0D250B75FC9DD435655DDEADCD6CFD84800792C146B3633188ECEB53D2038C185E0BD51A9E6C70FD38ADF530F8DF50FB62053C5E894897AB7DD65C7AC80665F18E7989BE6E30F15E939751123D6D8A44F033175301D15AAAD2AEA06FAC60BA4065846AE938F32B1CB15F16DC0E76792A7332346896048065D17C059899E1D2300E402BD0EA74265DA6A42B1C854E2470D7B21AE4A2DAE90E602A759B2CA0EE610B50D5389DB89335D5451FE76DD85B09FD5297D6F9EFB6C34CE885007F7DF20D6A524E0C3E772FA04B3DD2E014D3A337A790943DAD523CBB5453F4FDF8E74DFE361BD5F25AB31952B478148B570DF5762643F32B994FEC99A747E4A265A66EE84A53509EC285C84679606049314FC526C61B537AC8061C788F8B86F52208'),('c3a1ac0694979e709c3b5486927e558af1e2be02ca96e5615c5a65aacc829226','Thumbprint','auth','Wn64','E716F4F0A01EB9C032A6C1393356A4F766F067949D71023C0CFC0613718966EF814E65CC6EE70C432A7F8AFD8A062B52603A2697E851D231D72C0277614181D713369B1E8E4BEEAB72045A9AAD45F319DB918ECDDB83C8EF8B7510600D391D45E7FEC0BEEAE904A5F9FA620F1CCDAD699D84A4739CE669B5A551831E396214E13B4C88F573F5CDC784CD01530C086B674C03BEB66403A0F87ED17ABBB403DE54CF31BE828A20C566C22E4D4263AA77220B0644D99245345BCAC276EA06925EB984D664725C3CB757140AFE12E27CB996F17159B1057E9B58B78BBB5A139C9FF6215A0D250B75FC9DD435655DDEADCD6CFD84800792C146B3633188ECEB53D2038C185E0BD51A9E6C70FD38ADF530F8DF50FB62053C5E894897AB7DD65C7AC80665F18E7989BE6E30F15E939751123D6D8A44F033175301D15AAAD2AEA06FAC60BA4065846AE938F32B1CB15F16DC0E76792A7332346896048065D17C059899E1D2300E402BD0EA74265DA6A42B1C854E2470D7B21AE4A2DAE90E602A759B2CA0EE610B50D5389DB89335D5451FE76DD85B09FD5297D6F9EFB6C34CE885007F7DF20D6A524E0C3E772FA04B3DD2E014D3A337A790943DAD523CBB5453F4FDF8E74DFE361BD5F25AB31952B478148B570DF5762643F32B994FEC99A747E4A265A66EE84A53509EC285C84679606049314FC526C61B537AC8061C788F8B86F52208'),('393ca8d75aff6f04f79532cf95a88b91e5743bc59121520ac31fc4508019fe60','Token','auth','Mac',NULL),('a1edab845d9e13e9c84531369be2f61b930a37c8e7a9c66d11ef8963380e178a','Token','auth','Mc64',NULL),('fbe675a99fb5f4b7fb3eb5e5a22add91a4cabf83e3c5930c6659ad13c457ba18','Token','auth','Win',NULL),('a330f388b6687f8a42fe8fbb592a3df724b20b65fb0989342bb8261f2f452318','Token','auth','Wn64',NULL);
/*!40000 ALTER TABLE `battlenet_modules` ENABLE KEYS */;
UNLOCK TABLES;
@@ -517,7 +467,7 @@ CREATE TABLE `rbac_default_permissions` (
LOCK TABLES `rbac_default_permissions` WRITE;
/*!40000 ALTER TABLE `rbac_default_permissions` DISABLE KEYS */;
-INSERT INTO `rbac_default_permissions` VALUES (0,195),(1,194),(2,193),(3,192);
+INSERT INTO `rbac_default_permissions` VALUES (3,192),(2,193),(1,194),(0,195);
/*!40000 ALTER TABLE `rbac_default_permissions` ENABLE KEYS */;
UNLOCK TABLES;
@@ -545,7 +495,7 @@ CREATE TABLE `rbac_linked_permissions` (
LOCK TABLES `rbac_linked_permissions` WRITE;
/*!40000 ALTER TABLE `rbac_linked_permissions` DISABLE KEYS */;
-INSERT INTO `rbac_linked_permissions` VALUES (192,21),(192,42),(192,43),(192,193),(192,196),(192,778),(192,779),(192,780),(192,781),(192,782),(192,783),(192,784),(192,785),(192,786),(192,787),(192,788),(192,789),(192,790),(192,791),(192,792),(192,793),(192,794),(193,48),(193,194),(193,197),(194,1),(194,2),(194,11),(194,13),(194,14),(194,15),(194,16),(194,17),(194,18),(194,19),(194,20),(194,22),(194,23),(194,25),(194,26),(194,27),(194,28),(194,29),(194,30),(194,31),(194,32),(194,33),(194,34),(194,35),(194,36),(194,37),(194,38),(194,39),(194,40),(194,41),(194,44),(194,46),(194,47),(194,195),(194,198),(195,3),(195,4),(195,5),(195,6),(195,24),(195,49),(195,199),(196,200),(196,201),(196,208),(196,212),(196,213),(196,214),(196,215),(196,216),(196,226),(196,227),(196,230),(196,231),(196,233),(196,234),(196,235),(196,238),(196,239),(196,240),(196,241),(196,242),(196,243),(196,244),(196,245),(196,246),(196,247),(196,248),(196,249),(196,250),(196,251),(196,252),(196,253),(196,254),(196,255),(196,256),(196,257),(196,258),(196,259),(196,260),(196,261),(196,262),(196,264),(196,265),(196,266),(196,267),(196,268),(196,269),(196,270),(196,271),(196,272),(196,279),(196,280),(196,283),(196,287),(196,288),(196,289),(196,290),(196,291),(196,292),(196,293),(196,294),(196,295),(196,296),(196,297),(196,298),(196,299),(196,302),(196,303),(196,304),(196,305),(196,306),(196,307),(196,308),(196,309),(196,310),(196,313),(196,314),(196,319),(196,320),(196,321),(196,322),(196,323),(196,324),(196,325),(196,326),(196,327),(196,328),(196,329),(196,330),(196,331),(196,332),(196,333),(196,334),(196,335),(196,336),(196,337),(196,338),(196,339),(196,340),(196,341),(196,342),(196,343),(196,344),(196,345),(196,346),(196,347),(196,348),(196,349),(196,350),(196,351),(196,352),(196,353),(196,354),(196,355),(196,356),(196,357),(196,358),(196,359),(196,360),(196,361),(196,362),(196,363),(196,364),(196,365),(196,366),(196,373),(196,375),(196,400),(196,401),(196,402),(196,403),(196,404),(196,405),(196,406),(196,407),(196,417),(196,418),(196,419),(196,420),(196,421),(196,422),(196,423),(196,424),(196,425),(196,426),(196,427),(196,428),(196,429),(196,434),(196,435),(196,436),(196,437),(196,438),(196,439),(196,440),(196,441),(196,442),(196,443),(196,444),(196,445),(196,446),(196,447),(196,448),(196,449),(196,450),(196,451),(196,452),(196,453),(196,454),(196,455),(196,456),(196,457),(196,458),(196,459),(196,461),(196,463),(196,464),(196,465),(196,472),(196,473),(196,474),(196,475),(196,476),(196,477),(196,478),(196,488),(196,489),(196,491),(196,492),(196,493),(196,495),(196,497),(196,498),(196,499),(196,500),(196,502),(196,503),(196,505),(196,508),(196,511),(196,513),(196,514),(196,516),(196,519),(196,522),(196,523),(196,526),(196,527),(196,529),(196,530),(196,533),(196,535),(196,536),(196,537),(196,538),(196,539),(196,540),(196,541),(196,556),(196,581),(196,582),(196,592),(196,593),(196,596),(196,602),(196,603),(196,604),(196,605),(196,606),(196,607),(196,608),(196,609),(196,610),(196,611),(196,612),(196,613),(196,614),(196,615),(196,616),(196,617),(196,618),(196,619),(196,620),(196,621),(196,622),(196,623),(196,624),(196,625),(196,626),(196,627),(196,628),(196,629),(196,630),(196,631),(194,632),(196,633),(196,634),(196,635),(196,636),(196,637),(196,638),(196,639),(196,640),(196,641),(196,642),(196,643),(196,644),(196,645),(196,646),(196,647),(196,648),(196,649),(196,650),(196,651),(196,652),(196,653),(196,654),(196,655),(196,656),(196,657),(196,658),(196,659),(196,660),(196,661),(196,662),(196,663),(196,664),(196,665),(196,666),(196,667),(196,668),(196,669),(196,670),(196,671),(196,672),(196,673),(196,674),(196,675),(196,676),(196,677),(196,678),(196,679),(196,680),(196,681),(196,682),(196,683),(196,684),(196,685),(196,686),(196,687),(196,688),(196,689),(196,690),(196,691),(196,692),(196,693),(196,694),(196,695),(196,696),(196,697),(196,698),(196,699),(196,700),(196,701),(196,702),(196,703),(196,704),(196,705),(196,706),(196,707),(196,708),(196,709),(196,710),(196,711),(196,712),(196,713),(196,714),(196,715),(196,716),(196,717),(196,718),(196,719),(196,721),(196,722),(196,723),(196,724),(196,725),(196,726),(196,727),(196,728),(196,729),(196,730),(196,733),(196,734),(196,735),(196,736),(196,738),(196,739),(196,748),(196,753),(196,757),(196,773),(196,777),(197,232),(197,236),(197,237),(197,273),(197,274),(197,275),(197,276),(197,277),(197,284),(197,285),(197,286),(197,301),(197,311),(197,387),(197,388),(197,389),(197,390),(197,391),(197,392),(197,393),(197,394),(197,395),(197,396),(197,397),(197,398),(197,399),(197,479),(197,480),(197,481),(197,482),(197,485),(197,486),(197,487),(197,494),(197,506),(197,509),(197,510),(197,517),(197,518),(197,521),(197,542),(197,543),(197,550),(197,558),(197,568),(197,571),(197,572),(197,573),(197,574),(197,575),(197,576),(197,577),(197,578),(197,579),(197,580),(197,583),(197,584),(197,585),(197,586),(197,587),(197,588),(197,589),(197,590),(197,591),(197,594),(197,595),(197,601),(197,743),(197,750),(197,758),(197,761),(197,762),(197,763),(197,764),(197,765),(197,766),(197,767),(197,768),(197,769),(197,770),(197,771),(197,772),(197,774),(198,218),(198,300),(198,312),(198,315),(198,316),(198,317),(198,318),(198,367),(198,368),(198,369),(198,370),(198,371),(198,372),(198,374),(198,376),(198,377),(198,378),(198,379),(198,380),(198,381),(198,382),(198,383),(198,384),(198,385),(198,386),(198,408),(198,409),(198,410),(198,411),(198,412),(198,413),(198,414),(198,415),(198,416),(198,430),(198,431),(198,432),(198,433),(198,462),(198,466),(198,467),(198,468),(198,469),(198,470),(198,471),(198,483),(198,484),(198,490),(198,504),(198,512),(198,515),(198,520),(198,524),(198,528),(198,531),(198,532),(198,544),(198,545),(198,546),(198,547),(198,548),(198,549),(198,551),(198,552),(198,553),(198,554),(198,555),(198,557),(198,559),(198,560),(198,561),(198,562),(198,563),(198,564),(198,565),(198,566),(198,567),(198,569),(198,570),(198,597),(198,598),(198,599),(198,600),(198,737),(198,740),(198,741),(198,742),(198,744),(198,745),(198,746),(198,747),(198,749),(198,751),(198,752),(198,754),(198,755),(198,756),(198,759),(198,760),(199,207),(199,209),(199,210),(199,211),(199,217),(199,221),(199,222),(199,223),(199,225),(199,263),(199,496),(199,501),(199,507),(199,525),(199,534);
+INSERT INTO `rbac_linked_permissions` VALUES (192,21),(192,42),(192,43),(192,193),(192,196),(192,778),(192,779),(192,780),(192,781),(192,782),(192,783),(192,784),(192,785),(192,786),(192,787),(192,788),(192,789),(192,790),(192,791),(192,792),(192,793),(192,794),(193,48),(193,194),(193,197),(194,1),(194,2),(194,11),(194,13),(194,14),(194,15),(194,16),(194,17),(194,18),(194,19),(194,20),(194,22),(194,23),(194,25),(194,26),(194,27),(194,28),(194,29),(194,30),(194,31),(194,32),(194,33),(194,34),(194,35),(194,36),(194,37),(194,38),(194,39),(194,40),(194,41),(194,44),(194,46),(194,47),(194,195),(194,198),(194,632),(194,798),(195,3),(195,4),(195,5),(195,6),(195,24),(195,49),(195,199),(196,200),(196,201),(196,208),(196,212),(196,213),(196,214),(196,215),(196,216),(196,226),(196,227),(196,230),(196,231),(196,233),(196,234),(196,235),(196,238),(196,239),(196,240),(196,241),(196,242),(196,243),(196,244),(196,245),(196,246),(196,247),(196,248),(196,249),(196,250),(196,251),(196,252),(196,253),(196,254),(196,255),(196,256),(196,257),(196,258),(196,259),(196,260),(196,261),(196,262),(196,264),(196,265),(196,266),(196,267),(196,268),(196,269),(196,270),(196,271),(196,272),(196,279),(196,280),(196,283),(196,287),(196,288),(196,289),(196,290),(196,291),(196,292),(196,293),(196,294),(196,295),(196,296),(196,297),(196,298),(196,299),(196,302),(196,303),(196,304),(196,305),(196,306),(196,307),(196,308),(196,309),(196,310),(196,313),(196,314),(196,319),(196,320),(196,321),(196,322),(196,323),(196,324),(196,325),(196,326),(196,327),(196,328),(196,329),(196,330),(196,331),(196,332),(196,333),(196,334),(196,335),(196,336),(196,337),(196,338),(196,339),(196,340),(196,341),(196,342),(196,343),(196,344),(196,345),(196,346),(196,347),(196,348),(196,349),(196,350),(196,351),(196,352),(196,353),(196,354),(196,355),(196,356),(196,357),(196,358),(196,359),(196,360),(196,361),(196,362),(196,363),(196,364),(196,365),(196,366),(196,373),(196,375),(196,400),(196,401),(196,402),(196,403),(196,404),(196,405),(196,406),(196,407),(196,417),(196,418),(196,419),(196,420),(196,421),(196,422),(196,423),(196,424),(196,425),(196,426),(196,427),(196,428),(196,429),(196,434),(196,435),(196,436),(196,437),(196,438),(196,439),(196,440),(196,441),(196,442),(196,443),(196,444),(196,445),(196,446),(196,447),(196,448),(196,449),(196,450),(196,451),(196,452),(196,453),(196,454),(196,455),(196,456),(196,457),(196,458),(196,459),(196,461),(196,463),(196,464),(196,465),(196,472),(196,473),(196,474),(196,475),(196,476),(196,477),(196,478),(196,488),(196,489),(196,491),(196,492),(196,493),(196,495),(196,497),(196,498),(196,499),(196,500),(196,502),(196,503),(196,505),(196,508),(196,511),(196,513),(196,514),(196,516),(196,519),(196,522),(196,523),(196,526),(196,527),(196,529),(196,530),(196,533),(196,535),(196,536),(196,537),(196,538),(196,539),(196,540),(196,541),(196,556),(196,581),(196,582),(196,592),(196,593),(196,596),(196,602),(196,603),(196,604),(196,605),(196,606),(196,607),(196,608),(196,609),(196,610),(196,611),(196,612),(196,613),(196,614),(196,615),(196,616),(196,617),(196,618),(196,619),(196,620),(196,621),(196,622),(196,623),(196,624),(196,625),(196,626),(196,627),(196,628),(196,629),(196,630),(196,631),(196,633),(196,634),(196,635),(196,636),(196,637),(196,638),(196,639),(196,640),(196,641),(196,642),(196,643),(196,644),(196,645),(196,646),(196,647),(196,648),(196,649),(196,650),(196,651),(196,652),(196,653),(196,654),(196,655),(196,656),(196,657),(196,658),(196,659),(196,660),(196,661),(196,662),(196,663),(196,664),(196,665),(196,666),(196,667),(196,668),(196,669),(196,670),(196,671),(196,672),(196,673),(196,674),(196,675),(196,676),(196,677),(196,678),(196,679),(196,680),(196,681),(196,682),(196,683),(196,684),(196,685),(196,686),(196,687),(196,688),(196,689),(196,690),(196,691),(196,692),(196,693),(196,694),(196,695),(196,696),(196,697),(196,698),(196,699),(196,700),(196,701),(196,702),(196,703),(196,704),(196,705),(196,706),(196,707),(196,708),(196,709),(196,710),(196,711),(196,712),(196,713),(196,714),(196,715),(196,716),(196,717),(196,718),(196,719),(196,721),(196,722),(196,723),(196,724),(196,725),(196,726),(196,727),(196,728),(196,729),(196,730),(196,733),(196,734),(196,735),(196,736),(196,738),(196,739),(196,748),(196,753),(196,757),(196,773),(196,777),(197,232),(197,236),(197,237),(197,273),(197,274),(197,275),(197,276),(197,277),(197,284),(197,285),(197,286),(197,301),(197,311),(197,387),(197,388),(197,389),(197,390),(197,391),(197,392),(197,393),(197,394),(197,395),(197,396),(197,397),(197,398),(197,399),(197,479),(197,480),(197,481),(197,482),(197,485),(197,486),(197,487),(197,494),(197,506),(197,509),(197,510),(197,517),(197,518),(197,521),(197,542),(197,543),(197,550),(197,558),(197,568),(197,571),(197,572),(197,573),(197,574),(197,575),(197,576),(197,577),(197,578),(197,579),(197,580),(197,583),(197,584),(197,585),(197,586),(197,587),(197,588),(197,589),(197,590),(197,591),(197,594),(197,595),(197,601),(197,743),(197,750),(197,758),(197,761),(197,762),(197,763),(197,764),(197,765),(197,766),(197,767),(197,768),(197,769),(197,770),(197,771),(197,772),(197,774),(198,218),(198,300),(198,312),(198,315),(198,316),(198,317),(198,318),(198,367),(198,368),(198,369),(198,370),(198,371),(198,372),(198,374),(198,376),(198,377),(198,378),(198,379),(198,380),(198,381),(198,382),(198,383),(198,384),(198,385),(198,386),(198,408),(198,409),(198,410),(198,411),(198,412),(198,413),(198,414),(198,415),(198,416),(198,430),(198,431),(198,432),(198,433),(198,462),(198,466),(198,467),(198,468),(198,469),(198,470),(198,471),(198,483),(198,484),(198,490),(198,504),(198,512),(198,515),(198,520),(198,524),(198,528),(198,531),(198,532),(198,544),(198,545),(198,546),(198,547),(198,548),(198,549),(198,551),(198,552),(198,553),(198,554),(198,555),(198,557),(198,559),(198,560),(198,561),(198,562),(198,563),(198,564),(198,565),(198,566),(198,567),(198,569),(198,570),(198,597),(198,598),(198,599),(198,600),(198,737),(198,740),(198,741),(198,742),(198,744),(198,745),(198,746),(198,747),(198,749),(198,751),(198,752),(198,754),(198,755),(198,756),(198,759),(198,760),(199,207),(199,209),(199,210),(199,211),(199,217),(199,221),(199,222),(199,223),(199,225),(199,263),(199,496),(199,501),(199,507),(199,525),(199,534),(199,797);
/*!40000 ALTER TABLE `rbac_linked_permissions` ENABLE KEYS */;
UNLOCK TABLES;
@@ -569,7 +519,7 @@ CREATE TABLE `rbac_permissions` (
LOCK TABLES `rbac_permissions` WRITE;
/*!40000 ALTER TABLE `rbac_permissions` DISABLE KEYS */;
-INSERT INTO `rbac_permissions` VALUES (1,'Instant logout'),(2,'Skip Queue'),(3,'Join Normal Battleground'),(4,'Join Random Battleground'),(5,'Join Arenas'),(6,'Join Dungeon Finder'),(11,'Log GM trades'),(13,'Skip Instance required bosses check'),(14,'Skip character creation team mask check'),(15,'Skip character creation class mask check'),(16,'Skip character creation race mask check'),(17,'Skip character creation reserved name check'),(18,'Skip character creation heroic min level check'),(19,'Skip needed requirements to use channel check'),(20,'Skip disable map check'),(21,'Skip reset talents when used more than allowed check'),(22,'Skip spam chat check'),(23,'Skip over-speed ping check'),(24,'Two side faction characters on the same account'),(25,'Allow say chat between factions'),(26,'Allow channel chat between factions'),(27,'Two side mail interaction'),(28,'See two side who list'),(29,'Add friends of other faction'),(30,'Save character without delay with .save command'),(31,'Use params with .unstuck command'),(32,'Can be assigned tickets with .assign ticket command'),(33,'Notify if a command was not found'),(34,'Check if should appear in list using .gm ingame command'),(35,'See all security levels with who command'),(36,'Filter whispers'),(37,'Use staff badge in chat'),(38,'Resurrect with full Health Points'),(39,'Restore saved gm setting states'),(40,'Allows to add a gm to friend list'),(41,'Use Config option START_GM_LEVEL to assign new character level'),(42,'Allows to use CMSG_WORLD_TELEPORT opcode'),(43,'Allows to use CMSG_WHOIS opcode'),(44,'Receive global GM messages/texts'),(45,'Join channels without announce'),(46,'Change channel settings without being channel moderator'),(47,'Enables lower security than target check'),(48,'Enable IP, Last Login and EMail output in pinfo'),(49,'Forces to enter the email for confirmation on password change'),(50,'Allow user to check his own email with .account'),(192,'Role: Sec Level Administrator'),(193,'Role: Sec Level Gamemaster'),(194,'Role: Sec Level Moderator'),(195,'Role: Sec Level Player'),(196,'Role: Administrator Commands'),(197,'Role: Gamemaster Commands'),(198,'Role: Moderator Commands'),(199,'Role: Player Commands'),(200,'Command: rbac'),(201,'Command: rbac account'),(202,'Command: rbac account list'),(203,'Command: rbac account grant'),(204,'Command: rbac account deny'),(205,'Command: rbac account revoke'),(206,'Command: rbac list'),(207,'Command: battlenetaccount'),(208,'Command: battlenetaccount create'),(209,'Command: battlenetaccount lock country'),(210,'Command: battlenetaccount lock ip'),(211,'Command: battlenetaccount password'),(212,'Command: battlenetaccount set'),(213,'Command: battlenetaccount set password'),(217,'Command: account'),(218,'Command: account addon'),(219,'Command: account create'),(220,'Command: account delete'),(221,'Command: account lock'),(222,'Command: account lock country'),(223,'Command: account lock ip'),(224,'Command: account onlinelist'),(225,'Command: account password'),(226,'Command: account set'),(227,'Command: account set addon'),(228,'Command: account set gmlevel'),(229,'Command: account set password'),(230,'Command: achievement'),(231,'Command: achievement add'),(232,'Command: arena'),(233,'Command: arena captain'),(234,'Command: arena create'),(235,'Command: arena disband'),(236,'Command: arena info'),(237,'Command: arena lookup'),(238,'Command: arena rename'),(239,'Command: ban'),(240,'Command: ban account'),(241,'Command: ban character'),(242,'Command: ban ip'),(243,'Command: ban playeraccount'),(244,'Command: baninfo'),(245,'Command: baninfo account'),(246,'Command: baninfo character'),(247,'Command: baninfo ip'),(248,'Command: banlist'),(249,'Command: banlist account'),(250,'Command: banlist character'),(251,'Command: banlist ip'),(252,'Command: unban'),(253,'Command: unban account'),(254,'Command: unban character'),(255,'Command: unban ip'),(256,'Command: unban playeraccount'),(257,'Command: bf'),(258,'Command: bf start'),(259,'Command: bf stop'),(260,'Command: bf switch'),(261,'Command: bf timer'),(262,'Command: bf enable'),(263,'Command: account email'),(264,'Command: account set sec'),(265,'Command: account set sec email'),(266,'Command: account set sec regmail'),(267,'Command: cast'),(268,'Command: cast back'),(269,'Command: cast dist'),(270,'Command: cast self'),(271,'Command: cast target'),(272,'Command: cast dest'),(273,'Command: character'),(274,'Command: character customize'),(275,'Command: character changefaction'),(276,'Command: character changerace'),(277,'Command: character deleted'),(279,'Command: character deleted list'),(280,'Command: character deleted restore'),(283,'Command: character level'),(284,'Command: character rename'),(285,'Command: character reputation'),(286,'Command: character titles'),(287,'Command: levelup'),(288,'Command: pdump'),(289,'Command: pdump load'),(290,'Command: pdump write'),(291,'Command: cheat'),(292,'Command: cheat casttime'),(293,'Command: cheat cooldown'),(294,'Command: cheat explore'),(295,'Command: cheat god'),(296,'Command: cheat power'),(297,'Command: cheat status'),(298,'Command: cheat taxi'),(299,'Command: cheat waterwalk'),(300,'Command: debug'),(301,'Command: debug anim'),(302,'Command: debug areatriggers'),(303,'Command: debug arena'),(304,'Command: debug bg'),(305,'Command: debug entervehicle'),(306,'Command: debug getitemstate'),(307,'Command: debug getitemvalue'),(308,'Command: debug getvalue'),(309,'Command: debug hostil'),(310,'Command: debug itemexpire'),(311,'Command: debug lootrecipient'),(312,'Command: debug los'),(313,'Command: debug mod32value'),(314,'Command: debug moveflags'),(315,'Command: debug play'),(316,'Command: debug play cinematics'),(317,'Command: debug play movie'),(318,'Command: debug play sound'),(319,'Command: debug send'),(320,'Command: debug send buyerror'),(321,'Command: debug send channelnotify'),(322,'Command: debug send chatmessage'),(323,'Command: debug send equiperror'),(324,'Command: debug send largepacket'),(325,'Command: debug send opcode'),(326,'Command: debug send qinvalidmsg'),(327,'Command: debug send qpartymsg'),(328,'Command: debug send sellerror'),(329,'Command: debug send setphaseshift'),(330,'Command: debug send spellfail'),(331,'Command: debug setaurastate'),(332,'Command: debug setbit'),(333,'Command: debug setitemvalue'),(334,'Command: debug setvalue'),(335,'Command: debug setvid'),(336,'Command: debug spawnvehicle'),(337,'Command: debug threat'),(338,'Command: debug update'),(339,'Command: debug uws'),(340,'Command: wpgps'),(341,'Command: deserter'),(342,'Command: deserter bg'),(343,'Command: deserter bg add'),(344,'Command: deserter bg remove'),(345,'Command: deserter instance'),(346,'Command: deserter instance add'),(347,'Command: deserter instance remove'),(348,'Command: disable'),(349,'Command: disable add'),(350,'Command: disable add achievement_criteria'),(351,'Command: disable add battleground'),(352,'Command: disable add map'),(353,'Command: disable add mmap'),(354,'Command: disable add outdoorpvp'),(355,'Command: disable add quest'),(356,'Command: disable add spell'),(357,'Command: disable add vmap'),(358,'Command: disable remove'),(359,'Command: disable remove achievement_criteria'),(360,'Command: disable remove battleground'),(361,'Command: disable remove map'),(362,'Command: disable remove mmap'),(363,'Command: disable remove outdoorpvp'),(364,'Command: disable remove quest'),(365,'Command: disable remove spell'),(366,'Command: disable remove vmap'),(367,'Command: event'),(368,'Command: event activelist'),(369,'Command: event start'),(370,'Command: event stop'),(371,'Command: gm'),(372,'Command: gm chat'),(373,'Command: gm fly'),(374,'Command: gm ingame'),(375,'Command: gm list'),(376,'Command: gm visible'),(377,'Command: go'),(378,'Command: go creature'),(379,'Command: go graveyard'),(380,'Command: go grid'),(381,'Command: go object'),(382,'Command: go taxinode'),(383,'Command: go ticket'),(384,'Command: go trigger'),(385,'Command: go xyz'),(386,'Command: go zonexy'),(387,'Command: gobject'),(388,'Command: gobject activate'),(389,'Command: gobject add'),(390,'Command: gobject add temp'),(391,'Command: gobject delete'),(392,'Command: gobject info'),(393,'Command: gobject move'),(394,'Command: gobject near'),(395,'Command: gobject set'),(396,'Command: gobject set phase'),(397,'Command: gobject set state'),(398,'Command: gobject target'),(399,'Command: gobject turn'),(400,'debug transport'),(401,'Command: guild'),(402,'Command: guild create'),(403,'Command: guild delete'),(404,'Command: guild invite'),(405,'Command: guild uninvite'),(406,'Command: guild rank'),(407,'Command: guild rename'),(408,'Command: honor'),(409,'Command: honor add'),(410,'Command: honor add kill'),(411,'Command: honor update'),(412,'Command: instance'),(413,'Command: instance listbinds'),(414,'Command: instance unbind'),(415,'Command: instance stats'),(416,'Command: instance savedata'),(417,'Command: learn'),(418,'Command: learn all'),(419,'Command: learn all my'),(420,'Command: learn all my class'),(421,'Command: learn all my pettalents'),(422,'Command: learn all my spells'),(423,'Command: learn all my talents'),(424,'Command: learn all gm'),(425,'Command: learn all crafts'),(426,'Command: learn all default'),(427,'Command: learn all lang'),(428,'Command: learn all recipes'),(429,'Command: unlearn'),(430,'Command: lfg'),(431,'Command: lfg player'),(432,'Command: lfg group'),(433,'Command: lfg queue'),(434,'Command: lfg clean'),(435,'Command: lfg options'),(436,'Command: list'),(437,'Command: list creature'),(438,'Command: list item'),(439,'Command: list object'),(440,'Command: list auras'),(441,'Command: list mail'),(442,'Command: lookup'),(443,'Command: lookup area'),(444,'Command: lookup creature'),(445,'Command: lookup event'),(446,'Command: lookup faction'),(447,'Command: lookup item'),(448,'Command: lookup itemset'),(449,'Command: lookup object'),(450,'Command: lookup quest'),(451,'Command: lookup player'),(452,'Command: lookup player ip'),(453,'Command: lookup player account'),(454,'Command: lookup player email'),(455,'Command: lookup skill'),(456,'Command: lookup spell'),(457,'Command: lookup spell id'),(458,'Command: lookup taxinode'),(459,'Command: lookup tele'),(460,'Command: lookup title'),(461,'Command: lookup map'),(462,'Command: announce'),(463,'Command: channel'),(464,'Command: channel set'),(465,'Command: channel set ownership'),(466,'Command: gmannounce'),(467,'Command: gmnameannounce'),(468,'Command: gmnotify'),(469,'Command: nameannounce'),(470,'Command: notify'),(471,'Command: whispers'),(472,'Command: group'),(473,'Command: group leader'),(474,'Command: group disband'),(475,'Command: group remove'),(476,'Command: group join'),(477,'Command: group list'),(478,'Command: group summon'),(479,'Command: pet'),(480,'Command: pet create'),(481,'Command: pet learn'),(482,'Command: pet unlearn'),(483,'Command: send'),(484,'Command: send items'),(485,'Command: send mail'),(486,'Command: send message'),(487,'Command: send money'),(488,'Command: additem'),(489,'Command: additemset'),(490,'Command: appear'),(491,'Command: aura'),(492,'Command: bank'),(493,'Command: bindsight'),(494,'Command: combatstop'),(495,'Command: cometome'),(496,'Command: commands'),(497,'Command: cooldown'),(498,'Command: damage'),(499,'Command: dev'),(500,'Command: die'),(501,'Command: dismount'),(502,'Command: distance'),(503,'Command: flusharenapoints'),(504,'Command: freeze'),(505,'Command: gps'),(506,'Command: guid'),(507,'Command: help'),(508,'Command: hidearea'),(509,'Command: itemmove'),(510,'Command: kick'),(511,'Command: linkgrave'),(512,'Command: listfreeze'),(513,'Command: maxskill'),(514,'Command: movegens'),(515,'Command: mute'),(516,'Command: neargrave'),(517,'Command: pinfo'),(518,'Command: playall'),(519,'Command: possess'),(520,'Command: recall'),(521,'Command: repairitems'),(522,'Command: respawn'),(523,'Command: revive'),(524,'Command: saveall'),(525,'Command: save'),(526,'Command: setskill'),(527,'Command: showarea'),(528,'Command: summon'),(529,'Command: unaura'),(530,'Command: unbindsight'),(531,'Command: unfreeze'),(532,'Command: unmute'),(533,'Command: unpossess'),(534,'Command: unstuck'),(535,'Command: wchange'),(536,'Command: mmap'),(537,'Command: mmap loadedtiles'),(538,'Command: mmap loc'),(539,'Command: mmap path'),(540,'Command: mmap stats'),(541,'Command: mmap testarea'),(542,'Command: morph'),(543,'Command: demorph'),(544,'Command: modify'),(545,'Command: modify arenapoints'),(546,'Command: modify bit'),(547,'Command: modify drunk'),(548,'Command: modify energy'),(549,'Command: modify faction'),(550,'Command: modify gender'),(551,'Command: modify honor'),(552,'Command: modify hp'),(553,'Command: modify mana'),(554,'Command: modify money'),(555,'Command: modify mount'),(556,'Command: modify phase'),(557,'Command: modify rage'),(558,'Command: modify reputation'),(559,'Command: modify runicpower'),(560,'Command: modify scale'),(561,'Command: modify speed'),(562,'Command: modify speed all'),(563,'Command: modify speed backwalk'),(564,'Command: modify speed fly'),(565,'Command: modify speed walk'),(566,'Command: modify speed swim'),(567,'Command: modify spell'),(568,'Command: modify standstate'),(569,'Command: modify talentpoints'),(570,'Command: npc'),(571,'Command: npc add'),(572,'Command: npc add formation'),(573,'Command: npc add item'),(574,'Command: npc add move'),(575,'Command: npc add temp'),(576,'Command: npc add delete'),(577,'Command: npc add delete item'),(578,'Command: npc add follow'),(579,'Command: npc add follow stop'),(580,'Command: npc set'),(581,'Command: npc set allowmove'),(582,'Command: npc set entry'),(583,'Command: npc set factionid'),(584,'Command: npc set flag'),(585,'Command: npc set level'),(586,'Command: npc set link'),(587,'Command: npc set model'),(588,'Command: npc set movetype'),(589,'Command: npc set phase'),(590,'Command: npc set spawndist'),(591,'Command: npc set spawntime'),(592,'Command: npc set data'),(593,'Command: npc info'),(594,'Command: npc near'),(595,'Command: npc move'),(596,'Command: npc playemote'),(597,'Command: npc say'),(598,'Command: npc textemote'),(599,'Command: npc whisper'),(600,'Command: npc yell'),(601,'Command: npc tame'),(602,'Command: quest'),(603,'Command: quest add'),(604,'Command: quest complete'),(605,'Command: quest remove'),(606,'Command: quest reward'),(607,'Command: reload'),(608,'Command: reload access_requirement'),(609,'Command: reload achievement_criteria_data'),(610,'Command: reload achievement_reward'),(611,'Command: reload all'),(612,'Command: reload all achievement'),(613,'Command: reload all area'),(614,'Command: broadcast_text'),(615,'Command: reload all gossips'),(616,'Command: reload all item'),(617,'Command: reload all locales'),(618,'Command: reload all loot'),(619,'Command: reload all npc'),(620,'Command: reload all quest'),(621,'Command: reload all scripts'),(622,'Command: reload all spell'),(623,'Command: reload areatrigger_involvedrelation'),(624,'Command: reload areatrigger_tavern'),(625,'Command: reload areatrigger_teleport'),(626,'Command: reload auctions'),(627,'Command: reload autobroadcast'),(628,'Command: reload command'),(629,'Command: reload conditions'),(630,'Command: reload config'),(631,'Command: reload battleground_template'),(632, 'Command: .mutehistory'),(633,'Command: reload creature_linked_respawn'),(634,'Command: reload creature_loot_template'),(635,'Command: reload creature_onkill_reputation'),(636,'Command: reload creature_questender'),(637,'Command: reload creature_queststarter'),(638,'Command: reload creature_summon_groups'),(639,'Command: reload creature_template'),(640,'Command: reload creature_text'),(641,'Command: reload disables'),(642,'Command: reload disenchant_loot_template'),(643,'Command: reload event_scripts'),(644,'Command: reload fishing_loot_template'),(645,'Command: reload game_graveyard_zone'),(646,'Command: reload game_tele'),(647,'Command: reload gameobject_questender'),(648,'Command: reload gameobject_loot_template'),(649,'Command: reload gameobject_queststarter'),(650,'Command: reload gm_tickets'),(651,'Command: reload gossip_menu'),(652,'Command: reload gossip_menu_option'),(653,'Command: reload item_enchantment_template'),(654,'Command: reload item_loot_template'),(655,'Command: reload item_set_names'),(656,'Command: reload lfg_dungeon_rewards'),(657,'Command: reload locales_achievement_reward'),(658,'Command: reload locales_creature'),(659,'Command: reload locales_creature_text'),(660,'Command: reload locales_gameobject'),(661,'Command: reload locales_gossip_menu_option'),(662,'Command: reload locales_item'),(663,'Command: reload locales_item_set_name'),(664,'Command: reload locales_npc_text'),(665,'Command: reload locales_page_text'),(666,'Command: reload locales_points_of_interest'),(667,'Command: reload locales_quest'),(668,'Command: reload mail_level_reward'),(669,'Command: reload mail_loot_template'),(670,'Command: reload milling_loot_template'),(671,'Command: reload npc_spellclick_spells'),(672,'Command: reload npc_trainer'),(673,'Command: reload npc_vendor'),(674,'Command: reload page_text'),(675,'Command: reload pickpocketing_loot_template'),(676,'Command: reload points_of_interest'),(677,'Command: reload prospecting_loot_template'),(678,'Command: reload quest_poi'),(679,'Command: reload quest_template'),(680,'Command: reload rbac'),(681,'Command: reload reference_loot_template'),(682,'Command: reload reserved_name'),(683,'Command: reload reputation_reward_rate'),(684,'Command: reload reputation_spillover_template'),(685,'Command: reload skill_discovery_template'),(686,'Command: reload skill_extra_item_template'),(687,'Command: reload skill_fishing_base_level'),(688,'Command: reload skinning_loot_template'),(689,'Command: reload smart_scripts'),(690,'Command: reload spell_required'),(691,'Command: reload spell_area'),(692,'Command: reload spell_bonus_data'),(693,'Command: reload spell_group'),(694,'Command: reload spell_learn_spell'),(695,'Command: reload spell_loot_template'),(696,'Command: reload spell_linked_spell'),(697,'Command: reload spell_pet_auras'),(698,'Command: reload spell_proc_event'),(699,'Command: reload spell_proc'),(700,'Command: reload spell_scripts'),(701,'Command: reload spell_target_position'),(702,'Command: reload spell_threats'),(703,'Command: reload spell_group_stack_rules'),(704,'Command: reload trinity_string'),(705,'Command: reload warden_action'),(706,'Command: reload waypoint_scripts'),(707,'Command: reload waypoint_data'),(708,'Command: reload vehicle_accessory'),(709,'Command: reload vehicle_template_accessory'),(710,'Command: reset'),(711,'Command: reset achievements'),(712,'Command: reset honor'),(713,'Command: reset level'),(714,'Command: reset spells'),(715,'Command: reset stats'),(716,'Command: reset talents'),(717,'Command: reset all'),(718,'Command: server'),(719,'Command: server corpses'),(720,'Command: server exit'),(721,'Command: server idlerestart'),(722,'Command: server idlerestart cancel'),(723,'Command: server idleshutdown'),(724,'Command: server idleshutdown cancel'),(725,'Command: server info'),(726,'Command: server plimit'),(727,'Command: server restart'),(728,'Command: server restart cancel'),(729,'Command: server set'),(730,'Command: server set closed'),(731,'Command: server set difftime'),(732,'Command: server set loglevel'),(733,'Command: server set motd'),(734,'Command: server shutdown'),(735,'Command: server shutdown cancel'),(736,'Command: server motd'),(737,'Command: tele'),(738,'Command: tele add'),(739,'Command: tele del'),(740,'Command: tele name'),(741,'Command: tele group'),(742,'Command: ticket'),(743,'Command: ticket assign'),(744,'Command: ticket close'),(745,'Command: ticket closedlist'),(746,'Command: ticket comment'),(747,'Command: ticket complete'),(748,'Command: ticket delete'),(749,'Command: ticket escalate'),(750,'Command: ticket escalatedlist'),(751,'Command: ticket list'),(752,'Command: ticket onlinelist'),(753,'Command: ticket reset'),(754,'Command: ticket response'),(755,'Command: ticket response append'),(756,'Command: ticket response appendln'),(757,'Command: ticket togglesystem'),(758,'Command: ticket unassign'),(759,'Command: ticket viewid'),(760,'Command: ticket viewname'),(761,'Command: titles'),(762,'Command: titles add'),(763,'Command: titles current'),(764,'Command: titles remove'),(765,'Command: titles set'),(766,'Command: titles set mask'),(767,'Command: wp'),(768,'Command: wp add'),(769,'Command: wp event'),(770,'Command: wp load'),(771,'Command: wp modify'),(772,'Command: wp unload'),(773,'Command: wp reload'),(774,'Command: wp show'),(777,'Command: mailbox'),(778,'Command: ahbot'),(779,'Command: ahbot items'),(780,'Command: ahbot items gray'),(781,'Command: ahbot items white'),(782,'Command: ahbot items green'),(783,'Command: ahbot items blue'),(784,'Command: ahbot items purple'),(785,'Command: ahbot items orange'),(786,'Command: ahbot items yellow'),(787,'Command: ahbot ratio'),(788,'Command: ahbot ratio alliance'),(789,'Command: ahbot ratio horde'),(790,'Command: ahbot ratio neutral'),(791,'Command: ahbot rebuild'),(792,'Command: ahbot reload'),(793,'Command: ahbot status'),(794,'Command: .guild info');
+INSERT INTO `rbac_permissions` VALUES (1,'Instant logout'),(2,'Skip Queue'),(3,'Join Normal Battleground'),(4,'Join Random Battleground'),(5,'Join Arenas'),(6,'Join Dungeon Finder'),(11,'Log GM trades'),(13,'Skip Instance required bosses check'),(14,'Skip character creation team mask check'),(15,'Skip character creation class mask check'),(16,'Skip character creation race mask check'),(17,'Skip character creation reserved name check'),(18,'Skip character creation heroic min level check'),(19,'Skip needed requirements to use channel check'),(20,'Skip disable map check'),(21,'Skip reset talents when used more than allowed check'),(22,'Skip spam chat check'),(23,'Skip over-speed ping check'),(24,'Two side faction characters on the same account'),(25,'Allow say chat between factions'),(26,'Allow channel chat between factions'),(27,'Two side mail interaction'),(28,'See two side who list'),(29,'Add friends of other faction'),(30,'Save character without delay with .save command'),(31,'Use params with .unstuck command'),(32,'Can be assigned tickets with .assign ticket command'),(33,'Notify if a command was not found'),(34,'Check if should appear in list using .gm ingame command'),(35,'See all security levels with who command'),(36,'Filter whispers'),(37,'Use staff badge in chat'),(38,'Resurrect with full Health Points'),(39,'Restore saved gm setting states'),(40,'Allows to add a gm to friend list'),(41,'Use Config option START_GM_LEVEL to assign new character level'),(42,'Allows to use CMSG_WORLD_TELEPORT opcode'),(43,'Allows to use CMSG_WHOIS opcode'),(44,'Receive global GM messages/texts'),(45,'Join channels without announce'),(46,'Change channel settings without being channel moderator'),(47,'Enables lower security than target check'),(48,'Enable IP, Last Login and EMail output in pinfo'),(49,'Forces to enter the email for confirmation on password change'),(50,'Allow user to check his own email with .account'),(192,'Role: Sec Level Administrator'),(193,'Role: Sec Level Gamemaster'),(194,'Role: Sec Level Moderator'),(195,'Role: Sec Level Player'),(196,'Role: Administrator Commands'),(197,'Role: Gamemaster Commands'),(198,'Role: Moderator Commands'),(199,'Role: Player Commands'),(200,'Command: rbac'),(201,'Command: rbac account'),(202,'Command: rbac account list'),(203,'Command: rbac account grant'),(204,'Command: rbac account deny'),(205,'Command: rbac account revoke'),(206,'Command: rbac list'),(207,'Command: battlenetaccount'),(208,'Command: battlenetaccount create'),(209,'Command: battlenetaccount lock country'),(210,'Command: battlenetaccount lock ip'),(211,'Command: battlenetaccount password'),(212,'Command: battlenetaccount set'),(213,'Command: battlenetaccount set password'),(214,'Command: bnetaccount link'),(215,'Command: bnetaccount unlink'),(216,'Command: bnetaccount gameaccountcreate'),(217,'Command: account'),(218,'Command: account addon'),(219,'Command: account create'),(220,'Command: account delete'),(221,'Command: account lock'),(222,'Command: account lock country'),(223,'Command: account lock ip'),(224,'Command: account onlinelist'),(225,'Command: account password'),(226,'Command: account set'),(227,'Command: account set addon'),(228,'Command: account set gmlevel'),(229,'Command: account set password'),(230,'Command: achievement'),(231,'Command: achievement add'),(232,'Command: arena'),(233,'Command: arena captain'),(234,'Command: arena create'),(235,'Command: arena disband'),(236,'Command: arena info'),(237,'Command: arena lookup'),(238,'Command: arena rename'),(239,'Command: ban'),(240,'Command: ban account'),(241,'Command: ban character'),(242,'Command: ban ip'),(243,'Command: ban playeraccount'),(244,'Command: baninfo'),(245,'Command: baninfo account'),(246,'Command: baninfo character'),(247,'Command: baninfo ip'),(248,'Command: banlist'),(249,'Command: banlist account'),(250,'Command: banlist character'),(251,'Command: banlist ip'),(252,'Command: unban'),(253,'Command: unban account'),(254,'Command: unban character'),(255,'Command: unban ip'),(256,'Command: unban playeraccount'),(257,'Command: bf'),(258,'Command: bf start'),(259,'Command: bf stop'),(260,'Command: bf switch'),(261,'Command: bf timer'),(262,'Command: bf enable'),(263,'Command: account email'),(264,'Command: account set sec'),(265,'Command: account set sec email'),(266,'Command: account set sec regmail'),(267,'Command: cast'),(268,'Command: cast back'),(269,'Command: cast dist'),(270,'Command: cast self'),(271,'Command: cast target'),(272,'Command: cast dest'),(273,'Command: character'),(274,'Command: character customize'),(275,'Command: character changefaction'),(276,'Command: character changerace'),(277,'Command: character deleted'),(279,'Command: character deleted list'),(280,'Command: character deleted restore'),(283,'Command: character level'),(284,'Command: character rename'),(285,'Command: character reputation'),(286,'Command: character titles'),(287,'Command: levelup'),(288,'Command: pdump'),(289,'Command: pdump load'),(290,'Command: pdump write'),(291,'Command: cheat'),(292,'Command: cheat casttime'),(293,'Command: cheat cooldown'),(294,'Command: cheat explore'),(295,'Command: cheat god'),(296,'Command: cheat power'),(297,'Command: cheat status'),(298,'Command: cheat taxi'),(299,'Command: cheat waterwalk'),(300,'Command: debug'),(301,'Command: debug anim'),(302,'Command: debug areatriggers'),(303,'Command: debug arena'),(304,'Command: debug bg'),(305,'Command: debug entervehicle'),(306,'Command: debug getitemstate'),(307,'Command: debug getitemvalue'),(308,'Command: debug getvalue'),(309,'Command: debug hostil'),(310,'Command: debug itemexpire'),(311,'Command: debug lootrecipient'),(312,'Command: debug los'),(313,'Command: debug mod32value'),(314,'Command: debug moveflags'),(315,'Command: debug play'),(316,'Command: debug play cinematics'),(317,'Command: debug play movie'),(318,'Command: debug play sound'),(319,'Command: debug send'),(320,'Command: debug send buyerror'),(321,'Command: debug send channelnotify'),(322,'Command: debug send chatmessage'),(323,'Command: debug send equiperror'),(324,'Command: debug send largepacket'),(325,'Command: debug send opcode'),(326,'Command: debug send qinvalidmsg'),(327,'Command: debug send qpartymsg'),(328,'Command: debug send sellerror'),(329,'Command: debug send setphaseshift'),(330,'Command: debug send spellfail'),(331,'Command: debug setaurastate'),(332,'Command: debug setbit'),(333,'Command: debug setitemvalue'),(334,'Command: debug setvalue'),(335,'Command: debug setvid'),(336,'Command: debug spawnvehicle'),(337,'Command: debug threat'),(338,'Command: debug update'),(339,'Command: debug uws'),(340,'Command: wpgps'),(341,'Command: deserter'),(342,'Command: deserter bg'),(343,'Command: deserter bg add'),(344,'Command: deserter bg remove'),(345,'Command: deserter instance'),(346,'Command: deserter instance add'),(347,'Command: deserter instance remove'),(348,'Command: disable'),(349,'Command: disable add'),(350,'Command: disable add achievement_criteria'),(351,'Command: disable add battleground'),(352,'Command: disable add map'),(353,'Command: disable add mmap'),(354,'Command: disable add outdoorpvp'),(355,'Command: disable add quest'),(356,'Command: disable add spell'),(357,'Command: disable add vmap'),(358,'Command: disable remove'),(359,'Command: disable remove achievement_criteria'),(360,'Command: disable remove battleground'),(361,'Command: disable remove map'),(362,'Command: disable remove mmap'),(363,'Command: disable remove outdoorpvp'),(364,'Command: disable remove quest'),(365,'Command: disable remove spell'),(366,'Command: disable remove vmap'),(367,'Command: event'),(368,'Command: event activelist'),(369,'Command: event start'),(370,'Command: event stop'),(371,'Command: gm'),(372,'Command: gm chat'),(373,'Command: gm fly'),(374,'Command: gm ingame'),(375,'Command: gm list'),(376,'Command: gm visible'),(377,'Command: go'),(378,'Command: go creature'),(379,'Command: go graveyard'),(380,'Command: go grid'),(381,'Command: go object'),(382,'Command: go taxinode'),(383,'Command: go ticket'),(384,'Command: go trigger'),(385,'Command: go xyz'),(386,'Command: go zonexy'),(387,'Command: gobject'),(388,'Command: gobject activate'),(389,'Command: gobject add'),(390,'Command: gobject add temp'),(391,'Command: gobject delete'),(392,'Command: gobject info'),(393,'Command: gobject move'),(394,'Command: gobject near'),(395,'Command: gobject set'),(396,'Command: gobject set phase'),(397,'Command: gobject set state'),(398,'Command: gobject target'),(399,'Command: gobject turn'),(400,'debug transport'),(401,'Command: guild'),(402,'Command: guild create'),(403,'Command: guild delete'),(404,'Command: guild invite'),(405,'Command: guild uninvite'),(406,'Command: guild rank'),(407,'Command: guild rename'),(408,'Command: honor'),(409,'Command: honor add'),(410,'Command: honor add kill'),(411,'Command: honor update'),(412,'Command: instance'),(413,'Command: instance listbinds'),(414,'Command: instance unbind'),(415,'Command: instance stats'),(416,'Command: instance savedata'),(417,'Command: learn'),(418,'Command: learn all'),(419,'Command: learn all my'),(420,'Command: learn all my class'),(421,'Command: learn all my pettalents'),(422,'Command: learn all my spells'),(423,'Command: learn all my talents'),(424,'Command: learn all gm'),(425,'Command: learn all crafts'),(426,'Command: learn all default'),(427,'Command: learn all lang'),(428,'Command: learn all recipes'),(429,'Command: unlearn'),(430,'Command: lfg'),(431,'Command: lfg player'),(432,'Command: lfg group'),(433,'Command: lfg queue'),(434,'Command: lfg clean'),(435,'Command: lfg options'),(436,'Command: list'),(437,'Command: list creature'),(438,'Command: list item'),(439,'Command: list object'),(440,'Command: list auras'),(441,'Command: list mail'),(442,'Command: lookup'),(443,'Command: lookup area'),(444,'Command: lookup creature'),(445,'Command: lookup event'),(446,'Command: lookup faction'),(447,'Command: lookup item'),(448,'Command: lookup itemset'),(449,'Command: lookup object'),(450,'Command: lookup quest'),(451,'Command: lookup player'),(452,'Command: lookup player ip'),(453,'Command: lookup player account'),(454,'Command: lookup player email'),(455,'Command: lookup skill'),(456,'Command: lookup spell'),(457,'Command: lookup spell id'),(458,'Command: lookup taxinode'),(459,'Command: lookup tele'),(460,'Command: lookup title'),(461,'Command: lookup map'),(462,'Command: announce'),(463,'Command: channel'),(464,'Command: channel set'),(465,'Command: channel set ownership'),(466,'Command: gmannounce'),(467,'Command: gmnameannounce'),(468,'Command: gmnotify'),(469,'Command: nameannounce'),(470,'Command: notify'),(471,'Command: whispers'),(472,'Command: group'),(473,'Command: group leader'),(474,'Command: group disband'),(475,'Command: group remove'),(476,'Command: group join'),(477,'Command: group list'),(478,'Command: group summon'),(479,'Command: pet'),(480,'Command: pet create'),(481,'Command: pet learn'),(482,'Command: pet unlearn'),(483,'Command: send'),(484,'Command: send items'),(485,'Command: send mail'),(486,'Command: send message'),(487,'Command: send money'),(488,'Command: additem'),(489,'Command: additemset'),(490,'Command: appear'),(491,'Command: aura'),(492,'Command: bank'),(493,'Command: bindsight'),(494,'Command: combatstop'),(495,'Command: cometome'),(496,'Command: commands'),(497,'Command: cooldown'),(498,'Command: damage'),(499,'Command: dev'),(500,'Command: die'),(501,'Command: dismount'),(502,'Command: distance'),(503,'Command: flusharenapoints'),(504,'Command: freeze'),(505,'Command: gps'),(506,'Command: guid'),(507,'Command: help'),(508,'Command: hidearea'),(509,'Command: itemmove'),(510,'Command: kick'),(511,'Command: linkgrave'),(512,'Command: listfreeze'),(513,'Command: maxskill'),(514,'Command: movegens'),(515,'Command: mute'),(516,'Command: neargrave'),(517,'Command: pinfo'),(518,'Command: playall'),(519,'Command: possess'),(520,'Command: recall'),(521,'Command: repairitems'),(522,'Command: respawn'),(523,'Command: revive'),(524,'Command: saveall'),(525,'Command: save'),(526,'Command: setskill'),(527,'Command: showarea'),(528,'Command: summon'),(529,'Command: unaura'),(530,'Command: unbindsight'),(531,'Command: unfreeze'),(532,'Command: unmute'),(533,'Command: unpossess'),(534,'Command: unstuck'),(535,'Command: wchange'),(536,'Command: mmap'),(537,'Command: mmap loadedtiles'),(538,'Command: mmap loc'),(539,'Command: mmap path'),(540,'Command: mmap stats'),(541,'Command: mmap testarea'),(542,'Command: morph'),(543,'Command: demorph'),(544,'Command: modify'),(545,'Command: modify arenapoints'),(546,'Command: modify bit'),(547,'Command: modify drunk'),(548,'Command: modify energy'),(549,'Command: modify faction'),(550,'Command: modify gender'),(551,'Command: modify honor'),(552,'Command: modify hp'),(553,'Command: modify mana'),(554,'Command: modify money'),(555,'Command: modify mount'),(556,'Command: modify phase'),(557,'Command: modify rage'),(558,'Command: modify reputation'),(559,'Command: modify runicpower'),(560,'Command: modify scale'),(561,'Command: modify speed'),(562,'Command: modify speed all'),(563,'Command: modify speed backwalk'),(564,'Command: modify speed fly'),(565,'Command: modify speed walk'),(566,'Command: modify speed swim'),(567,'Command: modify spell'),(568,'Command: modify standstate'),(569,'Command: modify talentpoints'),(570,'Command: npc'),(571,'Command: npc add'),(572,'Command: npc add formation'),(573,'Command: npc add item'),(574,'Command: npc add move'),(575,'Command: npc add temp'),(576,'Command: npc add delete'),(577,'Command: npc add delete item'),(578,'Command: npc add follow'),(579,'Command: npc add follow stop'),(580,'Command: npc set'),(581,'Command: npc set allowmove'),(582,'Command: npc set entry'),(583,'Command: npc set factionid'),(584,'Command: npc set flag'),(585,'Command: npc set level'),(586,'Command: npc set link'),(587,'Command: npc set model'),(588,'Command: npc set movetype'),(589,'Command: npc set phase'),(590,'Command: npc set spawndist'),(591,'Command: npc set spawntime'),(592,'Command: npc set data'),(593,'Command: npc info'),(594,'Command: npc near'),(595,'Command: npc move'),(596,'Command: npc playemote'),(597,'Command: npc say'),(598,'Command: npc textemote'),(599,'Command: npc whisper'),(600,'Command: npc yell'),(601,'Command: npc tame'),(602,'Command: quest'),(603,'Command: quest add'),(604,'Command: quest complete'),(605,'Command: quest remove'),(606,'Command: quest reward'),(607,'Command: reload'),(608,'Command: reload access_requirement'),(609,'Command: reload achievement_criteria_data'),(610,'Command: reload achievement_reward'),(611,'Command: reload all'),(612,'Command: reload all achievement'),(613,'Command: reload all area'),(614,'Command: broadcast_text'),(615,'Command: reload all gossips'),(616,'Command: reload all item'),(617,'Command: reload all locales'),(618,'Command: reload all loot'),(619,'Command: reload all npc'),(620,'Command: reload all quest'),(621,'Command: reload all scripts'),(622,'Command: reload all spell'),(623,'Command: reload areatrigger_involvedrelation'),(624,'Command: reload areatrigger_tavern'),(625,'Command: reload areatrigger_teleport'),(626,'Command: reload auctions'),(627,'Command: reload autobroadcast'),(628,'Command: reload command'),(629,'Command: reload conditions'),(630,'Command: reload config'),(631,'Command: reload battleground_template'),(632,'Command: .mutehistory'),(633,'Command: reload creature_linked_respawn'),(634,'Command: reload creature_loot_template'),(635,'Command: reload creature_onkill_reputation'),(636,'Command: reload creature_questender'),(637,'Command: reload creature_queststarter'),(638,'Command: reload creature_summon_groups'),(639,'Command: reload creature_template'),(640,'Command: reload creature_text'),(641,'Command: reload disables'),(642,'Command: reload disenchant_loot_template'),(643,'Command: reload event_scripts'),(644,'Command: reload fishing_loot_template'),(645,'Command: reload game_graveyard_zone'),(646,'Command: reload game_tele'),(647,'Command: reload gameobject_questender'),(648,'Command: reload gameobject_loot_template'),(649,'Command: reload gameobject_queststarter'),(650,'Command: reload gm_tickets'),(651,'Command: reload gossip_menu'),(652,'Command: reload gossip_menu_option'),(653,'Command: reload item_enchantment_template'),(654,'Command: reload item_loot_template'),(655,'Command: reload item_set_names'),(656,'Command: reload lfg_dungeon_rewards'),(657,'Command: reload locales_achievement_reward'),(658,'Command: reload locales_creature'),(659,'Command: reload locales_creature_text'),(660,'Command: reload locales_gameobject'),(661,'Command: reload locales_gossip_menu_option'),(662,'Command: reload locales_item'),(663,'Command: reload locales_item_set_name'),(664,'Command: reload locales_npc_text'),(665,'Command: reload locales_page_text'),(666,'Command: reload locales_points_of_interest'),(667,'Command: reload locales_quest'),(668,'Command: reload mail_level_reward'),(669,'Command: reload mail_loot_template'),(670,'Command: reload milling_loot_template'),(671,'Command: reload npc_spellclick_spells'),(672,'Command: reload npc_trainer'),(673,'Command: reload npc_vendor'),(674,'Command: reload page_text'),(675,'Command: reload pickpocketing_loot_template'),(676,'Command: reload points_of_interest'),(677,'Command: reload prospecting_loot_template'),(678,'Command: reload quest_poi'),(679,'Command: reload quest_template'),(680,'Command: reload rbac'),(681,'Command: reload reference_loot_template'),(682,'Command: reload reserved_name'),(683,'Command: reload reputation_reward_rate'),(684,'Command: reload reputation_spillover_template'),(685,'Command: reload skill_discovery_template'),(686,'Command: reload skill_extra_item_template'),(687,'Command: reload skill_fishing_base_level'),(688,'Command: reload skinning_loot_template'),(689,'Command: reload smart_scripts'),(690,'Command: reload spell_required'),(691,'Command: reload spell_area'),(692,'Command: reload spell_bonus_data'),(693,'Command: reload spell_group'),(694,'Command: reload spell_learn_spell'),(695,'Command: reload spell_loot_template'),(696,'Command: reload spell_linked_spell'),(697,'Command: reload spell_pet_auras'),(698,'Command: reload spell_proc_event'),(699,'Command: reload spell_proc'),(700,'Command: reload spell_scripts'),(701,'Command: reload spell_target_position'),(702,'Command: reload spell_threats'),(703,'Command: reload spell_group_stack_rules'),(704,'Command: reload trinity_string'),(705,'Command: reload warden_action'),(706,'Command: reload waypoint_scripts'),(707,'Command: reload waypoint_data'),(708,'Command: reload vehicle_accessory'),(709,'Command: reload vehicle_template_accessory'),(710,'Command: reset'),(711,'Command: reset achievements'),(712,'Command: reset honor'),(713,'Command: reset level'),(714,'Command: reset spells'),(715,'Command: reset stats'),(716,'Command: reset talents'),(717,'Command: reset all'),(718,'Command: server'),(719,'Command: server corpses'),(720,'Command: server exit'),(721,'Command: server idlerestart'),(722,'Command: server idlerestart cancel'),(723,'Command: server idleshutdown'),(724,'Command: server idleshutdown cancel'),(725,'Command: server info'),(726,'Command: server plimit'),(727,'Command: server restart'),(728,'Command: server restart cancel'),(729,'Command: server set'),(730,'Command: server set closed'),(731,'Command: server set difftime'),(732,'Command: server set loglevel'),(733,'Command: server set motd'),(734,'Command: server shutdown'),(735,'Command: server shutdown cancel'),(736,'Command: server motd'),(737,'Command: tele'),(738,'Command: tele add'),(739,'Command: tele del'),(740,'Command: tele name'),(741,'Command: tele group'),(742,'Command: ticket'),(743,'Command: ticket assign'),(744,'Command: ticket close'),(745,'Command: ticket closedlist'),(746,'Command: ticket comment'),(747,'Command: ticket complete'),(748,'Command: ticket delete'),(749,'Command: ticket escalate'),(750,'Command: ticket escalatedlist'),(751,'Command: ticket list'),(752,'Command: ticket onlinelist'),(753,'Command: ticket reset'),(754,'Command: ticket response'),(755,'Command: ticket response append'),(756,'Command: ticket response appendln'),(757,'Command: ticket togglesystem'),(758,'Command: ticket unassign'),(759,'Command: ticket viewid'),(760,'Command: ticket viewname'),(761,'Command: titles'),(762,'Command: titles add'),(763,'Command: titles current'),(764,'Command: titles remove'),(765,'Command: titles set'),(766,'Command: titles set mask'),(767,'Command: wp'),(768,'Command: wp add'),(769,'Command: wp event'),(770,'Command: wp load'),(771,'Command: wp modify'),(772,'Command: wp unload'),(773,'Command: wp reload'),(774,'Command: wp show'),(777,'Command: mailbox'),(778,'Command: ahbot'),(779,'Command: ahbot items'),(780,'Command: ahbot items gray'),(781,'Command: ahbot items white'),(782,'Command: ahbot items green'),(783,'Command: ahbot items blue'),(784,'Command: ahbot items purple'),(785,'Command: ahbot items orange'),(786,'Command: ahbot items yellow'),(787,'Command: ahbot ratio'),(788,'Command: ahbot ratio alliance'),(789,'Command: ahbot ratio horde'),(790,'Command: ahbot ratio neutral'),(791,'Command: ahbot rebuild'),(792,'Command: ahbot reload'),(793,'Command: ahbot status'),(794,'Command: .guild info'),(797,'Command: pvpstats'),(798,'Command: .mod xp');
/*!40000 ALTER TABLE `rbac_permissions` ENABLE KEYS */;
UNLOCK TABLES;
@@ -670,4 +620,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2014-10-18 23:33:11
+-- Dump completed on 2014-11-11 0:57:33
diff --git a/sql/updates/auth/2014_11_10_00_auth_from_335.sql b/sql/updates/auth/2014_11_10_00_auth_from_335.sql
new file mode 100644
index 00000000000..088c5cc71b5
--- /dev/null
+++ b/sql/updates/auth/2014_11_10_00_auth_from_335.sql
@@ -0,0 +1,7 @@
+DELETE FROM rbac_permissions WHERE id = 797;
+INSERT INTO rbac_permissions (`id`, `name`) VALUES
+(797, 'Command: pvpstats');
+
+DELETE FROM rbac_linked_permissions WHERE `linkedId` = 797;
+INSERT INTO rbac_linked_permissions (`id`, `linkedId`) VALUES
+(199, 797);
diff --git a/sql/updates/auth/2014_11_10_01_auth.sql b/sql/updates/auth/2014_11_10_01_auth.sql
new file mode 100644
index 00000000000..0f89140ecf4
--- /dev/null
+++ b/sql/updates/auth/2014_11_10_01_auth.sql
@@ -0,0 +1,9 @@
+/* add rbac permissions to new commands */
+DELETE FROM `rbac_permissions` WHERE `id`=798;
+INSERT INTO `rbac_permissions` (`id`,`name`) VALUES
+(798, 'Command: .mod xp');
+
+DELETE FROM `rbac_linked_permissions` WHERE `id`=798;
+INSERT INTO `rbac_linked_permissions` (`id`,`linkedId`) VALUES
+/* add mod xp to gms */
+(194, 798);
diff --git a/sql/updates/world/2014_11_10_03_world.sql b/sql/updates/world/2014_11_10_03_world.sql
new file mode 100644
index 00000000000..41044e8c7ef
--- /dev/null
+++ b/sql/updates/world/2014_11_10_03_world.sql
@@ -0,0 +1,4 @@
+update creature_template set `AIName`='SmartAI' where entry=26261;
+
+Delete from `smart_scripts` where entryorguid=26261 and event_param1=47394;
+INSERT INTO `smart_scripts` VALUES (26261, 0, 0, 0, 8, 0, 100, 0, 47394, 0, 0, 0, 33, 26261, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'On Spellhit call Killcredit for Q 12070');
diff --git a/sql/updates/world/2014_11_10_04_world.sql b/sql/updates/world/2014_11_10_04_world.sql
new file mode 100644
index 00000000000..1b4857e4724
--- /dev/null
+++ b/sql/updates/world/2014_11_10_04_world.sql
@@ -0,0 +1,8 @@
+DELETE FROM `trinity_string` WHERE entry IN (80, 81);
+INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES
+(80, 'BattleGround victories in the last 7 days\nAlliance: %d\nHorde: %d'),
+(81, 'BattleGround scores storing is disabled!');
+
+DELETE FROM `command` WHERE `name`='pvpstats';
+INSERT INTO `command` (`name`, `permission`, `help`) VALUES
+('pvpstats', 797, 'Shows number of battleground victories in the last 7 days');
diff --git a/sql/updates/world/2014_11_10_05_world.sql b/sql/updates/world/2014_11_10_05_world.sql
new file mode 100644
index 00000000000..2ffd85afa5e
--- /dev/null
+++ b/sql/updates/world/2014_11_10_05_world.sql
@@ -0,0 +1,5 @@
+DELETE FROM `command` WHERE `name`='pvpstats';
+INSERT INTO `command` (`name`, `permission`, `help`) VALUES
+('modify xp', 797, 'Syntax: .modify xp #xp
+
+Gives experience points to the targeted player or self.');
diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt
index e691b9527a5..6997fd6e146 100644
--- a/src/server/CMakeLists.txt
+++ b/src/server/CMakeLists.txt
@@ -24,7 +24,6 @@ if( SERVERS )
add_subdirectory(shared)
add_subdirectory(game)
add_subdirectory(collision)
- add_subdirectory(authserver)
add_subdirectory(ipc)
add_subdirectory(bnetserver)
add_subdirectory(scripts)
diff --git a/src/server/authserver/Authentication/AuthCodes.cpp b/src/server/authserver/Authentication/AuthCodes.cpp
deleted file mode 100644
index 44921f6a1cd..00000000000
--- a/src/server/authserver/Authentication/AuthCodes.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "AuthCodes.h"
-#include <cstddef>
-
-namespace AuthHelper
-{
- static RealmBuildInfo const PostBcAcceptedClientBuilds[] =
- {
- {15595, 4, 3, 4, ' '},
- {14545, 4, 2, 2, ' '},
- {13623, 4, 0, 6, 'a'},
- {13930, 3, 3, 5, 'a'}, // 3.3.5a China Mainland build
- {12340, 3, 3, 5, 'a'},
- {11723, 3, 3, 3, 'a'},
- {11403, 3, 3, 2, ' '},
- {11159, 3, 3, 0, 'a'},
- {10505, 3, 2, 2, 'a'},
- {9947, 3, 1, 3, ' '},
- {8606, 2, 4, 3, ' '},
- {0, 0, 0, 0, ' '} // terminator
- };
-
- static RealmBuildInfo const PreBcAcceptedClientBuilds[] =
- {
- {6141, 1, 12, 3, ' '},
- {6005, 1, 12, 2, ' '},
- {5875, 1, 12, 1, ' '},
- {0, 0, 0, 0, ' '} // terminator
- };
-
- bool IsPreBCAcceptedClientBuild(int build)
- {
- for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i)
- if (PreBcAcceptedClientBuilds[i].Build == build)
- return true;
-
- return false;
- }
-
- bool IsPostBCAcceptedClientBuild(int build)
- {
- for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i)
- if (PostBcAcceptedClientBuilds[i].Build == build)
- return true;
-
- return false;
- }
-
- bool IsAcceptedClientBuild(int build)
- {
- return (IsPostBCAcceptedClientBuild(build) || IsPreBCAcceptedClientBuild(build));
- }
-
- RealmBuildInfo const* GetBuildInfo(int build)
- {
- for (int i = 0; PostBcAcceptedClientBuilds[i].Build; ++i)
- if (PostBcAcceptedClientBuilds[i].Build == build)
- return &PostBcAcceptedClientBuilds[i];
-
- for (int i = 0; PreBcAcceptedClientBuilds[i].Build; ++i)
- if (PreBcAcceptedClientBuilds[i].Build == build)
- return &PreBcAcceptedClientBuilds[i];
-
- return NULL;
- }
-
- bool IsBuildSupportingBattlenet(int build)
- {
- return build >= 15595;
- }
-}
diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h
deleted file mode 100644
index bc7f0c43f17..00000000000
--- a/src/server/authserver/Authentication/AuthCodes.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _AUTHCODES_H
-#define _AUTHCODES_H
-
-enum AuthResult
-{
- WOW_SUCCESS = 0x00,
- WOW_FAIL_BANNED = 0x03,
- WOW_FAIL_UNKNOWN_ACCOUNT = 0x04,
- WOW_FAIL_INCORRECT_PASSWORD = 0x05,
- WOW_FAIL_ALREADY_ONLINE = 0x06,
- WOW_FAIL_NO_TIME = 0x07,
- WOW_FAIL_DB_BUSY = 0x08,
- WOW_FAIL_VERSION_INVALID = 0x09,
- WOW_FAIL_VERSION_UPDATE = 0x0A,
- WOW_FAIL_INVALID_SERVER = 0x0B,
- WOW_FAIL_SUSPENDED = 0x0C,
- WOW_FAIL_FAIL_NOACCESS = 0x0D,
- WOW_SUCCESS_SURVEY = 0x0E,
- WOW_FAIL_PARENTCONTROL = 0x0F,
- WOW_FAIL_LOCKED_ENFORCED = 0x10,
- WOW_FAIL_TRIAL_ENDED = 0x11,
- WOW_FAIL_USE_BATTLENET = 0x12,
- WOW_FAIL_ANTI_INDULGENCE = 0x13,
- WOW_FAIL_EXPIRED = 0x14,
- WOW_FAIL_NO_GAME_ACCOUNT = 0x15,
- WOW_FAIL_CHARGEBACK = 0x16,
- WOW_FAIL_INTERNET_GAME_ROOM_WITHOUT_BNET = 0x17,
- WOW_FAIL_GAME_ACCOUNT_LOCKED = 0x18,
- WOW_FAIL_UNLOCKABLE_LOCK = 0x19,
- WOW_FAIL_CONVERSION_REQUIRED = 0x20,
- WOW_FAIL_DISCONNECTED = 0xFF
-};
-
-enum LoginResult
-{
- LOGIN_OK = 0x00,
- LOGIN_FAILED = 0x01,
- LOGIN_FAILED2 = 0x02,
- LOGIN_BANNED = 0x03,
- LOGIN_UNKNOWN_ACCOUNT = 0x04,
- LOGIN_UNKNOWN_ACCOUNT3 = 0x05,
- LOGIN_ALREADYONLINE = 0x06,
- LOGIN_NOTIME = 0x07,
- LOGIN_DBBUSY = 0x08,
- LOGIN_BADVERSION = 0x09,
- LOGIN_DOWNLOAD_FILE = 0x0A,
- LOGIN_FAILED3 = 0x0B,
- LOGIN_SUSPENDED = 0x0C,
- LOGIN_FAILED4 = 0x0D,
- LOGIN_CONNECTED = 0x0E,
- LOGIN_PARENTALCONTROL = 0x0F,
- LOGIN_LOCKED_ENFORCED = 0x10
-};
-
-enum GameAccountFlags
-{
- GAMEACCOUNT_FLAG_GM = 0x00000001,
- GAMEACCOUNT_FLAG_NOKICK = 0x00000002,
- GAMEACCOUNT_FLAG_COLLECTOR = 0x00000004,
- GAMEACCOUNT_FLAG_WOW_TRIAL = 0x00000008,
- GAMEACCOUNT_FLAG_CANCELLED = 0x00000010,
- GAMEACCOUNT_FLAG_IGR = 0x00000020,
- GAMEACCOUNT_FLAG_WHOLESALER = 0x00000040,
- GAMEACCOUNT_FLAG_PRIVILEGED = 0x00000080,
- GAMEACCOUNT_FLAG_EU_FORBID_ELV = 0x00000100,
- GAMEACCOUNT_FLAG_EU_FORBID_BILLING = 0x00000200,
- GAMEACCOUNT_FLAG_WOW_RESTRICTED = 0x00000400,
- GAMEACCOUNT_FLAG_REFERRAL = 0x00000800,
- GAMEACCOUNT_FLAG_BLIZZARD = 0x00001000,
- GAMEACCOUNT_FLAG_RECURRING_BILLING = 0x00002000,
- GAMEACCOUNT_FLAG_NOELECTUP = 0x00004000,
- GAMEACCOUNT_FLAG_KR_CERTIFICATE = 0x00008000,
- GAMEACCOUNT_FLAG_EXPANSION_COLLECTOR = 0x00010000,
- GAMEACCOUNT_FLAG_DISABLE_VOICE = 0x00020000,
- GAMEACCOUNT_FLAG_DISABLE_VOICE_SPEAK = 0x00040000,
- GAMEACCOUNT_FLAG_REFERRAL_RESURRECT = 0x00080000,
- GAMEACCOUNT_FLAG_EU_FORBID_CC = 0x00100000,
- GAMEACCOUNT_FLAG_OPENBETA_DELL = 0x00200000,
- GAMEACCOUNT_FLAG_PROPASS = 0x00400000,
- GAMEACCOUNT_FLAG_PROPASS_LOCK = 0x00800000,
- GAMEACCOUNT_FLAG_PENDING_UPGRADE = 0x01000000,
- GAMEACCOUNT_FLAG_RETAIL_FROM_TRIAL = 0x02000000,
- GAMEACCOUNT_FLAG_EXPANSION2_COLLECTOR = 0x04000000,
- GAMEACCOUNT_FLAG_OVERMIND_LINKED = 0x08000000,
- GAMEACCOUNT_FLAG_DEMOS = 0x10000000,
- GAMEACCOUNT_FLAG_DEATH_KNIGHT_OK = 0x20000000,
-};
-
-enum ExpansionFlags
-{
- POST_BC_EXP_FLAG = 0x2,
- PRE_BC_EXP_FLAG = 0x1,
- NO_VALID_EXP_FLAG = 0x0
-};
-
-struct RealmBuildInfo
-{
- int Build;
- int MajorVersion;
- int MinorVersion;
- int BugfixVersion;
- int HotfixVersion;
-};
-
-namespace AuthHelper
-{
- RealmBuildInfo const* GetBuildInfo(int build);
- bool IsAcceptedClientBuild(int build);
- bool IsPostBCAcceptedClientBuild(int build);
- bool IsPreBCAcceptedClientBuild(int build);
- bool IsBuildSupportingBattlenet(int build);
-}
-
-#endif
diff --git a/src/server/authserver/Authentication/TOTP.cpp b/src/server/authserver/Authentication/TOTP.cpp
deleted file mode 100644
index 01842cfe234..00000000000
--- a/src/server/authserver/Authentication/TOTP.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "TOTP.h"
-#include <cstring>
-
-int base32_decode(const char* encoded, char* result, int bufSize)
-{
- // Base32 implementation
- // Copyright 2010 Google Inc.
- // Author: Markus Gutschke
- // Licensed under the Apache License, Version 2.0
- int buffer = 0;
- int bitsLeft = 0;
- int count = 0;
- for (const char *ptr = encoded; count < bufSize && *ptr; ++ptr)
- {
- char ch = *ptr;
- if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n' || ch == '-')
- continue;
- buffer <<= 5;
-
- // Deal with commonly mistyped characters
- if (ch == '0')
- ch = 'O';
- else if (ch == '1')
- ch = 'L';
- else if (ch == '8')
- ch = 'B';
-
- // Look up one base32 digit
- if ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'))
- ch = (ch & 0x1F) - 1;
- else if (ch >= '2' && ch <= '7')
- ch -= '2' - 26;
- else
- return -1;
-
- buffer |= ch;
- bitsLeft += 5;
- if (bitsLeft >= 8)
- {
- result[count++] = buffer >> (bitsLeft - 8);
- bitsLeft -= 8;
- }
- }
-
- if (count < bufSize)
- result[count] = '\000';
- return count;
-}
-
-#define HMAC_RES_SIZE 20
-
-namespace TOTP
-{
- unsigned int GenerateToken(const char* b32key)
- {
- size_t keySize = strlen(b32key);
- int bufsize = (keySize + 7)/8*5;
- char* encoded = new char[bufsize];
- memset(encoded, 0, bufsize);
- unsigned int hmacResSize = HMAC_RES_SIZE;
- unsigned char hmacRes[HMAC_RES_SIZE];
- unsigned long timestamp = time(NULL)/30;
- unsigned char challenge[8];
-
- for (int i = 8; i--;timestamp >>= 8)
- challenge[i] = timestamp;
-
- base32_decode(b32key, encoded, bufsize);
- HMAC(EVP_sha1(), encoded, bufsize, challenge, 8, hmacRes, &hmacResSize);
- unsigned int offset = hmacRes[19] & 0xF;
- unsigned int truncHash = (hmacRes[offset] << 24) | (hmacRes[offset+1] << 16 )| (hmacRes[offset+2] << 8) | (hmacRes[offset+3]);
- truncHash &= 0x7FFFFFFF;
-
- delete[] encoded;
-
- return truncHash % 1000000;
- }
-}
diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt
deleted file mode 100644
index b40b8c906f4..00000000000
--- a/src/server/authserver/CMakeLists.txt
+++ /dev/null
@@ -1,112 +0,0 @@
-# Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
-#
-# This file is free software; as a special exception the author gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-########### authserver ###############
-
-file(GLOB_RECURSE sources_authentication Authentication/*.cpp Authentication/*.h)
-file(GLOB_RECURSE sources_realms Realms/*.cpp Realms/*.h)
-file(GLOB_RECURSE sources_server Server/*.cpp Server/*.h)
-file(GLOB sources_localdir *.cpp *.h)
-
-if (USE_COREPCH)
- set(authserver_PCH_HDR PrecompiledHeaders/authPCH.h)
- set(authserver_PCH_SRC PrecompiledHeaders/authPCH.cpp)
-endif()
-
-set(authserver_SRCS
- ${authserver_SRCS}
- ${sources_authentication}
- ${sources_realms}
- ${sources_server}
- ${sources_localdir}
-)
-
-if( WIN32 )
- set(authserver_SRCS
- ${authserver_SRCS}
- ${sources_windows_Debugging}
- )
- if ( MSVC )
- set(authserver_SRCS
- ${authserver_SRCS}
- authserver.rc
- )
- endif ()
-endif()
-
-include_directories(
- ${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/src/server/shared
- ${CMAKE_SOURCE_DIR}/src/server/shared/Configuration
- ${CMAKE_SOURCE_DIR}/src/server/shared/Database
- ${CMAKE_SOURCE_DIR}/src/server/shared/Debugging
- ${CMAKE_SOURCE_DIR}/src/server/shared/Packets
- ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography
- ${CMAKE_SOURCE_DIR}/src/server/shared/Cryptography/Authentication
- ${CMAKE_SOURCE_DIR}/src/server/shared/Logging
- ${CMAKE_SOURCE_DIR}/src/server/shared/Networking
- ${CMAKE_SOURCE_DIR}/src/server/shared/Threading
- ${CMAKE_SOURCE_DIR}/src/server/shared/Utilities
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/Authentication
- ${CMAKE_CURRENT_SOURCE_DIR}/Realms
- ${CMAKE_CURRENT_SOURCE_DIR}/Server
- ${MYSQL_INCLUDE_DIR}
- ${OPENSSL_INCLUDE_DIR}
- ${VALGRIND_INCLUDE_DIR}
-)
-
-add_executable(authserver
- ${authserver_SRCS}
- ${authserver_PCH_SRC}
-)
-
-add_dependencies(authserver revision.h)
-
-if( NOT WIN32 )
- set_target_properties(authserver PROPERTIES
- COMPILE_DEFINITIONS _TRINITY_REALM_CONFIG="${CONF_DIR}/authserver.conf"
- )
-endif()
-
-target_link_libraries(authserver
- shared
- ${MYSQL_LIBRARY}
- ${OPENSSL_LIBRARIES}
- ${CMAKE_THREAD_LIBS_INIT}
- ${Boost_LIBRARIES}
-)
-
-if( WIN32 )
- if ( MSVC )
- add_custom_command(TARGET authserver
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/authserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
- )
- elseif ( MINGW )
- add_custom_command(TARGET authserver
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/authserver.conf.dist ${CMAKE_BINARY_DIR}/bin/
- )
- endif()
-endif()
-
-if( UNIX )
- install(TARGETS authserver DESTINATION bin)
- install(FILES authserver.conf.dist DESTINATION ${CONF_DIR})
-elseif( WIN32 )
- install(TARGETS authserver DESTINATION "${CMAKE_INSTALL_PREFIX}")
- install(FILES authserver.conf.dist DESTINATION "${CMAKE_INSTALL_PREFIX}")
-endif()
-
-# Generate precompiled header
-if (USE_COREPCH)
- add_cxx_pch(authserver ${authserver_PCH_HDR} ${authserver_PCH_SRC})
-endif()
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
deleted file mode 100644
index 5f08ebe3127..00000000000
--- a/src/server/authserver/Main.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/**
-* @file main.cpp
-* @brief Authentication Server main program
-*
-* This file contains the main program for the
-* authentication server
-*/
-
-#include "AuthSocketMgr.h"
-#include "Common.h"
-#include "Config.h"
-#include "DatabaseEnv.h"
-#include "Log.h"
-#include "ProcessPriority.h"
-#include "RealmList.h"
-#include "SystemConfig.h"
-#include "Util.h"
-#include <cstdlib>
-#include <iostream>
-#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/program_options.hpp>
-#include <openssl/opensslv.h>
-#include <openssl/crypto.h>
-
-using boost::asio::ip::tcp;
-using namespace boost::program_options;
-
-#ifndef _TRINITY_REALM_CONFIG
-# define _TRINITY_REALM_CONFIG "authserver.conf"
-#endif
-
-bool StartDB();
-void StopDB();
-void SignalHandler(const boost::system::error_code& error, int signalNumber);
-void KeepDatabaseAliveHandler(const boost::system::error_code& error);
-variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile);
-
-boost::asio::io_service _ioService;
-boost::asio::deadline_timer _dbPingTimer(_ioService);
-uint32 _dbPingInterval;
-LoginDatabaseWorkerPool LoginDatabase;
-
-int main(int argc, char** argv)
-{
- std::string configFile = _TRINITY_REALM_CONFIG;
- auto vm = GetConsoleArguments(argc, argv, configFile);
- // exit if help is enabled
- if (vm.count("help"))
- return 0;
-
- std::string configError;
- if (!sConfigMgr->LoadInitial(configFile, configError))
- {
- printf("Error in config file: %s\n", configError.c_str());
- return 1;
- }
-
- TC_LOG_INFO("server.authserver", "%s (authserver)", _FULLVERSION);
- TC_LOG_INFO("server.authserver", "<Ctrl-C> to stop.\n");
- TC_LOG_INFO("server.authserver", "Using configuration file %s.", configFile.c_str());
- TC_LOG_INFO("server.authserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
- TC_LOG_INFO("server.authserver", "Using Boost version: %i.%i.%i", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
-
- // authserver PID file creation
- std::string pidFile = sConfigMgr->GetStringDefault("PidFile", "");
- if (!pidFile.empty())
- {
- if (uint32 pid = CreatePIDFile(pidFile))
- TC_LOG_INFO("server.authserver", "Daemon PID: %u\n", pid);
- else
- {
- TC_LOG_ERROR("server.authserver", "Cannot create PID file %s.\n", pidFile.c_str());
- return 1;
- }
- }
-
- // Initialize the database connection
- if (!StartDB())
- return 1;
-
- // Get the list of realms for the server
- sRealmList->Initialize(_ioService, sConfigMgr->GetIntDefault("RealmsStateUpdateDelay", 20));
-
- if (sRealmList->size() == 0)
- {
- TC_LOG_ERROR("server.authserver", "No valid realms specified.");
- StopDB();
- return 1;
- }
-
- // Start the listening port (acceptor) for auth connections
- int32 port = sConfigMgr->GetIntDefault("RealmServerPort", 3724);
- if (port < 0 || port > 0xFFFF)
- {
- TC_LOG_ERROR("server.authserver", "Specified port out of allowed range (1-65535)");
- StopDB();
- return 1;
- }
-
- std::string bindIp = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
-
- sAuthSocketMgr.StartNetwork(_ioService, bindIp, port);
-
- // Set signal handlers
- boost::asio::signal_set signals(_ioService, SIGINT, SIGTERM);
-#if PLATFORM == PLATFORM_WINDOWS
- signals.add(SIGBREAK);
-#endif
- signals.async_wait(SignalHandler);
-
- // Set process priority according to configuration settings
- SetProcessPriority("server.authserver");
-
- // Enabled a timed callback for handling the database keep alive ping
- _dbPingInterval = sConfigMgr->GetIntDefault("MaxPingTime", 30);
- _dbPingTimer.expires_from_now(boost::posix_time::minutes(_dbPingInterval));
- _dbPingTimer.async_wait(KeepDatabaseAliveHandler);
-
- // Start the io service worker loop
- _ioService.run();
-
- // Close the Database Pool and library
- StopDB();
-
- TC_LOG_INFO("server.authserver", "Halting process...");
- return 0;
-}
-
-
-/// Initialize connection to the database
-bool StartDB()
-{
- MySQL::Library_Init();
-
- std::string dbstring = sConfigMgr->GetStringDefault("LoginDatabaseInfo", "");
- if (dbstring.empty())
- {
- TC_LOG_ERROR("server.authserver", "Database not specified");
- return false;
- }
-
- int32 worker_threads = sConfigMgr->GetIntDefault("LoginDatabase.WorkerThreads", 1);
- if (worker_threads < 1 || worker_threads > 32)
- {
- TC_LOG_ERROR("server.authserver", "Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1.");
- worker_threads = 1;
- }
-
- int32 synch_threads = sConfigMgr->GetIntDefault("LoginDatabase.SynchThreads", 1);
- if (synch_threads < 1 || synch_threads > 32)
- {
- TC_LOG_ERROR("server.authserver", "Improper value specified for LoginDatabase.SynchThreads, defaulting to 1.");
- synch_threads = 1;
- }
-
- // NOTE: While authserver is singlethreaded you should keep synch_threads == 1. Increasing it is just silly since only 1 will be used ever.
- if (!LoginDatabase.Open(dbstring, uint8(worker_threads), uint8(synch_threads)))
- {
- TC_LOG_ERROR("server.authserver", "Cannot connect to database");
- return false;
- }
-
- TC_LOG_INFO("server.authserver", "Started auth database connection pool.");
- sLog->SetRealmId(0); // Enables DB appenders when realm is set.
- return true;
-}
-
-/// Close the connection to the database
-void StopDB()
-{
- LoginDatabase.Close();
- MySQL::Library_End();
-}
-
-void SignalHandler(const boost::system::error_code& error, int /*signalNumber*/)
-{
- if (!error)
- _ioService.stop();
-}
-
-void KeepDatabaseAliveHandler(const boost::system::error_code& error)
-{
- if (!error)
- {
- TC_LOG_INFO("server.authserver", "Ping MySQL to keep connection alive");
- LoginDatabase.KeepAlive();
-
- _dbPingTimer.expires_from_now(boost::posix_time::minutes(_dbPingInterval));
- _dbPingTimer.async_wait(KeepDatabaseAliveHandler);
- }
-}
-
-variables_map GetConsoleArguments(int argc, char** argv, std::string& configFile)
-{
- options_description all("Allowed options");
- all.add_options()
- ("help,h", "print usage message")
- ("config,c", value<std::string>(&configFile)->default_value(_TRINITY_REALM_CONFIG), "use <arg> as configuration file")
- ;
- variables_map variablesMap;
- try
- {
- store(command_line_parser(argc, argv).options(all).allow_unregistered().run(), variablesMap);
- notify(variablesMap);
- }
- catch (std::exception& e) {
- std::cerr << e.what() << "\n";
- }
-
- if (variablesMap.count("help")) {
- std::cout << all << "\n";
- }
-
- return variablesMap;
-}
diff --git a/src/server/authserver/PrecompiledHeaders/authPCH.cpp b/src/server/authserver/PrecompiledHeaders/authPCH.cpp
deleted file mode 100644
index eed50cb2c0b..00000000000
--- a/src/server/authserver/PrecompiledHeaders/authPCH.cpp
+++ /dev/null
@@ -1 +0,0 @@
-#include "authPCH.h"
diff --git a/src/server/authserver/PrecompiledHeaders/authPCH.h b/src/server/authserver/PrecompiledHeaders/authPCH.h
deleted file mode 100644
index 90424161344..00000000000
--- a/src/server/authserver/PrecompiledHeaders/authPCH.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "Common.h"
-#include "Configuration/Config.h"
-#include "Database/DatabaseEnv.h"
-#include "Log.h"
-#include "RealmList.h"
-#include "ByteBuffer.h"
-#include "AuthSession.h"
diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp
deleted file mode 100644
index 15302c74ac6..00000000000
--- a/src/server/authserver/Realms/RealmList.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <boost/asio/ip/tcp.hpp>
-#include "Common.h"
-#include "RealmList.h"
-#include "Database/DatabaseEnv.h"
-#include "Util.h"
-
-ip::tcp::endpoint Realm::GetAddressForClient(ip::address const& clientAddr) const
-{
- ip::address realmIp;
-
- // Attempt to send best address for client
- if (clientAddr.is_loopback())
- {
- // Try guessing if realm is also connected locally
- if (LocalAddress.is_loopback() || ExternalAddress.is_loopback())
- realmIp = clientAddr;
- else
- {
- // Assume that user connecting from the machine that authserver is located on
- // has all realms available in his local network
- realmIp = LocalAddress;
- }
- }
- else
- {
- if (clientAddr.is_v4() &&
- (clientAddr.to_v4().to_ulong() & LocalSubnetMask.to_v4().to_ulong()) ==
- (LocalAddress.to_v4().to_ulong() & LocalSubnetMask.to_v4().to_ulong()))
- {
- realmIp = LocalAddress;
- }
- else
- realmIp = ExternalAddress;
- }
-
- ip::tcp::endpoint endpoint(realmIp, port);
-
- // Return external IP
- return endpoint;
-}
-
-RealmList::RealmList() : m_UpdateInterval(0), m_NextUpdateTime(time(NULL)), _resolver(nullptr)
-{
-}
-
-RealmList::~RealmList()
-{
- delete _resolver;
-}
-
-// Load the realm list from the database
-void RealmList::Initialize(boost::asio::io_service& ioService, uint32 updateInterval)
-{
- _resolver = new boost::asio::ip::tcp::resolver(ioService);
- m_UpdateInterval = updateInterval;
-
- // Get the content of the realmlist table in the database
- UpdateRealms(true);
-}
-
-void RealmList::UpdateRealm(uint32 id, const std::string& name, ip::address const& address, ip::address const& localAddr,
- ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population, uint32 build)
-{
- // Create new if not exist or update existed
- Realm& realm = m_realms[name];
-
- realm.m_ID = id;
- realm.name = name;
- realm.icon = icon;
- realm.flag = flag;
- realm.timezone = timezone;
- realm.allowedSecurityLevel = allowedSecurityLevel;
- realm.populationLevel = population;
-
- realm.ExternalAddress = address;
- realm.LocalAddress = localAddr;
- realm.LocalSubnetMask = localSubmask;
- realm.port = port;
- realm.gamebuild = build;
-}
-
-void RealmList::UpdateIfNeed()
-{
- // maybe disabled or updated recently
- if (!m_UpdateInterval || m_NextUpdateTime > time(NULL))
- return;
-
- m_NextUpdateTime = time(NULL) + m_UpdateInterval;
-
- // Clears Realm list
- m_realms.clear();
-
- // Get the content of the realmlist table in the database
- UpdateRealms();
-}
-
-void RealmList::UpdateRealms(bool init)
-{
- TC_LOG_INFO("server.authserver", "Updating Realm List...");
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_REALMLIST);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
-
- // Circle through results and add them to the realm map
- if (result)
- {
- do
- {
- try
- {
- boost::asio::ip::tcp::resolver::iterator end;
-
- Field* fields = result->Fetch();
- uint32 realmId = fields[0].GetUInt32();
- std::string name = fields[1].GetString();
- boost::asio::ip::tcp::resolver::query externalAddressQuery(ip::tcp::v4(), fields[2].GetString(), "");
-
- boost::system::error_code ec;
- boost::asio::ip::tcp::resolver::iterator endPoint = _resolver->resolve(externalAddressQuery, ec);
- if (endPoint == end || ec)
- {
- TC_LOG_ERROR("server.authserver", "Could not resolve address %s", fields[2].GetString().c_str());
- return;
- }
-
- ip::address externalAddress = (*endPoint).endpoint().address();
-
- boost::asio::ip::tcp::resolver::query localAddressQuery(ip::tcp::v4(), fields[3].GetString(), "");
- endPoint = _resolver->resolve(localAddressQuery, ec);
- if (endPoint == end || ec)
- {
- TC_LOG_ERROR("server.authserver", "Could not resolve address %s", fields[3].GetString().c_str());
- return;
- }
-
- ip::address localAddress = (*endPoint).endpoint().address();
-
- boost::asio::ip::tcp::resolver::query localSubmaskQuery(ip::tcp::v4(), fields[4].GetString(), "");
- endPoint = _resolver->resolve(localSubmaskQuery, ec);
- if (endPoint == end || ec)
- {
- TC_LOG_ERROR("server.authserver", "Could not resolve address %s", fields[4].GetString().c_str());
- return;
- }
-
- ip::address localSubmask = (*endPoint).endpoint().address();
-
- uint16 port = fields[5].GetUInt16();
- uint8 icon = fields[6].GetUInt8();
- RealmFlags flag = RealmFlags(fields[7].GetUInt8());
- uint8 timezone = fields[8].GetUInt8();
- uint8 allowedSecurityLevel = fields[9].GetUInt8();
- float pop = fields[10].GetFloat();
- uint32 build = fields[11].GetUInt32();
-
- UpdateRealm(realmId, name, externalAddress, localAddress, localSubmask, port, icon, flag, timezone,
- (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build);
-
- if (init)
- TC_LOG_INFO("server.authserver", "Added realm \"%s\" at %s:%u.", name.c_str(), m_realms[name].ExternalAddress.to_string().c_str(), port);
- }
- catch (std::exception& ex)
- {
- TC_LOG_ERROR("server.authserver", "Realmlist::UpdateRealms has thrown an exception: %s", ex.what());
- ASSERT(false);
- }
- }
- while (result->NextRow());
- }
-}
diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h
deleted file mode 100644
index 9d5771144a9..00000000000
--- a/src/server/authserver/Realms/RealmList.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _REALMLIST_H
-#define _REALMLIST_H
-
-#include <boost/asio/ip/address.hpp>
-#include <boost/asio/ip/tcp.hpp>
-#include <boost/asio/io_service.hpp>
-#include "Common.h"
-
-using namespace boost::asio;
-
-enum RealmFlags
-{
- REALM_FLAG_NONE = 0x00,
- REALM_FLAG_INVALID = 0x01,
- REALM_FLAG_OFFLINE = 0x02,
- REALM_FLAG_SPECIFYBUILD = 0x04,
- REALM_FLAG_UNK1 = 0x08,
- REALM_FLAG_UNK2 = 0x10,
- REALM_FLAG_RECOMMENDED = 0x20,
- REALM_FLAG_NEW = 0x40,
- REALM_FLAG_FULL = 0x80
-};
-
-// Storage object for a realm
-struct Realm
-{
- ip::address ExternalAddress;
- ip::address LocalAddress;
- ip::address LocalSubnetMask;
- uint16 port;
- std::string name;
- uint8 icon;
- RealmFlags flag;
- uint8 timezone;
- uint32 m_ID;
- AccountTypes allowedSecurityLevel;
- float populationLevel;
- uint32 gamebuild;
-
- ip::tcp::endpoint GetAddressForClient(ip::address const& clientAddr) const;
-};
-
-/// Storage object for the list of realms on the server
-class RealmList
-{
-public:
- typedef std::map<std::string, Realm> RealmMap;
-
- static RealmList* instance()
- {
- static RealmList instance;
- return &instance;
- }
-
- ~RealmList();
-
- void Initialize(boost::asio::io_service& ioService, uint32 updateInterval);
-
- void UpdateIfNeed();
-
- void AddRealm(const Realm& NewRealm) { m_realms[NewRealm.name] = NewRealm; }
-
- RealmMap::const_iterator begin() const { return m_realms.begin(); }
- RealmMap::const_iterator end() const { return m_realms.end(); }
- uint32 size() const { return m_realms.size(); }
-
-private:
- RealmList();
-
- void UpdateRealms(bool init = false);
- void UpdateRealm(uint32 id, const std::string& name, ip::address const& address, ip::address const& localAddr,
- ip::address const& localSubmask, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float population, uint32 build);
-
- RealmMap m_realms;
- uint32 m_UpdateInterval;
- time_t m_NextUpdateTime;
- boost::asio::ip::tcp::resolver* _resolver;
-};
-
-#define sRealmList RealmList::instance()
-#endif
diff --git a/src/server/authserver/Server/AuthSession.cpp b/src/server/authserver/Server/AuthSession.cpp
deleted file mode 100644
index 248010ef112..00000000000
--- a/src/server/authserver/Server/AuthSession.cpp
+++ /dev/null
@@ -1,902 +0,0 @@
-/*
-* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
-* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
-*
-* This program is free software; you can redistribute it and/or modify it
-* under the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the License, or (at your
-* option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but WITHOUT
-* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-* more details.
-*
-* You should have received a copy of the GNU General Public License along
-* with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "AuthSession.h"
-#include "Log.h"
-#include "AuthCodes.h"
-#include "Database/DatabaseEnv.h"
-#include "SHA1.h"
-#include "TOTP.h"
-#include "openssl/crypto.h"
-#include "Configuration/Config.h"
-#include "RealmList.h"
-#include <boost/lexical_cast.hpp>
-
-using boost::asio::ip::tcp;
-
-enum eAuthCmd
-{
- AUTH_LOGON_CHALLENGE = 0x00,
- AUTH_LOGON_PROOF = 0x01,
- AUTH_RECONNECT_CHALLENGE = 0x02,
- AUTH_RECONNECT_PROOF = 0x03,
- REALM_LIST = 0x10,
- XFER_INITIATE = 0x30,
- XFER_DATA = 0x31,
- XFER_ACCEPT = 0x32,
- XFER_RESUME = 0x33,
- XFER_CANCEL = 0x34
-};
-
-enum eStatus
-{
- STATUS_CONNECTED = 0,
- STATUS_AUTHED
-};
-
-#pragma pack(push, 1)
-
-typedef struct AUTH_LOGON_CHALLENGE_C
-{
- uint8 cmd;
- uint8 error;
- uint16 size;
- uint8 gamename[4];
- uint8 version1;
- uint8 version2;
- uint8 version3;
- uint16 build;
- uint8 platform[4];
- uint8 os[4];
- uint8 country[4];
- uint32 timezone_bias;
- uint32 ip;
- uint8 I_len;
- uint8 I[1];
-} sAuthLogonChallenge_C;
-
-typedef struct AUTH_LOGON_PROOF_C
-{
- uint8 cmd;
- uint8 A[32];
- uint8 M1[20];
- uint8 crc_hash[20];
- uint8 number_of_keys;
- uint8 securityFlags;
-} sAuthLogonProof_C;
-
-typedef struct AUTH_LOGON_PROOF_S
-{
- uint8 cmd;
- uint8 error;
- uint8 M2[20];
- uint32 AccountFlags;
- uint32 SurveyId;
- uint16 unk3;
-} sAuthLogonProof_S;
-
-typedef struct AUTH_LOGON_PROOF_S_OLD
-{
- uint8 cmd;
- uint8 error;
- uint8 M2[20];
- uint32 unk2;
-} sAuthLogonProof_S_Old;
-
-typedef struct AUTH_RECONNECT_PROOF_C
-{
- uint8 cmd;
- uint8 R1[16];
- uint8 R2[20];
- uint8 R3[20];
- uint8 number_of_keys;
-} sAuthReconnectProof_C;
-
-#pragma pack(pop)
-
-enum class BufferSizes : uint32
-{
- SRP_6_V = 0x20,
- SRP_6_S = 0x20,
-};
-
-#define AUTH_LOGON_CHALLENGE_INITIAL_SIZE 4
-#define REALM_LIST_PACKET_SIZE 5
-#define XFER_ACCEPT_SIZE 1
-#define XFER_RESUME_SIZE 9
-#define XFER_CANCEL_SIZE 1
-
-std::unordered_map<uint8, AuthHandler> AuthSession::InitHandlers()
-{
- std::unordered_map<uint8, AuthHandler> handlers;
-
- handlers[AUTH_LOGON_CHALLENGE] = { STATUS_CONNECTED, AUTH_LOGON_CHALLENGE_INITIAL_SIZE, &AuthSession::HandleLogonChallenge };
- handlers[AUTH_LOGON_PROOF] = { STATUS_CONNECTED, sizeof(AUTH_LOGON_PROOF_C), &AuthSession::HandleLogonProof };
- handlers[AUTH_RECONNECT_CHALLENGE] = { STATUS_CONNECTED, AUTH_LOGON_CHALLENGE_INITIAL_SIZE, &AuthSession::HandleReconnectChallenge };
- handlers[AUTH_RECONNECT_PROOF] = { STATUS_CONNECTED, sizeof(AUTH_RECONNECT_PROOF_C), &AuthSession::HandleReconnectProof };
- handlers[REALM_LIST] = { STATUS_AUTHED, REALM_LIST_PACKET_SIZE, &AuthSession::HandleRealmList };
- handlers[XFER_ACCEPT] = { STATUS_AUTHED, XFER_ACCEPT_SIZE, &AuthSession::HandleXferAccept };
- handlers[XFER_RESUME] = { STATUS_AUTHED, XFER_RESUME_SIZE, &AuthSession::HandleXferResume };
- handlers[XFER_CANCEL] = { STATUS_AUTHED, XFER_CANCEL_SIZE, &AuthSession::HandleXferCancel };
-
- return handlers;
-}
-
-std::unordered_map<uint8, AuthHandler> const Handlers = AuthSession::InitHandlers();
-
-void AuthSession::ReadHandler()
-{
- MessageBuffer& packet = GetReadBuffer();
- while (packet.GetActiveSize())
- {
- uint8 cmd = packet.GetReadPointer()[0];
- auto itr = Handlers.find(cmd);
- if (itr == Handlers.end())
- {
- // well we dont handle this, lets just ignore it
- packet.Reset();
- break;
- }
-
- uint16 size = uint16(itr->second.packetSize);
- if (packet.GetActiveSize() < size)
- break;
-
- if (cmd == AUTH_LOGON_CHALLENGE || cmd == AUTH_RECONNECT_CHALLENGE)
- {
- sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(packet.GetReadPointer());
- size += challenge->size;
- }
-
- if (packet.GetActiveSize() < size)
- break;
-
- if (!(*this.*Handlers.at(cmd).handler)())
- {
- CloseSocket();
- return;
- }
-
- packet.ReadCompleted(size);
- }
-
- AsyncRead();
-}
-
-void AuthSession::SendPacket(ByteBuffer& packet)
-{
- if (!IsOpen())
- return;
-
- if (!packet.empty())
- {
- MessageBuffer buffer;
- buffer.Write(packet.contents(), packet.size());
-
- std::unique_lock<std::mutex> guard(_writeLock);
-
- QueuePacket(std::move(buffer), guard);
- }
-}
-
-bool AuthSession::HandleLogonChallenge()
-{
- sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(GetReadBuffer().GetReadPointer());
-
- //TC_LOG_DEBUG("server.authserver", "[AuthChallenge] got full packet, %#04x bytes", challenge->size);
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] name(%d): '%s'", challenge->I_len, challenge->I);
-
- ByteBuffer pkt;
-
- _login.assign((const char*)challenge->I, challenge->I_len);
- _build = challenge->build;
- _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG));
- _os = (const char*)challenge->os;
-
- if (_os.size() > 4)
- return false;
-
- // Restore string order as its byte order is reversed
- std::reverse(_os.begin(), _os.end());
-
- pkt << uint8(AUTH_LOGON_CHALLENGE);
- pkt << uint8(0x00);
-
- // Verify that this IP is not in the ip_banned table
- LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS));
-
- std::string ipAddress = GetRemoteIpAddress().to_string();
- uint16 port = GetRemotePort();
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_BANNED);
- stmt->setString(0, ipAddress);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
- if (result)
- {
- pkt << uint8(WOW_FAIL_BANNED);
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Banned ip tries to login!", ipAddress.c_str(), port);
- }
- else
- {
- // Get the account details from the account table
- // No SQL injection (prepared statement)
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGONCHALLENGE);
- stmt->setString(0, _login);
-
- PreparedQueryResult res2 = LoginDatabase.Query(stmt);
- if (res2)
- {
- Field* fields = res2->Fetch();
-
- // If the IP is 'locked', check that the player comes indeed from the correct IP address
- bool locked = false;
- if (fields[2].GetUInt8() == 1) // if ip is locked
- {
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[4].GetCString());
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Player address is '%s'", ipAddress.c_str());
-
- if (strcmp(fields[4].GetCString(), ipAddress.c_str()) != 0)
- {
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account IP differs");
- pkt << uint8(WOW_FAIL_LOCKED_ENFORCED);
- locked = true;
- }
- else
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account IP matches");
- }
- else
- {
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to ip", _login.c_str());
- std::string accountCountry = fields[3].GetString();
- if (accountCountry.empty() || accountCountry == "00")
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to country", _login.c_str());
- else if (!accountCountry.empty())
- {
- uint32 ip = inet_addr(ipAddress.c_str());
- EndianConvertReverse(ip);
-
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_LOGON_COUNTRY);
- stmt->setUInt32(0, ip);
- if (PreparedQueryResult sessionCountryQuery = LoginDatabase.Query(stmt))
- {
- std::string loginCountry = (*sessionCountryQuery)[0].GetString();
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to country: '%s' Player country is '%s'", _login.c_str(),
- accountCountry.c_str(), loginCountry.c_str());
-
- if (loginCountry != accountCountry)
- {
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account country differs.");
- pkt << uint8(WOW_FAIL_UNLOCKABLE_LOCK);
- locked = true;
- }
- else
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account country matches");
- }
- else
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] IP2NATION Table empty");
- }
- }
-
- if (!locked)
- {
- //set expired bans to inactive
- LoginDatabase.DirectExecute(LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS));
-
- // If the account is banned, reject the logon attempt
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_BANNED);
- stmt->setUInt32(0, fields[1].GetUInt32());
- PreparedQueryResult banresult = LoginDatabase.Query(stmt);
- if (banresult)
- {
- if ((*banresult)[0].GetUInt32() == (*banresult)[1].GetUInt32())
- {
- pkt << uint8(WOW_FAIL_BANNED);
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Banned account %s tried to login!", ipAddress.c_str(),
- port, _login.c_str());
- }
- else
- {
- pkt << uint8(WOW_FAIL_SUSPENDED);
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!",
- ipAddress.c_str(), port, _login.c_str());
- }
- }
- else
- {
- // Get the password from the account table, upper it, and make the SRP6 calculation
- std::string rI = fields[0].GetString();
-
- // Don't calculate (v, s) if there are already some in the database
- std::string databaseV = fields[6].GetString();
- std::string databaseS = fields[7].GetString();
-
- TC_LOG_DEBUG("network", "database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str());
-
- // multiply with 2 since bytes are stored as hexstring
- if (databaseV.size() != size_t(BufferSizes::SRP_6_V) * 2 || databaseS.size() != size_t(BufferSizes::SRP_6_S) * 2)
- SetVSFields(rI);
- else
- {
- s.SetHexStr(databaseS.c_str());
- v.SetHexStr(databaseV.c_str());
- }
-
- b.SetRand(19 * 8);
- BigNumber gmod = g.ModExp(b, N);
- B = ((v * 3) + gmod) % N;
-
- ASSERT(gmod.GetNumBytes() <= 32);
-
- BigNumber unk3;
- unk3.SetRand(16 * 8);
-
- // Fill the response packet with the result
- if (fields[9].GetUInt32() && AuthHelper::IsBuildSupportingBattlenet(_build))
- pkt << uint8(WOW_FAIL_USE_BATTLENET);
- else if (AuthHelper::IsAcceptedClientBuild(_build))
- pkt << uint8(WOW_SUCCESS);
- else
- pkt << uint8(WOW_FAIL_VERSION_INVALID);
-
- // B may be calculated < 32B so we force minimal length to 32B
- pkt.append(B.AsByteArray(32).get(), 32); // 32 bytes
- pkt << uint8(1);
- pkt.append(g.AsByteArray(1).get(), 1);
- pkt << uint8(32);
- pkt.append(N.AsByteArray(32).get(), 32);
- pkt.append(s.AsByteArray(int32(BufferSizes::SRP_6_S)).get(), size_t(BufferSizes::SRP_6_S)); // 32 bytes
- pkt.append(unk3.AsByteArray(16).get(), 16);
- uint8 securityFlags = 0;
-
- // Check if token is used
- _tokenKey = fields[8].GetString();
- if (!_tokenKey.empty())
- securityFlags = 4;
-
- pkt << uint8(securityFlags); // security flags (0x0...0x04)
-
- if (securityFlags & 0x01) // PIN input
- {
- pkt << uint32(0);
- pkt << uint64(0) << uint64(0); // 16 bytes hash?
- }
-
- if (securityFlags & 0x02) // Matrix input
- {
- pkt << uint8(0);
- pkt << uint8(0);
- pkt << uint8(0);
- pkt << uint8(0);
- pkt << uint64(0);
- }
-
- if (securityFlags & 0x04) // Security token input
- pkt << uint8(1);
-
- uint8 secLevel = fields[5].GetUInt8();
- _accountSecurityLevel = secLevel <= SEC_ADMINISTRATOR ? AccountTypes(secLevel) : SEC_ADMINISTRATOR;
-
- _localizationName.resize(4);
- for (int i = 0; i < 4; ++i)
- _localizationName[i] = challenge->country[4 - i - 1];
-
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)",
- ipAddress.c_str(), port, _login.c_str(),
- challenge->country[3], challenge->country[2], challenge->country[1], challenge->country[0],
- GetLocaleByName(_localizationName)
- );
- }
- }
- }
- else //no account
- pkt << uint8(WOW_FAIL_UNKNOWN_ACCOUNT);
- }
-
- SendPacket(pkt);
- return true;
-}
-
-// Logon Proof command handler
-bool AuthSession::HandleLogonProof()
-{
-
- TC_LOG_DEBUG("server.authserver", "Entering _HandleLogonProof");
- // Read the packet
- sAuthLogonProof_C *logonProof = reinterpret_cast<sAuthLogonProof_C*>(GetReadBuffer().GetReadPointer());
-
- // If the client has no valid version
- if (_expversion == NO_VALID_EXP_FLAG)
- {
- // Check if we have the appropriate patch on the disk
- TC_LOG_DEBUG("network", "Client with invalid version, patching is not implemented");
- return false;
- }
-
- // Continue the SRP6 calculation based on data received from the client
- BigNumber A;
-
- A.SetBinary(logonProof->A, 32);
-
- // SRP safeguard: abort if A == 0
- if (A.IsZero())
- {
- return false;
- }
-
- SHA1Hash sha;
- sha.UpdateBigNumbers(&A, &B, NULL);
- sha.Finalize();
- BigNumber u;
- u.SetBinary(sha.GetDigest(), 20);
- BigNumber S = (A * (v.ModExp(u, N))).ModExp(b, N);
-
- uint8 t[32];
- uint8 t1[16];
- uint8 vK[40];
- memcpy(t, S.AsByteArray(32).get(), 32);
-
- for (int i = 0; i < 16; ++i)
- t1[i] = t[i * 2];
-
- sha.Initialize();
- sha.UpdateData(t1, 16);
- sha.Finalize();
-
- for (int i = 0; i < 20; ++i)
- vK[i * 2] = sha.GetDigest()[i];
-
- for (int i = 0; i < 16; ++i)
- t1[i] = t[i * 2 + 1];
-
- sha.Initialize();
- sha.UpdateData(t1, 16);
- sha.Finalize();
-
- for (int i = 0; i < 20; ++i)
- vK[i * 2 + 1] = sha.GetDigest()[i];
-
- K.SetBinary(vK, 40);
-
- uint8 hash[20];
-
- sha.Initialize();
- sha.UpdateBigNumbers(&N, NULL);
- sha.Finalize();
- memcpy(hash, sha.GetDigest(), 20);
- sha.Initialize();
- sha.UpdateBigNumbers(&g, NULL);
- sha.Finalize();
-
- for (int i = 0; i < 20; ++i)
- hash[i] ^= sha.GetDigest()[i];
-
- BigNumber t3;
- t3.SetBinary(hash, 20);
-
- sha.Initialize();
- sha.UpdateData(_login);
- sha.Finalize();
- uint8 t4[SHA_DIGEST_LENGTH];
- memcpy(t4, sha.GetDigest(), SHA_DIGEST_LENGTH);
-
- sha.Initialize();
- sha.UpdateBigNumbers(&t3, NULL);
- sha.UpdateData(t4, SHA_DIGEST_LENGTH);
- sha.UpdateBigNumbers(&s, &A, &B, &K, NULL);
- sha.Finalize();
- BigNumber M;
- M.SetBinary(sha.GetDigest(), sha.GetLength());
-
- // Check if SRP6 results match (password is correct), else send an error
- if (!memcmp(M.AsByteArray(sha.GetLength()).get(), logonProof->M1, 20))
- {
- TC_LOG_DEBUG("server.authserver", "'%s:%d' User '%s' successfully authenticated", GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str());
-
- // Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account
- PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGONPROOF);
- stmt->setString(0, K.AsHexStr());
- stmt->setString(1, GetRemoteIpAddress().to_string().c_str());
- stmt->setUInt32(2, GetLocaleByName(_localizationName));
- stmt->setString(3, _os);
- stmt->setString(4, _login);
- LoginDatabase.DirectExecute(stmt);
-
- // Finish SRP6 and send the final result to the client
- sha.Initialize();
- sha.UpdateBigNumbers(&A, &M, &K, NULL);
- sha.Finalize();
-
- // Check auth token
- if ((logonProof->securityFlags & 0x04) || !_tokenKey.empty())
- {
- uint8 size = *(GetReadBuffer().GetReadPointer() + sizeof(sAuthLogonProof_C));
- std::string token(reinterpret_cast<char*>(GetReadBuffer().GetReadPointer() + sizeof(sAuthLogonProof_C) + sizeof(size)), size);
- GetReadBuffer().ReadCompleted(sizeof(size) + size);
- uint32 validToken = TOTP::GenerateToken(_tokenKey.c_str());
- uint32 incomingToken = atoi(token.c_str());
- if (validToken != incomingToken)
- {
- ByteBuffer packet;
- packet << uint8(AUTH_LOGON_PROOF);
- packet << uint8(WOW_FAIL_UNKNOWN_ACCOUNT);
- packet << uint8(3);
- packet << uint8(0);
- SendPacket(packet);
- return false;
- }
- }
-
- ByteBuffer packet;
- if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
- {
- sAuthLogonProof_S proof;
- memcpy(proof.M2, sha.GetDigest(), 20);
- proof.cmd = AUTH_LOGON_PROOF;
- proof.error = 0;
- proof.AccountFlags = GAMEACCOUNT_FLAG_PROPASS_LOCK;
- proof.SurveyId = 0;
- proof.unk3 = 0;
-
- packet.resize(sizeof(proof));
- std::memcpy(packet.contents(), &proof, sizeof(proof));
- }
- else
- {
- sAuthLogonProof_S_Old proof;
- memcpy(proof.M2, sha.GetDigest(), 20);
- proof.cmd = AUTH_LOGON_PROOF;
- proof.error = 0;
- proof.unk2 = 0x00;
-
- packet.resize(sizeof(proof));
- std::memcpy(packet.contents(), &proof, sizeof(proof));
- }
-
- SendPacket(packet);
- _isAuthenticated = true;
- }
- else
- {
- ByteBuffer packet;
- packet << uint8(AUTH_LOGON_PROOF);
- packet << uint8(WOW_FAIL_UNKNOWN_ACCOUNT);
- packet << uint8(3);
- packet << uint8(0);
- SendPacket(packet);
-
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!",
- GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str());
-
- uint32 MaxWrongPassCount = sConfigMgr->GetIntDefault("WrongPass.MaxCount", 0);
-
- // We can not include the failed account login hook. However, this is a workaround to still log this.
- if (sConfigMgr->GetBoolDefault("Wrong.Password.Login.Logging", false))
- {
- PreparedStatement* logstmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_FALP_IP_LOGGING);
- logstmt->setString(0, _login);
- logstmt->setString(1, GetRemoteIpAddress().to_string());
- logstmt->setString(2, "Logged on failed AccountLogin due wrong password");
-
- LoginDatabase.Execute(logstmt);
- }
-
- if (MaxWrongPassCount > 0)
- {
- //Increment number of failed logins by one and if it reaches the limit temporarily ban that account or IP
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_FAILEDLOGINS);
- stmt->setString(0, _login);
- LoginDatabase.Execute(stmt);
-
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_FAILEDLOGINS);
- stmt->setString(0, _login);
-
- if (PreparedQueryResult loginfail = LoginDatabase.Query(stmt))
- {
- uint32 failed_logins = (*loginfail)[1].GetUInt32();
-
- if (failed_logins >= MaxWrongPassCount)
- {
- uint32 WrongPassBanTime = sConfigMgr->GetIntDefault("WrongPass.BanTime", 600);
- bool WrongPassBanType = sConfigMgr->GetBoolDefault("WrongPass.BanType", false);
-
- if (WrongPassBanType)
- {
- uint32 acc_id = (*loginfail)[0].GetUInt32();
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED);
- stmt->setUInt32(0, acc_id);
- stmt->setUInt32(1, WrongPassBanTime);
- LoginDatabase.Execute(stmt);
-
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times",
- GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str(), WrongPassBanTime, failed_logins);
- }
- else
- {
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_IP_AUTO_BANNED);
- stmt->setString(0, GetRemoteIpAddress().to_string());
- stmt->setUInt32(1, WrongPassBanTime);
- LoginDatabase.Execute(stmt);
-
- TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] IP got banned for '%u' seconds because account %s failed to authenticate '%u' times",
- GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), WrongPassBanTime, _login.c_str(), failed_logins);
- }
- }
- }
- }
- }
-
- return true;
-}
-
-bool AuthSession::HandleReconnectChallenge()
-{
- TC_LOG_DEBUG("server.authserver", "Entering _HandleReconnectChallenge");
- sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(GetReadBuffer().GetReadPointer());
-
- //TC_LOG_DEBUG("server.authserver", "[AuthChallenge] got full packet, %#04x bytes", challenge->size);
- TC_LOG_DEBUG("server.authserver", "[AuthChallenge] name(%d): '%s'", challenge->I_len, challenge->I);
-
- _login.assign((const char*)challenge->I, challenge->I_len);
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_SESSIONKEY);
- stmt->setString(0, _login);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
-
- // Stop if the account is not found
- if (!result)
- {
- TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login and we cannot find his session key in the database.",
- GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _login.c_str());
- return false;
- }
-
- // Reinitialize build, expansion and the account securitylevel
- _build = challenge->build;
- _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG));
- _os = (const char*)challenge->os;
-
- if (_os.size() > 4)
- return false;
-
- // Restore string order as its byte order is reversed
- std::reverse(_os.begin(), _os.end());
-
- Field* fields = result->Fetch();
- uint8 secLevel = fields[2].GetUInt8();
- _accountSecurityLevel = secLevel <= SEC_ADMINISTRATOR ? AccountTypes(secLevel) : SEC_ADMINISTRATOR;
-
- K.SetHexStr((*result)[0].GetCString());
-
- // Sending response
- ByteBuffer pkt;
- pkt << uint8(AUTH_RECONNECT_CHALLENGE);
- pkt << uint8(0x00);
- _reconnectProof.SetRand(16 * 8);
- pkt.append(_reconnectProof.AsByteArray(16).get(), 16); // 16 bytes random
- pkt << uint64(0x00) << uint64(0x00); // 16 bytes zeros
-
- SendPacket(pkt);
-
- return true;
-}
-bool AuthSession::HandleReconnectProof()
-{
- TC_LOG_DEBUG("server.authserver", "Entering _HandleReconnectProof");
- sAuthReconnectProof_C *reconnectProof = reinterpret_cast<sAuthReconnectProof_C*>(GetReadBuffer().GetReadPointer());
-
- if (_login.empty() || !_reconnectProof.GetNumBytes() || !K.GetNumBytes())
- return false;
-
- BigNumber t1;
- t1.SetBinary(reconnectProof->R1, 16);
-
- SHA1Hash sha;
- sha.Initialize();
- sha.UpdateData(_login);
- sha.UpdateBigNumbers(&t1, &_reconnectProof, &K, NULL);
- sha.Finalize();
-
- if (!memcmp(sha.GetDigest(), reconnectProof->R2, SHA_DIGEST_LENGTH))
- {
- // Sending response
- ByteBuffer pkt;
- pkt << uint8(AUTH_RECONNECT_PROOF);
- pkt << uint8(0x00);
- pkt << uint16(0x00); // 2 bytes zeros
- SendPacket(pkt);
- _isAuthenticated = true;
- return true;
- }
- else
- {
- TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login, but session is invalid.", GetRemoteIpAddress().to_string().c_str(),
- GetRemotePort(), _login.c_str());
- return false;
- }
-}
-
-bool AuthSession::HandleRealmList()
-{
- TC_LOG_DEBUG("server.authserver", "Entering _HandleRealmList");
-
- // Get the user id (else close the connection)
- // No SQL injection (prepared statement)
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME);
- stmt->setString(0, _login);
- PreparedQueryResult result = LoginDatabase.Query(stmt);
- if (!result)
- {
- TC_LOG_ERROR("server.authserver", "'%s:%d' [ERROR] user %s tried to login but we cannot find him in the database.", GetRemoteIpAddress().to_string().c_str(),
- GetRemotePort(), _login.c_str());
- return false;
- }
-
- Field* fields = result->Fetch();
- uint32 id = fields[0].GetUInt32();
-
- // Update realm list if need
- sRealmList->UpdateIfNeed();
-
- // Circle through realms in the RealmList and construct the return packet (including # of user characters in each realm)
- ByteBuffer pkt;
-
- size_t RealmListSize = 0;
- for (RealmList::RealmMap::const_iterator i = sRealmList->begin(); i != sRealmList->end(); ++i)
- {
- const Realm &realm = i->second;
- // don't work with realms which not compatible with the client
- bool okBuild = ((_expversion & POST_BC_EXP_FLAG) && realm.gamebuild == _build) || ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(realm.gamebuild));
-
- // No SQL injection. id of realm is controlled by the database.
- uint32 flag = realm.flag;
- RealmBuildInfo const* buildInfo = AuthHelper::GetBuildInfo(realm.gamebuild);
- if (!okBuild)
- {
- if (!buildInfo)
- continue;
-
- flag |= REALM_FLAG_OFFLINE | REALM_FLAG_SPECIFYBUILD; // tell the client what build the realm is for
- }
-
- if (!buildInfo)
- flag &= ~REALM_FLAG_SPECIFYBUILD;
-
- std::string name = i->first;
- if (_expversion & PRE_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD)
- {
- std::ostringstream ss;
- ss << name << " (" << buildInfo->MajorVersion << '.' << buildInfo->MinorVersion << '.' << buildInfo->BugfixVersion << ')';
- name = ss.str();
- }
-
- uint8 lock = (realm.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0;
-
- uint8 AmountOfCharacters = 0;
- stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_NUM_CHARS_ON_REALM);
- stmt->setUInt32(0, realm.m_ID);
- stmt->setUInt32(1, id);
- result = LoginDatabase.Query(stmt);
- if (result)
- AmountOfCharacters = (*result)[0].GetUInt8();
-
- pkt << realm.icon; // realm type
- if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients
- pkt << lock; // if 1, then realm locked
- pkt << uint8(flag); // RealmFlags
- pkt << name;
- pkt << boost::lexical_cast<std::string>(realm.GetAddressForClient(GetRemoteIpAddress()));
- pkt << realm.populationLevel;
- pkt << AmountOfCharacters;
- pkt << realm.timezone; // realm category
- if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
- pkt << uint8(realm.m_ID);
- else
- pkt << uint8(0x0); // 1.12.1 and 1.12.2 clients
-
- if (_expversion & POST_BC_EXP_FLAG && flag & REALM_FLAG_SPECIFYBUILD)
- {
- pkt << uint8(buildInfo->MajorVersion);
- pkt << uint8(buildInfo->MinorVersion);
- pkt << uint8(buildInfo->BugfixVersion);
- pkt << uint16(buildInfo->Build);
- }
-
- ++RealmListSize;
- }
-
- if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
- {
- pkt << uint8(0x10);
- pkt << uint8(0x00);
- }
- else // 1.12.1 and 1.12.2 clients
- {
- pkt << uint8(0x00);
- pkt << uint8(0x02);
- }
-
- // make a ByteBuffer which stores the RealmList's size
- ByteBuffer RealmListSizeBuffer;
- RealmListSizeBuffer << uint32(0);
- if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients
- RealmListSizeBuffer << uint16(RealmListSize);
- else
- RealmListSizeBuffer << uint32(RealmListSize);
-
- ByteBuffer hdr;
- hdr << uint8(REALM_LIST);
- hdr << uint16(pkt.size() + RealmListSizeBuffer.size());
- hdr.append(RealmListSizeBuffer); // append RealmList's size buffer
- hdr.append(pkt); // append realms in the realmlist
- SendPacket(hdr);
- return true;
-}
-
-// Resume patch transfer
-bool AuthSession::HandleXferResume()
-{
- TC_LOG_DEBUG("server.authserver", "Entering _HandleXferResume");
- //uint8
- //uint64
- return true;
-}
-
-// Cancel patch transfer
-bool AuthSession::HandleXferCancel()
-{
- TC_LOG_DEBUG("server.authserver", "Entering _HandleXferCancel");
- //uint8
- return false;
-}
-
-// Accept patch transfer
-bool AuthSession::HandleXferAccept()
-{
- TC_LOG_DEBUG("server.authserver", "Entering _HandleXferAccept");
- //uint8
- return true;
-}
-
-// Make the SRP6 calculation from hash in dB
-void AuthSession::SetVSFields(const std::string& rI)
-{
- s.SetRand(int32(BufferSizes::SRP_6_S) * 8);
-
- BigNumber I;
- I.SetHexStr(rI.c_str());
-
- // In case of leading zeros in the rI hash, restore them
- uint8 mDigest[SHA_DIGEST_LENGTH];
- memcpy(mDigest, I.AsByteArray(SHA_DIGEST_LENGTH).get(), SHA_DIGEST_LENGTH);
-
- std::reverse(mDigest, mDigest + SHA_DIGEST_LENGTH);
-
- SHA1Hash sha;
- sha.UpdateData(s.AsByteArray(uint32(BufferSizes::SRP_6_S)).get(), (uint32(BufferSizes::SRP_6_S)));
- sha.UpdateData(mDigest, SHA_DIGEST_LENGTH);
- sha.Finalize();
- BigNumber x;
- x.SetBinary(sha.GetDigest(), sha.GetLength());
- v = g.ModExp(x, N);
-
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_VS);
- stmt->setString(0, v.AsHexStr());
- stmt->setString(1, s.AsHexStr());
- stmt->setString(2, _login);
- LoginDatabase.Execute(stmt);
-}
diff --git a/src/server/authserver/Server/AuthSession.h b/src/server/authserver/Server/AuthSession.h
deleted file mode 100644
index 07af61d9c1d..00000000000
--- a/src/server/authserver/Server/AuthSession.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
-* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
-*
-* This program is free software; you can redistribute it and/or modify it
-* under the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the License, or (at your
-* option) any later version.
-*
-* This program is distributed in the hope that it will be useful, but WITHOUT
-* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-* more details.
-*
-* You should have received a copy of the GNU General Public License along
-* with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __AUTHSESSION_H__
-#define __AUTHSESSION_H__
-
-#include "Common.h"
-#include "ByteBuffer.h"
-#include "Socket.h"
-#include "BigNumber.h"
-#include <memory>
-#include <boost/asio/ip/tcp.hpp>
-
-using boost::asio::ip::tcp;
-
-struct AuthHandler;
-
-class AuthSession : public Socket<AuthSession>
-{
-public:
- static std::unordered_map<uint8, AuthHandler> InitHandlers();
-
- AuthSession(tcp::socket&& socket) : Socket(std::move(socket)),
- _isAuthenticated(false), _build(0), _expversion(0), _accountSecurityLevel(SEC_PLAYER)
- {
- N.SetHexStr("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7");
- g.SetDword(7);
- }
-
- void Start() override
- {
- AsyncRead();
- }
-
- void SendPacket(ByteBuffer& packet);
-
-protected:
- void ReadHandler() override;
-
-private:
- bool HandleLogonChallenge();
- bool HandleLogonProof();
- bool HandleReconnectChallenge();
- bool HandleReconnectProof();
- bool HandleRealmList();
-
- //data transfer handle for patch
- bool HandleXferResume();
- bool HandleXferCancel();
- bool HandleXferAccept();
-
- void SetVSFields(const std::string& rI);
-
- BigNumber N, s, g, v;
- BigNumber b, B;
- BigNumber K;
- BigNumber _reconnectProof;
-
- bool _isAuthenticated;
- std::string _tokenKey;
- std::string _login;
- std::string _localizationName;
- std::string _os;
- uint16 _build;
- uint8 _expversion;
-
- AccountTypes _accountSecurityLevel;
-};
-
-#pragma pack(push, 1)
-
-struct AuthHandler
-{
- uint32 status;
- size_t packetSize;
- bool (AuthSession::*handler)();
-};
-
-#pragma pack(pop)
-
-#endif
diff --git a/src/server/authserver/Server/AuthSocketMgr.h b/src/server/authserver/Server/AuthSocketMgr.h
deleted file mode 100644
index a14ee26ed56..00000000000
--- a/src/server/authserver/Server/AuthSocketMgr.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef AuthSocketMgr_h__
-#define AuthSocketMgr_h__
-
-#include "SocketMgr.h"
-#include "AuthSession.h"
-
-void OnSocketAccept(tcp::socket&& sock);
-
-class AuthSocketMgr : public SocketMgr<AuthSession>
-{
- typedef SocketMgr<AuthSession> BaseSocketMgr;
-
-public:
- static AuthSocketMgr& Instance()
- {
- static AuthSocketMgr instance;
- return instance;
- }
-
- bool StartNetwork(boost::asio::io_service& service, std::string const& bindIp, uint16 port) override
- {
- if (!BaseSocketMgr::StartNetwork(service, bindIp, port))
- return false;
-
- _acceptor->AsyncAcceptManaged(&OnSocketAccept);
- return true;
- }
-
-protected:
- NetworkThread<AuthSession>* CreateThreads() const override
- {
- return new NetworkThread<AuthSession>[1];
- }
-};
-
-#define sAuthSocketMgr AuthSocketMgr::Instance()
-
-void OnSocketAccept(tcp::socket&& sock)
-{
- sAuthSocketMgr.OnSocketOpen(std::forward<tcp::socket>(sock));
-}
-
-
-#endif // AuthSocketMgr_h__
diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist
deleted file mode 100644
index b7dee9ac08b..00000000000
--- a/src/server/authserver/authserver.conf.dist
+++ /dev/null
@@ -1,250 +0,0 @@
-###############################################
-# Trinity Core Auth Server configuration file #
-###############################################
-[authserver]
-
-###################################################################################################
-# SECTION INDEX
-#
-# EXAMPLE CONFIG
-# AUTH SERVER SETTINGS
-# MYSQL SETTINGS
-# LOGGING SYSTEM SETTINGS
-#
-###################################################################################################
-
-###################################################################################################
-# EXAMPLE CONFIG
-#
-# Variable
-# Description: Brief description what the variable is doing.
-# Important: Annotation for important things about this variable.
-# Example: "Example, i.e. if the value is a string"
-# Default: 10 - (Enabled|Comment|Variable name in case of grouped config options)
-# 0 - (Disabled|Comment|Variable name in case of grouped config options)
-#
-# Note to developers:
-# - Copy this example to keep the formatting.
-# - Line breaks should be at column 100.
-###################################################################################################
-
-###################################################################################################
-# AUTH SERVER SETTINGS
-#
-# LogsDir
-# Description: Logs directory setting.
-# Important: LogsDir needs to be quoted, as the string might contain space characters.
-# Logs directory must exists, or log file creation will be disabled.
-# Default: "" - (Log files will be stored in the current path)
-
-LogsDir = ""
-
-#
-# MaxPingTime
-# Description: Time (in minutes) between database pings.
-# Default: 30
-
-MaxPingTime = 30
-
-#
-# RealmServerPort
-# Description: TCP port to reach the auth server.
-# Default: 3724
-
-RealmServerPort = 3724
-
-#
-#
-# BindIP
-# Description: Bind auth server to IP/hostname
-# Default: "0.0.0.0" - (Bind to all IPs on the system)
-
-BindIP = "0.0.0.0"
-
-#
-# PidFile
-# Description: Auth server PID file.
-# Example: "./authserver.pid" - (Enabled)
-# Default: "" - (Disabled)
-
-PidFile = ""
-
-#
-# UseProcessors
-# Description: Processors mask for Windows and Linux based multi-processor systems.
-# Example: A computer with 2 CPUs:
-# 1 - 1st CPU only, 2 - 2nd CPU only, 3 - 1st and 2nd CPU, because 1 | 2 is 3
-# Default: 0 - (Selected by OS)
-# 1+ - (Bit mask value of selected processors)
-
-UseProcessors = 0
-
-#
-# ProcessPriority
-# Description: Process priority setting for Windows and Linux based systems.
-# Details: On Linux, a nice value of -15 is used. (requires superuser). On Windows, process is set to HIGH class.
-# Default: 0 - (Normal)
-# 1 - (High)
-
-ProcessPriority = 0
-
-#
-# RealmsStateUpdateDelay
-# Description: Time (in seconds) between realm list updates.
-# Default: 20 - (Enabled)
-# 0 - (Disabled)
-
-RealmsStateUpdateDelay = 20
-
-#
-# WrongPass.MaxCount
-# Description: Number of login attemps with wrong password before the account or IP will be
-# banned.
-# Default: 0 - (Disabled)
-# 1+ - (Enabled)
-
-WrongPass.MaxCount = 0
-
-#
-# WrongPass.BanTime
-# Description: Time (in seconds) for banning account or IP for invalid login attempts.
-# Default: 600 - (10 minutes)
-# 0 - (Permanent ban)
-
-WrongPass.BanTime = 600
-
-#
-# WrongPass.BanType
-# Description: Ban type for invalid login attempts.
-# Default: 0 - (Ban IP)
-# 1 - (Ban Account)
-
-WrongPass.BanType = 0
-
-#
-###################################################################################################
-
-###################################################################################################
-# MYSQL SETTINGS
-#
-# LoginDatabaseInfo
-# Description: Database connection settings for the realm server.
-# Example: "hostname;port;username;password;database"
-# ".;somenumber;username;password;database" - (Use named pipes on Windows
-# "enable-named-pipe" to [mysqld]
-# section my.ini)
-# ".;/path/to/unix_socket;username;password;database" - (use Unix sockets on
-# Unix/Linux)
-# Default: "127.0.0.1;3306;trinity;trinity;auth"
-
-LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth"
-
-#
-# LoginDatabase.WorkerThreads
-# Description: The amount of worker threads spawned to handle asynchronous (delayed) MySQL
-# statements. Each worker thread is mirrored with its own connection to the
-# Default: 1
-
-LoginDatabase.WorkerThreads = 1
-
-#
-# Wrong.Password.Login.Logging
-# Description: Additionally log attempted wrong password logging
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-Wrong.Password.Login.Logging = 0
-#
-###################################################################################################
-
-###################################################################################################
-#
-# LOGGING SYSTEM SETTINGS
-#
-# Appender config values: Given a appender "name"
-# Appender.name
-# Description: Defines 'where to log'
-# Format: Type,LogLevel,Flags,optional1,optional2,optional3
-#
-# Type
-# 0 - (None)
-# 1 - (Console)
-# 2 - (File)
-# 3 - (DB)
-#
-# LogLevel
-# 0 - (Disabled)
-# 1 - (Trace)
-# 2 - (Debug)
-# 3 - (Info)
-# 4 - (Warn)
-# 5 - (Error)
-# 6 - (Fatal)
-#
-# Flags:
-# 0 - None
-# 1 - Prefix Timestamp to the text
-# 2 - Prefix Log Level to the text
-# 4 - Prefix Log Filter type to the text
-# 8 - Append timestamp to the log file name. Format: YYYY-MM-DD_HH-MM-SS (Only used with Type = 2)
-# 16 - Make a backup of existing file before overwrite (Only used with Mode = w)
-#
-# Colors (read as optional1 if Type = Console)
-# Format: "fatal error warn info debug trace"
-# 0 - BLACK
-# 1 - RED
-# 2 - GREEN
-# 3 - BROWN
-# 4 - BLUE
-# 5 - MAGENTA
-# 6 - CYAN
-# 7 - GREY
-# 8 - YELLOW
-# 9 - LRED
-# 10 - LGREEN
-# 11 - LBLUE
-# 12 - LMAGENTA
-# 13 - LCYAN
-# 14 - WHITE
-# Example: "13 11 9 5 3 1"
-#
-# File: Name of the file (read as optional1 if Type = File)
-# Allows to use one "%s" to create dynamic files
-#
-# Mode: Mode to open the file (read as optional2 if Type = File)
-# a - (Append)
-# w - (Overwrite)
-#
-# MaxFileSize: Maximum file size of the log file before creating a new log file
-# (read as optional3 if Type = File)
-# Size is measured in bytes expressed in a 64-bit unsigned integer.
-# Maximum value is 4294967295 (4 gb). Leave blank for no limit.
-# NOTE: Does not work with dynamic filenames.
-# Example: 536870912 (512 mb)
-#
-
-Appender.Console=1,2,0
-Appender.Auth=2,2,0,Auth.log,w
-
-# Logger config values: Given a logger "name"
-# Logger.name
-# Description: Defines 'What to log'
-# Format: LogLevel,AppenderList
-#
-# LogLevel
-# 0 - (Disabled)
-# 1 - (Trace)
-# 2 - (Debug)
-# 3 - (Info)
-# 4 - (Warn)
-# 5 - (Error)
-# 6 - (Fatal)
-#
-# AppenderList: List of appenders linked to logger
-# (Using spaces as separator).
-#
-
-Logger.root=3,Console Auth
-
-#
-###################################################################################################
diff --git a/src/server/authserver/authserver.ico b/src/server/authserver/authserver.ico
deleted file mode 100644
index da318f48a8c..00000000000
--- a/src/server/authserver/authserver.ico
+++ /dev/null
Binary files differ
diff --git a/src/server/authserver/authserver.rc b/src/server/authserver/authserver.rc
deleted file mode 100644
index 6ceaa135b42..00000000000
--- a/src/server/authserver/authserver.rc
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "resource.h"
-#include "revision.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "windows.h" //"afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_APPICON ICON "authserver.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-// Neutre (Par défaut système) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUSD)
-#ifdef _WIN32
-LANGUAGE LANG_NEUTRAL, SUBLANG_SYS_DEFAULT
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
-FILEVERSION VER_FILEVERSION
-PRODUCTVERSION VER_PRODUCTVERSION
-
-FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-
-#ifndef _DEBUG
- FILEFLAGS 0
-#else
- #define VER_PRERELEASE VS_FF_PRERELEASE
- #define VER_PRIVATEBUILD VS_FF_PRIVATEBUILD
- #define VER_DEBUG 0
- FILEFLAGS (VER_PRIVATEBUILD|VER_PRERELEASE|VER_DEBUG)
-#endif
-
-FILEOS VOS_NT_WINDOWS32
-FILETYPE VFT_APP
-
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "080004b0"
- BEGIN
- VALUE "CompanyName", VER_COMPANYNAME_STR
- VALUE "FileDescription", "TrinityCore Authentication Server Daemon"
- VALUE "FileVersion", VER_FILEVERSION_STR
- VALUE "InternalName", "authserver"
- VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR
- VALUE "OriginalFilename", "authserver.exe"
- VALUE "ProductName", "TrinityCore Authentication Server"
- VALUE "ProductVersion", VER_PRODUCTVERSION_STR
- END
- END
-
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x800, 1200
- END
-END
-#endif
diff --git a/src/server/authserver/resource.h b/src/server/authserver/resource.h
deleted file mode 100644
index 7dc5cb9ef7b..00000000000
--- a/src/server/authserver/resource.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by TrinityCore.rc
-//
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 101
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/src/server/bnetserver/bnetserver.conf.dist b/src/server/bnetserver/bnetserver.conf.dist
index 102ddb9906a..462bb0cd075 100644
--- a/src/server/bnetserver/bnetserver.conf.dist
+++ b/src/server/bnetserver/bnetserver.conf.dist
@@ -1,7 +1,7 @@
###############################################
# Trinity Core Auth Server configuration file #
###############################################
-[authserver]
+[bnetserver]
###################################################################################################
# SECTION INDEX
@@ -71,7 +71,7 @@ BindIP = "0.0.0.0"
#
# PidFile
# Description: Auth server PID file.
-# Example: "./authserver.pid" - (Enabled)
+# Example: "./bnetserver.pid" - (Enabled)
# Default: "" - (Disabled)
PidFile = ""
diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h
index 17c34a9b42a..650bd998028 100644
--- a/src/server/game/Accounts/RBAC.h
+++ b/src/server/game/Accounts/RBAC.h
@@ -700,6 +700,8 @@ enum RBACPermissions
RBAC_PERM_COMMAND_GUILD_INFO = 794,
RBAC_PERM_COMMAND_INSTANCE_SET_BOSS_STATE = 795,
RBAC_PERM_COMMAND_INSTANCE_GET_BOSS_STATE = 796,
+ RBAC_PERM_COMMAND_PVPSTATS = 797,
+ RBAC_PERM_COMMAND_MODIFY_XP = 798,
// custom permissions 1000+
RBAC_PERM_MAX
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 9a48d19ad2d..01d68b3871b 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -20188,7 +20188,7 @@ void Player::SendAutoRepeatCancel(Unit* target)
{
WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, target->GetPackGUID().size());
data << target->GetPackGUID(); // may be it's target guid
- GetSession()->SendPacket(&data);
+ SendMessageToSet(&data, false);
}
void Player::SendExplorationExperience(uint32 Area, uint32 Experience)
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index a941dbd31ed..399d2229462 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -110,7 +110,9 @@ enum TrinityStrings
LANG_RBAC_PERM_DENIED = 77,
LANG_RBAC_PERM_REVOKED = 78,
LANG_RBAC_PERM_REVOKED_NOT_IN_LIST = 79,
- // Free 80 - 95
+ LANG_PVPSTATS = 80,
+ LANG_PVPSTATS_DISABLED = 81,
+ // Free 82 - 95
LANG_GUILD_RENAME_ALREADY_EXISTS = 96,
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 2540ab5c30c..cbc9e9b823f 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -297,7 +297,7 @@ public:
else
{
handler->PSendSysMessage("[IP2NATION] Table empty");
- TC_LOG_DEBUG("server.authserver", "[IP2NATION] Table empty");
+ TC_LOG_DEBUG("server.bnetserver", "[IP2NATION] Table empty");
}
}
else if (param == "off")
diff --git a/src/server/scripts/Commands/cs_battlenet_account.cpp b/src/server/scripts/Commands/cs_battlenet_account.cpp
index 79b57cb94ff..e98e0f34fd1 100644
--- a/src/server/scripts/Commands/cs_battlenet_account.cpp
+++ b/src/server/scripts/Commands/cs_battlenet_account.cpp
@@ -148,7 +148,7 @@ public:
else
{
handler->PSendSysMessage("[IP2NATION] Table empty");
- TC_LOG_DEBUG("server.authserver", "[IP2NATION] Table empty");
+ TC_LOG_DEBUG("server.bnetserver", "[IP2NATION] Table empty");
}
}
else if (param == "off")
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 4c2b7d40a89..0ebf05f74ad 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -78,6 +78,7 @@ public:
{ "pinfo", rbac::RBAC_PERM_COMMAND_PINFO, true, &HandlePInfoCommand, "", NULL },
{ "playall", rbac::RBAC_PERM_COMMAND_PLAYALL, false, &HandlePlayAllCommand, "", NULL },
{ "possess", rbac::RBAC_PERM_COMMAND_POSSESS, false, &HandlePossessCommand, "", NULL },
+ { "pvpstats", rbac::RBAC_PERM_COMMAND_PVPSTATS, true, &HandlePvPstatsCommand, "", NULL },
{ "recall", rbac::RBAC_PERM_COMMAND_RECALL, false, &HandleRecallCommand, "", NULL },
{ "repairitems", rbac::RBAC_PERM_COMMAND_REPAIRITEMS, true, &HandleRepairitemsCommand, "", NULL },
{ "respawn", rbac::RBAC_PERM_COMMAND_RESPAWN, false, &HandleRespawnCommand, "", NULL },
@@ -100,6 +101,35 @@ public:
return commandTable;
}
+ static bool HandlePvPstatsCommand(ChatHandler * handler, char const* /*args*/)
+ {
+ if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE))
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_PVPSTATS_FACTIONS_OVERALL);
+ PreparedQueryResult result = CharacterDatabase.Query(stmt);
+
+ if (result)
+ {
+ Field* fields = result->Fetch();
+ uint32 horde_victories = fields[1].GetUInt32();
+
+ if (!(result->NextRow()))
+ return false;
+
+ fields = result->Fetch();
+ uint32 alliance_victories = fields[1].GetUInt32();
+
+ handler->PSendSysMessage(LANG_PVPSTATS, alliance_victories, horde_victories);
+ }
+ else
+ return false;
+ }
+ else
+ handler->PSendSysMessage(LANG_PVPSTATS_DISABLED);
+
+ return true;
+ }
+
static bool HandleDevCommand(ChatHandler* handler, char const* args)
{
if (!*args)
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index d520c1cf765..1c689aadd47 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -71,6 +71,7 @@ public:
{ "spell", rbac::RBAC_PERM_COMMAND_MODIFY_SPELL, false, &HandleModifySpellCommand, "", NULL },
{ "standstate", rbac::RBAC_PERM_COMMAND_MODIFY_STANDSTATE, false, &HandleModifyStandStateCommand, "", NULL },
{ "talentpoints", rbac::RBAC_PERM_COMMAND_MODIFY_TALENTPOINTS, false, &HandleModifyTalentCommand, "", NULL },
+ { "xp", rbac::RBAC_PERM_COMMAND_MODIFY_XP, false, &HandleModifyXPCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
@@ -1400,6 +1401,37 @@ public:
return true;
}
+
+ // mod xp command
+ static bool HandleModifyXPCommand(ChatHandler *handler, const char* args)
+ {
+ if (!*args)
+ return false;
+
+ int32 xp = atoi((char*)args);
+
+ if (xp < 1)
+ {
+ handler->SendSysMessage(LANG_BAD_VALUE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ Player* target = handler->getSelectedPlayerOrSelf();
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (handler->HasLowerSecurity(target, ObjectGuid::Empty))
+ return false;
+
+ // we can run the command
+ target->GiveXP(xp, nullptr);
+ return true;
+ }
};
void AddSC_modify_commandscript()
diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt
index 1ad85acb601..ddc10ca4673 100644
--- a/src/server/shared/CMakeLists.txt
+++ b/src/server/shared/CMakeLists.txt
@@ -27,7 +27,7 @@ file(GLOB_RECURSE sources_Utilities Utilities/*.cpp Utilities/*.h)
file(GLOB sources_localdir *.cpp *.h)
# Manually set sources for Debugging directory as we don't want to include WheatyExceptionReport in shared project
-# It needs to be included both in authserver and worldserver for the static global variable to be properly initialized
+# It needs to be included both in bnetserver and worldserver for the static global variable to be properly initialized
# and to handle crash logs on windows
set(sources_Debugging Debugging/Errors.cpp Debugging/Errors.h)
diff --git a/src/server/shared/Configuration/Config.h b/src/server/shared/Configuration/Config.h
index ff0233b5669..c2e073c9c05 100644
--- a/src/server/shared/Configuration/Config.h
+++ b/src/server/shared/Configuration/Config.h
@@ -30,7 +30,7 @@ class ConfigMgr
~ConfigMgr() { }
public:
- /// Method used only for loading main configuration files (authserver.conf and worldserver.conf)
+ /// Method used only for loading main configuration files
bool LoadInitial(std::string const& file, std::string& error);
static ConfigMgr* instance()
diff --git a/src/server/shared/Database/DatabaseEnv.h b/src/server/shared/Database/DatabaseEnv.h
index d58fa81d608..fb629d2d9b4 100644
--- a/src/server/shared/Database/DatabaseEnv.h
+++ b/src/server/shared/Database/DatabaseEnv.h
@@ -37,10 +37,12 @@
#include "Implementation/LoginDatabase.h"
#include "Implementation/CharacterDatabase.h"
#include "Implementation/WorldDatabase.h"
+#include "Implementation/HotfixDatabase.h"
extern WorldDatabaseWorkerPool WorldDatabase;
extern CharacterDatabaseWorkerPool CharacterDatabase;
extern LoginDatabaseWorkerPool LoginDatabase;
+extern HotfixDatabaseWorkerPool HotfixDatabase;
#endif
diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp
index 51b5bf1d30b..90b662cea5c 100644
--- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp
@@ -639,6 +639,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_SEL_PVPSTATS_MAXID, "SELECT MAX(id) FROM pvpstats_battlegrounds", CONNECTION_SYNCH);
PrepareStatement(CHAR_INS_PVPSTATS_BATTLEGROUND, "INSERT INTO pvpstats_battlegrounds (id, winner_faction, bracket_id, type, date) VALUES (?, ?, ?, ?, NOW())", CONNECTION_ASYNC);
PrepareStatement(CHAR_INS_PVPSTATS_PLAYER, "INSERT INTO pvpstats_players (battleground_id, character_guid, score_killing_blows, score_deaths, score_honorable_kills, score_bonus_honor, score_damage_done, score_healing_done, attr_1, attr_2, attr_3, attr_4, attr_5) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
+ PrepareStatement(CHAR_SEL_PVPSTATS_FACTIONS_OVERALL, "SELECT winner_faction, COUNT(*) AS count FROM pvpstats_battlegrounds WHERE DATEDIFF(NOW(), date) < 7 GROUP BY winner_faction ORDER BY winner_faction ASC", CONNECTION_SYNCH);
// QuestTracker
PrepareStatement(CHAR_INS_QUEST_TRACK, "INSERT INTO quest_tracker (id, character_guid, quest_accept_time, core_hash, core_revision) VALUES (?, ?, NOW(), ?, ?)", CONNECTION_ASYNC);
diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h
index 329f2a5c23d..6cb239ed85b 100644
--- a/src/server/shared/Database/Implementation/CharacterDatabase.h
+++ b/src/server/shared/Database/Implementation/CharacterDatabase.h
@@ -560,6 +560,7 @@ enum CharacterDatabaseStatements
CHAR_SEL_PVPSTATS_MAXID,
CHAR_INS_PVPSTATS_BATTLEGROUND,
CHAR_INS_PVPSTATS_PLAYER,
+ CHAR_SEL_PVPSTATS_FACTIONS_OVERALL,
CHAR_INS_QUEST_TRACK,
CHAR_UPD_QUEST_TRACK_GM_COMPLETE,
diff --git a/src/server/authserver/Authentication/TOTP.h b/src/server/shared/Database/Implementation/HotfixDatabase.cpp
index 7ced260758c..f60287ef1a7 100644
--- a/src/server/authserver/Authentication/TOTP.h
+++ b/src/server/shared/Database/Implementation/HotfixDatabase.cpp
@@ -15,15 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _TOTP_H
-#define _TOTP_H
+#include "HotfixDatabase.h"
-#include "openssl/hmac.h"
-#include "openssl/evp.h"
-
-namespace TOTP
+void HotfixDatabaseConnection::DoPrepareStatements()
{
- unsigned int GenerateToken(const char* b32key);
+ if (!m_reconnecting)
+ m_stmts.resize(MAX_HOTFIXDATABASE_STATEMENTS);
}
-
-#endif
diff --git a/src/server/shared/Database/Implementation/HotfixDatabase.h b/src/server/shared/Database/Implementation/HotfixDatabase.h
new file mode 100644
index 00000000000..13c3af6714e
--- /dev/null
+++ b/src/server/shared/Database/Implementation/HotfixDatabase.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _HOTFIXDATABASE_H
+#define _HOTFIXDATABASE_H
+
+#include "DatabaseWorkerPool.h"
+#include "MySQLConnection.h"
+
+class HotfixDatabaseConnection : public MySQLConnection
+{
+ public:
+ //- Constructors for sync and async connections
+ HotfixDatabaseConnection(MySQLConnectionInfo& connInfo) : MySQLConnection(connInfo) { }
+ HotfixDatabaseConnection(ProducerConsumerQueue<SQLOperation*>* q, MySQLConnectionInfo& connInfo) : MySQLConnection(q, connInfo) { }
+
+ //- Loads database type specific prepared statements
+ void DoPrepareStatements() override;
+};
+
+typedef DatabaseWorkerPool<HotfixDatabaseConnection> HotfixDatabaseWorkerPool;
+
+enum HotfixDatabaseStatements
+{
+ /* Naming standard for defines:
+ {DB}_{SEL/INS/UPD/DEL/REP}_{Summary of data changed}
+ When updating more than one field, consider looking at the calling function
+ name for a suiting suffix.
+ */
+
+ MAX_HOTFIXDATABASE_STATEMENTS
+};
+
+#endif
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index 65972e680ef..d1283cc8cca 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -134,8 +134,8 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Warden/Modules
${CMAKE_SOURCE_DIR}/src/server/game/Weather
${CMAKE_SOURCE_DIR}/src/server/game/World
- ${CMAKE_SOURCE_DIR}/src/server/authserver/Server
- ${CMAKE_SOURCE_DIR}/src/server/authserver/Realms
+ ${CMAKE_SOURCE_DIR}/src/server/bnetserver/Server
+ ${CMAKE_SOURCE_DIR}/src/server/bnetserver/Realms
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/CommandLine
${CMAKE_CURRENT_SOURCE_DIR}/RemoteAccess
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp
index 821e1f5bd83..c46a1dffeec 100644
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -80,6 +80,7 @@ uint32 _maxCoreStuckTimeInMs(0);
WorldDatabaseWorkerPool WorldDatabase; ///< Accessor to the world database
CharacterDatabaseWorkerPool CharacterDatabase; ///< Accessor to the character database
+HotfixDatabaseWorkerPool HotfixDatabase; ///< Accessor to the hotfix database
LoginDatabaseWorkerPool LoginDatabase; ///< Accessor to the realm/login database
Battlenet::RealmHandle realmHandle; ///< Id of the realm
Realm realm;
@@ -570,6 +571,31 @@ bool StartDB()
return false;
}
+ ///- Get hotfix database info from configuration file
+ dbString = sConfigMgr->GetStringDefault("HotfixDatabaseInfo", "");
+ if (dbString.empty())
+ {
+ TC_LOG_ERROR("server.worldserver", "Hotfix database not specified in configuration file");
+ return false;
+ }
+
+ asyncThreads = uint8(sConfigMgr->GetIntDefault("HotfixDatabase.WorkerThreads", 1));
+ if (asyncThreads < 1 || asyncThreads > 32)
+ {
+ TC_LOG_ERROR("server.worldserver", "Hotfix database: invalid number of worker threads specified. "
+ "Please pick a value between 1 and 32.");
+ return false;
+ }
+
+ synchThreads = uint8(sConfigMgr->GetIntDefault("HotfixDatabase.SynchThreads", 2));
+
+ ///- Initialize the Hotfix database
+ if (!HotfixDatabase.Open(dbString, asyncThreads, synchThreads))
+ {
+ TC_LOG_ERROR("server.worldserver", "Cannot connect to Hotfix database %s", dbString.c_str());
+ return false;
+ }
+
///- Get login database info from configuration file
dbString = sConfigMgr->GetStringDefault("LoginDatabaseInfo", "");
if (dbString.empty())
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index e4406e7ecce..d7af94c133c 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -93,10 +93,12 @@ LogsDir = ""
# Default: "127.0.0.1;3306;trinity;trinity;auth" - (LoginDatabaseInfo)
# "127.0.0.1;3306;trinity;trinity;world" - (WorldDatabaseInfo)
# "127.0.0.1;3306;trinity;trinity;characters" - (CharacterDatabaseInfo)
+# "127.0.0.1;3306;trinity;trinity;hotfix" - (HotfixDatabaseInfo)
LoginDatabaseInfo = "127.0.0.1;3306;trinity;trinity;auth"
WorldDatabaseInfo = "127.0.0.1;3306;trinity;trinity;world"
CharacterDatabaseInfo = "127.0.0.1;3306;trinity;trinity;characters"
+HotfixDatabaseInfo = "127.0.0.1;3306;trinity;trinity;hotfix"
#
# LoginDatabase.WorkerThreads
@@ -108,10 +110,12 @@ CharacterDatabaseInfo = "127.0.0.1;3306;trinity;trinity;characters"
# Default: 1 - (LoginDatabase.WorkerThreads)
# 1 - (WorldDatabase.WorkerThreads)
# 1 - (CharacterDatabase.WorkerThreads)
+# 1 - (HotfixDatabase.WorkerThreads)
LoginDatabase.WorkerThreads = 1
WorldDatabase.WorkerThreads = 1
CharacterDatabase.WorkerThreads = 1
+HotfixDatabase.WorkerThreads = 1
#
# LoginDatabase.SynchThreads
@@ -121,10 +125,12 @@ CharacterDatabase.WorkerThreads = 1
# Default: 1 - (LoginDatabase.WorkerThreads)
# 1 - (WorldDatabase.WorkerThreads)
# 2 - (CharacterDatabase.WorkerThreads)
+# 1 - (HotfixDatabase.WorkerThreads)
LoginDatabase.SynchThreads = 1
WorldDatabase.SynchThreads = 1
CharacterDatabase.SynchThreads = 2
+HotfixDatabase.SynchThreads = 1
#
# MaxPingTime
@@ -3159,7 +3165,7 @@ Logger.sql.sql=5,Console DBErrors
#Logger.rbac=3,Console Server
#Logger.scripts=3,Console Server
#Logger.scripts.ai=3,Console Server
-#Logger.server.authserver=3,Console Server
+#Logger.server.bnetserver=3,Console Server
#Logger.spells=3,Console Server
#Logger.sql.dev=3,Console Server
#Logger.sql.driver=3,Console Server
diff --git a/src/tools/map_extractor/loadlib/DBFilesClientList.h b/src/tools/map_extractor/loadlib/DBFilesClientList.h
index aadfe7a3666..0520e63912b 100644
--- a/src/tools/map_extractor/loadlib/DBFilesClientList.h
+++ b/src/tools/map_extractor/loadlib/DBFilesClientList.h
@@ -526,7 +526,6 @@ char const* DBFilesClientList[] =
"DBFilesClient\\ModelFileData.dbc",
"DBFilesClient\\ManifestMP3.dbc",
"DBFilesClient\\FileData.dbc",
- "DBFilesClient\\WorldSafeLocs.dbc",
nullptr // terminator
};
diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp
index b273ebc5cbf..7664e12375a 100644
--- a/src/tools/vmap4_extractor/vmapexport.cpp
+++ b/src/tools/vmap4_extractor/vmapexport.cpp
@@ -76,7 +76,7 @@ const char* szRawVMAPMagic = "VMAP042";
bool OpenCascStorage()
{
- if (!CascOpenStorage(".\\Data", 0, &CascStorage))
+ if (!CascOpenStorage("Data", 0, &CascStorage))
{
printf("Error %d\n", GetLastError());
return false;