示例#1
0
void Client::SendGuildMOTD(bool GetGuildMOTDReply) {
	EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMOTD, sizeof(GuildMOTD_Struct));

	// When the Client gets an OP_GuildMOTD, it compares the text to the version it has previously stored.
	// If the text in the OP_GuildMOTD packet is the same, it does nothing. If not the same, it displays
	// the new MOTD and then stores the new text.
	//

	GuildMOTD_Struct *motd = (GuildMOTD_Struct *) outapp->pBuffer;
	motd->unknown0 = 0;
	strn0cpy(motd->name, m_pp.name, 64);

	if(IsInAGuild()) {
		if(!guild_mgr.GetGuildMOTD(GuildID(), motd->motd, motd->setby_name)) {
			motd->setby_name[0] = '\0';
			strcpy(motd->motd, "ERROR GETTING MOTD!");
		}
	} else {
		//we have to send them an empty MOTD anywyas.
		motd->motd[0] = '\0';	//just to be sure
		motd->setby_name[0] = '\0';	//just to be sure

	}

	Log.Out(Logs::Detail, Logs::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size);

	FastQueuePacket(&outapp);
}
示例#2
0
void Client::SendGuildMOTD(bool GetGuildMOTDReply) {
	auto outapp = new EQApplicationPacket(OP_GuildMOTD, sizeof(GuildMOTD_Struct));

	// When the Client gets an OP_GuildMOTD, it compares the text to the version it has previously stored.
	// If the text in the OP_GuildMOTD packet is the same, it does nothing. If not the same, it displays
	// the new MOTD and then stores the new text.
	//
	// When the Client receives an OP_GetGuildMOTDReply, it displays the text in the packet.
	//
	// So OP_GuildMOTD should be sent on zone entry and when an Officer changes the MOTD, and OP_GetGuildMOTDReply
	// should be sent when the client issues the /getguildmotd command.
	//
	if(GetGuildMOTDReply)
		outapp->SetOpcode(OP_GetGuildMOTDReply);

	GuildMOTD_Struct *motd = (GuildMOTD_Struct *) outapp->pBuffer;
	motd->unknown0 = 0;
	strn0cpy(motd->name, m_pp.name, 64);

	if(IsInAGuild()) {
		if(!guild_mgr.GetGuildMOTD(GuildID(), motd->motd, motd->setby_name)) {
			motd->setby_name[0] = '\0';
			strcpy(motd->motd, "ERROR GETTING MOTD!");
		}
	} else {
		//we have to send them an empty MOTD anywyas.
		motd->motd[0] = '\0';	//just to be sure
		motd->setby_name[0] = '\0';	//just to be sure

	}

	Log(Logs::Detail, Logs::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size);

	FastQueuePacket(&outapp);
}
示例#3
0
void Client::SendGuildSpawnAppearance() {
	if (!IsInAGuild()) {
		// clear guildtag
		SendAppearancePacket(AT_GuildID, GUILD_NONE);
		Log.Out(Logs::Detail, Logs::Guilds, "Sending spawn appearance for no guild tag.");
	} else {
		uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
		Log.Out(Logs::Detail, Logs::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank);
		SendAppearancePacket(AT_GuildID, GuildID());
		SendAppearancePacket(AT_GuildRank, rank);
	}
	UpdateWho();
}
示例#4
0
void Client::SendGuildURL()
{
	if(GetClientVersion() < EQClientSoF)
		return;

	if(IsInAGuild())
	{
		EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildUpdateURLAndChannel, sizeof(GuildUpdateURLAndChannel_Struct));

		GuildUpdateURLAndChannel_Struct *guuacs = (GuildUpdateURLAndChannel_Struct*) outapp->pBuffer;

		if(guild_mgr.GetGuildURL(GuildID(), guuacs->Text))
		{
			guuacs->Action = 0;
			FastQueuePacket(&outapp);
		}
		else
			safe_delete(outapp);
	}
}
示例#5
0
void Client::SendGuildSpawnAppearance() {
	if (!IsInAGuild()) {
		// clear guildtag
		SendAppearancePacket(AT_GuildID, GUILD_NONE);
		Log(Logs::Detail, Logs::Guilds, "Sending spawn appearance for no guild tag.");
	} else {
		uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
		Log(Logs::Detail, Logs::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank);
		SendAppearancePacket(AT_GuildID, GuildID());
		if (ClientVersion() >= EQEmu::versions::ClientVersion::RoF)
		{
			switch (rank) {
				case 0: { rank = 5; break; }	// GUILD_MEMBER	0
				case 1: { rank = 3; break; }	// GUILD_OFFICER 1
				case 2: { rank = 1; break; }	// GUILD_LEADER	2
				default: { break; }				// GUILD_NONE
			}
		}
		SendAppearancePacket(AT_GuildRank, rank);
	}
	UpdateWho();
}
示例#6
0
void Client::SendGuildRanks()
{
	if (ClientVersion() < EQEmu::versions::ClientVersion::RoF)
		return;

	int permissions = 30 + 1; //Static number of permissions in all EQ clients as of May 2014
	int ranks = 8 + 1; // Static number of RoF+ ranks as of May 2014
	int j = 1;
	int i = 1;
	if(IsInAGuild())
	{
		while(j < ranks)
		{
			while(i < permissions)
			{
				auto outapp = new EQApplicationPacket(OP_GuildUpdateURLAndChannel,
								      sizeof(GuildUpdateRanks_Struct));
				GuildUpdateRanks_Struct *guuacs = (GuildUpdateRanks_Struct*) outapp->pBuffer;
				//guuacs->Unknown0008 = this->GuildID();
				strncpy(guuacs->Unknown0012, this->GetCleanName(), 64);
				guuacs->Action = 5;
				guuacs->RankID = j;
				guuacs->GuildID = this->GuildID();
				guuacs->PermissionID = i;
				guuacs->PermissionVal = 1;
				guuacs->Unknown0089[0] = 0x2c;
				guuacs->Unknown0089[1] = 0x01;
				guuacs->Unknown0089[2] = 0x00;
				FastQueuePacket(&outapp);
				i++;
			}
			j++;
			i = 1;
		}
	}
}