From 107a6f2c4b904bff557ec489419db6aa85a17fcb Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 25 Mar 2012 21:15:22 +0100 Subject: DB/Auth: Update auth_database.sql with recent changes DB/GameEvent: Resync Darkmoon, again - by Aokromes --- sql/base/auth_database.sql | 16 ++++++++-------- sql/base/characters_database.sql | 6 ++++-- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'sql/base') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 3a9bd6fb08b..c80bebdac39 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.5.19, for Win64 (x86) +-- MySQL dump 10.13 Distrib 5.5.21, for Win64 (x86) -- -- Host: localhost Database: auth -- ------------------------------------------------------ --- Server version 5.5.19 +-- Server version 5.5.21 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -88,8 +88,8 @@ DROP TABLE IF EXISTS `account_banned`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account_banned` ( `id` int(11) NOT NULL DEFAULT '0' COMMENT 'Account id', - `bandate` bigint(40) NOT NULL DEFAULT '0', - `unbandate` bigint(40) NOT NULL DEFAULT '0', + `bandate` int(10) unsigned NOT NULL DEFAULT '0', + `unbandate` int(10) unsigned NOT NULL DEFAULT '0', `bannedby` varchar(50) NOT NULL, `banreason` varchar(255) NOT NULL, `active` tinyint(4) NOT NULL DEFAULT '1', @@ -114,9 +114,9 @@ DROP TABLE IF EXISTS `ip_banned`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `ip_banned` ( - `ip` varchar(32) NOT NULL DEFAULT '127.0.0.1', - `bandate` bigint(40) NOT NULL, - `unbandate` bigint(40) NOT NULL, + `ip` varchar(15) NOT NULL DEFAULT '127.0.0.1', + `bandate` int(10) unsigned NOT NULL, + `unbandate` int(10) unsigned NOT NULL, `bannedby` varchar(50) NOT NULL DEFAULT '[Console]', `banreason` varchar(255) NOT NULL DEFAULT 'no reason', PRIMARY KEY (`ip`,`bandate`) @@ -250,4 +250,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-02-19 13:18:35 +-- Dump completed on 2012-03-25 21:05:26 diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index c38dced90dd..f0e919a5bcd 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.5.9, for Win64 (x86) +-- MySQL dump 10.13 Distrib 5.5.21, for Win64 (x86) -- -- Host: localhost Database: characters -- ------------------------------------------------------ --- Server version 5.5.9 +-- Server version 5.5.21 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -2270,3 +2270,5 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2012-03-25 21:14:19 -- cgit v1.2.3 From 8d7f184ee6a62c1f976abfaa5a570412be98a29d Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 26 Mar 2012 18:23:05 +0100 Subject: DB/Auth: Update auth_database.sql with recent changes --- sql/base/auth_database.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/base') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index c80bebdac39..305ba679bf2 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -194,7 +194,7 @@ CREATE TABLE `realmlist` ( `address` varchar(32) NOT NULL DEFAULT '127.0.0.1', `port` int(11) NOT NULL DEFAULT '8085', `icon` tinyint(3) unsigned NOT NULL DEFAULT '0', - `color` tinyint(3) unsigned NOT NULL DEFAULT '2', + `flag` tinyint(3) unsigned NOT NULL DEFAULT '2', `timezone` tinyint(3) unsigned NOT NULL DEFAULT '0', `allowedSecurityLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', `population` float unsigned NOT NULL DEFAULT '0', @@ -250,4 +250,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-03-25 21:05:26 +-- Dump completed on 2012-03-26 18:21:51 -- cgit v1.2.3 From b21725ecac647b0a5af79f1ef730a9cbaf5e4070 Mon Sep 17 00:00:00 2001 From: leak Date: Wed, 28 Mar 2012 16:39:59 +0200 Subject: SQL: Auth db data type cleanup `account` / Storage engine switched to InnoDB --- sql/base/auth_database.sql | 30 ++++++++++++------------- sql/updates/auth/2012_03_28_00_auth_account.sql | 13 +++++++++++ 2 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 sql/updates/auth/2012_03_28_00_auth_account.sql (limited to 'sql/base') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 305ba679bf2..3c851d4dac7 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.5.21, for Win64 (x86) +-- MySQL dump 10.13 Distrib 5.5.22, for Win64 (x86) -- -- Host: localhost Database: auth -- ------------------------------------------------------ --- Server version 5.5.21 +-- Server version 5.5.22 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -23,27 +23,27 @@ DROP TABLE IF EXISTS `account`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', `username` varchar(32) NOT NULL DEFAULT '', `sha_pass_hash` varchar(40) NOT NULL DEFAULT '', - `sessionkey` longtext, - `v` longtext, - `s` longtext, - `email` text, + `sessionkey` varchar(80) NOT NULL DEFAULT '', + `v` varchar(64) NOT NULL DEFAULT '', + `s` varchar(64) NOT NULL DEFAULT '', + `email` varchar(254) NOT NULL DEFAULT '', `joindate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `last_ip` varchar(30) NOT NULL DEFAULT '127.0.0.1', - `failed_logins` int(11) unsigned NOT NULL DEFAULT '0', + `last_ip` varchar(15) NOT NULL DEFAULT '127.0.0.1', + `failed_logins` int(10) unsigned NOT NULL DEFAULT '0', `locked` tinyint(3) unsigned NOT NULL DEFAULT '0', `last_login` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', - `online` tinyint(4) NOT NULL DEFAULT '0', + `online` tinyint(3) unsigned NOT NULL DEFAULT '0', `expansion` tinyint(3) unsigned NOT NULL DEFAULT '2', - `mutetime` bigint(40) NOT NULL DEFAULT '0', + `mutetime` bigint(20) NOT NULL DEFAULT '0', `locale` tinyint(3) unsigned NOT NULL DEFAULT '0', - `os` varchar(4) NOT NULL DEFAULT '', - `recruiter` int(11) NOT NULL DEFAULT '0', + `os` varchar(3) NOT NULL DEFAULT '', + `recruiter` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `idx_username` (`username`) -) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Account System'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Account System'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -250,4 +250,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-03-26 18:21:51 +-- Dump completed on 2012-03-27 14:28:21 diff --git a/sql/updates/auth/2012_03_28_00_auth_account.sql b/sql/updates/auth/2012_03_28_00_auth_account.sql new file mode 100644 index 00000000000..199baac5178 --- /dev/null +++ b/sql/updates/auth/2012_03_28_00_auth_account.sql @@ -0,0 +1,13 @@ +ALTER TABLE `account` + CHANGE `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Identifier', + CHANGE `sessionkey` `sessionkey` VARCHAR(80) NOT NULL DEFAULT '', + CHANGE `v` `v` VARCHAR(64) NOT NULL DEFAULT '', + CHANGE `s` `s` VARCHAR(64) NOT NULL DEFAULT '', + CHANGE `email` `email` VARCHAR(254) NOT NULL DEFAULT '', + CHANGE `last_ip` `last_ip` VARCHAR(15) NOT NULL DEFAULT '127.0.0.1', + CHANGE `failed_logins` `failed_logins` INT(10) UNSIGNED NOT NULL DEFAULT '0', + CHANGE `online` `online` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', + CHANGE `mutetime` `mutetime` BIGINT(20) NOT NULL DEFAULT '0', + CHANGE `os` `os` VARCHAR(3) NOT NULL DEFAULT '', + CHANGE `recruiter` `recruiter` INT(10) UNSIGNED NOT NULL DEFAULT '0', + ROW_FORMAT=DEFAULT ENGINE=INNODB; -- cgit v1.2.3 From a01e2a59cd2904db7c39e2b8fc40901b0926f883 Mon Sep 17 00:00:00 2001 From: leak Date: Wed, 28 Mar 2012 16:48:49 +0200 Subject: SQL: Auth db data type cleanup `account_access`, `account_banned`, `ip_banned` / Storage engine switched to InnoDB --- sql/base/auth_database.sql | 14 +++++++------- sql/updates/auth/2012_03_28_01_auth_account_access.sql | 4 ++++ sql/updates/auth/2012_03_28_02_auth_account_banned.sql | 4 ++++ sql/updates/auth/2012_03_28_03_ip_banned.sql | 2 ++ 4 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 sql/updates/auth/2012_03_28_01_auth_account_access.sql create mode 100644 sql/updates/auth/2012_03_28_02_auth_account_banned.sql create mode 100644 sql/updates/auth/2012_03_28_03_ip_banned.sql (limited to 'sql/base') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 3c851d4dac7..20bb870ff56 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -63,11 +63,11 @@ DROP TABLE IF EXISTS `account_access`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account_access` ( - `id` int(11) unsigned NOT NULL, + `id` int(10) unsigned NOT NULL, `gmlevel` tinyint(3) unsigned NOT NULL, `RealmID` int(11) NOT NULL DEFAULT '-1', PRIMARY KEY (`id`,`RealmID`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -87,14 +87,14 @@ DROP TABLE IF EXISTS `account_banned`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account_banned` ( - `id` int(11) NOT NULL DEFAULT '0' COMMENT 'Account id', + `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Account id', `bandate` int(10) unsigned NOT NULL DEFAULT '0', `unbandate` int(10) unsigned NOT NULL DEFAULT '0', `bannedby` varchar(50) NOT NULL, `banreason` varchar(255) NOT NULL, - `active` tinyint(4) NOT NULL DEFAULT '1', + `active` tinyint(3) unsigned NOT NULL DEFAULT '1', PRIMARY KEY (`id`,`bandate`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Ban List'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Ban List'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -120,7 +120,7 @@ CREATE TABLE `ip_banned` ( `bannedby` varchar(50) NOT NULL DEFAULT '[Console]', `banreason` varchar(255) NOT NULL DEFAULT 'no reason', PRIMARY KEY (`ip`,`bandate`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Banned IPs'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Banned IPs'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -250,4 +250,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-03-27 14:28:21 +-- Dump completed on 2012-03-28 16:44:39 diff --git a/sql/updates/auth/2012_03_28_01_auth_account_access.sql b/sql/updates/auth/2012_03_28_01_auth_account_access.sql new file mode 100644 index 00000000000..7f79634d765 --- /dev/null +++ b/sql/updates/auth/2012_03_28_01_auth_account_access.sql @@ -0,0 +1,4 @@ +ALTER TABLE `account_access` + CHANGE `id` `id` INT(10) UNSIGNED NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; + \ No newline at end of file diff --git a/sql/updates/auth/2012_03_28_02_auth_account_banned.sql b/sql/updates/auth/2012_03_28_02_auth_account_banned.sql new file mode 100644 index 00000000000..917cea1a684 --- /dev/null +++ b/sql/updates/auth/2012_03_28_02_auth_account_banned.sql @@ -0,0 +1,4 @@ +ALTER TABLE `account_banned` + CHANGE `id` `id` INT(10) UNSIGNED DEFAULT '0' NOT NULL COMMENT 'Account id', + CHANGE `active` `active` TINYINT(3) UNSIGNED DEFAULT '1' NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/updates/auth/2012_03_28_03_ip_banned.sql b/sql/updates/auth/2012_03_28_03_ip_banned.sql new file mode 100644 index 00000000000..2e754effc60 --- /dev/null +++ b/sql/updates/auth/2012_03_28_03_ip_banned.sql @@ -0,0 +1,2 @@ +ALTER TABLE `ip_banned` + ROW_FORMAT=DEFAULT ENGINE=INNODB; -- cgit v1.2.3 From 7309ee562195146220b5f048a50af15096759fd3 Mon Sep 17 00:00:00 2001 From: leak Date: Wed, 28 Mar 2012 18:37:06 +0200 Subject: SQL: Auth db data type cleanup `logs`, `realmcharacters`, `realmlist`, `uptime` / Storage engine switched to InnoDB Note: As for the redundant `uptime`.`startstring` being removed, this page might be of interest how to generate time strings from unix timestamps http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_from-unixtime --- sql/base/auth_database.sql | 37 +++++++++++----------- sql/updates/auth/2012_03_28_04_logs.sql | 5 +++ sql/updates/auth/2012_03_28_05_realmcharacters.sql | 4 +++ sql/updates/auth/2012_03_28_06_realmlist.sql | 6 ++++ sql/updates/auth/2012_03_28_07_uptime.sql | 6 ++++ src/server/authserver/Realms/RealmList.cpp | 4 +-- src/server/authserver/Realms/RealmList.h | 2 +- src/server/game/World/World.cpp | 18 +++-------- src/server/shared/Logging/Log.cpp | 2 +- 9 files changed, 48 insertions(+), 36 deletions(-) create mode 100644 sql/updates/auth/2012_03_28_04_logs.sql create mode 100644 sql/updates/auth/2012_03_28_05_realmcharacters.sql create mode 100644 sql/updates/auth/2012_03_28_06_realmlist.sql create mode 100644 sql/updates/auth/2012_03_28_07_uptime.sql (limited to 'sql/base') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 20bb870ff56..5803529da1e 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -140,11 +140,11 @@ DROP TABLE IF EXISTS `logs`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `logs` ( - `time` int(14) NOT NULL, - `realm` int(4) NOT NULL, - `type` int(4) NOT NULL, - `string` text -) ENGINE=MyISAM DEFAULT CHARSET=latin1; + `time` int(10) unsigned NOT NULL, + `realm` int(10) unsigned NOT NULL, + `type` tinyint(3) unsigned NOT NULL, + `string` text CHARACTER SET latin1 +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -164,12 +164,12 @@ DROP TABLE IF EXISTS `realmcharacters`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `realmcharacters` ( - `realmid` int(11) unsigned NOT NULL DEFAULT '0', - `acctid` bigint(20) unsigned NOT NULL, + `realmid` int(10) unsigned NOT NULL DEFAULT '0', + `acctid` int(10) unsigned NOT NULL, `numchars` tinyint(3) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`realmid`,`acctid`), KEY `acctid` (`acctid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm Character Tracker'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Realm Character Tracker'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -189,19 +189,19 @@ DROP TABLE IF EXISTS `realmlist`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `realmlist` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL DEFAULT '', - `address` varchar(32) NOT NULL DEFAULT '127.0.0.1', - `port` int(11) NOT NULL DEFAULT '8085', + `address` varchar(15) NOT NULL DEFAULT '127.0.0.1', + `port` smallint(5) unsigned NOT NULL DEFAULT '8085', `icon` tinyint(3) unsigned NOT NULL DEFAULT '0', `flag` tinyint(3) unsigned NOT NULL DEFAULT '2', `timezone` tinyint(3) unsigned NOT NULL DEFAULT '0', `allowedSecurityLevel` tinyint(3) unsigned NOT NULL DEFAULT '0', `population` float unsigned NOT NULL DEFAULT '0', - `gamebuild` int(11) unsigned NOT NULL DEFAULT '12340', + `gamebuild` int(10) unsigned NOT NULL DEFAULT '12340', PRIMARY KEY (`id`), UNIQUE KEY `idx_name` (`name`) -) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Realm System'; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Realm System'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -222,14 +222,13 @@ DROP TABLE IF EXISTS `uptime`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `uptime` ( - `realmid` int(11) unsigned NOT NULL, - `starttime` bigint(20) unsigned NOT NULL DEFAULT '0', - `startstring` varchar(64) NOT NULL DEFAULT '', - `uptime` bigint(20) unsigned NOT NULL DEFAULT '0', + `realmid` int(10) unsigned NOT NULL, + `starttime` int(10) unsigned NOT NULL DEFAULT '0', + `uptime` int(10) unsigned NOT NULL DEFAULT '0', `maxplayers` smallint(5) unsigned NOT NULL DEFAULT '0', `revision` varchar(255) NOT NULL DEFAULT 'Trinitycore', PRIMARY KEY (`realmid`,`starttime`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Uptime system'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Uptime system'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -250,4 +249,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-03-28 16:44:39 +-- Dump completed on 2012-03-28 18:26:06 diff --git a/sql/updates/auth/2012_03_28_04_logs.sql b/sql/updates/auth/2012_03_28_04_logs.sql new file mode 100644 index 00000000000..4c837a47ed1 --- /dev/null +++ b/sql/updates/auth/2012_03_28_04_logs.sql @@ -0,0 +1,5 @@ +ALTER TABLE `logs` + CHANGE `time` `time` INT(10) UNSIGNED NOT NULL, + CHANGE `realm` `realm` INT(10) UNSIGNED NOT NULL, + CHANGE `type` `type` TINYINT(3) UNSIGNED NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/updates/auth/2012_03_28_05_realmcharacters.sql b/sql/updates/auth/2012_03_28_05_realmcharacters.sql new file mode 100644 index 00000000000..e50b3c3f331 --- /dev/null +++ b/sql/updates/auth/2012_03_28_05_realmcharacters.sql @@ -0,0 +1,4 @@ +ALTER TABLE `realmcharacters` + CHANGE `realmid` `realmid` INT(10) UNSIGNED DEFAULT 0 NOT NULL, + CHANGE `acctid` `acctid` INT(10) UNSIGNED NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/sql/updates/auth/2012_03_28_06_realmlist.sql b/sql/updates/auth/2012_03_28_06_realmlist.sql new file mode 100644 index 00000000000..e5e7b2e00d4 --- /dev/null +++ b/sql/updates/auth/2012_03_28_06_realmlist.sql @@ -0,0 +1,6 @@ +ALTER TABLE `realmlist` + CHANGE `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + CHANGE `address` `address` VARCHAR(15) DEFAULT '127.0.0.1' NOT NULL, + CHANGE `port` `port` SMALLINT(5) UNSIGNED DEFAULT '8085' NOT NULL, + CHANGE `gamebuild` `gamebuild` INT(10) UNSIGNED DEFAULT '12340' NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; \ No newline at end of file diff --git a/sql/updates/auth/2012_03_28_07_uptime.sql b/sql/updates/auth/2012_03_28_07_uptime.sql new file mode 100644 index 00000000000..0ea4e3321df --- /dev/null +++ b/sql/updates/auth/2012_03_28_07_uptime.sql @@ -0,0 +1,6 @@ +ALTER TABLE `uptime` + DROP COLUMN `startstring`, + CHANGE `realmid` `realmid` INT(10) UNSIGNED NOT NULL, + CHANGE `starttime` `starttime` INT(10) UNSIGNED DEFAULT 0 NOT NULL, + CHANGE `uptime` `uptime` INT(10) UNSIGNED DEFAULT 0 NOT NULL, + ROW_FORMAT=DEFAULT ENGINE=INNODB; diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index efcced51089..f856156825d 100755 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -31,7 +31,7 @@ void RealmList::Initialize(uint32 updateInterval) UpdateRealms(true); } -void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) +void RealmList::UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) { // Create new if not exist or update existed Realm& realm = m_realms[name]; @@ -82,7 +82,7 @@ void RealmList::UpdateRealms(bool init) uint32 realmId = fields[0].GetUInt32(); const std::string& name = fields[1].GetString(); const std::string& address = fields[2].GetString(); - uint32 port = fields[3].GetUInt32(); + uint16 port = fields[3].GetUInt16(); uint8 icon = fields[4].GetUInt8(); RealmFlags flag = RealmFlags(fields[5].GetUInt8()); uint8 timezone = fields[6].GetUInt8(); diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h index 4d258953ae0..c8407b0fea1 100755 --- a/src/server/authserver/Realms/RealmList.h +++ b/src/server/authserver/Realms/RealmList.h @@ -71,7 +71,7 @@ public: private: void UpdateRealms(bool init=false); - void UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); + void UpdateRealm(uint32 ID, const std::string& name, const std::string& address, uint16 port, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); RealmMap m_realms; uint32 m_UpdateInterval; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 489278f63e6..9683d847f86 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1669,18 +1669,10 @@ void World::SetInitialWorldSettings() ///- Initialize game time and timers sLog->outString("Initialize game time and timers"); m_gameTime = time(NULL); - m_startTime=m_gameTime; - - tm local; - time_t curr; - time(&curr); - local=*(localtime(&curr)); // dereference and assign - char isoDate[128]; - sprintf(isoDate, "%04d-%02d-%02d %02d:%02d:%02d", - local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec); + m_startTime = m_gameTime; - LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime, revision) VALUES('%u', " UI64FMTD ", '%s', 0, '%s')", - realmID, uint64(m_startTime), isoDate, _FULLVERSION); // One-time query + LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES(%u, %u, '%s', 0, '%s')", + realmID, uint32(m_startTime), _FULLVERSION); // One-time query m_timers[WUPDATE_WEATHERS].SetInterval(1*IN_MILLISECONDS); m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE*IN_MILLISECONDS); @@ -1965,10 +1957,10 @@ void World::Update(uint32 diff) PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_UPTIME_PLAYERS); - stmt->setUInt64(0, uint64(tmpDiff)); + stmt->setUInt32(0, tmpDiff); stmt->setUInt16(1, uint16(maxOnlinePlayers)); stmt->setUInt32(2, realmID); - stmt->setUInt64(3, uint64(m_startTime)); + stmt->setUInt32(3, uint32(m_startTime)); LoginDatabase.Execute(stmt); } diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index a9bb282cf86..0a53706fea2 100755 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -382,7 +382,7 @@ void Log::outDB(LogTypes type, const char * str) PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_LOG); stmt->setInt32(0, realm); - stmt->setInt32(1, type); + stmt->setUInt8(1, uint8(type)); stmt->setString(2, logStr); LoginDatabase.Execute(stmt); -- cgit v1.2.3 From 00264e45cf7b815061ac6503988506ec454b8360 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 1 Apr 2012 03:08:33 +0100 Subject: DB/Auth: Increase realmlist.address size to 64 (varchar) You might want to verify if the previous size did not truncate your address (it was 15) --- sql/base/auth_database.sql | 2 +- sql/updates/auth/2012_04_01_auth_realmlist.sql | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 sql/updates/auth/2012_04_01_auth_realmlist.sql (limited to 'sql/base') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 5803529da1e..1075644db3d 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -191,7 +191,7 @@ DROP TABLE IF EXISTS `realmlist`; CREATE TABLE `realmlist` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL DEFAULT '', - `address` varchar(15) NOT NULL DEFAULT '127.0.0.1', + `address` varchar(64) NOT NULL DEFAULT '127.0.0.1', `port` smallint(5) unsigned NOT NULL DEFAULT '8085', `icon` tinyint(3) unsigned NOT NULL DEFAULT '0', `flag` tinyint(3) unsigned NOT NULL DEFAULT '2', diff --git a/sql/updates/auth/2012_04_01_auth_realmlist.sql b/sql/updates/auth/2012_04_01_auth_realmlist.sql new file mode 100644 index 00000000000..e2e1efaf993 --- /dev/null +++ b/sql/updates/auth/2012_04_01_auth_realmlist.sql @@ -0,0 +1 @@ +ALTER TABLE `realmlist` CHANGE `address` `address` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '127.0.0.1'; -- cgit v1.2.3 From d155304f8409a55254d57f646e612098d20bf886 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 5 Apr 2012 17:38:13 +0100 Subject: DB/GOs: Correct some templates and add a missing one (WDB) DB/Auth: Add missed change to auth_base.sql Also fix file endings in some of hte sqls --- sql/base/auth_database.sql | 2 +- .../world/2012_03_30_00_world_smart_scripts.sql | 1 - .../world/2012_04_04_00_world_conditions.sql | 2 +- .../world/2012_04_04_01_world_spell_dbc.sql | 1 - .../2012_04_05_00_world_gameobject_template.sql | 32 ++++++++++++++++++++++ 5 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 sql/updates/world/2012_04_05_00_world_gameobject_template.sql (limited to 'sql/base') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 1075644db3d..14aaa4658e9 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -191,7 +191,7 @@ DROP TABLE IF EXISTS `realmlist`; CREATE TABLE `realmlist` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL DEFAULT '', - `address` varchar(64) NOT NULL DEFAULT '127.0.0.1', + `address` varchar(255) NOT NULL DEFAULT '127.0.0.1', `port` smallint(5) unsigned NOT NULL DEFAULT '8085', `icon` tinyint(3) unsigned NOT NULL DEFAULT '0', `flag` tinyint(3) unsigned NOT NULL DEFAULT '2', diff --git a/sql/updates/world/2012_03_30_00_world_smart_scripts.sql b/sql/updates/world/2012_03_30_00_world_smart_scripts.sql index 08d4ee90168..3ec709d76c1 100644 --- a/sql/updates/world/2012_03_30_00_world_smart_scripts.sql +++ b/sql/updates/world/2012_03_30_00_world_smart_scripts.sql @@ -92,4 +92,3 @@ INSERT INTO `quest_start_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2` (@COOP,38,10,@ENTRY,@LIFE,0, 5227.28,4407.01,-95.3888,4.29414), (@COOP,39,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,3.90536), (@COOP,40,10,@ENTRY,@LIFE,0, 5251.09,4413.76,-96.086,4.36089); - diff --git a/sql/updates/world/2012_04_04_00_world_conditions.sql b/sql/updates/world/2012_04_04_00_world_conditions.sql index f4d0a6c41b4..55cab4ca730 100644 --- a/sql/updates/world/2012_04_04_00_world_conditions.sql +++ b/sql/updates/world/2012_04_04_00_world_conditions.sql @@ -4,4 +4,4 @@ INSERT INTO `conditions`(`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,` (13, 1, 61254, 0, 0, 31, 0, 3, 30449, 0, 0, 0, '', 'Will of Sartharion'), (13, 1, 61254, 0, 1, 31, 0, 3, 30451, 0, 0, 0, '', 'Will of Sartharion'), (13, 1, 61254, 0, 2, 31, 0, 3, 30452, 0, 0, 0, '', 'Will of Sartharion'), -(13, 1, 61254, 0, 3, 31, 0, 3, 28860, 0, 0, 0, '', 'Will of Sartharion'); \ No newline at end of file +(13, 1, 61254, 0, 3, 31, 0, 3, 28860, 0, 0, 0, '', 'Will of Sartharion'); diff --git a/sql/updates/world/2012_04_04_01_world_spell_dbc.sql b/sql/updates/world/2012_04_04_01_world_spell_dbc.sql index 1b8b0868648..7eccdf811e4 100644 --- a/sql/updates/world/2012_04_04_01_world_spell_dbc.sql +++ b/sql/updates/world/2012_04_04_01_world_spell_dbc.sql @@ -1,2 +1 @@ UPDATE `spell_dbc` SET `EffectApplyAuraName1`=4 WHERE `Id`=56817; - diff --git a/sql/updates/world/2012_04_05_00_world_gameobject_template.sql b/sql/updates/world/2012_04_05_00_world_gameobject_template.sql new file mode 100644 index 00000000000..ab05bf43b86 --- /dev/null +++ b/sql/updates/world/2012_04_05_00_world_gameobject_template.sql @@ -0,0 +1,32 @@ +DELETE FROM `gameobject_template` WHERE `entry`=202931; +INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `WDBVerified`) VALUES +(202931, 5, 9463, 'Serpent Offering', '', '', '', 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.17, 0, 0, 0, 0, 0, 0, 12340); -- -Unknown- + +UPDATE `gameobject_template` SET `questItem1`=30527, `questItem2`=30524, `questItem3`=30525, `questItem4`=30526 WHERE `entry`=184815; -- Sealed Coffin +-- UPDATE `gameobject_template` SET `data0`=2061, `WDBVerified`=12340 WHERE `entry`=151951; -- Idol Oven Fire +-- UPDATE `gameobject_template` SET `type`=5, `data3`=0, `data5`=0 WHERE `entry`=188187; -- Snow Pile +UPDATE `gameobject_template` SET `size`=0.45 WHERE `entry`=190169; -- Tiger Lily +UPDATE `gameobject_template` SET `unk1`='' WHERE `entry`=190549; -- The Zephyr +UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=191300; -- Fire +UPDATE `gameobject_template` SET `displayId`=7836 WHERE `entry`=196485; -- Saronite Rock +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126337; -- 126337 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126338; -- 126338 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126339; -- 126339 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126340; -- 126340 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126341; -- 126341 +-- UPDATE `gameobject_template` SET `data0`=2061 WHERE `entry`=126345; -- 126345 +UPDATE `gameobject_template` SET `data2`=23787, `data7`=3605, `data19`=0 WHERE `entry`=202443; -- Dedication of Honor +UPDATE `gameobject_template` SET `type`=10 WHERE `entry`=166872; -- Supply Crate +UPDATE `gameobject_template` SET `data6`=-1000 WHERE `entry`=178559; -- Larva Spewer + +/* +GameObject (Entry: 126337 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126338 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126339 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126340 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126341 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 126345 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 151951 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +GameObject (Entry: 191300 GoType: 8) have data0=2061 but SpellFocus (Id: 2061) not exist. +Gameobject (Entry: 188192 GoType: 3) have data7=188187 but GO (Entry 188187) have not GAMEOBJECT_TYPE_TRAP (6) type. +*/ -- cgit v1.2.3 From 2d0e5e2e0c16ce1a7683ecf9cdc83cdc644d1eb0 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 8 Apr 2012 12:56:18 +0100 Subject: Core/Conditions: Add missing code for CONDITION_TITLE DB/Char: Add changes to character base Thanks to manuel and QAston for noticing --- sql/base/characters_database.sql | 2 ++ src/server/game/Conditions/ConditionMgr.cpp | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'sql/base') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index f0e919a5bcd..9908254ff0e 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1932,6 +1932,8 @@ CREATE TABLE `lag_reports` ( `posX` float NOT NULL DEFAULT '0', `posY` float NOT NULL DEFAULT '0', `posZ` float NOT NULL DEFAULT '0', + `latency` int(10) unsigned NOT NULL DEFAULT '0', + `createTime` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`reportId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Player System'; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 1fb0a78605b..96f454fd3e2 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -274,6 +274,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) condMeets = object->GetPhaseMask() & ConditionValue1; break; } + case CONDITION_TITLE: + { + if (Player* player = object->ToPlayer()) + condMeets = player->HasTitle(ConditionValue1); + break; + } default: condMeets = false; break; -- cgit v1.2.3 From 73e6eedce8e89f823de4646e204d78826758c840 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 7 Jun 2012 23:25:33 +0200 Subject: And missing full sql changes --- sql/base/characters_database.sql | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/base') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 9908254ff0e..57e5f6f6ab7 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1266,6 +1266,7 @@ DROP TABLE IF EXISTS `creature_respawn`; CREATE TABLE `creature_respawn` ( `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `respawnTime` int(10) unsigned NOT NULL DEFAULT '0', + `mapId` smallint(10) unsigned NOT NULL DEFAULT '0', `instanceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Instance Identifier', PRIMARY KEY (`guid`,`instanceId`), KEY `idx_instance` (`instanceId`) @@ -1339,6 +1340,7 @@ DROP TABLE IF EXISTS `gameobject_respawn`; CREATE TABLE `gameobject_respawn` ( `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', `respawnTime` int(10) unsigned NOT NULL DEFAULT '0', + `mapId` smallint(10) unsigned NOT NULL DEFAULT '0', `instanceId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Instance Identifier', PRIMARY KEY (`guid`,`instanceId`), KEY `idx_instance` (`instanceId`) -- cgit v1.2.3