mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[8600] allow unbinding instances also per map
so command can be called as .instance unbind all or .instance unbind #mapid now output also the mapname next to the mapid for the humanoid users among us ;)
This commit is contained in:
parent
dc96ddfbfb
commit
49c52ddf9c
6 changed files with 65 additions and 22 deletions
|
|
@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`creature_ai_version` varchar(120) default NULL,
|
`creature_ai_version` varchar(120) default NULL,
|
||||||
`cache_id` int(10) default '0',
|
`cache_id` int(10) default '0',
|
||||||
`required_8589_10_mangos_spell_proc_event` bit(1) default NULL
|
`required_8600_01_mangos_command` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -434,7 +434,7 @@ INSERT INTO `command` VALUES
|
||||||
('honor addkill',2,'Syntax: .honor addkikll\r\n\r\nAdd the targeted unit as one of your pvp kills today (you only get honor if it\'s a racial leader or a player)'),
|
('honor addkill',2,'Syntax: .honor addkikll\r\n\r\nAdd the targeted unit as one of your pvp kills today (you only get honor if it\'s a racial leader or a player)'),
|
||||||
('honor update',2,'Syntax: .honor update\r\n\r\nForce the yesterday\'s honor fields to be updated with today\'s data, which will get reset for the selected player.'),
|
('honor update',2,'Syntax: .honor update\r\n\r\nForce the yesterday\'s honor fields to be updated with today\'s data, which will get reset for the selected player.'),
|
||||||
('hover',3,'Syntax: .hover #flag\r\n\r\nEnable or disable hover mode for your character.\r\n\r\nUse a #flag of value 1 to enable, use a #flag value of 0 to disable hover.'),
|
('hover',3,'Syntax: .hover #flag\r\n\r\nEnable or disable hover mode for your character.\r\n\r\nUse a #flag of value 1 to enable, use a #flag value of 0 to disable hover.'),
|
||||||
('instance unbind',3,'Syntax: .instance unbind all\r\n All of the selected player\'s binds will be cleared.'),
|
('instance unbind',3,'Syntax: .instance unbind all\r\n All of the selected player\'s binds will be cleared.\r\n.instance unbind #mapid\r\n Only the specified #mapid instance will be cleared.'),
|
||||||
('instance listbinds',3,'Syntax: .instance listbinds\r\n Lists the binds of the selected player.'),
|
('instance listbinds',3,'Syntax: .instance listbinds\r\n Lists the binds of the selected player.'),
|
||||||
('instance stats',3,'Syntax: .instance stats\r\n Shows statistics about instances.'),
|
('instance stats',3,'Syntax: .instance stats\r\n Shows statistics about instances.'),
|
||||||
('instance savedata',3,'Syntax: .instance savedata\r\n Save the InstanceData for the current player\'s map to the DB.'),
|
('instance savedata',3,'Syntax: .instance savedata\r\n Save the InstanceData for the current player\'s map to the DB.'),
|
||||||
|
|
|
||||||
8
sql/updates/8600_01_mangos_command.sql
Normal file
8
sql/updates/8600_01_mangos_command.sql
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_8589_10_mangos_spell_proc_event required_8600_01_mangos_command bit;
|
||||||
|
|
||||||
|
DELETE FROM command where name='instance unbind';
|
||||||
|
|
||||||
|
INSERT INTO `command` VALUES
|
||||||
|
('instance unbind',3,'Syntax: .instance unbind all\r\n All of the selected
|
||||||
|
player\'s binds will be cleared.\r\n.instance unbind #mapid\r\n Only the
|
||||||
|
specified #mapid instance will be cleared.');
|
||||||
|
|
@ -129,6 +129,7 @@ pkgdata_DATA = \
|
||||||
8589_10_mangos_spell_proc_event.sql \
|
8589_10_mangos_spell_proc_event.sql \
|
||||||
8589_11_characters_characters.sql \
|
8589_11_characters_characters.sql \
|
||||||
8596_01_characters_bugreport.sql \
|
8596_01_characters_bugreport.sql \
|
||||||
|
8600_01_mangos_command.sql \
|
||||||
README
|
README
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
|
|
@ -238,4 +239,5 @@ EXTRA_DIST = \
|
||||||
8589_10_mangos_spell_proc_event.sql \
|
8589_10_mangos_spell_proc_event.sql \
|
||||||
8589_11_characters_characters.sql \
|
8589_11_characters_characters.sql \
|
||||||
8596_01_characters_bugreport.sql \
|
8596_01_characters_bugreport.sql \
|
||||||
|
8600_01_mangos_command.sql \
|
||||||
README
|
README
|
||||||
|
|
|
||||||
|
|
@ -5920,7 +5920,14 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
|
||||||
{
|
{
|
||||||
InstanceSave *save = itr->second.save;
|
InstanceSave *save = itr->second.save;
|
||||||
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
||||||
PSendSysMessage("map: %d inst: %d perm: %s diff: %s canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty() == DUNGEON_DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str());
|
if (const MapEntry* entry = sMapStore.LookupEntry(itr->first))
|
||||||
|
{
|
||||||
|
PSendSysMessage("map: %d (%s) inst: %d perm: %s diff: %s canReset: %s TTR: %s",
|
||||||
|
itr->first, entry->name[m_session->GetSessionDbcLocale()], save->GetInstanceId(), itr->second.perm ? "yes" : "no",
|
||||||
|
save->GetDifficulty() == DUNGEON_DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
PSendSysMessage("bound for a nonexistant map %u", itr->first);
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5936,7 +5943,14 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
|
||||||
{
|
{
|
||||||
InstanceSave *save = itr->second.save;
|
InstanceSave *save = itr->second.save;
|
||||||
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
||||||
PSendSysMessage("map: %d inst: %d perm: %s diff: %s canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty() == DUNGEON_DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str());
|
if (const MapEntry* entry = sMapStore.LookupEntry(itr->first))
|
||||||
|
{
|
||||||
|
PSendSysMessage("map: %d (%s) inst: %d perm: %s diff: %s canReset: %s TTR: %s",
|
||||||
|
itr->first, entry->name[m_session->GetSessionDbcLocale()], save->GetInstanceId(), itr->second.perm ? "yes" : "no",
|
||||||
|
save->GetDifficulty() == DUNGEON_DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
PSendSysMessage("bound for a nonexistant map %u", itr->first);
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -5951,22 +5965,42 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char* args)
|
||||||
if(!*args)
|
if(!*args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::string cmd = args;
|
|
||||||
if(cmd == "all")
|
|
||||||
{
|
|
||||||
Player* player = getSelectedPlayer();
|
Player* player = getSelectedPlayer();
|
||||||
if (!player) player = m_session->GetPlayer();
|
if (!player)
|
||||||
|
player = m_session->GetPlayer();
|
||||||
uint32 counter = 0;
|
uint32 counter = 0;
|
||||||
|
uint32 mapid = 0;
|
||||||
|
bool got_map = false;
|
||||||
|
|
||||||
|
if (args != "all")
|
||||||
|
{
|
||||||
|
got_map = true;
|
||||||
|
mapid = atoi(args);
|
||||||
|
}
|
||||||
|
|
||||||
for(uint8 i = 0; i < MAX_DIFFICULTY; ++i)
|
for(uint8 i = 0; i < MAX_DIFFICULTY; ++i)
|
||||||
{
|
{
|
||||||
Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
|
Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
|
||||||
for(Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
|
for(Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
|
||||||
{
|
{
|
||||||
|
if (got_map && mapid != itr->first)
|
||||||
|
{
|
||||||
|
++itr;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if(itr->first != player->GetMapId())
|
if(itr->first != player->GetMapId())
|
||||||
{
|
{
|
||||||
InstanceSave *save = itr->second.save;
|
InstanceSave *save = itr->second.save;
|
||||||
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
||||||
PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %s canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty() == DUNGEON_DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str());
|
|
||||||
|
if (const MapEntry* entry = sMapStore.LookupEntry(itr->first))
|
||||||
|
{
|
||||||
|
PSendSysMessage("unbinding map: %d (%s) inst: %d perm: %s diff: %s canReset: %s TTR: %s",
|
||||||
|
itr->first, entry->name[m_session->GetSessionDbcLocale()], save->GetInstanceId(), itr->second.perm ? "yes" : "no",
|
||||||
|
save->GetDifficulty() == DUNGEON_DIFFICULTY_NORMAL ? "normal" : "heroic", save->CanReset() ? "yes" : "no", timeleft.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
PSendSysMessage("bound for a nonexistant map %u", itr->first);
|
||||||
player->UnbindInstance(itr, Difficulty(i));
|
player->UnbindInstance(itr, Difficulty(i));
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
@ -5975,7 +6009,6 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char* args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PSendSysMessage("instances unbound: %d", counter);
|
PSendSysMessage("instances unbound: %d", counter);
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8599"
|
#define REVISION_NR "8600"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __REVISION_SQL_H__
|
#ifndef __REVISION_SQL_H__
|
||||||
#define __REVISION_SQL_H__
|
#define __REVISION_SQL_H__
|
||||||
#define REVISION_DB_CHARACTERS "required_8596_01_characters_bugreport"
|
#define REVISION_DB_CHARACTERS "required_8596_01_characters_bugreport"
|
||||||
#define REVISION_DB_MANGOS "required_8589_10_mangos_spell_proc_event"
|
#define REVISION_DB_MANGOS "required_8600_01_mangos_command"
|
||||||
#define REVISION_DB_REALMD "required_8332_01_realmd_realmcharacters"
|
#define REVISION_DB_REALMD "required_8332_01_realmd_realmcharacters"
|
||||||
#endif // __REVISION_SQL_H__
|
#endif // __REVISION_SQL_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue