From 313c787d7cae98e3007b29e94c41def9b2b78fe0 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 4 Nov 2021 18:00:57 +0800 Subject: [PATCH] rename abort->A8_ABORT() --- server/gameserver/CMakeLists.txt | 3 +- server/gameserver/android.ai.cc | 4 +- server/gameserver/buff.cc | 2 +- server/gameserver/car.cc | 4 +- server/gameserver/creature.cc | 42 +++++++------- server/gameserver/frameevent.cc | 2 +- server/gameserver/framemaker.cc | 4 +- server/gameserver/gridcell.cc | 4 +- server/gameserver/gridservice.cc | 30 +++++----- server/gameserver/hero.ai.cc | 2 +- server/gameserver/hero.cc | 14 ++--- server/gameserver/human.cc | 22 +++---- server/gameserver/incubator.cc | 6 +- server/gameserver/jsondatamgr.cc | 4 +- server/gameserver/mapinstance.cc | 32 +++++------ server/gameserver/mapmgr.cc | 8 +-- server/gameserver/mapservice.cc | 12 ++-- server/gameserver/matchteam.cc | 2 +- server/gameserver/metadata.cc | 98 ++++++++++++++++---------------- server/gameserver/metamgr.cc | 52 ++++++++--------- server/gameserver/obstacle.cc | 6 +- server/gameserver/player.cc | 2 +- server/gameserver/room.cc | 64 ++++++++++----------- server/gameserver/roommgr.cc | 6 +- server/gameserver/skill.cc | 4 +- server/gameserver/tracemgr.cc | 6 +- server/gameserver/trigger.cc | 2 +- server/gameserver/weakptr.cc | 12 ++-- third_party/a8engine | 2 +- 29 files changed, 226 insertions(+), 225 deletions(-) diff --git a/server/gameserver/CMakeLists.txt b/server/gameserver/CMakeLists.txt index ac0e7eb..a2ba0e5 100644 --- a/server/gameserver/CMakeLists.txt +++ b/server/gameserver/CMakeLists.txt @@ -10,7 +10,8 @@ else() set(CMAKE_BUILD_TYPE "Debug") message("debug mode") endif() -set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DNDEBUG") +#set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DNDEBUG -fsanitize=address -fno-omit-frame-pointer") set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DDEBUG -fsanitize=address -fno-omit-frame-pointer") include_directories( diff --git a/server/gameserver/android.ai.cc b/server/gameserver/android.ai.cc index c53517b..7046824 100644 --- a/server/gameserver/android.ai.cc +++ b/server/gameserver/android.ai.cc @@ -265,7 +265,7 @@ void AndroidAI::UpdateNewAI() if (!ai_meta && GetAiLevel() != 0) { ai_meta = MetaMgr::Instance()->GetAndroidAI(GetAiLevel(), 0); if (!ai_meta) { - abort(); + A8_ABORT(); } } if (hum->playing_skill) { @@ -301,7 +301,7 @@ void AndroidAI::UpdateNewAI() break; default: { - abort(); + A8_ABORT(); } break; } diff --git a/server/gameserver/buff.cc b/server/gameserver/buff.cc index 2dcf2b8..c74e78c 100644 --- a/server/gameserver/buff.cc +++ b/server/gameserver/buff.cc @@ -88,7 +88,7 @@ void Buff::ProcBatchAddBuff() int rand_space = std::get<0>(tuple); const auto& items = std::get<1>(tuple); if (items.empty()) { - abort(); + A8_ABORT(); } int rnd = rand(); if (rand_space == -1) { diff --git a/server/gameserver/car.cc b/server/gameserver/car.cc index aadf1e4..eef572d 100644 --- a/server/gameserver/car.cc +++ b/server/gameserver/car.cc @@ -31,7 +31,7 @@ void Car::Initialize() Creature::Initialize(); hero_meta_ = MetaMgr::Instance()->GetPlayer(meta->i->heroid()); if (!hero_meta_) { - abort(); + A8_ABORT(); } RecalcSelfCollider(); MetaData::Equip* weapon_meta = MetaMgr::Instance()->GetEquip(hero_meta_->i->default_weapon()); @@ -139,7 +139,7 @@ void Car::GetOn(Human* passenger) return; } if (meta->int_param2 <= 0) { - abort(); + A8_ABORT(); } if (meta->int_param2 <= passengers_.size()) { return; diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index c94ad03..c577098 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -466,7 +466,7 @@ int Creature::MustBeAddBuff(Creature* caster, int buff_id) { MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id); if (!buff_meta) { - abort(); + A8_ABORT(); } return AddBuff(caster, buff_meta, 1); } @@ -1113,7 +1113,7 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff) case kBET_BePull: { if (caster == this) { - abort(); + A8_ABORT(); } if (caster->GetEntitySubType() == EST_Android) { float target_distance = caster->GetPos().Distance(GetPos()); @@ -1302,7 +1302,7 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff) case kBET_CondAddBuff: { if (!IsValidCondBuff(buff->meta->int_param1)) { - abort(); + A8_ABORT(); } list_add_tail(&buff->cond_entry, &cond_buffs_[buff->meta->int_param1]); } @@ -1703,13 +1703,13 @@ void Creature::Shot(a8::Vec2& target_dir, bool& shot_ok, float fly_distance) fly_distance, false); } else { - abort(); + A8_ABORT(); } } else { - abort(); + A8_ABORT(); } } else { - abort(); + A8_ABORT(); } if (GetCurrWeapon()->weapon_idx != 0 && @@ -1840,7 +1840,7 @@ void Creature::AutoLoadingBullet(bool manual) int Creature::GetInventory(int slot_id) { if (!IsValidSlotId(slot_id)) { - abort(); + A8_ABORT(); } return inventory_[slot_id].num; } @@ -1849,7 +1849,7 @@ void Creature::AddInventory(int slot_id, int num) { assert(num > 0); if (!IsValidSlotId(slot_id)) { - abort(); + A8_ABORT(); } inventory_[slot_id].num += num; } @@ -1858,7 +1858,7 @@ void Creature::DecInventory(int slot_id, int num) { assert(num > 0); if (!IsValidSlotId(slot_id)) { - abort(); + A8_ABORT(); } inventory_[slot_id].num -= num; } @@ -2005,7 +2005,7 @@ void Creature::SummonObstacle(Buff* buff, int id, const a8::Vec2& pos) #endif } else { #ifdef DEBUG - abort(); + A8_ABORT(); #endif } } @@ -2082,17 +2082,17 @@ Weapon* Creature::AutoChgWeapon() Weapon* Creature::ChooseNextWeapon(int curr_weapon_slot_id, int begin_slot_id, int end_slot_id) { if (curr_weapon_slot_id < begin_slot_id) { - abort(); + A8_ABORT(); } if (curr_weapon_slot_id > end_slot_id) { - abort(); + A8_ABORT(); } if (begin_slot_id > end_slot_id) { - abort(); + A8_ABORT(); } if (begin_slot_id < 0 || end_slot_id < 0) { - abort(); + A8_ABORT(); } Weapon* next_weapon = nullptr; for (int i = 1; i <= (end_slot_id - begin_slot_id + 1); ++i) { @@ -2126,7 +2126,7 @@ void Creature::SetCurrWeapon(Weapon* weapon) } } if (!found) { - abort(); + A8_ABORT(); } #endif if (auto_switch_weapon_timer_) { @@ -2249,7 +2249,7 @@ void Creature::SlaveOnRemove(Entity* slave) break; default: { - abort(); + A8_ABORT(); } break; } @@ -2407,14 +2407,14 @@ void Creature::FindLocationWithTarget(Entity* target, ColliderComponent* target_ if (target_collider) { bool ret = a_collider.CalcSafePoint(target_collider, new_pos); if (!ret) { - abort(); + A8_ABORT(); } } else { AabbCollider aabb_collider; target->GetAabbBox(aabb_collider); bool ret = a_collider.CalcSafePoint(&aabb_collider, new_pos); if (!ret) { - abort(); + A8_ABORT(); } } } @@ -2475,7 +2475,7 @@ void Creature::FindLocation() ColliderComponent* target_collider = nullptr; if (CollisonDetectionAndGetCollider(&target_collider)) { if (!target_collider) { - abort(); + A8_ABORT(); } } if (target_collider) { @@ -2736,7 +2736,7 @@ void Creature::AutoSwitchWeapon() c->SetCurrWeapon(next_weapon); switch_ok = true; } else { - abort(); + A8_ABORT(); } } } @@ -2858,7 +2858,7 @@ void Creature::OnBattleStart(Room* room) } #ifdef DEBUG if (try_count > 5) { - abort(); + A8_ABORT(); } #endif } diff --git a/server/gameserver/frameevent.cc b/server/gameserver/frameevent.cc index 710a71b..3dd70e6 100644 --- a/server/gameserver/frameevent.cc +++ b/server/gameserver/frameevent.cc @@ -108,7 +108,7 @@ void FrameEvent::AddBullet(int bullet_uniid, { #ifdef DEBUG if (!hum->InPartObjects(sender.Get())) { - abort(); + A8_ABORT(); } #endif hum->GetFrameData().bullets_.push_back(bullet_idx); diff --git a/server/gameserver/framemaker.cc b/server/gameserver/framemaker.cc index 004681c..afd3bd3 100644 --- a/server/gameserver/framemaker.cc +++ b/server/gameserver/framemaker.cc @@ -232,7 +232,7 @@ void FrameMaker::SerializePartObjects(cs::SMUpdate* msg, Room* room, Human* hum, Entity* entity = pair.second.object.Get(); if (!entity) { #ifdef DEBUG - abort(); + A8_ABORT(); #endif deleted_uniid = pair.first; continue; @@ -311,7 +311,7 @@ void FrameMaker::SerializeShots(cs::SMUpdate* msg, Room* room, Human* hum, Frame *msg->add_shots() = std::get<1>(tuple); } else { #ifdef DEBUG1 - abort(); + A8_ABORT(); #endif } } diff --git a/server/gameserver/gridcell.cc b/server/gameserver/gridcell.cc index de1b5c2..59829cd 100644 --- a/server/gameserver/gridcell.cc +++ b/server/gameserver/gridcell.cc @@ -124,7 +124,7 @@ void GridCell::AddCreature(Creature* c) { #ifdef DEBUG if (Global::Instance()->traversing_cell_creature_count > 0) { - abort(); + A8_ABORT(); } #endif creatures_[c->room->GetRoomIdx()].insert(c); @@ -134,7 +134,7 @@ void GridCell::RemoveCreature(Creature* c) { #ifdef DEBUG if (Global::Instance()->traversing_cell_creature_count > 0) { - abort(); + A8_ABORT(); } #endif creatures_[c->room->GetRoomIdx()].erase(c); diff --git a/server/gameserver/gridservice.cc b/server/gameserver/gridservice.cc index b100956..877d315 100644 --- a/server/gameserver/gridservice.cc +++ b/server/gameserver/gridservice.cc @@ -77,7 +77,7 @@ void GridService::GetAllCellsByXy(Room* room, int x, int y, std::set& int new_y = y + cell_width_; int new_grid_id = new_x/cell_width_ + (new_y/cell_width_) * cell_count_per_row_; if (BroderOverFlow(new_x, new_y)) { - abort(); + A8_ABORT(); } GetAllCells(room, new_grid_id, grid_list); } @@ -104,7 +104,7 @@ bool GridService::CanAdd(float x, float y) void GridService::ClearRoomData(Room* room) { if (room->GetRoomIdx() <= 0) { - abort(); + A8_ABORT(); } for (int i = 0; i < (max_grid_id_ + 1); ++i) { GridCell& cell = cells_[i]; @@ -117,11 +117,11 @@ void GridService::AddCreature(Creature* c) int x = (int)c->GetX() + cell_width_; int y = (int)c->GetY() + cell_width_; if (BroderOverFlow(x, y)) { - abort(); + A8_ABORT(); } c->SetGridId(x/cell_width_ + (y/cell_width_) * cell_count_per_row_); if (c->GetGridId() == 0 || c->GetGridId() > max_grid_id_) { - abort(); + A8_ABORT(); } cells_[c->GetGridId()].AddCreature(c); GetAllCells(c->room, c->GetGridId(), c->GetGridList()); @@ -139,10 +139,10 @@ void GridService::MoveCreature(Creature* c) int new_y = (int)c->GetY() + cell_width_; int new_grid_id = new_x/cell_width_ + (new_y/cell_width_) * cell_count_per_row_; if (BroderOverFlow(new_x, new_y)) { - abort(); + A8_ABORT(); } if (new_grid_id == 0 || new_grid_id > max_grid_id_) { - abort(); + A8_ABORT(); } if (new_grid_id != c->GetGridId()) { std::set inc_grid_list; @@ -167,11 +167,11 @@ void GridService::AddRoomEntity(Room* room, Entity* entity) int x = (int)entity->GetX() + cell_width_; int y = (int)entity->GetY() + cell_width_; if (BroderOverFlow(x, y)) { - abort(); + A8_ABORT(); } entity->SetGridId(x/cell_width_ + (y/cell_width_) * cell_count_per_row_); if (entity->GetGridId() == 0 || entity->GetGridId() > max_grid_id_) { - abort(); + A8_ABORT(); } cells_[entity->GetGridId()].AddRoomEntity(room, entity); } @@ -188,11 +188,11 @@ void GridService::AddPermanentEntity(Entity* entity) int x = (int)entity->GetX() + cell_width_; int y = (int)entity->GetY() + cell_width_; if (BroderOverFlow(x, y)) { - abort(); + A8_ABORT(); } entity->SetGridId(x/cell_width_ + (y/cell_width_) * cell_count_per_row_); if (entity->GetGridId() == 0 || entity->GetGridId() > max_grid_id_) { - abort(); + A8_ABORT(); } cells_[entity->GetGridId()].AddPermanentEntity(entity); } @@ -252,7 +252,7 @@ void GridService::GetGridList(int grid_id, int offset, std::set& grid_list) { if (offset <1 || offset > 9) { - abort(); + A8_ABORT(); } if (grid_id <= 0 || grid_id >= max_grid_id_) { return; @@ -378,11 +378,11 @@ void GridService::AddBullet(Bullet* bullet) int x = (int)bullet->GetX() + cell_width_; int y = (int)bullet->GetY() + cell_width_; if (BroderOverFlow(x, y)) { - abort(); + A8_ABORT(); } bullet->SetGridId(x/cell_width_ + (y/cell_width_) * cell_count_per_row_); if (bullet->GetGridId() == 0 || bullet->GetGridId() > max_grid_id_) { - abort(); + A8_ABORT(); } cells_[bullet->GetGridId()].AddBullet(bullet); GetAllCells(bullet->room, bullet->GetGridId(), bullet->GetGridList()); @@ -394,10 +394,10 @@ void GridService::MoveBullet(Bullet* bullet) int new_y = (int)bullet->GetY() + cell_width_; int new_grid_id = new_x/cell_width_ + (new_y/cell_width_) * cell_count_per_row_; if (BroderOverFlow(new_x, new_y)) { - abort(); + A8_ABORT(); } if (new_grid_id == 0 || new_grid_id > max_grid_id_) { - abort(); + A8_ABORT(); } if (new_grid_id != bullet->GetGridId()) { std::set inc_grid_list; diff --git a/server/gameserver/hero.ai.cc b/server/gameserver/hero.ai.cc index 50869bd..fb67c2c 100644 --- a/server/gameserver/hero.ai.cc +++ b/server/gameserver/hero.ai.cc @@ -84,7 +84,7 @@ void HeroAI::UpdateAI() break; default: { - abort(); + A8_ABORT(); } break; } diff --git a/server/gameserver/hero.cc b/server/gameserver/hero.cc index 6860c38..84679ca 100644 --- a/server/gameserver/hero.cc +++ b/server/gameserver/hero.cc @@ -203,7 +203,7 @@ float Hero::GetHitRadius() void Hero::GetAabbBox(AabbCollider& aabb_box) { if (!meta) { - abort(); + A8_ABORT(); } aabb_box.active = true; aabb_box.owner = this; @@ -217,7 +217,7 @@ void Hero::GetAabbBox(AabbCollider& aabb_box) void Hero::GetHitAabbBox(AabbCollider& aabb_box) { if (!meta) { - abort(); + A8_ABORT(); } aabb_box.active = true; aabb_box.owner = this; @@ -275,7 +275,7 @@ void Hero::BeKill(int killer_id, const std::string& killer_name, int weapon_id) std::vector watch_list; hero->room->GetPartObjectWatchList(hero, watch_list); if (!watch_list.empty()) { - abort(); + A8_ABORT(); } }, &xtimer_attacher.timer_list_); @@ -285,7 +285,7 @@ void Hero::BeKill(int killer_id, const std::string& killer_name, int weapon_id) void Hero::OnAddToTargetPartObject(Entity* target) { if (delete_frameno > 0) { - abort(); + A8_ABORT(); } } @@ -299,12 +299,12 @@ void Hero::InitAI() MetaData::AI* ai_meta = MetaMgr::Instance()->GetHeroAI(meta->i->ai()); if (!ai_meta) { #ifdef DEBUG - abort(); + A8_ABORT(); #endif ai_meta = MetaMgr::Instance()->GetHeroAI(ANDROID_AI_ID_START); } if (!ai_meta) { - abort(); + A8_ABORT(); } if (ai_meta->i->ai_kind() == kAI_MineSweeper) { ai = new MineSweeperAI; @@ -371,7 +371,7 @@ void Hero::Destory() std::vector watch_list; hero->room->GetPartObjectWatchList(hero, watch_list); if (!watch_list.empty()) { - abort(); + A8_ABORT(); } } }, diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 46f701a..32396e7 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -363,7 +363,7 @@ void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb) void Human::GetAabbBox(AabbCollider& aabb_box) { if (!meta) { - abort(); + A8_ABORT(); } aabb_box.active = true; aabb_box.owner = this; @@ -1278,7 +1278,7 @@ void Human::RecalcBaseAttr() int Human::GetVolume(int slot_id) { if (!IsValidSlotId(slot_id)) { - abort(); + A8_ABORT(); } return volume_[slot_id]; } @@ -1343,7 +1343,7 @@ void Human::SendUpdateMsg() #ifdef DEBUG end_tick = a8::XGetTickCount(); if (a8::XGetTickCount() - begin_tick > 1000) { - abort(); + A8_ABORT(); } begin_tick = a8::XGetTickCount(); #endif @@ -1356,7 +1356,7 @@ void Human::SendUpdateMsg() #ifdef DEBUG end_tick = a8::XGetTickCount(); if (a8::XGetTickCount() - begin_tick > 1000) { - abort(); + A8_ABORT(); } begin_tick = a8::XGetTickCount(); #endif @@ -1373,7 +1373,7 @@ void Human::SendUpdateMsg() #ifdef DEBUG end_tick1 = a8::XGetTickCount(); if (end_tick1 - begin_tick1 > 100) { - abort(); + A8_ABORT(); } #endif framedata_.ClearFrameData(this); @@ -2488,7 +2488,7 @@ void Human::NotifyObservers(cs::SMUpdate* msg, cs::MFActivePlayerData* active_pl synced_objects.insert(entity->GetUniId()); } else { #ifdef DEBUG - abort(); + A8_ABORT(); #endif } } @@ -2552,7 +2552,7 @@ void Human::NotifyObservers(cs::SMUpdate* msg, cs::MFActivePlayerData* active_pl } } else { #ifdef DEBUG - abort(); + A8_ABORT(); #endif } } @@ -3071,7 +3071,7 @@ float Human::GetHitRadius() void Human::GetHitAabbBox(AabbCollider& aabb_box) { if (!meta) { - abort(); + A8_ABORT(); } aabb_box.active = true; aabb_box.owner = this; @@ -3471,7 +3471,7 @@ void Human::ProcLootSpecItem(AddItemDTO& dto) { int i = 0; #if 0 - abort(); + A8_ABORT(); #endif } break; @@ -3611,7 +3611,7 @@ void Human::ProcAddItemDto(AddItemDTO& dto) break; case EQUIP_TYPE_OLDSKIN: { - abort(); + A8_ABORT(); } break; case EQUIP_TYPE_SKIN: @@ -3866,7 +3866,7 @@ void Human::OnWatcherDie(Human* watcher) } } else { #ifdef DEBUG - abort(); + A8_ABORT(); #endif } } diff --git a/server/gameserver/incubator.cc b/server/gameserver/incubator.cc index 0f9467a..4ab6ad0 100644 --- a/server/gameserver/incubator.cc +++ b/server/gameserver/incubator.cc @@ -29,7 +29,7 @@ void Incubator::UnInit() void Incubator::AllocAndroid(Human* target, int num) { if (room->xtimer.GetRunningTimer() == nullptr) { - abort(); + A8_ABORT(); } int try_count = 0; a8::Vec2 dir = a8::Vec2::UP; @@ -46,11 +46,11 @@ void Incubator::AllocAndroid(Human* target, int num) #ifdef DEBUG #if 0 if (!target->InNewObjects(hum)) { - abort(); + A8_ABORT(); } #endif if (hum->dead) { - abort(); + A8_ABORT(); } #endif hum->MustBeAddBuff(hum, kTraceBuffId); diff --git a/server/gameserver/jsondatamgr.cc b/server/gameserver/jsondatamgr.cc index 7e7d2e6..bbe064c 100644 --- a/server/gameserver/jsondatamgr.cc +++ b/server/gameserver/jsondatamgr.cc @@ -55,7 +55,7 @@ void JsonDataMgr::Init() ip = getenv("HOST_IP"); } if (!ok) { - abort(); + A8_ABORT(); } } } @@ -81,7 +81,7 @@ std::shared_ptr JsonDataMgr::GetConf() return conf; } } - abort(); + A8_ABORT(); } std::shared_ptr JsonDataMgr::GetMasterServerClusterConf() diff --git a/server/gameserver/mapinstance.cc b/server/gameserver/mapinstance.cc index 632f1f4..efa9dc7 100644 --- a/server/gameserver/mapinstance.cc +++ b/server/gameserver/mapinstance.cc @@ -21,13 +21,13 @@ void MapInstance::Init() current_map_block_uniid_ = MAP_BLOCK_START_ID; map_meta_ = MetaMgr::Instance()->GetMap(map_id); if (!map_meta_) { - abort(); + A8_ABORT(); } if (map_meta_->i->map_width() < 1) { - abort(); + A8_ABORT(); } if (map_meta_->i->map_height() < 1) { - abort(); + A8_ABORT(); } map_service_ = new MapService(); grid_service_ = new GridService(); @@ -57,7 +57,7 @@ void MapInstance::Init() obstacle2_num_, }); if (current_uniid_ >= FIXED_OBJECT_MAXID) { - abort(); + A8_ABORT(); } } @@ -115,14 +115,14 @@ void MapInstance::CreateThings() std::string point_name = thing_tpl.i->name(); //pointxxx if (point_name.size() < 6) { - abort(); + A8_ABORT(); } std::string name_part = point_name.substr(0, 5); std::string id_part = point_name.substr(5, point_name.size() - 5); int point_id = a8::XValue(id_part); if (spawn_points_hash.find(thing_tpl.i->name()) != spawn_points_hash.end()) { - abort(); + A8_ABORT(); } if (point_id <= 100) { normal_room_spawn_points_.push_back(&thing_tpl); @@ -138,16 +138,16 @@ void MapInstance::CreateThings() for (int hero_id : thing_tpl.heros) { MetaData::Player* hero_meta = MetaMgr::Instance()->GetPlayer(hero_id); if (!hero_meta) { - abort(); + A8_ABORT(); } if (!MetaMgr::Instance()->GetHeroAI(hero_meta->i->ai())) { - abort(); + A8_ABORT(); } } } break; default: - abort(); + A8_ABORT(); break; } } @@ -170,7 +170,7 @@ void MapInstance::CreateTerrain() std::list* layers = MetaMgr::Instance()->GetMapLayer(map_meta_->i->map_pic()); if (!terrain || !layers) { return; - //abort(); + //A8_ABORT(); } if (layers->empty()) { return; @@ -181,20 +181,20 @@ void MapInstance::CreateTerrain() first_layer = &layer; } if (layer.width() != first_layer->width()) { - abort(); + A8_ABORT(); } if (layer.height() != first_layer->height()) { - abort(); + A8_ABORT(); } if (layer.grids().size() != first_layer->grids().size()) { - abort(); + A8_ABORT(); } } if (first_layer->grids().size() != first_layer->width() * first_layer->height()) { - abort(); + A8_ABORT(); } if (first_layer->grids().size() <= 0) { - abort(); + A8_ABORT(); } std::vector grids; @@ -328,7 +328,7 @@ void MapInstance::CreateBlock() uniid_hash_[block->GetUniId()] = block; grid_service_->AddPermanentEntity(block); if (!block->meta) { - abort(); + A8_ABORT(); } } else { int i = 0; diff --git a/server/gameserver/mapmgr.cc b/server/gameserver/mapmgr.cc index 95eaa21..c867df6 100644 --- a/server/gameserver/mapmgr.cc +++ b/server/gameserver/mapmgr.cc @@ -26,15 +26,15 @@ void MapMgr::Init() } } } else { - abort(); + A8_ABORT(); } #if 0 if (mode_hash_.find(kZombieMode) == mode_hash_.end()) { - abort(); + A8_ABORT(); } #endif if (mode_hash_.find(kChiJiMode) == mode_hash_.end()) { - abort(); + A8_ABORT(); } } @@ -61,7 +61,7 @@ void MapMgr::AttachRoom(Room* room, RoomInitInfo& init_info) } if (!map_instance) { - abort(); + A8_ABORT(); } map_instance->AttachRoom(room, init_info); } diff --git a/server/gameserver/mapservice.cc b/server/gameserver/mapservice.cc index 7caf4a7..c38d1e1 100644 --- a/server/gameserver/mapservice.cc +++ b/server/gameserver/mapservice.cc @@ -38,7 +38,7 @@ MapService::~MapService() void MapService::Init(int width, int height, int cell_width) { if (width < 1 || height < 1 || cell_width < 1) { - abort(); + A8_ABORT(); } map_width_ = width; map_height_ = height; @@ -95,7 +95,7 @@ void MapService::AddCollider(ColliderComponent* collider) if (!(collider->owner->IsEntityType(ET_Obstacle) || collider->owner->IsEntityType(ET_Dummy) || collider->owner->IsEntityType(ET_Building))) { - abort(); + A8_ABORT(); } CellNode* top_node = nullptr; CellNode* bot_node = nullptr; @@ -136,7 +136,7 @@ void MapService::AddCollider(ColliderComponent* collider) min_grid_x = 0; } if (min_grid_x < 0) { - abort(); + A8_ABORT(); } if (max_grid_x >= map_width_) { max_grid_x = map_width_ - 1; @@ -145,7 +145,7 @@ void MapService::AddCollider(ColliderComponent* collider) min_grid_y = 0; } if (min_grid_y < 0) { - abort(); + A8_ABORT(); } if (max_grid_y >= map_height_) { max_grid_y = map_height_ - 1; @@ -239,7 +239,7 @@ void MapService::GetColliders(Room* room, break; default: { - abort(); + A8_ABORT(); } break; } @@ -253,7 +253,7 @@ void MapService::GetColliders(Room* room, break; default: { - abort(); + A8_ABORT(); } break; } diff --git a/server/gameserver/matchteam.cc b/server/gameserver/matchteam.cc index 25d014c..3d6390a 100644 --- a/server/gameserver/matchteam.cc +++ b/server/gameserver/matchteam.cc @@ -58,7 +58,7 @@ void RawTeamMember::InitRobot() } } } else { - abort(); + A8_ABORT(); } } } diff --git a/server/gameserver/metadata.cc b/server/gameserver/metadata.cc index d3ebf10..ac64c2b 100644 --- a/server/gameserver/metadata.cc +++ b/server/gameserver/metadata.cc @@ -72,13 +72,13 @@ namespace MetaData std::vector strings; a8::Split(i->refresh_robot(), strings, '|'); if (strings.size() != 2) { - abort(); + A8_ABORT(); } { std::vector strings2; a8::Split(strings[0], strings2, '-'); if (strings2.size() != 2) { - abort(); + A8_ABORT(); } refresh_robot_min_num = a8::XValue(strings2[0]); refresh_robot_max_num = a8::XValue(strings2[1]); @@ -87,20 +87,20 @@ namespace MetaData std::vector strings2; a8::Split(strings[1], strings2, '-'); if (strings2.size() != 2) { - abort(); + A8_ABORT(); } refresh_robot_min_time = a8::XValue(strings2[0]); refresh_robot_max_time = a8::XValue(strings2[1]); } if (refresh_robot_min_num >= refresh_robot_max_num) { - abort(); + A8_ABORT(); } if (refresh_robot_min_time >= refresh_robot_max_time) { - abort(); + A8_ABORT(); } if (refresh_robot_min_num <= 0 || refresh_robot_max_num <= 0 || refresh_robot_min_time <= 0 || refresh_robot_max_time <= 0) { - abort(); + A8_ABORT(); } } first_safearea_center = a8::Vec2(i->map_width() / 2.0f, @@ -109,13 +109,13 @@ namespace MetaData std::vector strings; a8::Split(i->first_safearea_center(), strings, ':'); if (strings.size() != 2) { - abort(); + A8_ABORT(); } first_safearea_center = a8::Vec2(a8::XValue(strings[0]).GetDouble(), a8::XValue(strings[1]).GetDouble()); } if (i->player() < 10) { - abort(); + A8_ABORT(); } } @@ -134,15 +134,15 @@ namespace MetaData for (MetaData::SafeAreaPos* pos_meta : *pos_list) { if (area_list.size() != pos_meta->poses.size()) { - abort(); + A8_ABORT(); } for (size_t j = 0; j < area_list.size(); ++j) { a8::Vec2 pos = pos_meta->poses[j]; if (pos.x < 0 || pos.y < 0) { - abort(); + A8_ABORT(); } if (pos.x > i->map_width() || pos.y > i->map_height()) { - abort(); + A8_ABORT(); } if (j > 0) { a8::Vec2 pre_pos = pos_meta->poses[j - 1]; @@ -150,7 +150,7 @@ namespace MetaData float distance = pos.Distance(pre_pos); if (distance + area_meta->i->rad() < pre_area_meta->i->rad()) { } else { - abort(); + A8_ABORT(); } } }//end for i @@ -159,11 +159,11 @@ namespace MetaData #endif { if (safearea_list.empty()) { - abort(); + A8_ABORT(); } for (int area_type : safearea_list) { if (!MetaMgr::Instance()->GetSafeAreaByType(area_type)) { - abort(); + A8_ABORT(); } } } @@ -198,7 +198,7 @@ namespace MetaData int Map::RandSafeArea() const { if (safearea_list.empty()) { - abort(); + A8_ABORT(); } return safearea_list[rand() % safearea_list.size()]; } @@ -258,7 +258,7 @@ namespace MetaData for (auto& str : strings) { int n = a8::XValue(str); if (n <= 0 || n > 63) { - abort(); + A8_ABORT(); } a8::SetBitFlag(special_damage_type, n); } @@ -269,7 +269,7 @@ namespace MetaData for (auto& str : strings) { int n = a8::XValue(str); if (n <= 0 || n > 63) { - abort(); + A8_ABORT(); } a8::SetBitFlag(receive_special_damage_type, n); } @@ -280,7 +280,7 @@ namespace MetaData for (auto& str : strings) { int n = a8::XValue(str); if (n <= 0 || n > 63) { - abort(); + A8_ABORT(); } a8::SetBitFlag(sweep_tags, n); } @@ -404,19 +404,19 @@ namespace MetaData int buff = a8::XValue(buff_strings[i]); power_charge.push_back(std::make_tuple(time, gun, buff)); if (time <= last_time) { - abort(); + A8_ABORT(); } last_time = time; } } else { - abort(); + A8_ABORT(); } } { if (i->buffid() != 0) { buff_meta = MetaMgr::Instance()->GetBuff(i->buffid()); if (!buff_meta) { - abort(); + A8_ABORT(); } } } @@ -451,7 +451,7 @@ namespace MetaData break; } } else { - abort(); + A8_ABORT(); } ++j; } @@ -462,7 +462,7 @@ namespace MetaData for (auto& str : strings) { int n = a8::XValue(str); if (n <= 0 || n > 63) { - abort(); + A8_ABORT(); } a8::SetBitFlag(special_damage_type, n); } @@ -477,7 +477,7 @@ namespace MetaData #if 0 a8::XPrintf("no bullet %d\n", {i->id()}); #else - abort(); + A8_ABORT(); #endif } } @@ -554,7 +554,7 @@ namespace MetaData std::vector strings3; a8::Split(str2, strings3, ':'); if (strings3.size() != 2) { - abort(); + A8_ABORT(); } int attr_type = a8::XValue(strings3[0]); int attr_value = a8::XValue(strings3[1]); @@ -656,7 +656,7 @@ namespace MetaData skin_id.push_back(a8::XValue(str)); } if (skin_id.size() != 3) { - abort(); + A8_ABORT(); } } } @@ -786,7 +786,7 @@ namespace MetaData for (auto& door : doors) { if (door.door_id == 0 || !door.state0 || !door.state1) { - abort(); + A8_ABORT(); } else { #if 0 if (door.state1->x() < door.state0.x()) { @@ -1001,22 +1001,22 @@ namespace MetaData { int skill_id = i->skill_id(); if (!(i->skill_type() == kActiveSkill || i->skill_type() == kPassiveSkill)) { - abort(); + A8_ABORT(); } #if 0 if (!(i->use_method() == 1 || i->use_method() == 2 || i->use_method() == 3)) { - abort(); + A8_ABORT(); } #endif { for (int buff_id : buff_list) { MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(buff_id); if (!buff_meta) { - abort(); + A8_ABORT(); } if (i->skill_type() == kPassiveSkill) { if (buff_meta->i->trigger_type() != kBTT_UseSkill) { - abort(); + A8_ABORT(); } } auto itr = trigger_type_buffs.find(buff_meta->i->trigger_type()); @@ -1072,7 +1072,7 @@ namespace MetaData std::vector strings; a8::Split(i->buff_param2(), strings, '|'); if (i->buff_param2().find(":") != std::string::npos) { - abort(); + A8_ABORT(); } for (auto& str : strings) { param2_int_list.push_back(a8::XValue(str).GetInt()); @@ -1099,7 +1099,7 @@ namespace MetaData for (auto& str : strings) { int n = a8::XValue(str); if (n <= 0 || n > 63) { - abort(); + A8_ABORT(); } a8::SetBitFlag(only_spec_race, n); } @@ -1110,7 +1110,7 @@ namespace MetaData for (auto& str : strings) { int n = a8::XValue(str); if (n <= 0 || n > 63) { - abort(); + A8_ABORT(); } a8::SetBitFlag(exclude_spec_race, n); } @@ -1179,7 +1179,7 @@ namespace MetaData a8::Split(str1, strings2, '|'); for (auto& str2 : strings2) { if (str2.size() < 1) { - abort(); + A8_ABORT(); } auto& p = a8::FastAppend(batch_add_list); if (str2[0] != '!') { @@ -1187,10 +1187,10 @@ namespace MetaData std::vector strings3; a8::Split(str2, strings3, ':'); if (strings3.size() != 2) { - abort(); + A8_ABORT(); } if (a8::XValue(strings3[1]).GetInt() <= 0) { - abort(); + A8_ABORT(); } std::get<0>(p) = -1; std::get<1>(p).push_back @@ -1207,14 +1207,14 @@ namespace MetaData std::vector strings4; a8::Split(str3, strings4, ':'); if (strings4.size() != 2) { - abort(); + A8_ABORT(); } std::string tmp_str = strings4[0]; a8::ReplaceString(tmp_str, "!", ""); int buff_id = a8::XValue(tmp_str); int weight = a8::XValue(strings4[1]); if (weight <= 0) { - abort(); + A8_ABORT(); } rand_space += weight; @@ -1231,7 +1231,7 @@ namespace MetaData } if (i->buff_effect() == kBET_CondAddBuff) { if (!IsValidCondBuff(int_param1)) { - abort(); + A8_ABORT(); } } } @@ -1244,7 +1244,7 @@ namespace MetaData assert(int_param2 == 1 || int_param2 == 2); if (int_param2 == 2) { if (i->buff_param3().find('.') != std::string::npos) { - abort(); + A8_ABORT(); } } } @@ -1255,11 +1255,11 @@ namespace MetaData int hero_id = std::get<3>(info); MetaData::Player* hero_meta = MetaMgr::Instance()->GetPlayer(hero_id); if (!hero_meta) { - abort(); + A8_ABORT(); } MetaData::AI* ai_meta = MetaMgr::Instance()->GetHeroAI(hero_meta->i->ai()); if (!ai_meta) { - abort(); + A8_ABORT(); } } } @@ -1268,7 +1268,7 @@ namespace MetaData { assert(param1 < i->duration_time()); if (!MetaMgr::Instance()->GetBuff(int_param2)) { - abort(); + A8_ABORT(); } } break; @@ -1276,7 +1276,7 @@ namespace MetaData { assert(int_param1 < i->duration_time() * 1000); if (!MetaMgr::Instance()->GetBuff(int_param2)) { - abort(); + A8_ABORT(); } } break; @@ -1288,13 +1288,13 @@ namespace MetaData if (rand_space == -1) { MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(std::get<0>(items[0])); if (!buff_meta) { - abort(); + A8_ABORT(); } } else { for (const auto& item : items) { MetaData::Buff* buff_meta = MetaMgr::Instance()->GetBuff(std::get<0>(item)); if (!buff_meta) { - abort(); + A8_ABORT(); } } } @@ -1353,7 +1353,7 @@ namespace MetaData std::vector strings2; a8::Split(str, strings2, ':'); if (strings2.size() != 3) { - abort(); + A8_ABORT(); } int attr_type = a8::XValue(strings2[0]); int attr_level = a8::XValue(strings2[1]); @@ -1479,7 +1479,7 @@ namespace MetaData if (i->ai_kind() == kAI_MineSweeper) { for (int n : int_list_param2) { if (n <= 0 || n > 63) { - abort(); + A8_ABORT(); } a8::SetBitFlag(bits_param2, n); } diff --git a/server/gameserver/metamgr.cc b/server/gameserver/metamgr.cc index 861436a..f531658 100644 --- a/server/gameserver/metamgr.cc +++ b/server/gameserver/metamgr.cc @@ -45,7 +45,7 @@ static void ParseElemets(const std::string& textid, std::string id = strings[1].substr(0, strings[1].length() - 1); elements.push_back(std::make_tuple(kImageElement, id)); } else { - abort(); + A8_ABORT(); } }; @@ -445,10 +445,10 @@ public: ++i; } if (MetaMgr::Instance()->a_room_ai_weights.size() != MAX_AI_LEVEL) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->a_room_ai_weights_space <= 0) { - abort(); + A8_ABORT(); } } { @@ -470,10 +470,10 @@ public: ++i; } if (MetaMgr::Instance()->b_room_ai_weights.size() != MAX_AI_LEVEL) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->b_room_ai_weights_space <= 0) { - abort(); + A8_ABORT(); } } { @@ -495,10 +495,10 @@ public: ++i; } if (MetaMgr::Instance()->c_room_ai_weights.size() != MAX_AI_LEVEL) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->c_room_ai_weights_space <= 0) { - abort(); + A8_ABORT(); } } @@ -522,17 +522,17 @@ public: METAMGR_READ(inwater_oxygen_recover, 20); } if (MetaMgr::Instance()->K < 0.01f) { - abort(); + A8_ABORT(); } } { MetaMgr::Instance()->human_meta = MetaMgr::Instance()->GetPlayer(40001); if (!MetaMgr::Instance()->human_meta) { - abort(); + A8_ABORT(); } MetaMgr::Instance()->android_meta = MetaMgr::Instance()->GetPlayer(40002); if (!MetaMgr::Instance()->android_meta) { - abort(); + A8_ABORT(); } MetaMgr::Instance()->terminator_meta = MetaMgr::Instance()->GetPlayer(5005); } @@ -548,38 +548,38 @@ private: { if (MetaMgr::Instance()->level0room_shua_robot_min_time > MetaMgr::Instance()->level0room_shua_robot_max_time) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->level0room_shua_robot_min_num > MetaMgr::Instance()->level0room_shua_robot_max_num) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->level0room_die_robot_min_time > MetaMgr::Instance()->level0room_die_robot_max_time) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->level0room_die_robot_min_num > MetaMgr::Instance()->level0room_die_robot_max_num) { - abort(); + A8_ABORT(); } } { if (MetaMgr::Instance()->level1room_shua_robot_min_time > MetaMgr::Instance()->level1room_shua_robot_max_time) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->level1room_shua_robot_min_num > MetaMgr::Instance()->level1room_shua_robot_max_num) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->level1room_die_robot_min_time > MetaMgr::Instance()->level1room_die_robot_max_time) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->level1room_die_robot_min_num > MetaMgr::Instance()->level1room_die_robot_max_num) { - abort(); + A8_ABORT(); } } { @@ -597,22 +597,22 @@ private: } } if (MetaMgr::Instance()->match_team_time <= 0) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->match_robot_time <= 0) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->match_robot_time >= MetaMgr::Instance()->match_team_time) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->match_choose_time <= 0) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->match_lock_time <= 0) { - abort(); + A8_ABORT(); } if (MetaMgr::Instance()->match_lock_time >= MetaMgr::Instance()->match_choose_time) { - abort(); + A8_ABORT(); } } @@ -715,13 +715,13 @@ private: for (auto& meta : buff_meta_list) { if (!IsValidBuffEffect(meta.buff_effect())) { - abort(); + A8_ABORT(); } MetaData::Buff& item = a8::FastAppend(buff_list); item.i = &meta; item.Init(); if (buff_hash.find(item.i->buff_id()) != buff_hash.end()) { - abort(); + A8_ABORT(); } buff_hash[item.i->buff_id()] = &item; } diff --git a/server/gameserver/obstacle.cc b/server/gameserver/obstacle.cc index e8dcc78..adc17c8 100644 --- a/server/gameserver/obstacle.cc +++ b/server/gameserver/obstacle.cc @@ -96,7 +96,7 @@ void Obstacle::RecalcSelfCollider() break; default: { - abort(); + A8_ABORT(); } break; } @@ -408,11 +408,11 @@ bool Obstacle::IsPermanent() { if (is_permanent) { if (GetUniId() >= FIXED_OBJECT_MAXID) { - abort(); + A8_ABORT(); } } else { if (GetUniId() < FIXED_OBJECT_MAXID) { - abort(); + A8_ABORT(); } } return is_permanent; diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index add546e..e1a6fc5 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -1331,7 +1331,7 @@ void Player::UpdateAiming() } if (!p_weapon->meta->power_charge.empty()) { if (power_idx + 1 > p_weapon->meta->power_charge.size()) { - abort(); + A8_ABORT(); } else if (power_idx + 1 == p_weapon->meta->power_charge.size()) { } else { long long passed_time = (room->GetFrameNo() - aiming_frameno) * FRAME_RATE_MS; diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 2eaf670..1fdbcda 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -151,7 +151,7 @@ void Room::Update(int delta_time) #ifdef DEBUG1 end_tick = a8::XGetTickCount(); if (a8::XGetTickCount() - begin_tick > 1000) { - abort(); + A8_ABORT(); } begin_tick = a8::XGetTickCount(); #endif @@ -161,7 +161,7 @@ void Room::Update(int delta_time) #ifdef DEBUG1 end_tick = a8::XGetTickCount(); if (a8::XGetTickCount() - begin_tick > 1000) { - abort(); + A8_ABORT(); } begin_tick = a8::XGetTickCount(); #endif @@ -171,7 +171,7 @@ void Room::Update(int delta_time) #ifdef DEBUG1 end_tick = a8::XGetTickCount(); if (a8::XGetTickCount() - begin_tick > 1000) { - abort(); + A8_ABORT(); } #endif ++frameno_; @@ -234,7 +234,7 @@ Player* Room::NewPlayer() void Room::AddPlayer(Player* hum, BornPoint* init_born_point, bool no_matchteam) { if (gas_data_.gas_mode != GasInactive) { - abort(); + A8_ABORT(); } while (human_hash_.size() >= GetRoomMaxPlayerNum()) { RandRemoveAndroid(); @@ -351,7 +351,7 @@ void Room::CreateAndroid(int robot_num) } MetaData::Robot* robot_meta = MetaMgr::Instance()->RandRobot(refreshed_robot_set_); if (!robot_meta) { - abort(); + A8_ABORT(); } Android* hum = EntityFactory::Instance()->MakeAndroid(AllocUniid()); @@ -530,7 +530,7 @@ int Room::CreateLootEx(int equip_id, a8::Vec2 born_pos, a8::Vec2 pos, int count, if (GetGasData().gas_mode == GasWaiting || GetGasData().gas_mode == GasMoving) { #if 0 if (equip_id == 30908) { - abort(); + A8_ABORT(); a8::XPrintf("CreateLootEx %d\n", {equip_id}); } #endif @@ -569,7 +569,7 @@ int Room::CreateLootEx(int equip_id, a8::Vec2 born_pos, a8::Vec2 pos, int count, if (equip_meta->i->_inventory_slot() == IS_OIL_BUCKET) { MetaData::MapThing* dummy_meta = MetaMgr::Instance()->GetMapThing(equip_meta->int_param1); if (dummy_meta->i->thing_type() != kObstacleOilBucket) { - abort(); + A8_ABORT(); } RoomObstacle* dummy_obj = CreateObstacle(equip_meta->int_param1, pos.x, pos.y); entity->dummy_thing_uniid = dummy_obj->GetUniId(); @@ -728,7 +728,7 @@ void Room::InternalRemoveObjectLater(Entity* entity, a8::XTimerAttacher& xtimer_ break; default: { - abort(); + A8_ABORT(); } break; } @@ -872,7 +872,7 @@ void Room::AdjustPosInnerMap(a8::Vec2& pos, float radius) if (OverBorder(pos, radius)) { pos = a8::Vec2(1800, 1800); #ifdef DEBUG - abort(); + A8_ABORT(); #endif } } @@ -1033,7 +1033,7 @@ void Room::FindLocationWithAabb(ColliderComponent* target_collider, { bool ret = aabb_box->CalcSafePointEx(aabb_pos, target_collider, new_pos); if (!ret) { - abort(); + A8_ABORT(); } } a8::Vec2 new_pos_dir = new_pos - old_pos; @@ -1373,7 +1373,7 @@ void Room::UpdateGasJump() } bool gen_ok = GenSmallCircle(); if (!gen_ok) { - abort(); + A8_ABORT(); } } gas_data_.rad_old = gas_data_.old_area_meta->i->rad(); @@ -1395,7 +1395,7 @@ void Room::UpdateGasJump() bool Room::GenSmallCircle() { if (gas_data_.new_area_meta->i->rad() >= gas_data_.old_area_meta->i->rad()) { - abort(); + A8_ABORT(); } if (gas_data_.pos_list && gas_data_.gas_count + 1 < gas_data_.pos_list->poses.size()) { gas_data_.pos_new = gas_data_.pos_list->poses[gas_data_.gas_count + 1]; @@ -1700,7 +1700,7 @@ void Room::AirDrop(int appear_time, int box_id, int airdrop_id) ); if (is_collision) { if (!pickup_collider) { - abort(); + A8_ABORT(); } } } @@ -1774,7 +1774,7 @@ void Room::ShuaPlane() { airline_ = MetaMgr::Instance()->RandAirLine(map_meta_->i->map_id()); if (!airline_) { - abort(); + A8_ABORT(); } plane.start_point = a8::Vec2(airline_->start_point_x, airline_->start_point_y); plane.end_point = a8::Vec2(airline_->end_point_x, airline_->end_point_y); @@ -2046,7 +2046,7 @@ BornPoint* Room::AllocBornPoint(Human* hum) } #ifdef DEBUG if (!born_point) { - abort(); + A8_ABORT(); } #endif return born_point; @@ -2067,7 +2067,7 @@ void Room::CreateSpawnPoints() spawn_points = normal_room_spawn_points_; } if (!spawn_points || spawn_points->empty()) { - abort(); + A8_ABORT(); } for (auto& thing_tpl : *spawn_points) { int uniid = AllocUniid(); @@ -2110,7 +2110,7 @@ void Room::CreateMonsterSpawnPoints() dir, team_id); if (!hero) { - abort(); + A8_ABORT(); } } } @@ -2383,7 +2383,7 @@ long long Room::GetGasInactiveTime() void Room::EnableHuman(Human* target) { if (!RuningInTimer()) { - abort(); + A8_ABORT(); } #ifdef DEBUG CheckPartObjects(); @@ -2409,7 +2409,7 @@ void Room::EnableHuman(Human* target) AddToAliveHumanHash(target); } } else { - abort(); + A8_ABORT(); } #endif #ifdef DEBUG @@ -2421,7 +2421,7 @@ void Room::DisableHuman(Human* target) { #if 0 if (!RuningInTimer()) { - abort(); + A8_ABORT(); } #endif #ifdef DEBUG @@ -2876,7 +2876,7 @@ void Room::CheckPartObjects(Human* testa, Human* testb) } if (a->InPartObjects(b)) { if (!b->InPartObjects(a)) { - abort(); + A8_ABORT(); } } } @@ -2900,7 +2900,7 @@ void Room::CheckPartObjects(Human* testa, Human* testb) return; } if (!huma->InPartObjects(humb)) { - abort(); + A8_ABORT(); } }); } @@ -3178,13 +3178,13 @@ void Room::ForceSetBornPoint(Human* hum, BornPoint* born_point) BornPoint* Room::ForceTakeBornPoint(Human* hum, BornPoint* reserve_born_point) { if (!reserve_born_point) { - abort(); + A8_ABORT(); } if (hum->born_point == reserve_born_point) { - abort(); + A8_ABORT(); } if (!hum->born_point) { - abort(); + A8_ABORT(); } BornPoint* pre_point = hum->born_point; if (pre_point) { @@ -3372,7 +3372,7 @@ void Room::SyncFrameData() #ifdef DEBUG end_tick = a8::XGetTickCount(); if (a8::XGetTickCount() - begin_tick > 100) { - abort(); + A8_ABORT(); } begin_tick = a8::XGetTickCount(); #endif @@ -3380,7 +3380,7 @@ void Room::SyncFrameData() #ifdef DEBUG end_tick = a8::XGetTickCount(); if (a8::XGetTickCount() - begin_tick > 1000) { - abort(); + A8_ABORT(); } begin_tick = a8::XGetTickCount(); #endif @@ -3679,7 +3679,7 @@ void Room::ForwardGasRing(int n) { bool gen_ok = GenSmallCircle(); if (!gen_ok) { - abort(); + A8_ABORT(); } } gas_data_.rad_old = gas_data_.old_area_meta->i->rad(); @@ -3724,7 +3724,7 @@ void Room::ShuaMon(const a8::Vec2& center, std::vector& airdrop_mon_list, f dir, team_id); if (!hero) { - abort(); + A8_ABORT(); } last_hero_idx = i; #ifdef DEBUG @@ -3881,13 +3881,13 @@ void Room::AirRaid(int airraid_id) void Room::AddToPostBattleAutoFreeList(xtimer_list* timer) { if (BattleStarted()) { - abort(); + A8_ABORT(); } if (!timer) { - abort(); + A8_ABORT(); } if (post_battle_auto_free_list_.find(timer) != post_battle_auto_free_list_.end()) { - abort(); + A8_ABORT(); } auto cb = [this] (xtimer_list* timer) diff --git a/server/gameserver/roommgr.cc b/server/gameserver/roommgr.cc index d7bf926..e1827aa 100644 --- a/server/gameserver/roommgr.cc +++ b/server/gameserver/roommgr.cc @@ -536,10 +536,10 @@ Room* RoomMgr::CreateRoom(const cs::CMJoin& msg, init_info.creator_channel = creator_channel; init_info.force_entry_newbie_room = msg.force_entry_newbie_room(); if (GetRoomByUuid(init_info.room_uuid)) { - abort(); + A8_ABORT(); } if (GetRoomByIdx(init_info.room_idx)) { - abort(); + A8_ABORT(); } } Room* room = new Room(); @@ -644,7 +644,7 @@ void RoomMgr::OnJoinRoomOk(const cs::CMJoin& msg, Player* hum) } } if (!team_hash) { - abort(); + A8_ABORT(); } hum->init_team_member_num = team_hash->size(); { diff --git a/server/gameserver/skill.cc b/server/gameserver/skill.cc index 120b673..b87dfec 100644 --- a/server/gameserver/skill.cc +++ b/server/gameserver/skill.cc @@ -42,7 +42,7 @@ int Skill::GetCd() int Skill::GetPassedTime() { if (!inc_times_timer_) { - abort(); + A8_ABORT(); } if (GetCurrTimes() >= GetMaxTimes()) { return GetCd(); @@ -101,7 +101,7 @@ void Skill::AddPassiveSkillBuff() void Skill::DecTimes() { if (!inc_times_timer_) { - abort(); + A8_ABORT(); } if (GetCurrTimes() >= GetMaxTimes()) { owner->room->xtimer.ModifyTimer(inc_times_timer_, GetCd() / FRAME_RATE_MS); diff --git a/server/gameserver/tracemgr.cc b/server/gameserver/tracemgr.cc index c045cc4..b56b3fa 100644 --- a/server/gameserver/tracemgr.cc +++ b/server/gameserver/tracemgr.cc @@ -7,7 +7,7 @@ #if __GNUC__ > 4 static void ErrorCallback(void *data, const char *msg, int errnum) { - abort(); + A8_ABORT(); } #endif @@ -20,12 +20,12 @@ void TraceMgr::Init(const std::string& filename) ErrorCallback, nullptr); if (!state_) { - abort(); + A8_ABORT(); } #endif log_file_ = fopen("backtrace.log", "w"); if (!log_file_) { - abort(); + A8_ABORT(); } } diff --git a/server/gameserver/trigger.cc b/server/gameserver/trigger.cc index 7ce6588..0a28615 100644 --- a/server/gameserver/trigger.cc +++ b/server/gameserver/trigger.cc @@ -212,7 +212,7 @@ void Trigger::Die() void Trigger::TraverseCondBuffs(int cond, std::function func) { if (!IsValidCondBuff(cond)) { - abort(); + A8_ABORT(); } if (!owner_->room->BattleStarted()) { return; diff --git a/server/gameserver/weakptr.cc b/server/gameserver/weakptr.cc index 473a2c6..522bcf4 100644 --- a/server/gameserver/weakptr.cc +++ b/server/gameserver/weakptr.cc @@ -71,7 +71,7 @@ CreatureWeakPtr&& CreatureWeakPtr::operator=(CreatureWeakPtr&& x) Attach(x.ptr_); x.Detach(); } - abort(); + A8_ABORT(); // return *this; } @@ -97,7 +97,7 @@ void CreatureWeakPtr::Attach(Creature* c) Reset(); CreatureWeakPtrChunk* chunk = c->GetWeakPtrChunk(); if (c != chunk->ptr_) { - abort(); + A8_ABORT(); } ptr_ = c; list_add_tail(&entry_, &chunk->ptrs_); @@ -179,7 +179,7 @@ RoomObstacleWeakPtr&& RoomObstacleWeakPtr::operator=(RoomObstacleWeakPtr&& x) Attach(x.ptr_); x.Detach(); } - abort(); + A8_ABORT(); // return *this; } @@ -205,7 +205,7 @@ void RoomObstacleWeakPtr::Attach(RoomObstacle* c) Reset(); RoomObstacleWeakPtrChunk* chunk = c->GetWeakPtrChunk(); if (c != chunk->ptr_) { - abort(); + A8_ABORT(); } ptr_ = c; list_add_tail(&entry_, &chunk->ptrs_); @@ -287,7 +287,7 @@ EntityWeakPtr&& EntityWeakPtr::operator=(EntityWeakPtr&& x) Attach(x.ptr_); x.Detach(); } - abort(); + A8_ABORT(); // return *this; } @@ -313,7 +313,7 @@ void EntityWeakPtr::Attach(Entity* c) Reset(); EntityWeakPtrChunk* chunk = c->GetEntityWeakPtrChunk(); if (c != chunk->ptr_) { - abort(); + A8_ABORT(); } ptr_ = c; list_add_tail(&entry_, &chunk->ptrs_); diff --git a/third_party/a8engine b/third_party/a8engine index 5e0a939..adcd7a7 160000 --- a/third_party/a8engine +++ b/third_party/a8engine @@ -1 +1 @@ -Subproject commit 5e0a939a89ba97edd371695432ef029eae2c55d5 +Subproject commit adcd7a71ae0d085df858585bef5df69270b01c86