cggetoffmotorcyclehandler.cpp
来自「天之炼狱1服务器端源文件游戏服务端不完整」· C++ 代码 · 共 98 行
CPP
98 行
//////////////////////////////////////////////////////////////////////////////// Filename : CGGetOffMotorCycleHandler.cc// Written By : elca@ewestsoft.com// Description ://////////////////////////////////////////////////////////////////////////////#include "CGGetOffMotorCycle.h"#ifdef __GAME_SERVER__ #include "GamePlayer.h" #include "Slayer.h" #include "item/Motorcycle.h" #include "ctf/FlagManager.h" #include "Gpackets/GCGetOffMotorCycle.h" #include "Gpackets/GCGetOffMotorCycleOK.h" #include "Gpackets/GCGetOffMotorCycleFailed.h"#endif // __GAME_SERVER__////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////void CGGetOffMotorCycleHandler::execute (CGGetOffMotorCycle* pPacket , Player* pPlayer) throw (Error){ __BEGIN_TRY __BEGIN_DEBUG_EX #ifdef __GAME_SERVER__ Assert(pPacket != NULL); Assert(pPlayer != NULL); GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pPlayer); // 敲饭捞绢狼 惑怕啊 沥惑利牢 惑怕牢瘤甫 八荤茄促. if (pGamePlayer->getPlayerStatus() != GPS_NORMAL) { GCGetOffMotorCycleFailed _GCGetOffMotorCycleFailed; pPlayer->sendPacket(&_GCGetOffMotorCycleFailed); return; } Creature* pCreature = pGamePlayer->getCreature(); // 浇饭捞绢捞牢瘤甫 八荤茄促. if (!pCreature->isSlayer()) { GCGetOffMotorCycleFailed _GCGetOffMotorCycleFailed; pPlayer->sendPacket(&_GCGetOffMotorCycleFailed); return; } Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature); Motorcycle* pMotorcycle = pSlayer->getMotorcycle(); bool bSuccess = false; Zone* pZone = pSlayer->getZone(); // 坷配官捞甫 鸥绊 乐促搁... if (pMotorcycle != NULL) { ZoneCoord_t x = pSlayer->getX(); ZoneCoord_t y = pSlayer->getY(); // 老馆 瘤开捞 酒聪扼搁 (0捞 老馆 瘤开捞促.), 款康磊父捞 郴副 荐 乐促. if (pZone->getZoneLevel(x, y) & SAFE_ZONE) { if (pSlayer->isGOD() || pSlayer->isDM()) bSuccess = true; } else if ( !g_pFlagManager->isInPoleField( ZONE_COORD( pZone->getZoneID(), x, y ) ) ) { bSuccess = true; } } if (bSuccess) { pSlayer->getOffMotorcycle(); GCGetOffMotorCycle _GCGetOffMotorCycle; GCGetOffMotorCycleOK _GCGetOffMotorCycleOK; _GCGetOffMotorCycle.setObjectID(pSlayer->getObjectID()); pGamePlayer->sendPacket(&_GCGetOffMotorCycleOK); pZone->broadcastPacket(pSlayer->getX(), pSlayer->getY(), &_GCGetOffMotorCycle , pSlayer); } else { GCGetOffMotorCycleFailed _GCGetOffMotorCycleFailed; pPlayer->sendPacket(&_GCGetOffMotorCycleFailed); }#endif // __GAME_SERVER__ __END_DEBUG_EX __END_CATCH}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?