From 9cfced88c94f7960d7b45252870a5955ad306692 Mon Sep 17 00:00:00 2001 From: SengokuNadeko <70702835+SengokuNadeko@users.noreply.github.com> Date: Wed, 23 Sep 2020 13:52:21 -0400 Subject: [PATCH] Stubbed buddy warping After testing warping a lot I saw how buggy it is. I decided to stub it for this PR and work on it in a later PR. --- src/BuddyManager.cpp | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/src/BuddyManager.cpp b/src/BuddyManager.cpp index 40939c2..198c614 100644 --- a/src/BuddyManager.cpp +++ b/src/BuddyManager.cpp @@ -4,7 +4,10 @@ #include "PlayerManager.hpp" #include "BuddyManager.hpp" +#include +#include #include +#include void BuddyManager::init() { REGISTER_SHARD_PACKET(P_CL2FE_REQ_REQUEST_MAKE_BUDDY, requestBuddy); @@ -73,8 +76,6 @@ void BuddyManager::reqBuddyByName(CNSocket* sock, CNPacketData* data) { } } - PlayerView& plr = PlayerManager::players[otherSock]; - resp.iPCUID = plrReq->PCStyle.iPC_UID; resp.iNameCheckFlag = plrReq->PCStyle.iNameCheck; @@ -312,30 +313,7 @@ void BuddyManager::reqBuddyDelete(CNSocket* sock, CNPacketData* data) { } //Warping to buddy -void BuddyManager::reqBuddyWarp(CNSocket* sock, CNPacketData* data) { - if (data->size != sizeof(sP_CL2FE_REQ_PC_BUDDY_WARP)) - return; //malformed packet - - sP_CL2FE_REQ_PC_BUDDY_WARP* pkt = (sP_CL2FE_REQ_PC_BUDDY_WARP*)data->buf; - - INITSTRUCT(sP_FE2CL_REP_PC_BUDDY_WARP_OTHER_SHARD_SUCC, resp); - resp.iBuddyPCUID = pkt->iBuddyPCUID; - - CNSocket* otherSock = sock; - - for (auto pair : PlayerManager::players) { - if (pair.second.plr->PCStyle.iPC_UID == pkt->iBuddyPCUID) { - otherSock = pair.first; - } - } - - Player* buddy = PlayerManager::getPlayer(otherSock); - - PlayerManager::updatePlayerPosition(sock, buddy->x, buddy->y, buddy->z); - - sock->sendPacket((void*)&resp, P_FE2CL_REP_PC_BUDDY_WARP_OTHER_SHARD_SUCC, sizeof(sP_FE2CL_REP_PC_BUDDY_WARP_OTHER_SHARD_SUCC)); - -} +void BuddyManager::reqBuddyWarp(CNSocket* sock, CNPacketData* data) {} //stub #pragma region Helper methods