本文整理汇总了C++中ARCEMU_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ ARCEMU_ASSERT函数的具体用法?C++ ARCEMU_ASSERT怎么用?C++ ARCEMU_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ARCEMU_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetEntry
void Item::Create(uint32 itemid, Player* owner)
{
SetEntry(itemid);
if (owner)
{
uint64 OwnerGUID = owner->GetGUID();
SetOwnerGUID(OwnerGUID);
SetContainerGUID(OwnerGUID);
}
SetStackCount(1);
m_itemProto = ItemPrototypeStorage.LookupEntry(itemid);
ARCEMU_ASSERT(m_itemProto != NULL);
SetCharges(0, m_itemProto->Spells[0].Charges);
SetCharges(1, m_itemProto->Spells[1].Charges);
SetCharges(2, m_itemProto->Spells[2].Charges);
SetCharges(3, m_itemProto->Spells[3].Charges);
SetCharges(4, m_itemProto->Spells[4].Charges);
SetDurability(m_itemProto->MaxDurability);
SetDurabilityMax(m_itemProto->MaxDurability);
m_owner = owner;
locked = m_itemProto->LockId ? true : false;
}
示例2: ARCEMU_ASSERT
void Container::LoadFromDB(Field* fields)
{
uint32 itemid = fields[2].GetUInt32();
m_itemProto = ItemPrototypeStorage.LookupEntry(itemid);
ARCEMU_ASSERT(m_itemProto != NULL);
SetEntry(itemid);
SetCreatorGUID(fields[5].GetUInt32());
SetStackCount(1);
SetUInt32Value(ITEM_FIELD_FLAGS, fields[8].GetUInt32());
SetItemRandomPropertyId(fields[9].GetUInt32());
SetDurabilityMax(m_itemProto->MaxDurability);
SetDurability(fields[12].GetUInt32());
SetNumSlots(m_itemProto->ContainerSlots);
m_Slot = new Item*[m_itemProto->ContainerSlots];
memset(m_Slot, 0, sizeof(Item*) * (m_itemProto->ContainerSlots));
}
示例3: va_start
void Guild::LogGuildEvent(uint8 iEvent, uint8 iStringCount, ...)
{
if(!m_commandLogging)
return;
va_list ap;
char* strs[4] = {NULL, NULL, NULL, NULL};
va_start(ap, iStringCount);
ARCEMU_ASSERT(iStringCount <= 4);
WorldPacket data(SMSG_GUILD_EVENT, 100);
uint32 i;
data << iEvent;
data << iStringCount;
for(i = 0; i < iStringCount; ++i)
{
strs[i] = va_arg(ap, char*);
data << strs[i];
}
va_end(ap);
SendPacket(&data);
}
示例4: ARCEMU_ASSERT
bool QuestLogEntry::LoadFromDB(Field* fields)
{
// playerguid,questid,timeleft,area0,area1,area2,area3,kill0,kill1,kill2,kill3
int f = 3;
ARCEMU_ASSERT(m_plr && m_quest);
expirytime = fields[f].GetUInt32();
f++;
for(int i = 0; i < 4; ++i)
{
m_explored_areas[i] = fields[f].GetUInt32();
f++;
CALL_QUESTSCRIPT_EVENT(this, OnExploreArea)(m_explored_areas[i], m_plr, this);
}
for(int i = 0; i < 4; ++i)
{
m_mobcount[i] = fields[f].GetUInt32();
f++;
if(GetQuest()->required_mobtype[i] == QUEST_MOB_TYPE_CREATURE)
{
CALL_QUESTSCRIPT_EVENT(this, OnCreatureKill)(GetQuest()->required_mob[i], m_plr, this);
}
else
{
CALL_QUESTSCRIPT_EVENT(this, OnGameObjectActivate)(GetQuest()->required_mob[i], m_plr, this);
}
}
completed = fields[f].GetUInt32();
mDirty = false;
return true;
}
示例5: ARCEMU_ASSERT
void WorldSocket::Authenticate()
{
ARCEMU_ASSERT(pAuthenticationPacket != NULL);
mQueued = false;
if(mSession == NULL)
return;
if(mSession->HasFlag(ACCOUNT_FLAG_XPACK_02))
OutPacket(SMSG_AUTH_RESPONSE, 11, "\x0C\x30\x78\x00\x00\x00\x00\x00\x00\x00\x02");
else if(mSession->HasFlag(ACCOUNT_FLAG_XPACK_01))
OutPacket(SMSG_AUTH_RESPONSE, 11, "\x0C\x30\x78\x00\x00\x00\x00\x00\x00\x00\x01");
else
OutPacket(SMSG_AUTH_RESPONSE, 11, "\x0C\x30\x78\x00\x00\x00\x00\x00\x00\x00\x00");
sAddonMgr.SendAddonInfoPacket(pAuthenticationPacket, static_cast< uint32 >(pAuthenticationPacket->rpos()), mSession);
mSession->_latency = _latency;
delete pAuthenticationPacket;
pAuthenticationPacket = NULL;
sWorld.AddSession(mSession);
sWorld.AddGlobalSession(mSession);
if(mSession->HasGMPermissions())
sWorld.gmList.insert(mSession);
}
示例6: ARCEMU_ASSERT
MapMgr* InstanceMgr::_CreateInstance(uint32 mapid, uint32 instanceid)
{
MapInfo const* inf = sMySQLStore.GetWorldMapInfo(mapid);
ARCEMU_ASSERT(inf != nullptr && inf->type == INSTANCE_NULL);
ARCEMU_ASSERT(mapid < NUM_MAPS && m_maps[mapid] != NULL);
LogNotice("InstanceMgr : Creating continent %s.", m_maps[mapid]->GetMapName().c_str());
MapMgr* newMap = new MapMgr(m_maps[mapid], mapid, instanceid);
ARCEMU_ASSERT(newMap != NULL);
// Scheduling the new map for running
ThreadPool.ExecuteTask(newMap);
m_singleMaps[mapid] = newMap;
return newMap;
}
示例7: ARCEMU_ASSERT
MapMgr* InstanceMgr::_CreateInstance(uint32 mapid, uint32 instanceid)
{
MapInfo* inf = WorldMapInfoStorage.LookupEntry(mapid);
ARCEMU_ASSERT(inf != NULL && inf->type == INSTANCE_NULL);
ARCEMU_ASSERT(mapid < NUM_MAPS && m_maps[ mapid ] != NULL);
Log.Notice("InstanceMgr", "Creating continent %s.", m_maps[mapid]->GetName());
MapMgr* newMap = new MapMgr(m_maps[mapid], mapid, instanceid);
ARCEMU_ASSERT(newMap != NULL);
// Scheduling the new map for running
ThreadPool.ExecuteTask(newMap);
m_singleMaps[mapid] = newMap;
return newMap;
}
示例8: ARCEMU_ASSERT
AuctionHouse::AuctionHouse(uint32 ID)
{
dbc = sAuctionHouseStore.LookupEntry(ID);
ARCEMU_ASSERT(dbc != NULL);
cut_percent = dbc->tax / 100.0f;
deposit_percent = dbc->fee / 100.0f;
enabled = true;
}
示例9: ARCEMU_ASSERT
void Arena::HookOnPlayerDeath(Player* plr)
{
ARCEMU_ASSERT(plr != NULL);
if(plr->m_isGmInvisible == true) return;
if(m_playersAlive.find(plr->GetLowGUID()) != m_playersAlive.end())
{
m_playersCount[plr->GetTeam()]--;
UpdatePlayerCounts();
m_playersAlive.erase(plr->GetLowGUID());
}
}
示例10: ARCEMU_ASSERT
bool Transporter::RemovePassenger(Player* passenger)
{
ARCEMU_ASSERT(passenger != nullptr);
m_passengers.erase(passenger->getGuidLow());
LOG_DEBUG("Player %s removed from transport %u.", passenger->GetName(), this->GetGameObjectProperties()->entry);
if (passenger->HasUnitMovementFlag(MOVEFLAG_TRANSPORT))
{
passenger->RemoveUnitMovementFlag(MOVEFLAG_TRANSPORT);
}
return true;
}
示例11: ARCEMU_ASSERT
void Guild::SetGuildMaster(PlayerInfo* pNewMaster)
{
GuildMemberMap::iterator itr = m_members.find(pNewMaster);
ARCEMU_ASSERT(m_ranks[0] != NULL);
if(itr == m_members.end())
return;
itr->second->pRank = m_ranks[0];
itr->first->guildRank = itr->second->pRank;
CharacterDatabase.Execute("UPDATE guild_data SET guildRank = 0 WHERE playerid = %u AND guildid = %u", itr->first->guid, m_guildId);
CharacterDatabase.Execute("UPDATE guilds SET leaderGuid = %u WHERE guildId = %u", itr->first->guid, m_guildId);
m_guildLeader = itr->first->guid;
LogGuildEvent(GUILD_EVENT_LEADER_CHANGED, 2, pNewMaster->name, pNewMaster->name);
}
示例12: event_GetInstanceID
void EventableObject::event_AddEvent(TimedEvent* ptr)
{
m_lock.Acquire();
if(m_holder == NULL)
{
m_event_Instanceid = event_GetInstanceID();
m_holder = sEventMgr.GetEventHolder(m_event_Instanceid);
if(m_holder == NULL)
{
///////////////////////////////////////// this is for me for debugging purposes - dfighter ////////////////////////////
// ARCEMU_ASSERT( false );
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// We still couldn't find an eventholder for us so let's run in WorldRunnable
m_event_Instanceid = WORLD_INSTANCE;
m_holder = sEventMgr.GetEventHolder(m_event_Instanceid);
}
}
// We still couldn't find an event holder for ourselves :(
ARCEMU_ASSERT(m_holder != NULL);
// If we are flagged not to run in WorldRunnable then we won't!
// This is much better than adding us to the eventholder and removing on an update
if(m_event_Instanceid == WORLD_INSTANCE && (ptr->eventFlag & EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT))
{
delete ptr->cb;
delete ptr;
///////////////////////////////////////// this is for me for debugging purposes - dfighter ////////////////////////////
// ARCEMU_ASSERT( false );
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
m_lock.Release();
return;
}
ptr->IncRef();
ptr->instanceId = m_event_Instanceid;
pair<uint32, TimedEvent*> p(ptr->eventType, ptr);
m_events.insert(p);
m_lock.Release();
/* Add to event manager */
m_holder->AddEvent(ptr);
}
示例13: GetCell
void MapMgr::LoadAllCells()
{
// eek
MapCell* cellInfo;
CellSpawns* spawns;
for(uint32 x = 0 ; x < _sizeX ; x ++)
{
for(uint32 y = 0 ; y < _sizeY ; y ++)
{
cellInfo = GetCell(x , y);
if(!cellInfo)
{
// Cell doesn't exist, create it.
// There is no spoon. Err... cell.
cellInfo = Create(x , y);
cellInfo->Init(x , y , this);
LOG_DETAIL("Created cell [%u,%u] on map %u (instance %u)." , x , y , _mapId , m_instanceID);
cellInfo->SetActivity(true);
_map->CellGoneActive(x , y);
ARCEMU_ASSERT(!cellInfo->IsLoaded());
spawns = _map->GetSpawnsList(x , y);
if(spawns)
cellInfo->LoadObjects(spawns);
}
else
{
// Cell exists, but is inactive
if(!cellInfo->IsActive())
{
LOG_DETAIL("Activated cell [%u,%u] on map %u (instance %u).", x, y, _mapId, m_instanceID);
_map->CellGoneActive(x , y);
cellInfo->SetActivity(true);
if(!cellInfo->IsLoaded())
{
//LOG_DETAIL("Loading objects for Cell [%u][%u] on map %u (instance %u)...",
// posX, posY, this->_mapId, m_instanceID);
spawns = _map->GetSpawnsList(x , y);
if(spawns)
cellInfo->LoadObjects(spawns);
}
}
}
}
}
}
示例14: ARCEMU_ASSERT
Creature* MapScriptInterface::SpawnCreature(uint32 Entry, float cX, float cY, float cZ, float cO, bool AddToWorld, bool tmplate, uint32 Misc1, uint32 Misc2, uint32 phase)
{
CreatureProto* proto = CreatureProtoStorage.LookupEntry(Entry);
CreatureInfo* info = CreatureNameStorage.LookupEntry(Entry);
if(proto == NULL || info == NULL)
{
return 0;
}
CreatureSpawn* sp = new CreatureSpawn;
sp->entry = Entry;
uint32 DisplayID = 0;
uint8 Gender = info->GenerateModelId(&DisplayID);
sp->displayid = DisplayID;
sp->form = 0;
sp->id = 0;
sp->movetype = 0;
sp->x = cX;
sp->y = cY;
sp->z = cZ;
sp->o = cO;
sp->emote_state = 0;
sp->flags = 0;
sp->factionid = proto->Faction;
sp->bytes0 = 0;
sp->bytes1 = 0;
sp->bytes2 = 0;
//sp->respawnNpcLink = 0;
sp->stand_state = 0;
sp->death_state = 0;
sp->channel_target_creature = sp->channel_target_go = sp->channel_spell = 0;
sp->MountedDisplayID = 0;
sp->Item1SlotDisplay = 0;
sp->Item2SlotDisplay = 0;
sp->Item3SlotDisplay = 0;
sp->CanFly = 0;
sp->phase = phase;
Creature* p = this->mapMgr.CreateCreature(Entry);
ARCEMU_ASSERT(p != NULL);
p->Load(sp, (uint32)NULL, NULL);
p->setGender(Gender);
p->spawnid = 0;
p->m_spawn = 0;
delete sp;
if(AddToWorld)
p->PushToWorld(&mapMgr);
return p;
}
示例15: FindHighestRank
void Guild::ChangeGuildMaster(PlayerInfo* pNewMaster, WorldSession* pClient)
{
if(pClient->GetPlayer()->GetLowGUID() != m_guildLeader)
{
Guild::SendGuildCommandResult(pClient, GUILD_PROMOTE_S, "", GUILD_PERMISSIONS);
return;
}
m_lock.Acquire();
GuildRank* newRank = FindHighestRank();
if(newRank == NULL)
{
m_lock.Release();
return;
}
GuildMemberMap::iterator itr = m_members.find(pNewMaster);
GuildMemberMap::iterator itr2 = m_members.find(pClient->GetPlayer()->getPlayerInfo());
ARCEMU_ASSERT(m_ranks[0] != NULL);
if(itr == m_members.end())
{
Guild::SendGuildCommandResult(pClient, GUILD_PROMOTE_S, pNewMaster->name, GUILD_PLAYER_NOT_IN_GUILD_S);
m_lock.Release();
return;
}
if(itr2 == m_members.end())
{
// wtf??
Guild::SendGuildCommandResult(pClient, GUILD_PROMOTE_S, "", GUILD_INTERNAL);
m_lock.Release();
return;
}
itr->second->pRank = m_ranks[0];
itr->first->guildRank = itr->second->pRank;
itr2->second->pRank = newRank;
itr2->first->guildRank = newRank;
CharacterDatabase.Execute("UPDATE guild_data SET guildRank = 0 WHERE playerid = %u AND guildid = %u", itr->first->guid, m_guildId);
CharacterDatabase.Execute("UPDATE guild_data SET guildRank = %u WHERE playerid = %u AND guildid = %u", newRank->iId, itr2->first->guid, m_guildId);
CharacterDatabase.Execute("UPDATE guilds SET leaderGuid = %u WHERE guildId = %u", itr->first->guid, m_guildId);
m_guildLeader = itr->first->guid;
m_lock.Release();
LogGuildEvent(GUILD_EVENT_LEADER_CHANGED, 2, pClient->GetPlayer()->GetName(), pNewMaster->name);
//TODO: Figure out the GUILD_LOG_EVENT_LEADER_CHANGED code
}