mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +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:
parent
166c87c931
commit
f5e4c6a127
@ -589,6 +589,7 @@ SET(common_headers
|
|||||||
ptimer.h
|
ptimer.h
|
||||||
queue.h
|
queue.h
|
||||||
races.h
|
races.h
|
||||||
|
raid.h
|
||||||
random.h
|
random.h
|
||||||
rdtsc.h
|
rdtsc.h
|
||||||
rulesys.h
|
rulesys.h
|
||||||
|
|||||||
@ -4164,7 +4164,6 @@ struct RaidGeneral_Struct {
|
|||||||
/*68*/ uint32 unknown1;
|
/*68*/ uint32 unknown1;
|
||||||
/*72*/ char leader_name[64];
|
/*72*/ char leader_name[64];
|
||||||
/*136*/ uint32 parameter;
|
/*136*/ uint32 parameter;
|
||||||
/*200*/ char note[64];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidAddMember_Struct {
|
struct RaidAddMember_Struct {
|
||||||
@ -4175,9 +4174,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general;
|
||||||
/*136*/ char motd[0]; // max size is 1024, but reply is variable
|
/*140*/ char motd[1024];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
@ -34,6 +34,7 @@
|
|||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
#include "../races.h"
|
#include "../races.h"
|
||||||
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -2608,88 +2609,124 @@ namespace RoF
|
|||||||
|
|
||||||
ENCODE(OP_RaidJoin)
|
ENCODE(OP_RaidJoin)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
*p = nullptr;
|
||||||
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidCreate_Struct* emu = (RaidCreate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
|
structs::RaidGeneral_Struct* general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
general->action = 8;
|
general->action = raidCreate;
|
||||||
general->parameter = 1;
|
general->parameter = RaidCommandAcceptInvite;
|
||||||
strn0cpy(general->leader_name, raid_create->leader_name, 64);
|
strn0cpy(general->leader_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
strn0cpy(general->player_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
dest->FastQueuePacket(&outapp_create);
|
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_RaidUpdate)
|
ENCODE(OP_RaidUpdate)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
if (raid_gen->action == 0) // raid add has longer length than other raid updates
|
switch (raid_gen->action)
|
||||||
{
|
{
|
||||||
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
add_member->raidGen.action = in_add_member->raidGen.action;
|
OUT(raidGen.action);
|
||||||
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
|
OUT(raidGen.parameter);
|
||||||
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
|
OUT_str(raidGen.leader_name);
|
||||||
strn0cpy(add_member->raidGen.player_name, in_add_member->raidGen.player_name, 64);
|
OUT_str(raidGen.player_name);
|
||||||
add_member->_class = in_add_member->_class;
|
OUT(_class);
|
||||||
add_member->level = in_add_member->level;
|
OUT(level);
|
||||||
add_member->isGroupLeader = in_add_member->isGroupLeader;
|
OUT(isGroupLeader);
|
||||||
add_member->flags[0] = in_add_member->flags[0];
|
OUT(flags[0]);
|
||||||
add_member->flags[1] = in_add_member->flags[1];
|
OUT(flags[1]);
|
||||||
add_member->flags[2] = in_add_member->flags[2];
|
OUT(flags[2]);
|
||||||
add_member->flags[3] = in_add_member->flags[3];
|
OUT(flags[3]);
|
||||||
add_member->flags[4] = in_add_member->flags[4];
|
OUT(flags[4]);
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
else if (raid_gen->action == 35)
|
|
||||||
{
|
|
||||||
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
|
|
||||||
strlen(inmotd->motd) + 1);
|
|
||||||
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
|
|
||||||
|
|
||||||
outmotd->general.action = inmotd->general.action;
|
|
||||||
strn0cpy(outmotd->general.player_name, inmotd->general.player_name, 64);
|
|
||||||
strn0cpy(outmotd->motd, inmotd->motd, strlen(inmotd->motd) + 1);
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == 14 || raid_gen->action == 30)
|
case raidSetMotd:
|
||||||
{
|
{
|
||||||
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
auto outapp =
|
|
||||||
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
outlaa->action = inlaa->action;
|
|
||||||
strn0cpy(outlaa->player_name, inlaa->player_name, 64);
|
|
||||||
strn0cpy(outlaa->leader_name, inlaa->leader_name, 64);
|
|
||||||
memcpy(&outlaa->raid, &inlaa->raid, sizeof(RaidLeadershipAA_Struct));
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
{
|
{
|
||||||
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT_str(player_name);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
|
|
||||||
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
|
|
||||||
raid_general->action = in_raid_general->action;
|
|
||||||
raid_general->parameter = in_raid_general->parameter;
|
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4861,37 +4898,47 @@ namespace RoF
|
|||||||
{
|
{
|
||||||
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
|
||||||
// This is a switch on the RaidGeneral action
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
switch (*(uint32 *)__packet->pBuffer) {
|
|
||||||
case 35: { // raidMOTD
|
switch (rgs->action)
|
||||||
// we don't have a nice macro for this
|
{
|
||||||
structs::RaidMOTD_Struct *__eq_buffer = (structs::RaidMOTD_Struct *)__packet->pBuffer;
|
case raidSetMotd:
|
||||||
__eq_buffer->motd[1023] = '\0';
|
{
|
||||||
size_t motd_size = strlen(__eq_buffer->motd) + 1;
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
__packet->size = sizeof(RaidMOTD_Struct) + motd_size;
|
|
||||||
__packet->pBuffer = new unsigned char[__packet->size];
|
IN(general.action);
|
||||||
RaidMOTD_Struct *emu = (RaidMOTD_Struct *)__packet->pBuffer;
|
IN(general.parameter);
|
||||||
structs::RaidMOTD_Struct *eq = (structs::RaidMOTD_Struct *)__eq_buffer;
|
IN_str(general.leader_name);
|
||||||
strn0cpy(emu->general.player_name, eq->general.player_name, 64);
|
IN_str(general.player_name);
|
||||||
strn0cpy(emu->motd, eq->motd, motd_size);
|
IN_str(motd);
|
||||||
IN(general.action);
|
|
||||||
IN(general.parameter);
|
FINISH_VAR_DECODE();
|
||||||
FINISH_DIRECT_DECODE();
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case raidSetNote:
|
||||||
case 36: { // raidPlayerNote unhandled
|
{
|
||||||
break;
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
}
|
|
||||||
default: {
|
IN(general.action);
|
||||||
DECODE_LENGTH_EXACT(structs::RaidGeneral_Struct);
|
IN(general.parameter);
|
||||||
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
IN_str(general.leader_name);
|
||||||
strn0cpy(emu->leader_name, eq->leader_name, 64);
|
IN_str(general.player_name);
|
||||||
strn0cpy(emu->player_name, eq->player_name, 64);
|
IN_str(note);
|
||||||
IN(action);
|
|
||||||
IN(parameter);
|
FINISH_VAR_DECODE();
|
||||||
FINISH_DIRECT_DECODE();
|
break;
|
||||||
break;
|
}
|
||||||
}
|
default:
|
||||||
|
{
|
||||||
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
|
IN(action);
|
||||||
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
#include "../classes.h"
|
#include "../classes.h"
|
||||||
#include "../races.h"
|
#include "../races.h"
|
||||||
#include "../../zone/raids.h"
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -2678,100 +2678,124 @@ namespace RoF2
|
|||||||
|
|
||||||
ENCODE(OP_RaidJoin)
|
ENCODE(OP_RaidJoin)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
*p = nullptr;
|
||||||
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidCreate_Struct* emu = (RaidCreate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
|
structs::RaidGeneral_Struct* general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
general->action = 8;
|
general->action = raidCreate;
|
||||||
general->parameter = 1;
|
general->parameter = RaidCommandAcceptInvite;
|
||||||
strn0cpy(general->leader_name, raid_create->leader_name, 64);
|
strn0cpy(general->leader_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
strn0cpy(general->player_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
dest->FastQueuePacket(&outapp_create);
|
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_RaidUpdate)
|
ENCODE(OP_RaidUpdate)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
if (raid_gen->action == 0) // raid add has longer length than other raid updates
|
switch (raid_gen->action)
|
||||||
{
|
{
|
||||||
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
add_member->raidGen.action = in_add_member->raidGen.action;
|
OUT(raidGen.action);
|
||||||
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
|
OUT(raidGen.parameter);
|
||||||
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
|
OUT_str(raidGen.leader_name);
|
||||||
strn0cpy(add_member->raidGen.player_name, in_add_member->raidGen.player_name, 64);
|
OUT_str(raidGen.player_name);
|
||||||
add_member->_class = in_add_member->_class;
|
OUT(_class);
|
||||||
add_member->level = in_add_member->level;
|
OUT(level);
|
||||||
add_member->isGroupLeader = in_add_member->isGroupLeader;
|
OUT(isGroupLeader);
|
||||||
add_member->flags[0] = in_add_member->flags[0];
|
OUT(flags[0]);
|
||||||
add_member->flags[1] = in_add_member->flags[1];
|
OUT(flags[1]);
|
||||||
add_member->flags[2] = in_add_member->flags[2];
|
OUT(flags[2]);
|
||||||
add_member->flags[3] = in_add_member->flags[3];
|
OUT(flags[3]);
|
||||||
add_member->flags[4] = in_add_member->flags[4];
|
OUT(flags[4]);
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
else if (raid_gen->action == 35)
|
|
||||||
{
|
|
||||||
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
|
|
||||||
strlen(inmotd->motd) + 1);
|
|
||||||
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
|
|
||||||
|
|
||||||
outmotd->general.action = inmotd->general.action;
|
|
||||||
strn0cpy(outmotd->general.player_name, inmotd->general.player_name, 64);
|
|
||||||
strn0cpy(outmotd->motd, inmotd->motd, strlen(inmotd->motd) + 1);
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == 14 || raid_gen->action == 30)
|
case raidSetMotd:
|
||||||
{
|
{
|
||||||
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
auto outapp =
|
|
||||||
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
outlaa->action = inlaa->action;
|
|
||||||
strn0cpy(outlaa->player_name, inlaa->player_name, 64);
|
|
||||||
strn0cpy(outlaa->leader_name, inlaa->leader_name, 64);
|
|
||||||
memcpy(&outlaa->raid, &inlaa->raid, sizeof(RaidLeadershipAA_Struct));
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == raidSetNote)
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
{
|
{
|
||||||
auto in_note = (RaidGeneral_Struct*)__emu_buffer;
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidGeneral_Struct));
|
|
||||||
auto note = (RaidGeneral_Struct*)outapp->pBuffer;
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
note->action = raidSetNote;
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(note->leader_name, in_note->leader_name, sizeof(note->leader_name));
|
|
||||||
strn0cpy(note->player_name, in_note->player_name, sizeof(note->leader_name));
|
OUT(action);
|
||||||
strn0cpy(note->note, in_note->note, sizeof(note->note));
|
OUT_str(player_name);
|
||||||
dest->QueuePacket(outapp);
|
OUT_str(leader_name);
|
||||||
safe_delete(outapp);
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case raidSetNote:
|
||||||
{
|
{
|
||||||
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
|
|
||||||
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
|
|
||||||
raid_general->action = in_raid_general->action;
|
|
||||||
raid_general->parameter = in_raid_general->parameter;
|
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5091,37 +5115,47 @@ namespace RoF2
|
|||||||
{
|
{
|
||||||
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
|
||||||
// This is a switch on the RaidGeneral action
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
switch (*(uint32 *)__packet->pBuffer) {
|
|
||||||
case 35: { // raidMOTD
|
switch (rgs->action)
|
||||||
// we don't have a nice macro for this
|
{
|
||||||
structs::RaidMOTD_Struct *__eq_buffer = (structs::RaidMOTD_Struct *)__packet->pBuffer;
|
case raidSetMotd:
|
||||||
__eq_buffer->motd[1023] = '\0';
|
{
|
||||||
size_t motd_size = strlen(__eq_buffer->motd) + 1;
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
__packet->size = sizeof(RaidMOTD_Struct) + motd_size;
|
|
||||||
__packet->pBuffer = new unsigned char[__packet->size];
|
IN(general.action);
|
||||||
RaidMOTD_Struct *emu = (RaidMOTD_Struct *)__packet->pBuffer;
|
IN(general.parameter);
|
||||||
structs::RaidMOTD_Struct *eq = (structs::RaidMOTD_Struct *)__eq_buffer;
|
IN_str(general.leader_name);
|
||||||
strn0cpy(emu->general.player_name, eq->general.player_name, 64);
|
IN_str(general.player_name);
|
||||||
strn0cpy(emu->motd, eq->motd, motd_size);
|
IN_str(motd);
|
||||||
IN(general.action);
|
|
||||||
IN(general.parameter);
|
FINISH_VAR_DECODE();
|
||||||
FINISH_DIRECT_DECODE();
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case raidSetNote:
|
||||||
case 36: { // raidPlayerNote unhandled
|
{
|
||||||
break;
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
}
|
|
||||||
default: {
|
IN(general.action);
|
||||||
DECODE_LENGTH_EXACT(structs::RaidGeneral_Struct);
|
IN(general.parameter);
|
||||||
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
IN_str(general.leader_name);
|
||||||
strn0cpy(emu->leader_name, eq->leader_name, 64);
|
IN_str(general.player_name);
|
||||||
strn0cpy(emu->player_name, eq->player_name, 64);
|
IN_str(note);
|
||||||
IN(action);
|
|
||||||
IN(parameter);
|
FINISH_VAR_DECODE();
|
||||||
FINISH_DIRECT_DECODE();
|
break;
|
||||||
break;
|
}
|
||||||
}
|
default:
|
||||||
|
{
|
||||||
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
|
IN(action);
|
||||||
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4198,9 +4198,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general;
|
||||||
/*140*/ char motd[0]; // max size 1024, but reply is variable
|
/*140*/ char motd[1024];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
@ -4136,9 +4136,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
||||||
/*140*/ char motd[0]; // max size 1024, but reply is variable
|
/*140*/ char motd[1024]; // max size is 1024, but reply is variable
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
@ -34,6 +34,7 @@
|
|||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
#include "../races.h"
|
#include "../races.h"
|
||||||
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -1686,88 +1687,124 @@ namespace SoD
|
|||||||
|
|
||||||
ENCODE(OP_RaidJoin)
|
ENCODE(OP_RaidJoin)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
*p = nullptr;
|
||||||
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidCreate_Struct* emu = (RaidCreate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
|
structs::RaidGeneral_Struct* general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
general->action = 8;
|
general->action = raidCreate;
|
||||||
general->parameter = 1;
|
general->parameter = RaidCommandAcceptInvite;
|
||||||
strn0cpy(general->leader_name, raid_create->leader_name, 64);
|
strn0cpy(general->leader_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
strn0cpy(general->player_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
dest->FastQueuePacket(&outapp_create);
|
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_RaidUpdate)
|
ENCODE(OP_RaidUpdate)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
if (raid_gen->action == 0) // raid add has longer length than other raid updates
|
switch (raid_gen->action)
|
||||||
{
|
{
|
||||||
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
add_member->raidGen.action = in_add_member->raidGen.action;
|
OUT(raidGen.action);
|
||||||
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
|
OUT(raidGen.parameter);
|
||||||
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
|
OUT_str(raidGen.leader_name);
|
||||||
strn0cpy(add_member->raidGen.player_name, in_add_member->raidGen.player_name, 64);
|
OUT_str(raidGen.player_name);
|
||||||
add_member->_class = in_add_member->_class;
|
OUT(_class);
|
||||||
add_member->level = in_add_member->level;
|
OUT(level);
|
||||||
add_member->isGroupLeader = in_add_member->isGroupLeader;
|
OUT(isGroupLeader);
|
||||||
add_member->flags[0] = in_add_member->flags[0];
|
OUT(flags[0]);
|
||||||
add_member->flags[1] = in_add_member->flags[1];
|
OUT(flags[1]);
|
||||||
add_member->flags[2] = in_add_member->flags[2];
|
OUT(flags[2]);
|
||||||
add_member->flags[3] = in_add_member->flags[3];
|
OUT(flags[3]);
|
||||||
add_member->flags[4] = in_add_member->flags[4];
|
OUT(flags[4]);
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
else if (raid_gen->action == 35)
|
|
||||||
{
|
|
||||||
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
|
|
||||||
strlen(inmotd->motd) + 1);
|
|
||||||
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
|
|
||||||
|
|
||||||
outmotd->general.action = inmotd->general.action;
|
|
||||||
strn0cpy(outmotd->general.player_name, inmotd->general.player_name, 64);
|
|
||||||
strn0cpy(outmotd->motd, inmotd->motd, strlen(inmotd->motd) + 1);
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == 14 || raid_gen->action == 30)
|
case raidSetMotd:
|
||||||
{
|
{
|
||||||
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
auto outapp =
|
|
||||||
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
outlaa->action = inlaa->action;
|
|
||||||
strn0cpy(outlaa->player_name, inlaa->player_name, 64);
|
|
||||||
strn0cpy(outlaa->leader_name, inlaa->leader_name, 64);
|
|
||||||
memcpy(&outlaa->raid, &inlaa->raid, sizeof(RaidLeadershipAA_Struct));
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
{
|
{
|
||||||
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT_str(player_name);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
|
|
||||||
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
|
|
||||||
raid_general->action = in_raid_general->action;
|
|
||||||
raid_general->parameter = in_raid_general->parameter;
|
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3338,37 +3375,47 @@ namespace SoD
|
|||||||
{
|
{
|
||||||
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
|
||||||
// This is a switch on the RaidGeneral action
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
switch (*(uint32 *)__packet->pBuffer) {
|
|
||||||
case 35: { // raidMOTD
|
switch (rgs->action)
|
||||||
// we don't have a nice macro for this
|
{
|
||||||
structs::RaidMOTD_Struct *__eq_buffer = (structs::RaidMOTD_Struct *)__packet->pBuffer;
|
case raidSetMotd:
|
||||||
__eq_buffer->motd[1023] = '\0';
|
{
|
||||||
size_t motd_size = strlen(__eq_buffer->motd) + 1;
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
__packet->size = sizeof(RaidMOTD_Struct) + motd_size;
|
|
||||||
__packet->pBuffer = new unsigned char[__packet->size];
|
IN(general.action);
|
||||||
RaidMOTD_Struct *emu = (RaidMOTD_Struct *)__packet->pBuffer;
|
IN(general.parameter);
|
||||||
structs::RaidMOTD_Struct *eq = (structs::RaidMOTD_Struct *)__eq_buffer;
|
IN_str(general.leader_name);
|
||||||
strn0cpy(emu->general.player_name, eq->general.player_name, 64);
|
IN_str(general.player_name);
|
||||||
strn0cpy(emu->motd, eq->motd, motd_size);
|
IN_str(motd);
|
||||||
IN(general.action);
|
|
||||||
IN(general.parameter);
|
FINISH_VAR_DECODE();
|
||||||
FINISH_DIRECT_DECODE();
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case raidSetNote:
|
||||||
case 36: { // raidPlayerNote unhandled
|
{
|
||||||
break;
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
}
|
|
||||||
default: {
|
IN(general.action);
|
||||||
DECODE_LENGTH_EXACT(structs::RaidGeneral_Struct);
|
IN(general.parameter);
|
||||||
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
IN_str(general.leader_name);
|
||||||
strn0cpy(emu->leader_name, eq->leader_name, 64);
|
IN_str(general.player_name);
|
||||||
strn0cpy(emu->player_name, eq->player_name, 64);
|
IN_str(note);
|
||||||
IN(action);
|
|
||||||
IN(parameter);
|
FINISH_VAR_DECODE();
|
||||||
FINISH_DIRECT_DECODE();
|
break;
|
||||||
break;
|
}
|
||||||
}
|
default:
|
||||||
|
{
|
||||||
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
|
IN(action);
|
||||||
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3592,9 +3592,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
||||||
/*140*/ char motd[0]; // max size 1024, but reply is variable
|
/*140*/ char motd[1024]; // max size is 1024, but reply is variable
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
@ -33,6 +33,7 @@
|
|||||||
#include "sof_structs.h"
|
#include "sof_structs.h"
|
||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -1356,88 +1357,124 @@ namespace SoF
|
|||||||
|
|
||||||
ENCODE(OP_RaidJoin)
|
ENCODE(OP_RaidJoin)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
*p = nullptr;
|
||||||
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidCreate_Struct* emu = (RaidCreate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
|
structs::RaidGeneral_Struct* general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
general->action = 8;
|
general->action = raidCreate;
|
||||||
general->parameter = 1;
|
general->parameter = RaidCommandAcceptInvite;
|
||||||
strn0cpy(general->leader_name, raid_create->leader_name, 64);
|
strn0cpy(general->leader_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
strn0cpy(general->player_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
dest->FastQueuePacket(&outapp_create);
|
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_RaidUpdate)
|
ENCODE(OP_RaidUpdate)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
if (raid_gen->action == 0) // raid add has longer length than other raid updates
|
switch (raid_gen->action)
|
||||||
{
|
{
|
||||||
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
add_member->raidGen.action = in_add_member->raidGen.action;
|
OUT(raidGen.action);
|
||||||
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
|
OUT(raidGen.parameter);
|
||||||
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
|
OUT_str(raidGen.leader_name);
|
||||||
strn0cpy(add_member->raidGen.player_name, in_add_member->raidGen.player_name, 64);
|
OUT_str(raidGen.player_name);
|
||||||
add_member->_class = in_add_member->_class;
|
OUT(_class);
|
||||||
add_member->level = in_add_member->level;
|
OUT(level);
|
||||||
add_member->isGroupLeader = in_add_member->isGroupLeader;
|
OUT(isGroupLeader);
|
||||||
add_member->flags[0] = in_add_member->flags[0];
|
OUT(flags[0]);
|
||||||
add_member->flags[1] = in_add_member->flags[1];
|
OUT(flags[1]);
|
||||||
add_member->flags[2] = in_add_member->flags[2];
|
OUT(flags[2]);
|
||||||
add_member->flags[3] = in_add_member->flags[3];
|
OUT(flags[3]);
|
||||||
add_member->flags[4] = in_add_member->flags[4];
|
OUT(flags[4]);
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
else if (raid_gen->action == 35)
|
|
||||||
{
|
|
||||||
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
|
|
||||||
strlen(inmotd->motd) + 1);
|
|
||||||
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
|
|
||||||
|
|
||||||
outmotd->general.action = inmotd->general.action;
|
|
||||||
strn0cpy(outmotd->general.player_name, inmotd->general.player_name, 64);
|
|
||||||
strn0cpy(outmotd->motd, inmotd->motd, strlen(inmotd->motd) + 1);
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == 14 || raid_gen->action == 30)
|
case raidSetMotd:
|
||||||
{
|
{
|
||||||
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
auto outapp =
|
|
||||||
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
outlaa->action = inlaa->action;
|
|
||||||
strn0cpy(outlaa->player_name, inlaa->player_name, 64);
|
|
||||||
strn0cpy(outlaa->leader_name, inlaa->leader_name, 64);
|
|
||||||
memcpy(&outlaa->raid, &inlaa->raid, sizeof(RaidLeadershipAA_Struct));
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
{
|
{
|
||||||
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT_str(player_name);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
|
|
||||||
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
|
|
||||||
raid_general->action = in_raid_general->action;
|
|
||||||
raid_general->parameter = in_raid_general->parameter;
|
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2743,37 +2780,47 @@ namespace SoF
|
|||||||
{
|
{
|
||||||
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
|
||||||
// This is a switch on the RaidGeneral action
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
switch (*(uint32 *)__packet->pBuffer) {
|
|
||||||
case 35: { // raidMOTD
|
switch (rgs->action)
|
||||||
// we don't have a nice macro for this
|
{
|
||||||
structs::RaidMOTD_Struct *__eq_buffer = (structs::RaidMOTD_Struct *)__packet->pBuffer;
|
case raidSetMotd:
|
||||||
__eq_buffer->motd[1023] = '\0';
|
{
|
||||||
size_t motd_size = strlen(__eq_buffer->motd) + 1;
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
__packet->size = sizeof(RaidMOTD_Struct) + motd_size;
|
|
||||||
__packet->pBuffer = new unsigned char[__packet->size];
|
IN(general.action);
|
||||||
RaidMOTD_Struct *emu = (RaidMOTD_Struct *)__packet->pBuffer;
|
IN(general.parameter);
|
||||||
structs::RaidMOTD_Struct *eq = (structs::RaidMOTD_Struct *)__eq_buffer;
|
IN_str(general.leader_name);
|
||||||
strn0cpy(emu->general.player_name, eq->general.player_name, 64);
|
IN_str(general.player_name);
|
||||||
strn0cpy(emu->motd, eq->motd, motd_size);
|
IN_str(motd);
|
||||||
IN(general.action);
|
|
||||||
IN(general.parameter);
|
FINISH_VAR_DECODE();
|
||||||
FINISH_DIRECT_DECODE();
|
break;
|
||||||
break;
|
}
|
||||||
}
|
case raidSetNote:
|
||||||
case 36: { // raidPlayerNote unhandled
|
{
|
||||||
break;
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
}
|
|
||||||
default: {
|
IN(general.action);
|
||||||
DECODE_LENGTH_EXACT(structs::RaidGeneral_Struct);
|
IN(general.parameter);
|
||||||
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
IN_str(general.leader_name);
|
||||||
strn0cpy(emu->leader_name, eq->leader_name, 64);
|
IN_str(general.player_name);
|
||||||
strn0cpy(emu->player_name, eq->player_name, 64);
|
IN_str(note);
|
||||||
IN(action);
|
|
||||||
IN(parameter);
|
FINISH_VAR_DECODE();
|
||||||
FINISH_DIRECT_DECODE();
|
break;
|
||||||
break;
|
}
|
||||||
}
|
default:
|
||||||
|
{
|
||||||
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
|
IN(action);
|
||||||
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3517,9 +3517,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
||||||
/*140*/ char motd[0]; // max size 1024, but reply is variable
|
/*140*/ char motd[1024]; // max size is 1024, but reply is variable
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
@ -128,6 +128,15 @@
|
|||||||
emu_struct *emu = (emu_struct *) __packet->pBuffer; \
|
emu_struct *emu = (emu_struct *) __packet->pBuffer; \
|
||||||
eq_struct *eq = (eq_struct *) __eq_buffer;
|
eq_struct *eq = (eq_struct *) __eq_buffer;
|
||||||
|
|
||||||
|
#define SETUP_VAR_DECODE(emu_struct, eq_struct, var_field) \
|
||||||
|
unsigned char *__eq_buffer = __packet->pBuffer; \
|
||||||
|
eq_struct* in = (eq_struct*)__packet->pBuffer; \
|
||||||
|
auto size = strlen(in->var_field); \
|
||||||
|
__packet->size = sizeof(emu_struct) + size + 1; \
|
||||||
|
__packet->pBuffer = new unsigned char[__packet->size]; \
|
||||||
|
emu_struct *emu = (emu_struct *) __packet->pBuffer; \
|
||||||
|
eq_struct *eq = (eq_struct *) __eq_buffer;
|
||||||
|
|
||||||
#define MEMSET_IN(emu_struct) \
|
#define MEMSET_IN(emu_struct) \
|
||||||
memset(__packet->pBuffer, 0, sizeof(emu_struct));
|
memset(__packet->pBuffer, 0, sizeof(emu_struct));
|
||||||
|
|
||||||
@ -146,6 +155,9 @@
|
|||||||
delete[] __eq_buffer; \
|
delete[] __eq_buffer; \
|
||||||
p->SetOpcode(OP_Unknown);
|
p->SetOpcode(OP_Unknown);
|
||||||
|
|
||||||
|
#define FINISH_VAR_DECODE() \
|
||||||
|
delete[] __eq_buffer;
|
||||||
|
|
||||||
//call to finish an encoder using SETUP_DIRECT_DECODE
|
//call to finish an encoder using SETUP_DIRECT_DECODE
|
||||||
#define FINISH_DIRECT_DECODE() \
|
#define FINISH_DIRECT_DECODE() \
|
||||||
delete[] __eq_buffer;
|
delete[] __eq_buffer;
|
||||||
|
|||||||
@ -33,6 +33,7 @@
|
|||||||
#include "../item_instance.h"
|
#include "../item_instance.h"
|
||||||
#include "titanium_structs.h"
|
#include "titanium_structs.h"
|
||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
@ -1245,6 +1246,119 @@ namespace Titanium
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_MarkRaidNPC)
|
||||||
|
{
|
||||||
|
ENCODE_LENGTH_EXACT(MarkNPC_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(MarkNPC_Struct, MarkNPC_Struct);
|
||||||
|
|
||||||
|
EQApplicationPacket* outapp = new EQApplicationPacket(OP_MarkNPC, sizeof(MarkNPC_Struct));
|
||||||
|
MarkNPC_Struct* mnpcs = (MarkNPC_Struct*)outapp->pBuffer;
|
||||||
|
mnpcs->TargetID = emu->TargetID;
|
||||||
|
mnpcs->Number = emu->Number;
|
||||||
|
dest->QueuePacket(outapp);
|
||||||
|
safe_delete(outapp);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_RaidUpdate)
|
||||||
|
{
|
||||||
|
EQApplicationPacket* inapp = *p;
|
||||||
|
*p = nullptr;
|
||||||
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
switch (raid_gen->action)
|
||||||
|
{
|
||||||
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(raidGen.action);
|
||||||
|
OUT(raidGen.parameter);
|
||||||
|
OUT_str(raidGen.leader_name);
|
||||||
|
OUT_str(raidGen.player_name);
|
||||||
|
OUT(_class);
|
||||||
|
OUT(level);
|
||||||
|
OUT(isGroupLeader);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
case raidSetMotd:
|
||||||
|
{
|
||||||
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
|
{
|
||||||
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT_str(player_name);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
safe_delete(inapp);
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_ReadBook)
|
ENCODE(OP_ReadBook)
|
||||||
{
|
{
|
||||||
// no apparent slot translation needed
|
// no apparent slot translation needed
|
||||||
@ -2272,6 +2386,63 @@ namespace Titanium
|
|||||||
FINISH_DIRECT_DECODE();
|
FINISH_DIRECT_DECODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECODE(OP_RaidInvite)
|
||||||
|
{
|
||||||
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
|
|
||||||
|
switch (rgs->action)
|
||||||
|
{
|
||||||
|
case raidSetMotd:
|
||||||
|
{
|
||||||
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
|
|
||||||
|
IN(general.action);
|
||||||
|
IN(general.parameter);
|
||||||
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
|
||||||
|
auto len = 0;
|
||||||
|
if (__packet->size < sizeof(structs::RaidMOTD_Struct)) {
|
||||||
|
len = __packet->size - sizeof(structs::RaidGeneral_Struct);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
len = sizeof(eq->motd);
|
||||||
|
}
|
||||||
|
|
||||||
|
strn0cpy(emu->motd, eq->motd, len > 1024 ? 1024 : len);
|
||||||
|
emu->motd[len - 1] = '\0';
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
|
|
||||||
|
IN(general.action);
|
||||||
|
IN(general.parameter);
|
||||||
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(note);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
|
IN(action);
|
||||||
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DECODE(OP_ReadBook)
|
DECODE(OP_ReadBook)
|
||||||
{
|
{
|
||||||
// no apparent slot translation needed
|
// no apparent slot translation needed
|
||||||
|
|||||||
@ -61,6 +61,8 @@ E(OP_OnLevelMessage)
|
|||||||
E(OP_PetBuffWindow)
|
E(OP_PetBuffWindow)
|
||||||
E(OP_PlayerProfile)
|
E(OP_PlayerProfile)
|
||||||
E(OP_NewSpawn)
|
E(OP_NewSpawn)
|
||||||
|
E(OP_MarkRaidNPC)
|
||||||
|
E(OP_RaidUpdate)
|
||||||
E(OP_ReadBook)
|
E(OP_ReadBook)
|
||||||
E(OP_RespondAA)
|
E(OP_RespondAA)
|
||||||
E(OP_SendCharInfo)
|
E(OP_SendCharInfo)
|
||||||
@ -106,6 +108,7 @@ D(OP_LoadSpellSet)
|
|||||||
D(OP_LootItem)
|
D(OP_LootItem)
|
||||||
D(OP_MoveItem)
|
D(OP_MoveItem)
|
||||||
D(OP_PetCommands)
|
D(OP_PetCommands)
|
||||||
|
D(OP_RaidInvite)
|
||||||
D(OP_ReadBook)
|
D(OP_ReadBook)
|
||||||
D(OP_SetServerFilter)
|
D(OP_SetServerFilter)
|
||||||
D(OP_ShopPlayerSell)
|
D(OP_ShopPlayerSell)
|
||||||
|
|||||||
@ -3017,23 +3017,39 @@ struct leadExpUpdateStruct {
|
|||||||
/*0028*/ uint32 unknown0028;
|
/*0028*/ uint32 unknown0028;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct RaidGeneral_Struct {
|
struct RaidGeneral_Struct {
|
||||||
/*00*/ uint32 action; //=10
|
/*000*/ uint32 action; //=10
|
||||||
/*04*/ char player_name[64]; //should both be the player's name
|
/*004*/ char player_name[64]; //should both be the player's name
|
||||||
/*04*/ char leader_name[64];
|
/*068*/ char leader_name[64];
|
||||||
/*132*/ uint32 parameter;
|
/*132*/ uint32 parameter;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidAdd_Struct {
|
struct RaidAddMember_Struct {
|
||||||
/*000*/ uint32 action; //=0
|
/*000*/ RaidGeneral_Struct raidGen;
|
||||||
/*004*/ char player_name[64]; //should both be the player's name
|
/*136*/ uint8 _class;
|
||||||
/*068*/ char leader_name[64];
|
/*137*/ uint8 level;
|
||||||
/*132*/ uint8 _class;
|
/*138*/ uint8 isGroupLeader;
|
||||||
/*133*/ uint8 level;
|
/*139*/ uint8 unknown139; //seems to be 0x42 or 0
|
||||||
/*134*/ uint8 has_group;
|
};
|
||||||
/*135*/ uint8 unknown135; //seems to be 0x42 or 0
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*136*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RaidMOTD_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
||||||
|
/*136*/ char motd[1024]; // max size is 1024, but reply is variable
|
||||||
|
};
|
||||||
|
|
||||||
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
/*000*/ uint32 action;
|
||||||
|
/*004*/ char player_name[64];
|
||||||
|
// /*068*/ uint32 Unknown068;
|
||||||
|
/*072*/ char leader_name[64];
|
||||||
|
/*136*/ GroupLeadershipAA_Struct group; //unneeded
|
||||||
|
/*200*/ RaidLeadershipAA_Struct raid;
|
||||||
|
/*264*/ char Unknown264[128];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidCreate_Struct {
|
struct RaidCreate_Struct {
|
||||||
|
|||||||
@ -35,6 +35,7 @@
|
|||||||
#include "../path_manager.h"
|
#include "../path_manager.h"
|
||||||
#include "../classes.h"
|
#include "../classes.h"
|
||||||
#include "../races.h"
|
#include "../races.h"
|
||||||
|
#include "../raid.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -1931,88 +1932,124 @@ namespace UF
|
|||||||
|
|
||||||
ENCODE(OP_RaidJoin)
|
ENCODE(OP_RaidJoin)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
*p = nullptr;
|
||||||
RaidCreate_Struct *raid_create = (RaidCreate_Struct*)__emu_buffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
|
RaidCreate_Struct* emu = (RaidCreate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp_create = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *general = (structs::RaidGeneral_Struct*)outapp_create->pBuffer;
|
structs::RaidGeneral_Struct* general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
general->action = 8;
|
general->action = raidCreate;
|
||||||
general->parameter = 1;
|
general->parameter = RaidCommandAcceptInvite;
|
||||||
strn0cpy(general->leader_name, raid_create->leader_name, 64);
|
strn0cpy(general->leader_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
strn0cpy(general->player_name, raid_create->leader_name, 64);
|
strn0cpy(general->player_name, emu->leader_name, sizeof(emu->leader_name));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
|
||||||
dest->FastQueuePacket(&outapp_create);
|
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_RaidUpdate)
|
ENCODE(OP_RaidUpdate)
|
||||||
{
|
{
|
||||||
EQApplicationPacket *inapp = *p;
|
EQApplicationPacket* inapp = *p;
|
||||||
*p = nullptr;
|
*p = nullptr;
|
||||||
unsigned char * __emu_buffer = inapp->pBuffer;
|
unsigned char* __emu_buffer = inapp->pBuffer;
|
||||||
RaidGeneral_Struct *raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
RaidGeneral_Struct* raid_gen = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
if (raid_gen->action == 0) // raid add has longer length than other raid updates
|
switch (raid_gen->action)
|
||||||
{
|
{
|
||||||
RaidAddMember_Struct* in_add_member = (RaidAddMember_Struct*)__emu_buffer;
|
case raidAdd:
|
||||||
|
{
|
||||||
|
RaidAddMember_Struct* emu = (RaidAddMember_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidAddMember_Struct));
|
||||||
structs::RaidAddMember_Struct *add_member = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
structs::RaidAddMember_Struct* eq = (structs::RaidAddMember_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
add_member->raidGen.action = in_add_member->raidGen.action;
|
OUT(raidGen.action);
|
||||||
add_member->raidGen.parameter = in_add_member->raidGen.parameter;
|
OUT(raidGen.parameter);
|
||||||
strn0cpy(add_member->raidGen.leader_name, in_add_member->raidGen.leader_name, 64);
|
OUT_str(raidGen.leader_name);
|
||||||
strn0cpy(add_member->raidGen.player_name, in_add_member->raidGen.player_name, 64);
|
OUT_str(raidGen.player_name);
|
||||||
add_member->_class = in_add_member->_class;
|
OUT(_class);
|
||||||
add_member->level = in_add_member->level;
|
OUT(level);
|
||||||
add_member->isGroupLeader = in_add_member->isGroupLeader;
|
OUT(isGroupLeader);
|
||||||
add_member->flags[0] = in_add_member->flags[0];
|
OUT(flags[0]);
|
||||||
add_member->flags[1] = in_add_member->flags[1];
|
OUT(flags[1]);
|
||||||
add_member->flags[2] = in_add_member->flags[2];
|
OUT(flags[2]);
|
||||||
add_member->flags[3] = in_add_member->flags[3];
|
OUT(flags[3]);
|
||||||
add_member->flags[4] = in_add_member->flags[4];
|
OUT(flags[4]);
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
else if (raid_gen->action == 35)
|
|
||||||
{
|
|
||||||
RaidMOTD_Struct *inmotd = (RaidMOTD_Struct *)__emu_buffer;
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct) +
|
|
||||||
strlen(inmotd->motd) + 1);
|
|
||||||
structs::RaidMOTD_Struct *outmotd = (structs::RaidMOTD_Struct *)outapp->pBuffer;
|
|
||||||
|
|
||||||
outmotd->general.action = inmotd->general.action;
|
|
||||||
strn0cpy(outmotd->general.player_name, inmotd->general.player_name, 64);
|
|
||||||
strn0cpy(outmotd->motd, inmotd->motd, strlen(inmotd->motd) + 1);
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (raid_gen->action == 14 || raid_gen->action == 30)
|
case raidSetMotd:
|
||||||
{
|
{
|
||||||
RaidLeadershipUpdate_Struct *inlaa = (RaidLeadershipUpdate_Struct *)__emu_buffer;
|
RaidMOTD_Struct* emu = (RaidMOTD_Struct*)__emu_buffer;
|
||||||
auto outapp =
|
|
||||||
new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidMOTD_Struct));
|
||||||
structs::RaidLeadershipUpdate_Struct *outlaa = (structs::RaidLeadershipUpdate_Struct *)outapp->pBuffer;
|
structs::RaidMOTD_Struct* eq = (structs::RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(motd);
|
||||||
|
|
||||||
outlaa->action = inlaa->action;
|
|
||||||
strn0cpy(outlaa->player_name, inlaa->player_name, 64);
|
|
||||||
strn0cpy(outlaa->leader_name, inlaa->leader_name, 64);
|
|
||||||
memcpy(&outlaa->raid, &inlaa->raid, sizeof(RaidLeadershipAA_Struct));
|
|
||||||
dest->FastQueuePacket(&outapp);
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
case raidSetLeaderAbilities:
|
||||||
|
case raidMakeLeader:
|
||||||
{
|
{
|
||||||
RaidGeneral_Struct* in_raid_general = (RaidGeneral_Struct*)__emu_buffer;
|
RaidLeadershipUpdate_Struct* emu = (RaidLeadershipUpdate_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidLeadershipUpdate_Struct));
|
||||||
|
structs::RaidLeadershipUpdate_Struct* eq = (structs::RaidLeadershipUpdate_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT_str(player_name);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
memcpy(&eq->raid, &emu->raid, sizeof(RaidLeadershipAA_Struct));
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
auto emu = (RaidNote_Struct*)__emu_buffer;
|
||||||
|
|
||||||
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidNote_Struct));
|
||||||
|
auto eq = (structs::RaidNote_Struct*)outapp->pBuffer;
|
||||||
|
|
||||||
|
OUT(general.action);
|
||||||
|
OUT_str(general.leader_name);
|
||||||
|
OUT_str(general.player_name);
|
||||||
|
OUT_str(note);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidNoRaid:
|
||||||
|
{
|
||||||
|
dest->QueuePacket(inapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
RaidGeneral_Struct* emu = (RaidGeneral_Struct*)__emu_buffer;
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(structs::RaidGeneral_Struct));
|
||||||
structs::RaidGeneral_Struct *raid_general = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
structs::RaidGeneral_Struct* eq = (structs::RaidGeneral_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(raid_general->leader_name, in_raid_general->leader_name, 64);
|
|
||||||
strn0cpy(raid_general->player_name, in_raid_general->player_name, 64);
|
|
||||||
raid_general->action = in_raid_general->action;
|
|
||||||
raid_general->parameter = in_raid_general->parameter;
|
|
||||||
dest->FastQueuePacket(&outapp);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OUT(action);
|
||||||
|
OUT(parameter);
|
||||||
|
OUT_str(leader_name);
|
||||||
|
OUT_str(player_name);
|
||||||
|
|
||||||
|
dest->FastQueuePacket(&outapp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
safe_delete(inapp);
|
safe_delete(inapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3637,39 +3674,48 @@ namespace UF
|
|||||||
{
|
{
|
||||||
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
DECODE_LENGTH_ATLEAST(structs::RaidGeneral_Struct);
|
||||||
|
|
||||||
// This is a switch on the RaidGeneral action
|
RaidGeneral_Struct* rgs = (RaidGeneral_Struct*)__packet->pBuffer;
|
||||||
switch (*(uint32 *)__packet->pBuffer) {
|
|
||||||
case 35: { // raidMOTD
|
|
||||||
// we don't have a nice macro for this
|
|
||||||
structs::RaidMOTD_Struct *__eq_buffer = (structs::RaidMOTD_Struct *)__packet->pBuffer;
|
|
||||||
__eq_buffer->motd[1023] = '\0';
|
|
||||||
size_t motd_size = strlen(__eq_buffer->motd) + 1;
|
|
||||||
__packet->size = sizeof(RaidMOTD_Struct) + motd_size;
|
|
||||||
__packet->pBuffer = new unsigned char[__packet->size];
|
|
||||||
RaidMOTD_Struct *emu = (RaidMOTD_Struct *)__packet->pBuffer;
|
|
||||||
structs::RaidMOTD_Struct *eq = (structs::RaidMOTD_Struct *)__eq_buffer;
|
|
||||||
strn0cpy(emu->general.player_name, eq->general.player_name, 64);
|
|
||||||
strn0cpy(emu->motd, eq->motd, motd_size);
|
|
||||||
IN(general.action);
|
|
||||||
IN(general.parameter);
|
|
||||||
FINISH_DIRECT_DECODE();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 36: { // raidPlayerNote unhandled
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
DECODE_LENGTH_EXACT(structs::RaidGeneral_Struct);
|
|
||||||
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
|
||||||
strn0cpy(emu->leader_name, eq->leader_name, 64);
|
|
||||||
strn0cpy(emu->player_name, eq->player_name, 64);
|
|
||||||
IN(action);
|
|
||||||
IN(parameter);
|
|
||||||
FINISH_DIRECT_DECODE();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
switch (rgs->action)
|
||||||
|
{
|
||||||
|
case raidSetMotd:
|
||||||
|
{
|
||||||
|
SETUP_VAR_DECODE(RaidMOTD_Struct, structs::RaidMOTD_Struct, motd);
|
||||||
|
|
||||||
|
IN(general.action);
|
||||||
|
IN(general.parameter);
|
||||||
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(motd);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case raidSetNote:
|
||||||
|
{
|
||||||
|
SETUP_VAR_DECODE(RaidNote_Struct, structs::RaidNote_Struct, note);
|
||||||
|
|
||||||
|
IN(general.action);
|
||||||
|
IN(general.parameter);
|
||||||
|
IN_str(general.leader_name);
|
||||||
|
IN_str(general.player_name);
|
||||||
|
IN_str(note);
|
||||||
|
|
||||||
|
FINISH_VAR_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
SETUP_DIRECT_DECODE(RaidGeneral_Struct, structs::RaidGeneral_Struct);
|
||||||
|
IN(action);
|
||||||
|
IN(parameter);
|
||||||
|
IN_str(leader_name);
|
||||||
|
IN_str(player_name);
|
||||||
|
|
||||||
|
FINISH_DIRECT_DECODE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DECODE(OP_ReadBook)
|
DECODE(OP_ReadBook)
|
||||||
|
|||||||
@ -3647,9 +3647,14 @@ struct RaidAddMember_Struct {
|
|||||||
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
/*139*/ uint8 flags[5]; //no idea if these are needed...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct RaidNote_Struct {
|
||||||
|
/*000*/ RaidGeneral_Struct general;
|
||||||
|
/*140*/ char note[64];
|
||||||
|
};
|
||||||
|
|
||||||
struct RaidMOTD_Struct {
|
struct RaidMOTD_Struct {
|
||||||
/*000*/ RaidGeneral_Struct general; // leader_name and action only used
|
/*000*/ RaidGeneral_Struct general;
|
||||||
/*140*/ char motd[0]; // max size 1024, but reply is variable
|
/*140*/ char motd[1024];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RaidLeadershipUpdate_Struct {
|
struct RaidLeadershipUpdate_Struct {
|
||||||
|
|||||||
72
common/raid.h
Normal file
72
common/raid.h
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
/* EQEMu: Everquest Server Emulator
|
||||||
|
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemu.org)
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; version 2 of the License.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY except by those people which sell it, which
|
||||||
|
are required to give you total support for your newly bought product;
|
||||||
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef RAID_H
|
||||||
|
#define RAID_H
|
||||||
|
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -1077,7 +1077,7 @@ struct ServerRaidMessage_Struct {
|
|||||||
|
|
||||||
struct ServerRaidMOTD_Struct {
|
struct ServerRaidMOTD_Struct {
|
||||||
uint32 rid;
|
uint32 rid;
|
||||||
char motd[0];
|
char motd[1024];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServerRaidNote_Struct {
|
struct ServerRaidNote_Struct {
|
||||||
|
|||||||
@ -423,6 +423,8 @@ OP_CancelInvite=0x0000
|
|||||||
OP_RaidJoin=0x1f21 # ShowEQ 10/27/05
|
OP_RaidJoin=0x1f21 # ShowEQ 10/27/05
|
||||||
OP_RaidInvite=0x5891 # ShowEQ 10/27/05
|
OP_RaidInvite=0x5891 # ShowEQ 10/27/05
|
||||||
OP_RaidUpdate=0x1f21 # EQEmu 06/29/05
|
OP_RaidUpdate=0x1f21 # EQEmu 06/29/05
|
||||||
|
OP_RaidDelegateAbility=0x56eb
|
||||||
|
OP_RaidClearNPCMarks=0x1794
|
||||||
|
|
||||||
OP_InspectBuffs=0x4FB6
|
OP_InspectBuffs=0x4FB6
|
||||||
|
|
||||||
|
|||||||
@ -534,6 +534,8 @@ OP_LFGResponse=0x0000 #
|
|||||||
OP_RaidInvite=0x60b5 # C
|
OP_RaidInvite=0x60b5 # C
|
||||||
OP_RaidUpdate=0x4d8b # C
|
OP_RaidUpdate=0x4d8b # C
|
||||||
OP_RaidJoin=0x0000 #
|
OP_RaidJoin=0x0000 #
|
||||||
|
OP_RaidDelegateAbility=0x0297
|
||||||
|
OP_RaidClearNPCMarks=0x2af4
|
||||||
|
|
||||||
# Button-push commands
|
# Button-push commands
|
||||||
OP_Taunt=0x30e2 # C
|
OP_Taunt=0x30e2 # C
|
||||||
|
|||||||
@ -18,6 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "../common/global_define.h"
|
#include "../common/global_define.h"
|
||||||
#include "../common/eqemu_logsys.h"
|
#include "../common/eqemu_logsys.h"
|
||||||
#include "../common/opcodemgr.h"
|
#include "../common/opcodemgr.h"
|
||||||
|
#include "../common/raid.h"
|
||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@ -12578,8 +12580,8 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
|
|||||||
if (!raid) {
|
if (!raid) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
RaidNote_Struct* note = (RaidNote_Struct*)app->pBuffer;
|
||||||
raid->SaveRaidNote(raid_command_packet->leader_name, raid_command_packet->note);
|
raid->SaveRaidNote(raid_command_packet->leader_name, note->note);
|
||||||
raid->SendRaidNotesToWorld();
|
raid->SendRaidNotesToWorld();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,8 @@
|
|||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
#include "../common/repositories/raid_details_repository.h"
|
#include "../common/repositories/raid_details_repository.h"
|
||||||
#include "../common/repositories/raid_members_repository.h"
|
#include "../common/repositories/raid_members_repository.h"
|
||||||
|
#include "../common/raid.h"
|
||||||
|
|
||||||
|
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "entity.h"
|
#include "entity.h"
|
||||||
@ -1547,21 +1549,22 @@ void Raid::SendRaidGroupRemove(const char *who, uint32 gid)
|
|||||||
|
|
||||||
void Raid::SendRaidMOTD(Client *c)
|
void Raid::SendRaidMOTD(Client *c)
|
||||||
{
|
{
|
||||||
if (!c || motd.empty()) {
|
if (!c || motd.empty() || c->IsBot()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entity_list.GetBotByBotName(c->GetName())) {
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidMOTD_Struct));
|
||||||
return;
|
auto data = (RaidMOTD_Struct*)outapp->pBuffer;
|
||||||
}
|
|
||||||
|
|
||||||
size_t size = motd.size() + 1;
|
data->general.action = raidSetMotd;
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidMOTD_Struct) + size);
|
data->general.parameter = 0;
|
||||||
auto rmotd = (RaidMOTD_Struct *)outapp->pBuffer;
|
data->general.unknown1 = 0;
|
||||||
rmotd->general.action = raidSetMotd;
|
strn0cpy(data->general.leader_name, c->GetName(), sizeof(c->GetName()));
|
||||||
strn0cpy(rmotd->general.player_name, c->GetName(), 64);
|
strn0cpy(data->general.player_name, GetLeaderName().c_str(), 64);
|
||||||
strn0cpy(rmotd->motd, motd.c_str(), size);
|
strn0cpy(data->motd, motd.c_str(), sizeof(data->motd));
|
||||||
c->FastQueuePacket(&outapp);
|
|
||||||
|
c->QueuePacket(outapp);
|
||||||
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Raid::SendRaidMOTD()
|
void Raid::SendRaidMOTD()
|
||||||
@ -1587,11 +1590,10 @@ void Raid::SendRaidMOTDToWorld()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t size = motd.size() + 1;
|
auto pack = new ServerPacket(ServerOP_RaidMOTD, sizeof(ServerRaidMOTD_Struct));
|
||||||
auto pack = new ServerPacket(ServerOP_RaidMOTD, sizeof(ServerRaidMOTD_Struct) + size);
|
|
||||||
auto smotd = (ServerRaidMOTD_Struct *)pack->pBuffer;
|
auto smotd = (ServerRaidMOTD_Struct *)pack->pBuffer;
|
||||||
smotd->rid = GetID();
|
smotd->rid = GetID();
|
||||||
strn0cpy(smotd->motd, motd.c_str(), size);
|
strn0cpy(smotd->motd, motd.c_str(), sizeof(smotd->motd));
|
||||||
worldserver.SendPacket(pack);
|
worldserver.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
@ -1730,7 +1732,8 @@ bool Raid::LearnMembers()
|
|||||||
|
|
||||||
members[i].member = nullptr;
|
members[i].member = nullptr;
|
||||||
strn0cpy(members[i].member_name, row[0], sizeof(members[i].member_name));
|
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]);
|
uint32 group_id = Strings::ToUnsignedInt(row[1]);
|
||||||
|
|
||||||
if (group_id >= MAX_RAID_GROUPS) {
|
if (group_id >= MAX_RAID_GROUPS) {
|
||||||
@ -2275,7 +2278,7 @@ std::vector<RaidMember> Raid::GetMembersWithNotes()
|
|||||||
{
|
{
|
||||||
std::vector<RaidMember> raid_members;
|
std::vector<RaidMember> raid_members;
|
||||||
for (const auto& m : members) {
|
for (const auto& m : members) {
|
||||||
if (strlen(m.note) != 0) {
|
if (!m.note.empty()) {
|
||||||
raid_members.emplace_back(m);
|
raid_members.emplace_back(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2288,12 +2291,17 @@ void Raid::SendRaidNotes()
|
|||||||
VerifyRaid();
|
VerifyRaid();
|
||||||
|
|
||||||
for (const auto& c : GetMembersWithNotes()) {
|
for (const auto& c : GetMembersWithNotes()) {
|
||||||
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidGeneral_Struct));
|
|
||||||
auto note = (RaidGeneral_Struct*)outapp->pBuffer;
|
auto outapp = new EQApplicationPacket(OP_RaidUpdate, sizeof(RaidNote_Struct));
|
||||||
note->action = raidSetNote;
|
auto data = (RaidNote_Struct*)outapp->pBuffer;
|
||||||
strn0cpy(note->leader_name, c.member_name, 64);
|
|
||||||
strn0cpy(note->player_name, GetLeaderName().c_str(), 64);
|
data->general.action = raidSetNote;
|
||||||
strn0cpy(note->note, c.note, 64);
|
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);
|
QueuePacket(outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
@ -2552,7 +2560,7 @@ void Raid::UpdateXTargetType(XTargetType Type, Mob *m, const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
strncpy(rm.member->XTargets[i].Name, name, 64);
|
strn0cpy(rm.member->XTargets[i].Name, name, 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
rm.member->SendXTargetPacket(i, m);
|
rm.member->SendXTargetPacket(i, m);
|
||||||
|
|||||||
51
zone/raids.h
51
zone/raids.h
@ -27,55 +27,6 @@ class Client;
|
|||||||
class EQApplicationPacket;
|
class EQApplicationPacket;
|
||||||
class Mob;
|
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 {
|
enum {
|
||||||
FindNextMarkerSlot = 1,
|
FindNextMarkerSlot = 1,
|
||||||
FindNextAssisterSlot = 2,
|
FindNextAssisterSlot = 2,
|
||||||
@ -129,7 +80,7 @@ struct RaidMember{
|
|||||||
uint32 group_number;
|
uint32 group_number;
|
||||||
uint8 _class;
|
uint8 _class;
|
||||||
uint8 level;
|
uint8 level;
|
||||||
char note[64];
|
std::string note;
|
||||||
bool is_group_leader;
|
bool is_group_leader;
|
||||||
bool is_raid_leader;
|
bool is_raid_leader;
|
||||||
bool is_looter;
|
bool is_looter;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user