[General] Disable automatic sync for PlayerJournal and PlayerFaction

Simplify PlayerFaction packets by removing BOTH action
0.6.1
David Cernat 7 years ago
parent 6dde0ca9c9
commit 4e74910fdb

@ -17,8 +17,6 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnPlayerFaction")>(player.getId());
}
};

@ -17,8 +17,6 @@ namespace mwmp
{
DEBUG_PRINTF(strPacketID.c_str());
packet.Send(true);
Script::Call<Script::CallbackIdentity("OnPlayerJournal")>(player.getId());
}
};

@ -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

@ -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

@ -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)

Loading…
Cancel
Save