diff --git a/dGame/dGameMessages/GameMessages.cpp b/dGame/dGameMessages/GameMessages.cpp index efd92031..5106e2d1 100644 --- a/dGame/dGameMessages/GameMessages.cpp +++ b/dGame/dGameMessages/GameMessages.cpp @@ -4641,7 +4641,7 @@ void GameMessages::SendDisplayGuildCreateBox(const LWOOBJID& objectID, bool bSho CBITSTREAM; CMSGHEADER; - bitStream.Write(GAME_MSG_DISPLAY_GUILD_CREATE_BOX); + bitStream.Write(eGameMessageType::DISPLAY_GUILD_CREATE_BOX); bitStream.Write(objectID); bitStream.Write((unsigned char)bShow); diff --git a/dGame/dGameMessages/GameMessages.h b/dGame/dGameMessages/GameMessages.h index 5a0e0256..b1779f5f 100644 --- a/dGame/dGameMessages/GameMessages.h +++ b/dGame/dGameMessages/GameMessages.h @@ -4,9 +4,6 @@ #include "dCommonVars.h" #include #include -#include "dMessageIdentifiers.h" -#include "AMFFormat.h" -#include "AMFFormat_BitStream.h" #include "NiQuaternion.h" #include "PropertySelectQueryProperty.h" #include "TradingManager.h" diff --git a/dNet/ClientPackets.cpp b/dNet/ClientPackets.cpp index e6c2805d..891d7d1c 100644 --- a/dNet/ClientPackets.cpp +++ b/dNet/ClientPackets.cpp @@ -499,10 +499,10 @@ void ClientPackets::HandleGuildCreation(const SystemAddress& sysAddr, Packet* pa void ClientPackets::SendGuildCreateResponse(const SystemAddress& sysAddr, eGuildCreationResponse guildResponse, LWOOBJID guildID, std::u16string& guildName) { CBITSTREAM; CMSGHEADER; - bitStream.Write(MSG_CLIENT_GUILD_CREATE_RESPONSE); + bitStream.Write(eClientMessageType::GUILD_CREATE_RESPONSE); bitStream.Write(guildResponse); bitStream.Write(guildID); - PacketUtils::WriteWString(bitStream, guildName, 33); + bitStream.Write(LUWString(guildName)); SEND_PACKET; } diff --git a/dScripts/ai/FV/FvGuildCreate.cpp b/dScripts/ai/FV/FvGuildCreate.cpp index 2e9e558f..7e73e0c1 100644 --- a/dScripts/ai/FV/FvGuildCreate.cpp +++ b/dScripts/ai/FV/FvGuildCreate.cpp @@ -1,14 +1,12 @@ #include "FvGuildCreate.h" #include "GameMessages.h" +#include "Amf3.h" // Server script for Guild Master NPC in FV area. // This NPC will react to a user interaction and display // the guild creation screen. void FvGuildCreate::OnUse(Entity* self, Entity* user) { - AMFStringValue* value = new AMFStringValue(); - value->SetStringValue("ToggleGuildCreate"); - AMFArrayValue args; - GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), value->GetStringValue(), &args); - delete value; + AMFArrayValue args; + GameMessages::SendUIMessageServerToSingleClient(user, user->GetSystemAddress(), "ToggleGuildCreate", args); } diff --git a/dWorldServer/WorldServer.cpp b/dWorldServer/WorldServer.cpp index 317224c9..0654d64c 100644 --- a/dWorldServer/WorldServer.cpp +++ b/dWorldServer/WorldServer.cpp @@ -1297,7 +1297,7 @@ void HandlePacket(Packet* packet) { break; } - case MSG_WORLD_CLIENT_TMP_GUILD_CREATE: { + case eWorldMessageType::TMP_GUILD_CREATE: { Game::logger->Log("WorldServer", "create a guild"); ClientPackets::HandleGuildCreation(packet->systemAddress, packet); } diff --git a/migrations/dlu/8_guilds.sql b/migrations/dlu/13_guilds.sql similarity index 87% rename from migrations/dlu/8_guilds.sql rename to migrations/dlu/13_guilds.sql index 68277c2a..1baf0bf5 100644 --- a/migrations/dlu/8_guilds.sql +++ b/migrations/dlu/13_guilds.sql @@ -3,7 +3,7 @@ CREATE TABLE IF NOT EXISTS guilds ( name VARCHAR(35) NOT NULL, owner_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE, motd TEXT, - uscore INT NOT NULL DEFAULT 0, + reputation INT NOT NULL DEFAULT 0, created BIGINT UNSIGNED NOT NULL DEFAULT 0 ); @@ -12,4 +12,5 @@ CREATE TABLE IF NOT EXISTS guild_members ( character_id BIGINT NOT NULL REFERENCES charinfo(id) ON DELETE CASCADE, rank INT NOT NULL DEFAULT 4, joined BIGINT UNSIGNED NOT NULL DEFAULT 0 + PRIMARY KEY (guild_id, character_id) );