mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[0016] Some Clean from last Commits.
Signed-off-by: Salja <salja2012@hotmail.de>
This commit is contained in:
parent
c7b2b311d8
commit
f8a7533a92
6 changed files with 42 additions and 40 deletions
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
DROP TABLE IF EXISTS `realmd_db_version`;
|
||||
CREATE TABLE `realmd_db_version` (
|
||||
`required_00014_01_realmd_account_access` bit(1) default NULL
|
||||
`required_0014_xxxxx_01_realmd_account_access` bit(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
|
||||
|
||||
--
|
||||
|
|
@ -86,7 +86,7 @@ CREATE TABLE `account_access` (
|
|||
`gmlevel` tinyint(3) unsigned NOT NULL,
|
||||
`RealmID` int(11) NOT NULL DEFAULT '-1',
|
||||
PRIMARY KEY (`id`,`RealmID`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
) ENGINE=MYISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `account_access`
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
ALTER TABLE realmd_db_version CHANGE COLUMN required_00014_01_realmd_account_access required_00014_02_realmd_account BIT;
|
||||
|
||||
ALTER TABLE `account` DROP `gmlevel`;
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
ALTER TABLE realmd_db_version CHANGE COLUMN required_0001_xxxxx_01_realmd required_00014_01_realmd_account_access bit;
|
||||
ALTER TABLE realmd_db_version CHANGE COLUMN required_0001_xxxxx_01_realmd required_0014_xxxxx_01_realmd_account_access bit;
|
||||
|
||||
--
|
||||
-- Table Stucture for table `account `account_access`
|
||||
--
|
||||
ALTER TABLE `account` DROP `gmlevel`;
|
||||
|
||||
DROP TABLE IF EXISTS `account_access`;
|
||||
|
||||
|
|
@ -12,3 +10,9 @@ CREATE TABLE `account_access` (
|
|||
`RealmID` int(11) NOT NULL DEFAULT '-1',
|
||||
PRIMARY KEY (`id`,`RealmID`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `account_access` VALUES
|
||||
(1,3,-1),
|
||||
(2,2,-1),
|
||||
(3,1,-1),
|
||||
(4,0,-1);
|
||||
|
|
@ -1167,7 +1167,7 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(char* args)
|
|||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
// Check if provided realmID is not current realmID, or isn't -1
|
||||
/// check if provided realmID is not current realmID, or isn't -1
|
||||
if (gmRealmID != realmID && gmRealmID != -1)
|
||||
{
|
||||
SendSysMessage(LANG_INVALID_REALMID);
|
||||
|
|
@ -1182,7 +1182,9 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(char* args)
|
|||
}
|
||||
|
||||
PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm);
|
||||
// If gmRealmID is -1, delete all values for the account id, else, insert values for the specific realmID
|
||||
//LoginDatabase.PExecute("UPDATE account_access SET gmlevel = '%i' WHERE id = '%u'", gm, targetAccountId);
|
||||
|
||||
/// If gmRealmID is -1, delete all values for the account id, else, insert values for the specific realmID
|
||||
if (gmRealmID == -1)
|
||||
{
|
||||
LoginDatabase.PExecute("DELETE FROM account_access WHERE id = '%u'", targetAccountId);
|
||||
|
|
@ -1193,7 +1195,6 @@ bool ChatHandler::HandleAccountSetGmLevelCommand(char* args)
|
|||
LoginDatabase.PExecute("DELETE FROM account_access WHERE id = '%u' AND RealmID = '%d'", targetAccountId, realmID);
|
||||
LoginDatabase.PExecute("INSERT INTO account_access VALUES ('%u','%d','%d')", targetAccountId, gm, realmID);
|
||||
}
|
||||
//LoginDatabase.PExecute("UPDATE account_access SET gmlevel = '%i' WHERE id = '%u'", gm, targetAccountId);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "0015"
|
||||
#define REVISION_NR "0016"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@
|
|||
#define __REVISION_SQL_H__
|
||||
#define REVISION_DB_CHARACTERS "required_0001_xxxxx_01_characters"
|
||||
#define REVISION_DB_MANGOS "required_0001_xxxxx_01_mangos"
|
||||
#define REVISION_DB_REALMD "required_00014_02_realmd_account"
|
||||
#define REVISION_DB_REALMD "required_0014_xxxxx_01_realmd_account_access"
|
||||
#endif // __REVISION_SQL_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue