mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[8444] Prevent spawn gameobjects with invalid displayid by command.
Also fix mangos string for not existed gameobejct entry.
This commit is contained in:
parent
a9dea03e09
commit
4d0088e7a9
8 changed files with 35 additions and 16 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_8416_01_mangos_spell_learn_spell` bit(1) default NULL
|
`required_8444_01_mangos_mangos_string` 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';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -2720,6 +2720,7 @@ INSERT INTO `mangos_string` VALUES
|
||||||
(345,'Forced customize for player %s will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(345,'Forced customize for player %s will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(346,'Forced customize for player %s (GUID #%u) will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(346,'Forced customize for player %s (GUID #%u) will be requested at next login.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(347,'TaxiNode ID %u not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(347,'TaxiNode ID %u not found!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
(348,'Game Object (Entry: %u) have invalid data and can\'t be spawned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(400,'|cffff0000[System Message]:|rScripts reloaded',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(400,'|cffff0000[System Message]:|rScripts reloaded',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(401,'You change security level of account %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(401,'You change security level of account %s to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(402,'%s changed your security level to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(402,'%s changed your security level to %i.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
|
@ -2841,7 +2842,7 @@ INSERT INTO `mangos_string` VALUES
|
||||||
(519,'|cffffffff|Htele:%s|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(519,'|cffffffff|Htele:%s|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(520,'%d - |cffffffff|Hspell:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(520,'%d - |cffffffff|Hspell:%d|h[%s]|h|r ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(521,'%d - |cffffffff|Hskill:%d|h[%s %s]|h|r %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(521,'%d - |cffffffff|Hskill:%d|h[%s %s]|h|r %s %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(522,'Game Object (GUID: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(522,'Game Object (Entry: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(523,'>> Game Object %s (GUID: %u) at %f %f %f. Orientation %f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(523,'>> Game Object %s (GUID: %u) at %f %f %f. Orientation %f.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(524,'Selected object:\n|cffffffff|Hgameobject:%d|h[%s]|h|r GUID: %u ID: %u\nX: %f Y: %f Z: %f MapId: %u\nOrientation: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(524,'Selected object:\n|cffffffff|Hgameobject:%d|h[%s]|h|r GUID: %u ID: %u\nX: %f Y: %f Z: %f MapId: %u\nOrientation: %f',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
(525,'>> Add Game Object \'%i\' (%s) (GUID: %i) added at \'%f %f %f\'.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
(525,'>> Add Game Object \'%i\' (%s) (GUID: %i) added at \'%f %f %f\'.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
|
|
||||||
6
sql/updates/8444_01_mangos_mangos_string.sql
Normal file
6
sql/updates/8444_01_mangos_mangos_string.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_8416_01_mangos_spell_learn_spell required_8444_01_mangos_mangos_string bit;
|
||||||
|
|
||||||
|
DELETE FROM mangos_string WHERE entry IN(348,522);
|
||||||
|
INSERT INTO mangos_string VALUES
|
||||||
|
(348,'Game Object (Entry: %u) have invalid data and can\'t be spawned',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
|
||||||
|
(522,'Game Object (Entry: %u) not found',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
|
||||||
|
|
@ -96,6 +96,7 @@ pkgdata_DATA = \
|
||||||
8412_01_mangos_mangos_string.sql \
|
8412_01_mangos_mangos_string.sql \
|
||||||
8416_01_mangos_spell_learn_spell.sql \
|
8416_01_mangos_spell_learn_spell.sql \
|
||||||
8433_01_characters_character_account_data.sql \
|
8433_01_characters_character_account_data.sql \
|
||||||
|
8444_01_mangos_mangos_string.sql \
|
||||||
README
|
README
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
|
|
@ -172,4 +173,5 @@ EXTRA_DIST = \
|
||||||
8412_01_mangos_mangos_string.sql \
|
8412_01_mangos_mangos_string.sql \
|
||||||
8416_01_mangos_spell_learn_spell.sql \
|
8416_01_mangos_spell_learn_spell.sql \
|
||||||
8433_01_characters_character_account_data.sql \
|
8433_01_characters_character_account_data.sql \
|
||||||
|
8444_01_mangos_mangos_string.sql \
|
||||||
README
|
README
|
||||||
|
|
|
||||||
|
|
@ -331,7 +331,8 @@ enum MangosStrings
|
||||||
LANG_CUSTOMIZE_PLAYER = 345,
|
LANG_CUSTOMIZE_PLAYER = 345,
|
||||||
LANG_CUSTOMIZE_PLAYER_GUID = 346,
|
LANG_CUSTOMIZE_PLAYER_GUID = 346,
|
||||||
LANG_COMMAND_GOTAXINODENOTFOUND = 347,
|
LANG_COMMAND_GOTAXINODENOTFOUND = 347,
|
||||||
// Room for more level 2 348-399 not used
|
LANG_GAMEOBJECT_HAVE_INVALID_DATA = 348,
|
||||||
|
// Room for more level 2 349-399 not used
|
||||||
|
|
||||||
// level 3 chat
|
// level 3 chat
|
||||||
LANG_SCRIPTS_RELOADED = 400,
|
LANG_SCRIPTS_RELOADED = 400,
|
||||||
|
|
|
||||||
|
|
@ -700,15 +700,24 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args)
|
||||||
|
|
||||||
char* spawntimeSecs = strtok(NULL, " ");
|
char* spawntimeSecs = strtok(NULL, " ");
|
||||||
|
|
||||||
const GameObjectInfo *goI = objmgr.GetGameObjectInfo(id);
|
const GameObjectInfo *gInfo = objmgr.GetGameObjectInfo(id);
|
||||||
|
|
||||||
if (!goI)
|
if (!gInfo)
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST,id);
|
PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST,id);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(gInfo->displayId))
|
||||||
|
{
|
||||||
|
// report to DB errors log as in loading case
|
||||||
|
sLog.outErrorDb("Gameobject (Entry %u GoType: %u) have invalid displayId (%u), not spawned.",id, gInfo->type, gInfo->displayId);
|
||||||
|
PSendSysMessage(LANG_GAMEOBJECT_HAVE_INVALID_DATA,id);
|
||||||
|
SetSentErrorMessage(true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Player *chr = m_session->GetPlayer();
|
Player *chr = m_session->GetPlayer();
|
||||||
float x = float(chr->GetPositionX());
|
float x = float(chr->GetPositionX());
|
||||||
float y = float(chr->GetPositionY());
|
float y = float(chr->GetPositionY());
|
||||||
|
|
@ -719,7 +728,7 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args)
|
||||||
GameObject* pGameObj = new GameObject;
|
GameObject* pGameObj = new GameObject;
|
||||||
uint32 db_lowGUID = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
|
uint32 db_lowGUID = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
|
||||||
|
|
||||||
if(!pGameObj->Create(db_lowGUID, goI->id, map, chr->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
|
if(!pGameObj->Create(db_lowGUID, gInfo->id, map, chr->GetPhaseMaskForSpawn(), x, y, z, o, 0.0f, 0.0f, 0.0f, 0.0f, 0, GO_STATE_READY))
|
||||||
{
|
{
|
||||||
delete pGameObj;
|
delete pGameObj;
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -742,14 +751,14 @@ bool ChatHandler::HandleGameObjectAddCommand(const char* args)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
sLog.outDebug(GetMangosString(LANG_GAMEOBJECT_CURRENT), goI->name, db_lowGUID, x, y, z, o);
|
sLog.outDebug(GetMangosString(LANG_GAMEOBJECT_CURRENT), gInfo->name, db_lowGUID, x, y, z, o);
|
||||||
|
|
||||||
map->Add(pGameObj);
|
map->Add(pGameObj);
|
||||||
|
|
||||||
// TODO: is it really necessary to add both the real and DB table guid here ?
|
// TODO: is it really necessary to add both the real and DB table guid here ?
|
||||||
objmgr.AddGameobjectToGrid(db_lowGUID, objmgr.GetGOData(db_lowGUID));
|
objmgr.AddGameobjectToGrid(db_lowGUID, objmgr.GetGOData(db_lowGUID));
|
||||||
|
|
||||||
PSendSysMessage(LANG_GAMEOBJECT_ADD,id,goI->name,db_lowGUID,x,y,z);
|
PSendSysMessage(LANG_GAMEOBJECT_ADD,id,gInfo->name,db_lowGUID,x,y,z);
|
||||||
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 "8443"
|
#define REVISION_NR "8444"
|
||||||
#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_8433_01_characters_character_account_data"
|
#define REVISION_DB_CHARACTERS "required_8433_01_characters_character_account_data"
|
||||||
#define REVISION_DB_MANGOS "required_8416_01_mangos_spell_learn_spell"
|
#define REVISION_DB_MANGOS "required_8444_01_mangos_mangos_string"
|
||||||
#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