mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-02 12:36:36 +00:00
[Feature] Update Raid Functions for Titanium and Underfoot (#3524)
* Update Raid Functions Updated various raid features for: Titanium - Raid window now functional, including with BOTS - Raid delegate assist/mark work - Raid notes work - Raid /rmark, /clearmarks work Underfoot - Raid window was already functional - Raid delegate assist/mark work - Raid notes work - Raid /rmark, /clearmarks work * Updates to resolve feedback * Slight update for overlooked case in encode for RaidUpdate for clients above Ti. * Updates to further address feedback. Only updated translators for Ti/RoF2. Once ok, I will update the others. * Update linux-build.sh * Final updates for other translators and the strncpy_s issue. * Fix for strn0cpy in raids.cpp, translators, and defines. Updated all in raids.cpp as well. * Reveted defines change. * Reverted accidental change --------- Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
@@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include "../common/global_define.h"
|
||||
#include "../common/eqemu_logsys.h"
|
||||
#include "../common/opcodemgr.h"
|
||||
#include "../common/raid.h"
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
@@ -12578,8 +12580,8 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
|
||||
if (!raid) {
|
||||
break;
|
||||
}
|
||||
|
||||
raid->SaveRaidNote(raid_command_packet->leader_name, raid_command_packet->note);
|
||||
RaidNote_Struct* note = (RaidNote_Struct*)app->pBuffer;
|
||||
raid->SaveRaidNote(raid_command_packet->leader_name, note->note);
|
||||
raid->SendRaidNotesToWorld();
|
||||
break;
|
||||
}
|
||||
|
||||
+31
-23
@@ -20,6 +20,8 @@
|
||||
#include "../common/events/player_event_logs.h"
|
||||
#include "../common/repositories/raid_details_repository.h"
|
||||
#include "../common/repositories/raid_members_repository.h"
|
||||
#include "../common/raid.h"
|
||||
|
||||
|
||||
#include "client.h"
|
||||
#include "entity.h"
|
||||
@@ -1547,21 +1549,22 @@ void Raid::SendRaidGroupRemove(const char *who, uint32 gid)
|
||||
|
||||
void Raid::SendRaidMOTD(Client *c)
|
||||
{
|
||||
if (!c || motd.empty()) {
|
||||
if (!c || motd.empty() || c->IsBot()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (entity_list.GetBotByBotName(c->GetName())) {
|
||||
return;
|
||||
}
|
||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidMOTD_Struct));
|
||||
auto data = (RaidMOTD_Struct*)outapp->pBuffer;
|
||||
|
||||
size_t size = motd.size() + 1;
|
||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidMOTD_Struct) + size);
|
||||
auto rmotd = (RaidMOTD_Struct *)outapp->pBuffer;
|
||||
rmotd->general.action = raidSetMotd;
|
||||
strn0cpy(rmotd->general.player_name, c->GetName(), 64);
|
||||
strn0cpy(rmotd->motd, motd.c_str(), size);
|
||||
c->FastQueuePacket(&outapp);
|
||||
data->general.action = raidSetMotd;
|
||||
data->general.parameter = 0;
|
||||
data->general.unknown1 = 0;
|
||||
strn0cpy(data->general.leader_name, c->GetName(), sizeof(c->GetName()));
|
||||
strn0cpy(data->general.player_name, GetLeaderName().c_str(), 64);
|
||||
strn0cpy(data->motd, motd.c_str(), sizeof(data->motd));
|
||||
|
||||
c->QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
void Raid::SendRaidMOTD()
|
||||
@@ -1587,11 +1590,10 @@ void Raid::SendRaidMOTDToWorld()
|
||||
return;
|
||||
}
|
||||
|
||||
size_t size = motd.size() + 1;
|
||||
auto pack = new ServerPacket(ServerOP_RaidMOTD, sizeof(ServerRaidMOTD_Struct) + size);
|
||||
auto pack = new ServerPacket(ServerOP_RaidMOTD, sizeof(ServerRaidMOTD_Struct));
|
||||
auto smotd = (ServerRaidMOTD_Struct *)pack->pBuffer;
|
||||
smotd->rid = GetID();
|
||||
strn0cpy(smotd->motd, motd.c_str(), size);
|
||||
strn0cpy(smotd->motd, motd.c_str(), sizeof(smotd->motd));
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
@@ -1730,7 +1732,8 @@ bool Raid::LearnMembers()
|
||||
|
||||
members[i].member = nullptr;
|
||||
strn0cpy(members[i].member_name, row[0], sizeof(members[i].member_name));
|
||||
strn0cpy(members[i].note, row[10], sizeof(members[i].note));
|
||||
// strn0cpy(members[i].note, row[10], sizeof(members[i].note));
|
||||
members[i].note = std::string(row[10]);
|
||||
uint32 group_id = Strings::ToUnsignedInt(row[1]);
|
||||
|
||||
if (group_id >= MAX_RAID_GROUPS) {
|
||||
@@ -2275,7 +2278,7 @@ std::vector<RaidMember> Raid::GetMembersWithNotes()
|
||||
{
|
||||
std::vector<RaidMember> raid_members;
|
||||
for (const auto& m : members) {
|
||||
if (strlen(m.note) != 0) {
|
||||
if (!m.note.empty()) {
|
||||
raid_members.emplace_back(m);
|
||||
}
|
||||
}
|
||||
@@ -2288,12 +2291,17 @@ void Raid::SendRaidNotes()
|
||||
VerifyRaid();
|
||||
|
||||
for (const auto& c : GetMembersWithNotes()) {
|
||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidGeneral_Struct));
|
||||
auto note = (RaidGeneral_Struct*)outapp->pBuffer;
|
||||
note->action = raidSetNote;
|
||||
strn0cpy(note->leader_name, c.member_name, 64);
|
||||
strn0cpy(note->player_name, GetLeaderName().c_str(), 64);
|
||||
strn0cpy(note->note, c.note, 64);
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidNote_Struct));
|
||||
auto data = (RaidNote_Struct*)outapp->pBuffer;
|
||||
|
||||
data->general.action = raidSetNote;
|
||||
data->general.parameter = 0;
|
||||
data->general.unknown1 = 0;
|
||||
strn0cpy(data->general.leader_name, c.member_name, sizeof(c.member_name));
|
||||
strn0cpy(data->general.player_name, GetLeaderName().c_str(), GetLeaderName().length());
|
||||
strn0cpy(data->note, c.note.c_str(), sizeof(data->note));
|
||||
|
||||
QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
@@ -2552,7 +2560,7 @@ void Raid::UpdateXTargetType(XTargetType Type, Mob *m, const char *name)
|
||||
}
|
||||
|
||||
if (name) {
|
||||
strncpy(rm.member->XTargets[i].Name, name, 64);
|
||||
strn0cpy(rm.member->XTargets[i].Name, name, 64);
|
||||
}
|
||||
|
||||
rm.member->SendXTargetPacket(i, m);
|
||||
|
||||
+1
-50
@@ -27,55 +27,6 @@ class Client;
|
||||
class EQApplicationPacket;
|
||||
class Mob;
|
||||
|
||||
enum { //raid packet types:
|
||||
raidAdd = 0,
|
||||
raidRemove2 = 1, //parameter=0
|
||||
raidMemberNameChange = 2,
|
||||
raidRemove1 = 3, //parameter=0xFFFFFFFF
|
||||
raidNoLongerLeader = 4,
|
||||
raidDisband = 5,
|
||||
raidMembers = 6, //len 395+, details + members list
|
||||
raidNoAssignLeadership = 7,
|
||||
raidCreate = 8, //len 72
|
||||
raidUnknown = 9, // unused?
|
||||
raidNoRaid = 10, //parameter=0
|
||||
raidChangeLootType = 11,
|
||||
raidStringID = 12,
|
||||
raidChangeGroupLeader = 13, //136 raid leader, new group leader, group_id?
|
||||
raidSetLeaderAbilities = 14, //472
|
||||
raidSetLeaderData = 15, // 14,15 SoE names, not sure on difference, 14 packet has 0x100 bytes 15 0x214 in addition to raid general
|
||||
raidChangeGroup = 16, //?? len 136 old leader, new leader, 0 (preceeded with a remove2)
|
||||
raidLock = 17, //len 136 leader?, leader, 0
|
||||
raidUnlock = 18, //len 136 leader?, leader, 0
|
||||
raidRedStringID = 19,
|
||||
raidSetLeader = 20, //len 388, contains 'details' struct without members; also used for "invite to raid"
|
||||
raidMakeLeader = 30,
|
||||
raidSetMotd = 35,
|
||||
raidSetNote = 36,
|
||||
};
|
||||
|
||||
|
||||
enum { //raid command types
|
||||
RaidCommandInviteIntoExisting = 0, //in use
|
||||
RaidCommandAcceptInvite = 1, //in use
|
||||
RaidCommandInvite = 3, //in use
|
||||
RaidCommandDisband = 5, //in use
|
||||
RaidCommandMoveGroup = 6, //in use
|
||||
RaidCommandRemoveGroupLeader = 7,
|
||||
RaidCommandRaidLock = 8, //in use
|
||||
RaidCommandRaidUnlock = 9, //in use
|
||||
RaidCommandLootType = 20, //in use
|
||||
RaidCommandAddLooter = 21, //in use
|
||||
RaidCommandRemoveLooter = 22, //in use
|
||||
RaidCommandMakeLeader = 30,
|
||||
RaidCommandInviteFail = 31, //already in raid, waiting on invite from other raid, etc
|
||||
RaidCommandLootType2 = 32, //in use
|
||||
RaidCommandAddLooter2 = 33, //in use
|
||||
RaidCommandRemoveLooter2 = 34, //in use
|
||||
RaidCommandSetMotd = 35,
|
||||
RaidCommandSetNote = 36,
|
||||
};
|
||||
|
||||
enum {
|
||||
FindNextMarkerSlot = 1,
|
||||
FindNextAssisterSlot = 2,
|
||||
@@ -129,7 +80,7 @@ struct RaidMember{
|
||||
uint32 group_number;
|
||||
uint8 _class;
|
||||
uint8 level;
|
||||
char note[64];
|
||||
std::string note;
|
||||
bool is_group_leader;
|
||||
bool is_raid_leader;
|
||||
bool is_looter;
|
||||
|
||||
Reference in New Issue
Block a user