rodecomp/Source/Network/ActorNamePacket.cpp
ragnarok-clanker c932ad6499 Maintenance: Resubmission of 15134 without the 12 struct/type renames (their new names changed mangled symbols in 17 functions). Rena
Batch #15141 by ragnarok-clanker: no function's compiled code changes; checked with 537 compiled unit(s), including every includer of Source/Client/Input/LanguageTC.h, Source/Client/Mode/CGameMode.h, Source/Client/Mode/CLoginMode.h, Source/Client/Replay.h, Source/Client/Session.h, Source/Contents/AchievementMgr.h, Source/Contents/Actors/CharacterRender.h, Source/Contents/Actors/EffectActors.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/Pc.h, Source/Contents/EnchantMgr.h, Source/Contents/GuildInfo.h, Source/Contents/Messenger/MessengerWindows.h, Source/Contents/Schedule/TimeScheduler.h, Source/Contents/Sound/SoundMgr.h, Source/Contents/SpriteLayerDrawing.h, Source/Contents/TableMng.h, Source/Contents/World/SkyBox.h, Source/UI/Chat/UINewChatWnd.h, Source/UI/Text/CreateLineInfo.h, Source/UI/UIGradeEnchantWnd.h, Source/UI/Window/UINewSelectCharWnd.h, Source/UI/Window/UINewSkillListWnd.h, Source/UI/Window/UIPetInfoWnd.h, Source/UI/Window/UIReplayRECControlWnd.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/UIWindowMgr.inl.
2026-11-09 12:21:09 +00:00

44 lines
1.8 KiB
C++

#include "Client/Mode/CGameMode.h"
#include "Client/Session.h"
#include "Contents/MessageTable.h"
#include "Network/ActorNamePacket.h"
#include "UI/Edit/UIEditCtrl.h"
#include "UI/Window/UIPetInfoWnd.h"
#include "UI/Window/UIWindowMgr.h"
#include "Resource/MSGSTRINGID.h"
#include <cstdio>
#include <string>
// OFFSET: 0x00D1DFB0
// FUNCTION: fn_21632
void CGameMode::ReceiveActorNameAll(const ActorNameAllPacket* packet) {
this->nameCard.Set(packet->actorId, std::string(packet->name, packet->name + sizeof(packet->name)).c_str(),
std::string(packet->partyName, packet->partyName + sizeof(packet->partyName)).c_str(),
std::string(packet->guildName, packet->guildName + sizeof(packet->guildName)).c_str(),
std::string(packet->positionName, packet->positionName + sizeof(packet->positionName)).c_str(), std::string(), std::string(), 0);
}
// OFFSET: 0x00D1E3D0
// FUNCTION: fn_21633
void CGameMode::ReceiveActorNameTitle(const ActorNameTitlePacket* packet) {
this->nameCard.Set(packet->actorId, std::string(packet->name, packet->name + sizeof(packet->name)).c_str(), std::string(), std::string(), std::string(),
std::string(), packet->title, packet->groupId);
if (packet->actorId == g_session.petGid) {
std::sprintf(g_session.petName, packet->name);
if (UIPetInfoWnd* window = static_cast<UIPetInfoWnd*>(g_windowMgr.petInfoWnd)) {
window->nameEdit->SetText(packet->name);
}
}
}
// OFFSET: 0x00D1DB50
// FUNCTION: fn_21631
void CGameMode::ReceivePlayerNameUpdate(const PlayerNameUpdatePacket* packet) {
if (packet->type == 4 || packet->type == 3) {
std::string name = packet->type == 4 ? std::string(LookupMessage(MSI_NAMELESS_USER))
: std::string(std::string(packet->name, packet->name + sizeof(packet->name)).c_str());
SetPlayerName(packet->characterId, name);
}
}