[Code] UCSConnection Global to Singleton Cleanup (#4937)

Co-authored-by: Chris Miles <akkadius1@gmail.com>
This commit is contained in:
Alex King
2025-06-25 15:25:37 -04:00
committed by GitHub
parent 654764685a
commit 1e6a4dac78
7 changed files with 19 additions and 13 deletions
+2 -2
View File
@@ -625,14 +625,14 @@ void WorldBoot::Shutdown()
void WorldBoot::SendDiscordMessage(int webhook_id, const std::string &message)
{
if (UCSLink.IsConnected()) {
if (UCSConnection::Instance()->IsConnected()) {
auto pack = new ServerPacket(ServerOP_DiscordWebhookMessage, sizeof(DiscordWebhookMessage_Struct) + 1);
auto *q = (DiscordWebhookMessage_Struct *) pack->pBuffer;
strn0cpy(q->message, message.c_str(), 2000);
q->webhook_id = webhook_id;
UCSLink.SendPacket(pack);
UCSConnection::Instance()->SendPacket(pack);
safe_delete(pack);
}