From 24d4e1c222c3146d8ab047758c606842d6b1f429 Mon Sep 17 00:00:00 2001 From: Koncord Date: Fri, 26 May 2017 02:40:49 +0800 Subject: [PATCH] [General] Remove useless PacketSendMyID --- apps/openmw-mp/Networking.cpp | 3 -- apps/openmw/mwmp/Networking.cpp | 2 ++ apps/openmw/mwmp/ProcessorInitializer.cpp | 2 -- .../processors/player/ProcessorUserMyID.hpp | 31 ------------------- .../Controllers/PlayerPacketController.cpp | 2 -- .../Packets/Player/PacketSendMyID.hpp | 25 --------------- 6 files changed, 2 insertions(+), 63 deletions(-) delete mode 100644 apps/openmw/mwmp/processors/player/ProcessorUserMyID.hpp delete mode 100644 components/openmw-mp/Packets/Player/PacketSendMyID.hpp diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 819f4974c..7381ea877 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -244,9 +244,6 @@ void Networking::update(RakNet::Packet *packet) playerPacketController->GetPacket(ID_HANDSHAKE)->RequestData(packet->guid); Players::newPlayer(packet->guid); player = Players::getPlayer(packet->guid); - - playerPacketController->GetPacket(ID_USER_MYID)->setPlayer(player); - playerPacketController->GetPacket(ID_USER_MYID)->Send(false); return; } else if (playerPacketController->ContainsPacket(packet->data[0])) diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 6dc51b421..f2e2dca5a 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -310,6 +310,8 @@ void Networking::connect(const std::string &ip, unsigned short port, std::vector } else preInit(content, collections); + + getLocalPlayer()->guid = peer->GetMyGUID(); } void Networking::preInit(std::vector &content, Files::Collections &collections) diff --git a/apps/openmw/mwmp/ProcessorInitializer.cpp b/apps/openmw/mwmp/ProcessorInitializer.cpp index 62463aeb1..bd8e4e011 100644 --- a/apps/openmw/mwmp/ProcessorInitializer.cpp +++ b/apps/openmw/mwmp/ProcessorInitializer.cpp @@ -12,7 +12,6 @@ #include "processors/player/ProcessorGUIMessageBox.hpp" #include "processors/player/ProcessorHandshake.hpp" #include "processors/player/ProcessorUserDisconnected.hpp" -#include "processors/player/ProcessorUserMyID.hpp" #include "processors/player/ProcessorPlayerBaseInfo.hpp" #include "processors/player/ProcessorPlayerCharGen.hpp" #include "processors/player/ProcessorPlayerAnimFlags.hpp" @@ -75,7 +74,6 @@ void ProcessorInitializer() PlayerProcessor::AddProcessor(new ProcessorGUIMessageBox()); PlayerProcessor::AddProcessor(new ProcessorHandshake()); PlayerProcessor::AddProcessor(new ProcessorUserDisconnected()); - PlayerProcessor::AddProcessor(new ProcessorUserMyID()); PlayerProcessor::AddProcessor(new ProcessorPlayerBaseInfo()); PlayerProcessor::AddProcessor(new ProcessorPlayerCharGen()); PlayerProcessor::AddProcessor(new ProcessorPlayerAnimFlags()); diff --git a/apps/openmw/mwmp/processors/player/ProcessorUserMyID.hpp b/apps/openmw/mwmp/processors/player/ProcessorUserMyID.hpp deleted file mode 100644 index bdd0a8b94..000000000 --- a/apps/openmw/mwmp/processors/player/ProcessorUserMyID.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// -// Created by koncord on 16.04.17. -// - -#ifndef OPENMW_PROCESSORUSERMYID_HPP -#define OPENMW_PROCESSORUSERMYID_HPP - - -#include "apps/openmw/mwmp/PlayerProcessor.hpp" - -namespace mwmp -{ - class ProcessorUserMyID : public PlayerProcessor - { - public: - ProcessorUserMyID() - { - BPP_INIT(ID_USER_MYID) - avoidReading = true; - } - - virtual void Do(PlayerPacket &packet, BasePlayer *player) - { - LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received ID_USER_MYID from server"); - myGuid = guid; - getLocalPlayer()->guid = guid; - } - }; -} - -#endif //OPENMW_PROCESSORUSERMYID_HPP diff --git a/components/openmw-mp/Controllers/PlayerPacketController.cpp b/components/openmw-mp/Controllers/PlayerPacketController.cpp index 9448bec26..2d19fea96 100644 --- a/components/openmw-mp/Controllers/PlayerPacketController.cpp +++ b/components/openmw-mp/Controllers/PlayerPacketController.cpp @@ -2,7 +2,6 @@ #include #include -#include "../Packets/Player/PacketSendMyID.hpp" #include "../Packets/Player/PacketDisconnect.hpp" #include "../Packets/Player/PacketChatMessage.hpp" #include "../Packets/Player/PacketPlayerCharGen.hpp" @@ -45,7 +44,6 @@ inline void AddPacket(mwmp::PlayerPacketController::packets_t *packets, RakNet:: mwmp::PlayerPacketController::PlayerPacketController(RakNet::RakPeerInterface *peer) { - AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); AddPacket(&packets, peer); diff --git a/components/openmw-mp/Packets/Player/PacketSendMyID.hpp b/components/openmw-mp/Packets/Player/PacketSendMyID.hpp deleted file mode 100644 index 2bd78b772..000000000 --- a/components/openmw-mp/Packets/Player/PacketSendMyID.hpp +++ /dev/null @@ -1,25 +0,0 @@ -// -// Created by koncord on 12.01.16. -// - -#ifndef OPENMW_PACKETSENDMYID_HPP -#define OPENMW_PACKETSENDMYID_HPP - -#include -#include - -namespace mwmp -{ - class PacketSendMyID : public PlayerPacket - { - public: - PacketSendMyID(RakNet::RakPeerInterface *peer) : PlayerPacket(peer) - { - packetID = ID_USER_MYID; - orderChannel = CHANNEL_SYSTEM; - } - }; -} - - -#endif //OPENMW_PACKETSENDMYID_HPP