mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-15 08:17:13 +00:00
fix: adapt the transfers of a match, a rescue and a property reload to a failed transfer
The chat server passes the master server's answer for a match on to the world servers as it is, and a world server tells each player of the match that the map change failed. A player moved from the dashboard and the players of a property that loads again are told the same, and their characters stay in the zone they are in. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "ActivityComponent.h"
|
||||
#include "WorldPackets.h"
|
||||
#include "ChatServerLink.h"
|
||||
#include "ChatPackets.h"
|
||||
#include "GameMessages.h"
|
||||
@@ -303,6 +304,9 @@ void ActivityInstance::TransferParticipants(const ChatPackets::MatchTransfer& tr
|
||||
const auto zoneInstance = transfer.zoneID.GetInstanceID();
|
||||
const auto zoneClone = transfer.zoneID.GetCloneID();
|
||||
for (Entity* player : GetParticipants()) {
|
||||
// The match got no instance: the players stay, and each is told the map change failed
|
||||
if (WorldPackets::SendIfTransferFailed(player->GetSystemAddress(), transfer.serverIP, transfer.serverPort)) continue;
|
||||
|
||||
LOG("Transferring %s to Zone %i (Instance %i | Clone %i | Mythran Shift: %s) with IP %s and Port %i", player->GetCharacter()->GetName().c_str(), zoneID, zoneInstance, zoneClone, transfer.mythranShift == true ? "true" : "false", transfer.serverIP.c_str(), transfer.serverPort);
|
||||
if (player->GetCharacter()) {
|
||||
auto* characterComponent = player->GetComponent<CharacterComponent>();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "DashboardActions.h"
|
||||
#include "WorldPackets.h"
|
||||
|
||||
#include "master/PlayerAction.h"
|
||||
#include "Game.h"
|
||||
@@ -144,6 +145,7 @@ namespace {
|
||||
[objectId, spawnPoint](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
|
||||
auto* entity = Game::entityManager->GetEntity(objectId);
|
||||
if (!entity || !entity->GetCharacter()) return;
|
||||
if (WorldPackets::SendIfTransferFailed(entity->GetSystemAddress(), serverIP, serverPort)) return;
|
||||
|
||||
auto* character = entity->GetCharacter();
|
||||
if (auto* characterComponent = entity->GetComponent<CharacterComponent>()) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "UgcManifest.h"
|
||||
#include "WorldPackets.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
@@ -331,6 +332,7 @@ namespace {
|
||||
[objectId](bool mythranShift, uint32_t zoneID, uint32_t zoneInstance, uint32_t zoneClone, std::string serverIP, uint16_t serverPort) {
|
||||
auto* const entity = Game::entityManager->GetEntity(objectId);
|
||||
if (!entity || !entity->GetCharacter()) return;
|
||||
if (WorldPackets::SendIfTransferFailed(entity->GetSystemAddress(), serverIP, serverPort)) return;
|
||||
auto* const character = entity->GetCharacter();
|
||||
character->SetZoneID(zoneID);
|
||||
character->SetZoneInstance(zoneInstance);
|
||||
|
||||
Reference in New Issue
Block a user