Merge remote-tracking branch 'upstream/main' into more-cdclient-cleanup

This commit is contained in:
David Markowitz
2023-03-26 03:00:21 -07:00
52 changed files with 721 additions and 309 deletions

View File

@@ -673,6 +673,9 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
case GAME_MSG_ACTIVATE_BUBBLE_BUFF:
GameMessages::HandleActivateBubbleBuff(inStream, entity);
break;
case GAME_MSG_ZONE_SUMMARY_DISMISSED:
GameMessages::HandleZoneSummaryDismissed(inStream, entity);
break;
default:
// Game::logger->Log("GameMessageHandler", "Unknown game message ID: %i", messageID);
break;

View File

@@ -35,6 +35,7 @@
#include "eMissionTaskType.h"
#include "eMissionState.h"
#include "RenderComponent.h"
#include "eTriggerEventType.h"
#include <sstream>
#include <future>
@@ -410,7 +411,7 @@ void GameMessages::SendServerDoneLoadingAllObjects(Entity* entity, const SystemA
SEND_PACKET;
}
void GameMessages::SendChatModeUpdate(const LWOOBJID& objectID, uint8_t level) {
void GameMessages::SendChatModeUpdate(const LWOOBJID& objectID, eGameMasterLevel level) {
CBITSTREAM;
CMSGHEADER;
bitStream.Write(objectID);
@@ -419,7 +420,7 @@ void GameMessages::SendChatModeUpdate(const LWOOBJID& objectID, uint8_t level) {
SEND_PACKET_BROADCAST;
}
void GameMessages::SendGMLevelBroadcast(const LWOOBJID& objectID, uint8_t level) {
void GameMessages::SendGMLevelBroadcast(const LWOOBJID& objectID, eGameMasterLevel level) {
CBITSTREAM;
CMSGHEADER;
bitStream.Write(objectID);
@@ -2814,7 +2815,7 @@ void GameMessages::HandleSetConsumableItem(RakNet::BitStream* inStream, Entity*
void GameMessages::SendPlayCinematic(LWOOBJID objectId, std::u16string pathName, const SystemAddress& sysAddr,
bool allowGhostUpdates, bool bCloseMultiInteract, bool bSendServerNotify, bool bUseControlledObjectForAudioListener,
int endBehavior, bool hidePlayerDuringCine, float leadIn, bool leavePlayerLockedWhenFinished,
eEndBehavior endBehavior, bool hidePlayerDuringCine, float leadIn, bool leavePlayerLockedWhenFinished,
bool lockPlayer, bool result, bool skipIfSamePath, float startTimeAdvance) {
CBITSTREAM;
CMSGHEADER;
@@ -2827,8 +2828,8 @@ void GameMessages::SendPlayCinematic(LWOOBJID objectId, std::u16string pathName,
bitStream.Write(bSendServerNotify);
bitStream.Write(bUseControlledObjectForAudioListener);
bitStream.Write(endBehavior != 0);
if (endBehavior != 0) bitStream.Write(endBehavior);
bitStream.Write(endBehavior != eEndBehavior::RETURN);
if (endBehavior != eEndBehavior::RETURN) bitStream.Write(endBehavior);
bitStream.Write(hidePlayerDuringCine);
@@ -6155,3 +6156,39 @@ void GameMessages::SendDeactivateBubbleBuffFromServer(LWOOBJID objectId, const S
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST;
SEND_PACKET;
}
void GameMessages::HandleZoneSummaryDismissed(RakNet::BitStream* inStream, Entity* entity) {
LWOOBJID player_id;
inStream->Read<LWOOBJID>(player_id);
auto target = EntityManager::Instance()->GetEntity(player_id);
entity->TriggerEvent(eTriggerEventType::ZONE_SUMMARY_DISMISSED, target);
};
void GameMessages::SendSetNamebillboardState(const SystemAddress& sysAddr, LWOOBJID objectId) {
CBITSTREAM;
CMSGHEADER;
bitStream.Write(objectId);
bitStream.Write(GAME_MSG::GAME_MSG_SET_NAME_BILLBOARD_STATE);
// Technically these bits would be written, however the client does not
// contain a deserialize method to actually deserialize, so we are leaving it out.
// As such this GM only turns the billboard off.
// bitStream.Write(overrideDefault);
// bitStream.Write(state);
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST
else SEND_PACKET
}
void GameMessages::SendShowBillboardInteractIcon(const SystemAddress& sysAddr, LWOOBJID objectId) {
CBITSTREAM;
CMSGHEADER;
bitStream.Write(objectId);
bitStream.Write(GAME_MSG::GAME_MSG_SHOW_BILLBOARD_INTERACT_ICON);
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST
else SEND_PACKET
}

View File

@@ -7,6 +7,7 @@
#include <vector>
#include "eMovementPlatformState.h"
#include "NiPoint3.h"
#include "eEndBehavior.h"
class AMFValue;
class Entity;
@@ -21,6 +22,7 @@ enum class eAnimationFlags : uint32_t;
enum class eUnequippableActiveType;
enum eInventoryType : uint32_t;
enum class eGameMasterLevel : uint8_t;
namespace GameMessages {
class PropertyDataMessage;
@@ -61,8 +63,8 @@ namespace GameMessages {
void SendRestoreToPostLoadStats(Entity* entity, const SystemAddress& sysAddr);
void SendServerDoneLoadingAllObjects(Entity* entity, const SystemAddress& sysAddr);
void SendGMLevelBroadcast(const LWOOBJID& objectID, uint8_t level);
void SendChatModeUpdate(const LWOOBJID& objectID, uint8_t level);
void SendGMLevelBroadcast(const LWOOBJID& objectID, eGameMasterLevel level);
void SendChatModeUpdate(const LWOOBJID& objectID, eGameMasterLevel level);
void SendAddItemToInventoryClientSync(Entity* entity, const SystemAddress& sysAddr, Item* item, const LWOOBJID& objectID, bool showFlyingLoot, int itemCount, LWOOBJID subKey = LWOOBJID_EMPTY, eLootSourceType lootSourceType = eLootSourceType::LOOT_SOURCE_NONE);
void SendNotifyClientFlagChange(const LWOOBJID& objectID, int iFlagID, bool bFlag, const SystemAddress& sysAddr);
@@ -265,7 +267,7 @@ namespace GameMessages {
void SendPlayCinematic(LWOOBJID objectId, std::u16string pathName, const SystemAddress& sysAddr,
bool allowGhostUpdates = true, bool bCloseMultiInteract = true, bool bSendServerNotify = false, bool bUseControlledObjectForAudioListener = false,
int endBehavior = 0, bool hidePlayerDuringCine = false, float leadIn = -1, bool leavePlayerLockedWhenFinished = false,
eEndBehavior endBehavior = eEndBehavior::RETURN, bool hidePlayerDuringCine = false, float leadIn = -1, bool leavePlayerLockedWhenFinished = false,
bool lockPlayer = true, bool result = false, bool skipIfSamePath = false, float startTimeAdvance = 0);
void SendEndCinematic(LWOOBJID objectID, std::u16string pathName, const SystemAddress& sysAddr = UNASSIGNED_SYSTEM_ADDRESS,
@@ -574,6 +576,8 @@ namespace GameMessages {
void HandleToggleGhostReferenceOverride(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
void HandleSetGhostReferencePosition(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
void SendSetNamebillboardState(const SystemAddress& sysAddr, LWOOBJID objectId);
void SendShowBillboardInteractIcon(const SystemAddress& sysAddr, LWOOBJID objectId);
void HandleBuyFromVendor(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
void HandleSellToVendor(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
void HandleBuybackFromVendor(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
@@ -621,7 +625,7 @@ namespace GameMessages {
void HandleReportBug(RakNet::BitStream* inStream, Entity* entity);
void SendRemoveBuff(Entity* entity, bool fromUnEquip, bool removeImmunity, uint32_t buffId);
// bubble
void HandleDeactivateBubbleBuff(RakNet::BitStream* inStream, Entity* entity);
@@ -630,6 +634,8 @@ namespace GameMessages {
void SendActivateBubbleBuffFromServer(LWOOBJID objectId, const SystemAddress& sysAddr);
void SendDeactivateBubbleBuffFromServer(LWOOBJID objectId, const SystemAddress& sysAddr);
void HandleZoneSummaryDismissed(RakNet::BitStream* inStream, Entity* entity);
};
#endif // GAMEMESSAGES_H