mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Commands] Remove #guildapprove, #guildcreate, and #guildlist Commands (#2775)
# Notes - Removes `#guildapprove`, `#guildcreate`, and `#guildlist`. - Removes associated functions, classes, etc. that were only used in these commands. - These commands are unused and/or covered by the general `#guild` command. - Approvals don't really seem to be a thing anymore and the variable itself doesn't exist in stock PEQ database anyway.
This commit is contained in:
parent
35c3778baf
commit
d0edb93d62
@ -176,9 +176,6 @@ int command_init(void)
|
||||
command_add("goto", "[playername] or [x y z] [h] - Teleport to the provided coordinates or to your target", AccountStatus::Steward, command_goto) ||
|
||||
command_add("grid", "[add/delete] [grid_num] [wandertype] [pausetype] - Create/delete a wandering grid", AccountStatus::GMAreas, command_grid) ||
|
||||
command_add("guild", "Guild manipulation commands. Use argument help for more info.", AccountStatus::Steward, command_guild) ||
|
||||
command_add("guildapprove", "[guildapproveid] - Approve a guild with specified ID (guild creator receives the id)", AccountStatus::Player, command_guildapprove) ||
|
||||
command_add("guildcreate", "[guildname] - Creates an approval setup for guild name specified", AccountStatus::Player, command_guildcreate) ||
|
||||
command_add("guildlist", "[guildapproveid] - Lists character names who have approved the guild specified by the approve id", AccountStatus::Player, command_guildlist) ||
|
||||
command_add("haste", "[percentage] - Set your haste percentage", AccountStatus::GMAdmin, command_haste) ||
|
||||
command_add("hatelist", "Display hate list for NPC.", AccountStatus::QuestTroupe, command_hatelist) ||
|
||||
command_add("heal", "Completely heal your target", AccountStatus::Steward, command_heal) ||
|
||||
@ -1014,9 +1011,6 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/goto.cpp"
|
||||
#include "gm_commands/grid.cpp"
|
||||
#include "gm_commands/guild.cpp"
|
||||
#include "gm_commands/guildapprove.cpp"
|
||||
#include "gm_commands/guildcreate.cpp"
|
||||
#include "gm_commands/guildlist.cpp"
|
||||
#include "gm_commands/haste.cpp"
|
||||
#include "gm_commands/hatelist.cpp"
|
||||
#include "gm_commands/heal.cpp"
|
||||
|
||||
@ -122,9 +122,6 @@ void command_godmode(Client* c, const Seperator *sep);
|
||||
void command_goto(Client *c, const Seperator *sep);
|
||||
void command_grid(Client *c, const Seperator *sep);
|
||||
void command_guild(Client *c, const Seperator *sep);
|
||||
void command_guildapprove(Client *c, const Seperator *sep);
|
||||
void command_guildcreate(Client *c, const Seperator *sep);
|
||||
void command_guildlist(Client *c, const Seperator *sep);
|
||||
void command_haste(Client *c, const Seperator *sep);
|
||||
void command_hatelist(Client *c, const Seperator *sep);
|
||||
void command_heal(Client *c, const Seperator *sep);
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../guild_mgr.h"
|
||||
|
||||
void command_guildapprove(Client *c, const Seperator *sep)
|
||||
{
|
||||
guild_mgr.AddMemberApproval(atoi(sep->arg[1]), c);
|
||||
}
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../guild_mgr.h"
|
||||
|
||||
void command_guildcreate(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (strlen(sep->argplus[1]) > 4 && strlen(sep->argplus[1]) < 16) {
|
||||
guild_mgr.AddGuildApproval(sep->argplus[1], c);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Guild name must be more than 4 characters and less than 16.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../guild_mgr.h"
|
||||
|
||||
void command_guildlist(Client *c, const Seperator *sep)
|
||||
{
|
||||
GuildApproval *tmp = guild_mgr.FindGuildByIDApproval(atoi(sep->arg[1]));
|
||||
if (tmp) {
|
||||
tmp->ApprovedMembers(c);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Could not find reference id.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -652,79 +652,11 @@ void ZoneGuildManager::RequestOnlineGuildMembers(uint32 FromID, uint32 GuildID)
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
void ZoneGuildManager::ProcessApproval()
|
||||
{
|
||||
LinkedListIterator<GuildApproval*> iterator(list);
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
if(!iterator.GetData()->ProcessApproval())
|
||||
iterator.RemoveCurrent();
|
||||
iterator.Advance();
|
||||
}
|
||||
}
|
||||
|
||||
void ZoneGuildManager::AddGuildApproval(const char* guildname,Client* owner)
|
||||
{
|
||||
auto tmp = new GuildApproval(guildname, owner, GetFreeID());
|
||||
list.Insert(tmp);
|
||||
}
|
||||
|
||||
void ZoneGuildManager::AddMemberApproval(uint32 refid,Client* name)
|
||||
{
|
||||
GuildApproval* tmp = FindGuildByIDApproval(refid);
|
||||
if(tmp != 0)
|
||||
{
|
||||
if(!tmp->AddMemberApproval(name))
|
||||
name->Message(Chat::White,"Unable to add to list.");
|
||||
else
|
||||
{
|
||||
name->Message(Chat::White,"Added to list.");
|
||||
}
|
||||
}
|
||||
else
|
||||
name->Message(Chat::White,"Unable to find guild reference id.");
|
||||
}
|
||||
|
||||
ZoneGuildManager::~ZoneGuildManager()
|
||||
{
|
||||
ClearGuilds();
|
||||
}
|
||||
|
||||
void ZoneGuildManager::ClearGuildsApproval()
|
||||
{
|
||||
list.Clear();
|
||||
}
|
||||
|
||||
GuildApproval* ZoneGuildManager::FindGuildByIDApproval(uint32 refid)
|
||||
{
|
||||
LinkedListIterator<GuildApproval*> iterator(list);
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
if(iterator.GetData()->GetID() == refid)
|
||||
return iterator.GetData();
|
||||
iterator.Advance();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
GuildApproval* ZoneGuildManager::FindGuildByOwnerApproval(Client* owner)
|
||||
{
|
||||
LinkedListIterator<GuildApproval*> iterator(list);
|
||||
|
||||
iterator.Reset();
|
||||
while(iterator.MoreElements())
|
||||
{
|
||||
if(iterator.GetData()->GetOwner() == owner)
|
||||
return iterator.GetData();
|
||||
iterator.Advance();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
GuildBankManager::~GuildBankManager()
|
||||
{
|
||||
auto Iterator = Banks.begin();
|
||||
@ -1524,154 +1456,3 @@ bool GuildBankManager::AllowedToWithdraw(uint32 GuildID, uint16 Area, uint16 Slo
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*================== GUILD APPROVAL ========================*/
|
||||
|
||||
bool GuildApproval::ProcessApproval()
|
||||
{
|
||||
if(owner && owner->GuildID() != 0)
|
||||
{
|
||||
owner->Message(Chat::NPCQuestSay,"You are already in a guild! Guild request deleted.");
|
||||
return false;
|
||||
}
|
||||
if(deletion_timer->Check() || !owner)
|
||||
{
|
||||
if(owner)
|
||||
owner->Message(Chat::White,"You took too long! Your guild request has been deleted.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
GuildApproval::GuildApproval(const char* guildname, Client* owner,uint32 id)
|
||||
{
|
||||
std::string founders;
|
||||
database.GetVariable("GuildCreation", founders);
|
||||
uint8 tmp = atoi(founders.c_str());
|
||||
deletion_timer = new Timer(1800000);
|
||||
strcpy(guild,guildname);
|
||||
owner = owner;
|
||||
refid = id;
|
||||
if(owner)
|
||||
owner->Message(Chat::White,"You can now start getting your guild approved, tell your %i members to #guildapprove %i, you have 30 minutes to create your guild.",tmp,GetID());
|
||||
for(int i=0;i<tmp;i++)
|
||||
members[i] = 0;
|
||||
}
|
||||
|
||||
GuildApproval::~GuildApproval()
|
||||
{
|
||||
safe_delete(deletion_timer);
|
||||
}
|
||||
|
||||
bool GuildApproval::AddMemberApproval(Client* addition)
|
||||
{
|
||||
std::string founders;
|
||||
database.GetVariable("GuildCreation", founders);
|
||||
uint8 tmp = atoi(founders.c_str());
|
||||
for(int i=0;i<tmp;i++)
|
||||
{
|
||||
if(members[i] && members[i] == addition)
|
||||
return false;
|
||||
}
|
||||
|
||||
for(int i=0;i<tmp;i++)
|
||||
{
|
||||
if(!members[i])
|
||||
{
|
||||
members[i] = addition;
|
||||
int z=0;
|
||||
for(int i=0;i<tmp;i++)
|
||||
{
|
||||
if(members[i])
|
||||
z++;
|
||||
}
|
||||
if(z==tmp)
|
||||
GuildApproved();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void GuildApproval::ApprovedMembers(Client* requestee)
|
||||
{
|
||||
std::string founders;
|
||||
database.GetVariable("GuildCreation", founders);
|
||||
uint8 tmp = atoi(founders.c_str());
|
||||
for(int i=0;i<tmp;i++)
|
||||
{
|
||||
if(members[i])
|
||||
requestee->Message(Chat::White,"%i: %s",i,members[i]->GetName());
|
||||
}
|
||||
}
|
||||
|
||||
void GuildApproval::GuildApproved()
|
||||
{
|
||||
char petitext[PBUFFER] = "A new guild was founded! Guildname: ";
|
||||
char gmembers[MBUFFER] = " ";
|
||||
|
||||
if(!owner)
|
||||
return;
|
||||
std::string founders;
|
||||
database.GetVariable("GuildCreation", founders);
|
||||
uint8 tmp = atoi(founders.c_str());
|
||||
uint32 tmpeq = guild_mgr.CreateGuild(guild, owner->CharacterID());
|
||||
guild_mgr.SetGuild(owner->CharacterID(),tmpeq,2);
|
||||
owner->SendAppearancePacket(AT_GuildID,true,false);
|
||||
for(int i=0;i<tmp;i++)
|
||||
{
|
||||
if(members[i])
|
||||
{
|
||||
owner->Message(Chat::White, "%s",members[i]->GetName());
|
||||
owner->Message(Chat::White, "%i",members[i]->CharacterID());
|
||||
guild_mgr.SetGuild(members[i]->CharacterID(),tmpeq,0);
|
||||
size_t len = MBUFFER - strlen(gmembers)+1;
|
||||
strncat(gmembers," ",len);
|
||||
strncat(gmembers,members[i]->GetName(),len);
|
||||
}
|
||||
}
|
||||
size_t len = PBUFFER - strlen(petitext)+1;
|
||||
strncat(petitext,guild,len);
|
||||
strncat(petitext," Leader: ",len);
|
||||
strncat(petitext,owner->CastToClient()->GetName(),len);
|
||||
strncat(petitext," Members:",len);
|
||||
strncat(petitext,gmembers,len);
|
||||
auto pet = new Petition(owner->CastToClient()->CharacterID());
|
||||
pet->SetAName(owner->CastToClient()->AccountName());
|
||||
pet->SetClass(owner->CastToClient()->GetClass());
|
||||
pet->SetLevel(owner->CastToClient()->GetLevel());
|
||||
pet->SetCName(owner->CastToClient()->GetName());
|
||||
pet->SetRace(owner->CastToClient()->GetRace());
|
||||
pet->SetLastGM("");
|
||||
pet->SetCName(owner->CastToClient()->GetName()); //aza77 is this really 2 times needed ??
|
||||
pet->SetPetitionText(petitext);
|
||||
pet->SetZone(zone->GetZoneID());
|
||||
pet->SetUrgency(0);
|
||||
petition_list.AddPetition(pet);
|
||||
database.InsertPetitionToDB(pet);
|
||||
petition_list.UpdateGMQueue();
|
||||
petition_list.UpdateZoneListQueue();
|
||||
worldserver.SendEmoteMessage(
|
||||
0,
|
||||
0,
|
||||
AccountStatus::QuestTroupe,
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"{} has made a petition. ID: {}",
|
||||
owner->CastToClient()->GetName(),
|
||||
pet->GetID()
|
||||
).c_str()
|
||||
);
|
||||
auto pack = new ServerPacket;
|
||||
pack->opcode = ServerOP_RefreshGuild;
|
||||
pack->size = tmp;
|
||||
pack->pBuffer = new uchar[pack->size];
|
||||
memcpy(pack->pBuffer, &tmpeq, 4);
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
owner->Message(Chat::White, "Your guild was created.");
|
||||
owner = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -47,36 +47,10 @@ enum { GuildBankDepositArea = 0, GuildBankMainArea = 1 };
|
||||
|
||||
enum { GuildBankBankerOnly = 0, GuildBankSingleMember = 1, GuildBankPublicIfUsable = 2, GuildBankPublic = 3 };
|
||||
|
||||
class GuildApproval
|
||||
{
|
||||
public:
|
||||
GuildApproval(const char* guildname,Client* owner,uint32 id);
|
||||
~GuildApproval();
|
||||
bool ProcessApproval();
|
||||
bool AddMemberApproval(Client* addition);
|
||||
uint32 GetID() { return refid; }
|
||||
Client* GetOwner() { return owner; }
|
||||
void GuildApproved();
|
||||
void ApprovedMembers(Client* requestee);
|
||||
private:
|
||||
Timer* deletion_timer;
|
||||
char guild[16];
|
||||
Client* owner;
|
||||
Client* members[6];
|
||||
uint32 refid;
|
||||
};
|
||||
|
||||
class ZoneGuildManager : public BaseGuildManager {
|
||||
public:
|
||||
~ZoneGuildManager(void);
|
||||
|
||||
void AddGuildApproval(const char* guildname, Client* owner);
|
||||
void AddMemberApproval(uint32 refid,Client* name);
|
||||
void ClearGuildsApproval();
|
||||
GuildApproval* FindGuildByIDApproval(uint32 refid);
|
||||
GuildApproval* FindGuildByOwnerApproval(Client* owner);
|
||||
void ProcessApproval();
|
||||
uint32 GetFreeID() { return id+1; }
|
||||
//called by worldserver when it receives a message from world.
|
||||
void ProcessWorldPacket(ServerPacket *pack);
|
||||
|
||||
@ -103,9 +77,7 @@ protected:
|
||||
std::map<uint32, std::pair<uint32, uint8> > m_inviteQueue; //map from char ID to guild,rank
|
||||
|
||||
private:
|
||||
LinkedList<GuildApproval*> list;
|
||||
uint32 id;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user