Batch #10019 by ragnarok-clanker: forced by an admin (23 lower score(s), 187 changed function(s)); checked with 447 compiled unit(s), including every includer of Source/Client/Input/Language.h, Source/Client/Mode/ModeDragState.h, Source/Contents/Async/AsyncWorkMgr.h, Source/Contents/Emblems/EmblemCache.h, Source/Contents/Party/AdventurerAgencyMgr.h, Source/Contents/Party/AgencyRequestContext.h, Source/Contents/Party/ChangePartyMasterAsyncWork.h, Source/Contents/Party/LoadMyPartyAsyncWork.h, Source/Contents/Party/LoadPartyInfoAsyncWork.h, Source/Contents/Party/LoadPartyListAsyncWork.h, Source/Contents/Party/PartyInvitation.h, Source/Contents/Party/RegisterPartyAsyncWork.h, Source/Contents/Party/StopRecruitingAsyncWork.h, Source/Contents/Skills/PlayerSkillBundle.h, Source/Contents/UserData/CharacterConfigLoad.h, Source/Network/Packets/PartyJoinPacket.h, Source/UI/Chat/ChatSuggestions.h, Source/UI/Dialogs/UIWaitDBSaveWnd.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/Lists/UIListBox.h, Source/UI/Party/UIRequestJoinPartyMgr.h, Source/UI/Shortcuts/NormalItemSlotLoad.h, Source/UI/Shortcuts/ShortcutDetails.h, Source/UI/Shortcuts/ShortcutPress.h, Source/UI/UIBasicCtrl.h, Source/UI/UIStaticItem.h, Source/UI/Window/FrameFocus.h, Source/UI/Window/UIFrameWnd.h, Source/UI/Window/UIVideoWnd.h, Source/UI/Window/WindowManagerWindows.h, Source/UI/Window/WindowMouseHit.h, Source/UI/Window/WindowOrdering.h.
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
#ifndef RAGNAROK_SOURCE_CONTENTS_PARTY_PARTYINVITATION_H
|
|
#define RAGNAROK_SOURCE_CONTENTS_PARTY_PARTYINVITATION_H
|
|
|
|
#include "Contents/ForbiddenWords.h"
|
|
#include "UI/Window/UIWindow.h"
|
|
#include "UI/Window/WindowManagerWindows.h"
|
|
|
|
#include <cstdint>
|
|
#include <cstring>
|
|
#include <string>
|
|
|
|
class ForbiddenWords;
|
|
#include "UI/Window/WindowManagerWindows.h"
|
|
|
|
struct PartyInvitationContext {
|
|
ForbiddenWords& words;
|
|
WindowManagerWindows& windows;
|
|
std::string& pendingName;
|
|
};
|
|
|
|
void ReceivePartyInvitation(const void* packet, PartyInvitationContext& context);
|
|
|
|
// INLINED
|
|
inline void ReceivePartyInvitation(const void* packet, PartyInvitationContext& context) {
|
|
const auto* bytes = static_cast<const unsigned char*>(packet);
|
|
char name[25];
|
|
std::strncpy(name, reinterpret_cast<const char*>(bytes + 6), 24);
|
|
name[24] = '\0';
|
|
|
|
if (g_forbiddenWords.Contains(name)) {
|
|
std::string unused;
|
|
g_forbiddenWords.Mask(name, &unused);
|
|
}
|
|
|
|
context.pendingName.assign(name, std::strlen(name));
|
|
UIWindow* window = context.windows.EnsureWindow(35);
|
|
std::uint32_t identity;
|
|
std::memcpy(&identity, bytes + 2, sizeof(identity));
|
|
window->SendMsg(nullptr, 56, identity, reinterpret_cast<std::intptr_t>(name), 0, 0);
|
|
}
|
|
|
|
#endif
|