From 4e74910fdb36f3ab2a17db28097561ec5c74c6ac Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 8 Jul 2017 12:27:48 +0300 Subject: [PATCH] [General] Disable automatic sync for PlayerJournal and PlayerFaction Simplify PlayerFaction packets by removing BOTH action --- apps/openmw-mp/processors/player/ProcessorPlayerFaction.hpp | 2 -- apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp | 2 -- apps/openmw/mwmp/LocalPlayer.cpp | 5 ++--- components/openmw-mp/Base/BasePlayer.hpp | 3 +-- components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp | 4 ++-- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerFaction.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerFaction.hpp index 20ab6b3bf..071d9bc1d 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerFaction.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerFaction.hpp @@ -17,8 +17,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.Send(true); - Script::Call(player.getId()); } }; diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp index 1ec3f1850..82fa46160 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerJournal.hpp @@ -17,8 +17,6 @@ namespace mwmp { DEBUG_PRINTF(strPacketID.c_str()); - packet.Send(true); - Script::Call(player.getId()); } }; diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index f9333b225..3e56fa0d7 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -955,7 +955,7 @@ void LocalPlayer::setFactions() if (!ptrNpcStats.isInFaction(faction.factionId)) ptrNpcStats.joinFaction(faction.factionId); - if (factionChanges.action == mwmp::FactionChanges::RANK || factionChanges.action == mwmp::FactionChanges::BOTH) + if (factionChanges.action == mwmp::FactionChanges::RANK) { // While the faction rank is different in the packet than in the NpcStats, // adjust the NpcStats accordingly @@ -967,8 +967,7 @@ void LocalPlayer::setFactions() ptrNpcStats.lowerRank(faction.factionId); } } - - if (factionChanges.action == mwmp::FactionChanges::EXPULSION || factionChanges.action == mwmp::FactionChanges::BOTH) + else if (factionChanges.action == mwmp::FactionChanges::EXPULSION) { // If the expelled state is different in the packet than in the NpcStats, // adjust the NpcStats accordingly diff --git a/components/openmw-mp/Base/BasePlayer.hpp b/components/openmw-mp/Base/BasePlayer.hpp index adffe849d..884f4a40f 100644 --- a/components/openmw-mp/Base/BasePlayer.hpp +++ b/components/openmw-mp/Base/BasePlayer.hpp @@ -91,8 +91,7 @@ namespace mwmp enum FACTION_ACTION { RANK = 0, - EXPULSION = 1, - BOTH = 2 + EXPULSION = 1 }; int action; // 0 - Rank, 1 - Expulsion state, 2 - Both diff --git a/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp b/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp index 43245032b..e107d4994 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerFaction.cpp @@ -31,10 +31,10 @@ void PacketPlayerFaction::Packet(RakNet::BitStream *bs, bool send) RW(faction.factionId, send, 1); - if (player->factionChanges.action == FactionChanges::BOTH || player->factionChanges.action == FactionChanges::RANK) + if (player->factionChanges.action == FactionChanges::RANK) RW(faction.rank, send); - if (player->factionChanges.action == FactionChanges::BOTH || player->factionChanges.action == FactionChanges::EXPULSION) + if (player->factionChanges.action == FactionChanges::EXPULSION) RW(faction.isExpelled, send); if (!send)