Added GM for reputation update

This commit is contained in:
EmosewaMC 2022-03-29 19:52:07 -07:00
parent 94e0ef77a9
commit fdd3e15b2f
3 changed files with 30 additions and 1 deletions

View File

@ -595,7 +595,9 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
case GAME_MSG_VEHICLE_NOTIFY_HIT_IMAGINATION_SERVER:
GameMessages::HandleVehicleNotifyHitImaginationServer(inStream, entity, sysAddr);
break;
case GAME_MSG_UPDATE_PROPERTY_PERFORMANCE_COST:
GameMessages::HandleUpdatePropertyPerformanceCost(inStream, entity, sysAddr);
break;
// SG
case GAME_MSG_UPDATE_SHOOTING_GALLERY_ROTATION:
GameMessages::HandleUpdateShootingGalleryRotation(inStream, entity, sysAddr);

View File

@ -4137,6 +4137,31 @@ void GameMessages::HandleRacingPlayerInfoResetFinished(RakNet::BitStream* inStre
}
}
void GameMessages::HandleUpdatePropertyPerformanceCost(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr) {
float performanceCost = 0.0f;
if (inStream->ReadBit()) inStream->Read(performanceCost);
Game::logger->Log("GameMessages", "new value is %f\n", performanceCost);
if (performanceCost == 0.0f) return;
auto zone = dZoneManager::Instance()->GetZone();
const auto& worldId = zone->GetZoneID();
const auto cloneId = worldId.GetCloneID();
const auto zoneId = worldId.GetMapID();
auto updatePerformanceCostQuery = Database::CreatePreppedStmt("UPDATE properties SET performance_cost = ? WHERE clone_id = ? AND zone_id = ?");
updatePerformanceCostQuery->setDouble(1, performanceCost);
updatePerformanceCostQuery->setInt(2, cloneId);
updatePerformanceCostQuery->setInt(3, zoneId);
updatePerformanceCostQuery->execute();
delete updatePerformanceCostQuery;
updatePerformanceCostQuery = nullptr;
}
void GameMessages::HandleVehicleNotifyHitImaginationServer(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr)
{

View File

@ -386,6 +386,8 @@ namespace GameMessages {
bool bUseLeaderboards
);
void HandleUpdatePropertyPerformanceCost(RakNet::BitStream* inStream, Entity* entity, const SystemAddress& sysAddr);
void SendNotifyClientShootingGalleryScore(LWOOBJID objectId, const SystemAddress& sysAddr,
float addTime,
int32_t score,