这篇教程C++ ARCEMU_ASSERT函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ARCEMU_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ ARCEMU_ASSERT函数的具体用法?C++ ARCEMU_ASSERT怎么用?C++ ARCEMU_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ARCEMU_ASSERT函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: SetEntryvoid 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;}
开发者ID:lev1976g,项目名称:easywow,代码行数:29,
示例2: ARCEMU_ASSERTvoid 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));}
开发者ID:Nupper,项目名称:AscEmu,代码行数:26,
示例3: va_startvoid 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);}
开发者ID:Antares84,项目名称:arcemu,代码行数:25,
示例4: ARCEMU_ASSERTbool 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;}
开发者ID:Antares84,项目名称:arcemu,代码行数:33,
示例5: ARCEMU_ASSERTvoid 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);}
开发者ID:dberga,项目名称:arcbliz,代码行数:28,
示例6: ARCEMU_ASSERTMapMgr* 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;}
开发者ID:master312,项目名称:AscEmu,代码行数:19,
示例7: ARCEMU_ASSERTMapMgr* 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;}
开发者ID:Selenah,项目名称:ArcEmu,代码行数:19,
示例8: ARCEMU_ASSERTAuctionHouse::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;}
开发者ID:Lbniese,项目名称:AscEmu,代码行数:10,
示例9: ARCEMU_ASSERTvoid 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()); }}
开发者ID:DebugProject,项目名称:Lua-Other,代码行数:13,
示例10: ARCEMU_ASSERTbool 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;}
开发者ID:armm77,项目名称:AscEmu,代码行数:14,
示例11: ARCEMU_ASSERTvoid 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);}
开发者ID:Desch,项目名称:Edge-of-Chaos,代码行数:14,
示例12: event_GetInstanceIDvoid 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);}
开发者ID:Selenah,项目名称:ArcEmu,代码行数:49,
示例13: GetCellvoid 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); } } } } }}
开发者ID:Thomas195,项目名称:arcemu,代码行数:49,
示例14: ARCEMU_ASSERTCreature* 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;}
开发者ID:Selenah,项目名称:ArcEmu,代码行数:49,
示例15: FindHighestRankvoid 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}
开发者ID:Antares84,项目名称:arcemu,代码行数:47,
示例16: ARCEMU_ASSERTvoid Summon::Load(CreatureProto* proto, Unit* owner, LocationVector & position, uint32 spellid, int32 summonslot){ ARCEMU_ASSERT(owner != NULL); Creature::Load(proto, owner->GetMapMgr(), position.x, position.y, position.z, position.o); SetFaction(owner->GetFaction()); Phase(PHASE_SET, owner->GetPhase()); SetZoneId(owner->GetZoneId()); SetCreatedBySpell(spellid); this->summonslot = summonslot; if (owner->IsPvPFlagged()) SetPvPFlag(); else RemovePvPFlag(); if (owner->IsFFAPvPFlagged()) SetFFAPvPFlag(); else RemoveFFAPvPFlag(); if (owner->IsSanctuaryFlagged()) SetSanctuaryFlag(); else RemoveSanctuaryFlag(); SetCreatedByGUID(owner->GetGUID()); if (owner->GetSummonedByGUID() == 0) SetSummonedByGUID(owner->GetGUID()); else SetSummonedByGUID(owner->GetSummonedByGUID()); this->owner = owner; if (owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);}
开发者ID:lev1976g,项目名称:easywow,代码行数:39,
示例17: ARCEMU_ASSERTvoid GameEventMgr::GameEventMgrThread::CleanupEntities(){ // DO NOT USE THIS FUNCTION UNLESS YOU KNOW WHAT YOU ARE DOING ARCEMU_ASSERT(FALSE); Log.Success("GameEventMgr", "Cleaning up entity remnants"); // Better solution: don't have creatures save here in the first place for (auto gameEventPair : sGameEventMgr.mGameEvents) { auto gameEvent = gameEventPair.second; for (auto npc : gameEvent->npc_data) { const char* cleanCreaturesQuery = "DELETE FROM creature_spawns WHERE entry=%u"; WorldDatabase.Execute(cleanCreaturesQuery, npc.entry); } for (auto gameobject : gameEvent->gameobject_data) { const char* cleanGameObjectsQuery = "DELETE FROM gameobject_spawns WHERE entry=%u"; WorldDatabase.Execute(cleanGameObjectsQuery, gameobject.entry); } } Log.Success("GameEventMgr", "Entity remnants cleaned up, starting main thread");}
开发者ID:Lbniese,项目名称:AscEmu,代码行数:22,
示例18: ARCEMU_ASSERTvoid CBattlegroundManager::RemovePlayerFromQueues(Player* plr){ m_queueLock.Acquire(); ARCEMU_ASSERT(plr->m_bgQueueType < BATTLEGROUND_NUM_TYPES); sEventMgr.RemoveEvents(plr, EVENT_BATTLEGROUND_QUEUE_UPDATE); uint32 lgroup = GetLevelGrouping(plr->getLevel()); list<uint32>::iterator itr; itr = m_queuedPlayers[plr->m_bgQueueType][lgroup].begin(); while (itr != m_queuedPlayers[plr->m_bgQueueType][lgroup].end()) { if ((*itr) == plr->GetLowGUID()) { Log.Debug("BattlegroundManager", "Removing player %u from queue instance %u type %u", plr->GetLowGUID(), plr->m_bgQueueInstanceId, plr->m_bgQueueType); m_queuedPlayers[plr->m_bgQueueType][lgroup].erase(itr); break; } ++itr; } plr->m_bgIsQueued = false; plr->m_bgTeam = plr->GetTeam(); plr->m_pendingBattleground = NULL; SendBattlefieldStatus(plr, BGSTATUS_NOFLAGS, 0, 0, 0, 0, 0); m_queueLock.Release(); Group* group; group = plr->GetGroup(); if (group) //if da niggas in a group, boot dis bitch ass' group outa da q { Log.Debug("BattlegroundManager", "Player %u removed whilst in a group. Removing players group %u from queue", plr->GetLowGUID(), group->GetID()); RemoveGroupFromQueues(group); }}
开发者ID:Declipe,项目名称:AscEmu,代码行数:38,
示例19: strdupbool Guild::LoadFromDB(Field* f){ m_guildId = f[0].GetUInt32(); m_guildName = strdup(f[1].GetString()); m_guildLeader = f[2].GetUInt32(); m_emblemStyle = f[3].GetUInt32(); m_emblemColor = f[4].GetUInt32(); m_borderStyle = f[5].GetUInt32(); m_borderColor = f[6].GetUInt32(); m_backgroundColor = f[7].GetUInt32(); m_guildInfo = strlen(f[8].GetString()) ? strdup(f[8].GetString()) : NULL; m_motd = strlen(f[9].GetString()) ? strdup(f[9].GetString()) : NULL; m_creationTimeStamp = f[10].GetUInt32(); m_bankBalance = f[11].GetUInt64(); // load ranks uint32 j; QueryResult* result = CharacterDatabase.Query("SELECT * FROM guild_ranks WHERE guildId = %u ORDER BY rankId ASC", m_guildId); if(result == NULL) return false; uint32 sid = 0; do { GuildRank* r = new GuildRank; Field* f2 = result->Fetch(); r->iId = f2[1].GetUInt32(); if(r->iId != sid) { Log.Notice("Guild", "Renaming rank %u of guild %s to %u.", r->iId, m_guildName, sid); CharacterDatabase.Execute("UPDATE guild_ranks SET rankId = %u WHERE guildId = %u AND rankName = /'%s/'", r->iId, m_guildId, CharacterDatabase.EscapeString(string(f2[2].GetString())).c_str()); r->iId = sid; } sid++; r->szRankName = strdup(f2[2].GetString()); r->iRights = f2[3].GetUInt32(); r->iGoldLimitPerDay = f2[4].GetUInt32(); for(j = 0; j < MAX_GUILD_BANK_TABS; ++j) { r->iTabPermissions[j].iFlags = f2[5 + (j * 2)].GetUInt32(); r->iTabPermissions[j].iStacksPerDay = f2[6 + (j * 2)].GetUInt32(); } //m_ranks.push_back(r); ARCEMU_ASSERT(m_ranks[r->iId] == NULL); m_ranks[r->iId] = r; } while(result->NextRow()); delete result; // load members result = CharacterDatabase.Query("SELECT * FROM guild_data WHERE guildid = %u", m_guildId); if(result == NULL) return false; do { Field* f3 = result->Fetch(); GuildMember* gm = new GuildMember; gm->pPlayer = objmgr.GetPlayerInfo(f3[1].GetUInt32()); if(gm->pPlayer == NULL) { delete gm; continue; } if(f3[2].GetUInt32() >= MAX_GUILD_RANKS || m_ranks[f3[2].GetUInt32()] == NULL) { delete gm; continue; } gm->pRank = m_ranks[f3[2].GetUInt32()]; if(gm->pRank == NULL) gm->pRank = FindLowestRank(); gm->pPlayer->guild = this; gm->pPlayer->guildRank = gm->pRank; gm->pPlayer->guildMember = gm; if(strlen(f3[3].GetString())) gm->szPublicNote = strdup(f3[3].GetString()); else gm->szPublicNote = NULL; if(strlen(f3[4].GetString())) gm->szOfficerNote = strdup(f3[4].GetString()); else gm->szOfficerNote = NULL; gm->uLastWithdrawReset = f3[5].GetUInt32(); gm->uWithdrawlsSinceLastReset = f3[6].GetUInt32(); for(j = 0; j < MAX_GUILD_BANK_TABS; ++j) { gm->uLastItemWithdrawReset[j] = f3[7 + (j * 2)].GetUInt32(); gm->uItemWithdrawlsSinceLastReset[j] = f3[8 + (j * 2)].GetUInt32();//.........这里部分代码省略.........
开发者ID:Antares84,项目名称:arcemu,代码行数:101,
示例20: OutPacketvoid WorldSocket::InformationRetreiveCallback(WorldPacket & recvData, uint32 requestid){ if(requestid != mRequestID) return; uint32 error; recvData >> error; if(error != 0 || pAuthenticationPacket == NULL) { // something happened wrong @ the logon server OutPacket(SMSG_AUTH_RESPONSE, 1, "/x0D"); return; } // Extract account information from the packet. string AccountName; const string* ForcedPermissions; uint32 AccountID; string GMFlags; uint8 AccountFlags; string lang = "enUS"; uint32 i; recvData >> AccountID >> AccountName >> GMFlags >> AccountFlags; ForcedPermissions = sLogonCommHandler.GetForcedPermissions(AccountName); if(ForcedPermissions != NULL) GMFlags.assign(ForcedPermissions->c_str()); LOG_DEBUG(" >> got information packet from logon: `%s` ID %u (request %u)", AccountName.c_str(), AccountID, mRequestID); mRequestID = 0; // Pull the sessionkey we generated during the logon - client handshake uint8 K[40]; recvData.read(K, 40); _crypt.Init(K); //checking if player is already connected //disconnect current player and login this one(blizzlike) if(recvData.rpos() != recvData.wpos()) recvData.read((uint8*)lang.data(), 4); WorldSession* session = sWorld.FindSession(AccountID); if(session) { // AUTH_FAILED = 0x0D session->Disconnect(); // clear the logout timer so he times out straight away session->SetLogoutTimer(1); // we must send authentication failed here. // the stupid newb can relog his client. // otherwise accounts dupe up and disasters happen. OutPacket(SMSG_AUTH_RESPONSE, 1, "/x15"); return; } Sha1Hash sha; uint8 digest[20]; pAuthenticationPacket->read(digest, 20); uint32 t = 0; if(m_fullAccountName == NULL) // should never happen ! sha.UpdateData(AccountName); else { sha.UpdateData(*m_fullAccountName); // this is unused now. we may as well free up the memory. delete m_fullAccountName; m_fullAccountName = NULL; } sha.UpdateData((uint8*)&t, 4); sha.UpdateData((uint8*)&mClientSeed, 4); sha.UpdateData((uint8*)&mSeed, 4); sha.UpdateData((uint8*)&K, 40); sha.Finalize(); if(memcmp(sha.GetDigest(), digest, 20)) { // AUTH_UNKNOWN_ACCOUNT = 21 OutPacket(SMSG_AUTH_RESPONSE, 1, "/x15"); return; } // Allocate session WorldSession* pSession = new WorldSession(AccountID, AccountName, this); mSession = pSession; ARCEMU_ASSERT(mSession != NULL); // aquire delete mutex pSession->deleteMutex.Acquire(); // Set session properties pSession->SetClientBuild(mClientBuild);//.........这里部分代码省略.........
开发者ID:dberga,项目名称:arcbliz,代码行数:101,
示例21: ARCEMU_ASSERTvoid Spell::FillTargetMap(uint32 i){ //Spell::prepare() has already a m_caster->IsInWorld() check so if now the caster is no more in world something bad happened. ARCEMU_ASSERT(m_caster->IsInWorld()); uint32 TargetType = 0; TargetType |= GetTargetType(m_spellInfo->EffectImplicitTargetA[i], i); //never get info from B if it is 0 :P if(m_spellInfo->EffectImplicitTargetB[i] != 0) TargetType |= GetTargetType(m_spellInfo->EffectImplicitTargetB[i], i); if(TargetType & SPELL_TARGET_NOT_IMPLEMENTED) return; if(TargetType & SPELL_TARGET_NO_OBJECT) //summon spells that appear infront of caster { HandleTargetNoObject(); return; } //always add this guy :P if(!(TargetType & (SPELL_TARGET_AREA | SPELL_TARGET_AREA_SELF | SPELL_TARGET_AREA_CURTARGET | SPELL_TARGET_AREA_CONE | SPELL_TARGET_OBJECT_SELF | SPELL_TARGET_OBJECT_PETOWNER))) { Object* target = m_caster->GetMapMgr()->_GetObject(m_targets.m_unitTarget); AddTarget(i, TargetType, target); } if(TargetType & SPELL_TARGET_OBJECT_SELF) AddTarget(i, TargetType, m_caster); if(TargetType & (SPELL_TARGET_AREA | SPELL_TARGET_AREA_SELF)) //targetted aoe AddAOETargets(i, TargetType, GetRadius(i), m_spellInfo->MaxTargets); //TODO: arcemu, doesn't support summon slots? /*if (TargetType & SPELL_TARGET_OBJECT_CURTOTEMS && u_caster != NULL) for (uint32 i=1; i<5; ++i) //totem slots are 1, 2, 3, 4 AddTarget(i, TargetType, u_caster->m_summonslot[i]);*/ if(TargetType & SPELL_TARGET_OBJECT_CURPET && p_caster != NULL) AddTarget(i, TargetType, p_caster->GetSummon()); if(TargetType & SPELL_TARGET_OBJECT_PETOWNER) { uint64 guid = m_targets.m_unitTarget; if(GET_TYPE_FROM_GUID(guid) == HIGHGUID_TYPE_PET) { Pet* p = m_caster->GetMapMgr()->GetPet(GET_LOWGUID_PART(guid)); if(p != NULL) AddTarget(i, TargetType, p->GetPetOwner()); } } //targets party, not raid if((TargetType & SPELL_TARGET_AREA_PARTY) && !(TargetType & SPELL_TARGET_AREA_RAID)) { if(p_caster == NULL && !m_caster->IsPet() && (!m_caster->IsCreature() || !m_caster->IsTotem())) AddAOETargets(i, TargetType, GetRadius(i), m_spellInfo->MaxTargets); //npcs else AddPartyTargets(i, TargetType, GetRadius(i), m_spellInfo->MaxTargets); //players/pets/totems } if(TargetType & SPELL_TARGET_AREA_RAID) { if(p_caster == NULL && !m_caster->IsPet() && (!m_caster->IsCreature() || !m_caster->IsTotem())) AddAOETargets(i, TargetType, GetRadius(i), m_spellInfo->MaxTargets); //npcs else AddRaidTargets(i, TargetType, GetRadius(i), m_spellInfo->MaxTargets, (TargetType & SPELL_TARGET_AREA_PARTY) ? true : false); //players/pets/totems } if(TargetType & SPELL_TARGET_AREA_CHAIN) AddChainTargets(i, TargetType, GetRadius(i), m_spellInfo->MaxTargets); //target cone if(TargetType & SPELL_TARGET_AREA_CONE) AddConeTargets(i, TargetType, GetRadius(i), m_spellInfo->MaxTargets); if(TargetType & SPELL_TARGET_OBJECT_SCRIPTED) AddScriptedOrSpellFocusTargets(i, TargetType, GetRadius(i), m_spellInfo->MaxTargets);}
开发者ID:Selenah,项目名称:ArcEmu,代码行数:73,
注:本文中的ARCEMU_ASSERT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ARCH_INDEX函数代码示例 C++ AR5416DESC函数代码示例 |