Merge branch 'master' into nats

# Conflicts:
#	world/client.cpp
#	zone/attack.cpp
#	zone/map.cpp
#	zone/map.h
#	zone/spells.cpp
This commit is contained in:
Xackery
2018-03-10 13:59:48 -08:00
96 changed files with 3580 additions and 2398 deletions
+65
View File
@@ -18,3 +18,68 @@
*/
#include "emu_constants.h"
const char* EQEmu::bug::CategoryIDToCategoryName(CategoryID category_id) {
switch (category_id) {
case catVideo:
return "Video";
case catAudio:
return "Audio";
case catPathing:
return "Pathing";
case catQuest:
return "Quest";
case catTradeskills:
return "Tradeskills";
case catSpellStacking:
return "Spell stacking";
case catDoorsPortals:
return "Doors/Portals";
case catItems:
return "Items";
case catNPC:
return "NPC";
case catDialogs:
return "Dialogs";
case catLoNTCG:
return "LoN - TCG";
case catMercenaries:
return "Mercenaries";
case catOther:
default:
return "Other";
}
}
EQEmu::bug::CategoryID EQEmu::bug::CategoryNameToCategoryID(const char* category_name) {
if (!category_name)
return catOther;
if (!strcmp(category_name, "Video"))
return catVideo;
if (!strcmp(category_name, "Audio"))
return catAudio;
if (!strcmp(category_name, "Pathing"))
return catPathing;
if (!strcmp(category_name, "Quest"))
return catQuest;
if (!strcmp(category_name, "Tradeskills"))
return catTradeskills;
if (!strcmp(category_name, "Spell stacking"))
return catSpellStacking;
if (!strcmp(category_name, "Doors/Portals"))
return catDoorsPortals;
if (!strcmp(category_name, "Items"))
return catItems;
if (!strcmp(category_name, "NPC"))
return catNPC;
if (!strcmp(category_name, "Dialogs"))
return catDialogs;
if (!strcmp(category_name, "LoN - TCG"))
return catLoNTCG;
if (!strcmp(category_name, "Mercenaries"))
return catMercenaries;
return catOther;
}
+36 -1
View File
@@ -24,7 +24,7 @@
#include "emu_legacy.h"
#include "emu_versions.h"
#include <string>
#include <string.h>
namespace EQEmu
@@ -114,7 +114,11 @@ namespace EQEmu
const EQEmu::versions::ClientVersion CharacterCreationClient = EQEmu::versions::ClientVersion::RoF2;
const size_t CharacterCreationMax = RoF2::constants::CharacterCreationLimit;
const size_t SayLinkOpenerSize = 1;
const size_t SayLinkBodySize = RoF2::constants::SayLinkBodySize;
const size_t SayLinkTextSize = 256; // this may be varied until it breaks something (tested:374) - the others are constant
const size_t SayLinkCloserSize = 1;
const size_t SayLinkMaximumSize = (SayLinkOpenerSize + SayLinkBodySize + SayLinkTextSize + SayLinkCloserSize);
const int LongBuffs = RoF2::constants::LongBuffs;
const int ShortBuffs = RoF2::constants::ShortBuffs;
@@ -126,6 +130,37 @@ namespace EQEmu
} /*constants*/
namespace bug {
enum CategoryID : uint32 {
catOther = 0,
catVideo,
catAudio,
catPathing,
catQuest,
catTradeskills,
catSpellStacking,
catDoorsPortals,
catItems,
catNPC,
catDialogs,
catLoNTCG,
catMercenaries
};
enum OptionalInfoFlag : uint32 {
infoNoOptionalInfo = 0x0,
infoCanDuplicate = 0x1,
infoCrashBug = 0x2,
infoTargetInfo = 0x4,
infoCharacterFlags = 0x8,
infoUnknownValue = 0xFFFFFFF0
};
const char* CategoryIDToCategoryName(CategoryID category_id);
CategoryID CategoryNameToCategoryID(const char* category_name);
} // namespace bug
enum class CastingSlot : uint32 {
Gem1 = 0,
Gem2 = 1,
-2
View File
@@ -175,8 +175,6 @@ namespace EQEmu
// POTION_BELT_SIZE sets maximum limit..active limit will need to be handled by the appropriate AA or spell (or item?)
static const size_t POTION_BELT_ITEM_COUNT = 5;
static const size_t TEXT_LINK_BODY_LENGTH = 56;
}
}
+1
View File
@@ -393,6 +393,7 @@ N(OP_PVPLeaderBoardReply),
N(OP_PVPLeaderBoardRequest),
N(OP_PVPStats),
N(OP_QueryResponseThing),
N(OP_QueryUCSServerStatus),
N(OP_RaidInvite),
N(OP_RaidJoin),
N(OP_RaidUpdate),
+16 -2
View File
@@ -28,7 +28,7 @@
namespace EQEmu
{
namespace versions {
enum class ClientVersion {
enum class ClientVersion : uint32 {
Unknown = 0,
Client62, // Build: 'Aug 4 2005 15:40:59'
Titanium, // Build: 'Oct 31 2005 10:33:37'
@@ -72,7 +72,7 @@ namespace EQEmu
uint32 ConvertClientVersionToExpansion(ClientVersion client_version);
enum class MobVersion {
enum class MobVersion : uint32 {
Unknown = 0,
Client62,
Titanium,
@@ -121,6 +121,20 @@ namespace EQEmu
ClientVersion ConvertOfflinePCMobVersionToClientVersion(MobVersion mob_version);
MobVersion ConvertClientVersionToOfflinePCMobVersion(ClientVersion client_version);
enum UCSVersion : char {
ucsUnknown = '\0',
ucsClient62Chat = 'A',
ucsClient62Mail = 'a',
ucsTitaniumChat = 'B',
ucsTitaniumMail = 'b',
ucsSoFCombined = 'C',
ucsSoDCombined = 'D',
ucsUFCombined = 'E',
ucsRoFCombined = 'F',
ucsRoF2Combined = 'G'
};
} /*versions*/
} /*EQEmu*/
+75 -47
View File
@@ -280,7 +280,7 @@ union
// horse: 0=brown, 1=white, 2=black, 3=tan
};
/*0340*/ uint32 spawnId; // Spawn Id
/*0344*/ uint8 unknown0344[3];
/*0344*/ float bounding_radius; // used in melee, overrides calc
/*0347*/ uint8 IsMercenary;
/*0348*/ EQEmu::TintProfile equipment_tint;
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
@@ -1253,21 +1253,22 @@ struct Action_Struct
{
/* 00 */ uint16 target; // id of target
/* 02 */ uint16 source; // id of caster
/* 04 */ uint16 level; // level of caster
/* 06 */ uint16 instrument_mod;
/* 08 */ uint32 bard_focus_id;
/* 12 */ uint16 unknown16;
// some kind of sequence that's the same in both actions
// as well as the combat damage, to tie em together?
/* 14 */ uint32 sequence;
/* 18 */ uint32 unknown18;
/* 22 */ uint8 type; // 231 (0xE7) for spells
/* 23 */ uint32 unknown23;
/* 04 */ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/* 06 */ uint32 instrument_mod; // OSX dump says base damage, spells use it for bard song (different from newer clients)
/* 10 */ float force;
/* 14 */ float hit_heading;
/* 18 */ float hit_pitch;
/* 22 */ uint8 type; // 231 (0xE7) for spells, skill
/* 23 */ uint16 unknown23; // OSX says min_damage
/* 25 */ uint16 unknown25; // OSX says tohit
/* 27 */ uint16 spell; // spell id being cast
/* 29 */ uint8 unknown29;
/* 29 */ uint8 spell_level;
// this field seems to be some sort of success flag, if it's 4
/* 30 */ uint8 buff_unknown; // if this is 4, a buff icon is made
/* 31 */
/* 30 */ uint8 effect_flag; // if this is 4, a buff icon is made
// newer clients have some data for setting LaunchSpellData when effect_flag & 4
// /* 31 */ uint8 spell_gem;
// /* 32 */ uint32 inventory_slot;
// /* 36 */ uint32 item_cast_type;
};
// this is what prints the You have been struck. and the regular
@@ -1277,12 +1278,12 @@ struct CombatDamage_Struct
{
/* 00 */ uint16 target;
/* 02 */ uint16 source;
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells, skill
/* 05 */ uint16 spellid;
/* 07 */ uint32 damage;
/* 11 */ float force;
/* 15 */ float meleepush_xy; // see above notes in Action_Struct
/* 19 */ float meleepush_z;
/* 15 */ float hit_heading; // see above notes in Action_Struct
/* 19 */ float hit_pitch;
/* 23 */ uint32 special; // 2 = Rampage, 1 = Wild Rampage
};
@@ -3323,23 +3324,32 @@ struct GuildMakeLeader{
char target[64];
};
struct BugStruct{
/*0000*/ char chartype[64];
/*0064*/ char name[96];
/*0160*/ char ui[128];
/*0288*/ float x;
/*0292*/ float y;
/*0296*/ float z;
/*0300*/ float heading;
/*0304*/ uint32 unknown304;
/*0308*/ char unknown308[160];
/*0468*/ char target_name[64];
/*0532*/ uint32 type;
/*0536*/ char unknown536[2052];
/*2584*/ char bug[2048];
/*4632*/ char unknown4632[6];
/*4638*/ char system_info[4094];
struct BugReport_Struct {
/*0000*/ uint32 category_id;
/*0004*/ char category_name[64];
/*0068*/ char reporter_name[64];
/*0132*/ char unused_0132[32];
/*0164*/ char ui_path[128];
/*0292*/ float pos_x;
/*0296*/ float pos_y;
/*0300*/ float pos_z;
/*0304*/ uint32 heading;
/*0308*/ uint32 unused_0308;
/*0312*/ uint32 time_played;
/*0316*/ char padding_0316[8];
/*0324*/ uint32 target_id;
/*0328*/ char padding_0328[140];
/*0468*/ uint32 unknown_0468; // seems to always be '0'
/*0472*/ char target_name[64];
/*0536*/ uint32 optional_info_mask;
// this looks like a butchered 8k buffer with 2 trailing dword fields
/*0540*/ char unused_0540[2052];
/*2592*/ char bug_report[2050];
/*4642*/ char system_info[4098];
/*8740*/
};
struct Make_Pet_Struct { //Simple struct for getting pet info
uint8 level;
uint8 class_;
@@ -3366,20 +3376,21 @@ struct Ground_Spawn{
struct Ground_Spawns {
struct Ground_Spawn spawn[50]; //Assigned max number to allow
};
struct PetitionBug_Struct{
uint32 petition_number;
uint32 unknown4;
char accountname[64];
uint32 zoneid;
char name[64];
uint32 level;
uint32 class_;
uint32 race;
uint32 unknown152[3];
uint32 time;
uint32 unknown168;
char text[1028];
};
//struct PetitionBug_Struct{
// uint32 petition_number;
// uint32 unknown4;
// char accountname[64];
// uint32 zoneid;
// char name[64];
// uint32 level;
// uint32 class_;
// uint32 race;
// uint32 unknown152[3];
// uint32 time;
// uint32 unknown168;
// char text[1028];
//};
struct ApproveZone_Struct {
char name[64];
@@ -5356,6 +5367,23 @@ struct AuraDestory_Struct {
};
// I think we can assume it's just action for 2, client doesn't seem to do anything with the rest of the data in that case
struct SayLinkBodyFrame_Struct {
/*000*/ char ActionID[1];
/*001*/ char ItemID[5];
/*006*/ char Augment1[5];
/*011*/ char Augment2[5];
/*016*/ char Augment3[5];
/*021*/ char Augment4[5];
/*026*/ char Augment5[5];
/*031*/ char Augment6[5];
/*036*/ char IsEvolving[1];
/*037*/ char EvolveGroup[4];
/*041*/ char EvolveLevel[2];
/*043*/ char OrnamentIcon[5];
/*048*/ char Hash[8];
/*056*/
};
// Restore structure packing to default
#pragma pack()
+3
View File
@@ -219,6 +219,9 @@ enum { //some random constants
//the square of the maximum range at whihc you could possibly use NPC services (shop, tribute, etc)
#define USE_NPC_RANGE2 200*200 //arbitrary right now
// Squared range for rampage 75.0 * 75.0 for now
#define NPC_RAMPAGE_RANGE2 5625.0f
//the formula for experience for killing a mob.
//level is the only valid variable to use
#define EXP_FORMULA level*level*75*35/10
+18
View File
@@ -242,6 +242,24 @@ int FloatToEQSpeedRun(float d)
return static_cast<int>(d * 40.0f);
}
float FixHeading(float in)
{
int i = 0;
if (in >= 512.0f) {
do {
in -= 512.0f;
} while (in >= 512.0f && i++ <= 5);
}
i = 0;
if (in < 0.0f) {
do {
in += 512.0f;
} while (in < 0.0f && i++ <= 5);
}
return in;
}
/*
Heading of 0 points in the pure positive Y direction
+3
View File
@@ -66,6 +66,9 @@ int FloatToEQ10(float d);
float EQSpeedRunToFloat(int d);
int FloatToEQSpeedRun(float d);
// brings heading back into EQ angles range
float FixHeading(float in);
uint32 SwapBits21and22(uint32 mask);
uint32 Catch22(uint32 mask);
+2 -2
View File
@@ -165,7 +165,7 @@ void EQ::Net::DaybreakConnectionManager::ProcessResend()
{
auto iter = m_connections.begin();
while (iter != m_connections.end()) {
auto connection = iter->second;
auto &connection = iter->second;
auto status = connection->m_status;
switch (status)
@@ -1397,4 +1397,4 @@ EQ::Net::SequenceOrder EQ::Net::DaybreakConnection::CompareSequence(uint16_t exp
}
return SequencePast;
}
}
+51 -50
View File
@@ -57,11 +57,11 @@ namespace RoF
static inline uint32 RoFToServerTypelessSlot(structs::TypelessInventorySlot_Struct rofSlot);
static inline uint32 RoFToServerCorpseSlot(uint32 rofCorpseSlot);
// server to client text link converter
static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink);
// server to client say link converter
static inline void ServerToRoFSayLink(std::string& rofSayLink, const std::string& serverSayLink);
// client to server text link converter
static inline void RoFToServerTextLink(std::string& serverTextLink, const std::string& rofTextLink);
// client to server say link converter
static inline void RoFToServerSayLink(std::string& serverSayLink, const std::string& rofSayLink);
static inline CastingSlot ServerToRoFCastingSlot(EQEmu::CastingSlot slot);
static inline EQEmu::CastingSlot RoFToServerCastingSlot(CastingSlot slot);
@@ -163,22 +163,23 @@ namespace RoF
OUT(level);
eq->unknown06 = 0;
eq->instrument_mod = 1.0f + (emu->instrument_mod - 10) / 10.0f;
eq->bard_focus_id = emu->bard_focus_id;
eq->knockback_angle = emu->sequence;
eq->unknown22 = 0;
OUT(force);
OUT(hit_heading);
OUT(hit_pitch);
OUT(type);
eq->damage = 0;
eq->unknown31 = 0;
OUT(spell);
eq->level2 = eq->level;
eq->effect_flag = emu->buff_unknown;
eq->unknown39 = 14;
eq->unknown43 = 0;
eq->unknown44 = 17;
eq->unknown45 = 0;
eq->unknown46 = -1;
eq->unknown50 = 0;
eq->unknown54 = 0;
OUT(spell_level);
OUT(effect_flag);
eq->spell_gem = 0;
eq->slot.Type = INVALID_INDEX;
eq->slot.Unknown02 = 0;
eq->slot.Slot = INVALID_INDEX;
eq->slot.SubIndex = INVALID_INDEX;
eq->slot.AugIndex = INVALID_INDEX;
eq->slot.Unknown01 = 0;
eq->item_cast_type = 0;
FINISH_ENCODE();
}
@@ -520,7 +521,7 @@ namespace RoF
std::string old_message = emu->message;
std::string new_message;
ServerToRoFTextLink(new_message, old_message);
ServerToRoFSayLink(new_message, old_message);
//in->size = strlen(emu->sender) + 1 + strlen(emu->targetname) + 1 + strlen(emu->message) + 1 + 36;
in->size = strlen(emu->sender) + strlen(emu->targetname) + new_message.length() + 39;
@@ -659,8 +660,8 @@ namespace RoF
OUT(spellid);
OUT(damage);
OUT(force);
OUT(meleepush_xy);
OUT(meleepush_z);
OUT(hit_heading);
OUT(hit_pitch);
OUT(special);
FINISH_ENCODE();
@@ -847,7 +848,7 @@ namespace RoF
std::string old_message = emu->message;
std::string new_message;
ServerToRoFTextLink(new_message, old_message);
ServerToRoFSayLink(new_message, old_message);
//if (new_message.length() > 512) // length restricted in packet building function due vari-length name size (no nullterm)
// new_message = new_message.substr(0, 512);
@@ -899,7 +900,7 @@ namespace RoF
for (int i = 0; i < 9; ++i) {
if (old_message_array[i].length() == 0) { break; }
ServerToRoFTextLink(new_message_array[i], old_message_array[i]);
ServerToRoFSayLink(new_message_array[i], old_message_array[i]);
new_message_size += new_message_array[i].length() + 1;
}
@@ -3295,7 +3296,7 @@ namespace RoF
std::string old_message = &emu->message[strlen(emu->sayer)];
std::string new_message;
ServerToRoFTextLink(new_message, old_message);
ServerToRoFSayLink(new_message, old_message);
//in->size = 3 + 4 + 4 + strlen(emu->sayer) + 1 + 12 + new_message.length() + 1;
in->size = strlen(emu->sayer) + new_message.length() + 25;
@@ -3369,7 +3370,7 @@ namespace RoF
std::string old_message = InBuffer; // start 'Reward' as string
std::string new_message;
ServerToRoFTextLink(new_message, old_message);
ServerToRoFSayLink(new_message, old_message);
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct)+
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct)+
@@ -4355,7 +4356,7 @@ namespace RoF
std::string old_message = InBuffer;
std::string new_message;
RoFToServerTextLink(new_message, old_message);
RoFToServerSayLink(new_message, old_message);
//__packet->size = sizeof(ChannelMessage_Struct)+strlen(InBuffer) + 1;
__packet->size = sizeof(ChannelMessage_Struct) + new_message.length() + 1;
@@ -4466,7 +4467,7 @@ namespace RoF
IN(type);
IN(spellid);
IN(damage);
IN(meleepush_xy);
IN(hit_heading);
FINISH_DIRECT_DECODE();
}
@@ -4489,7 +4490,7 @@ namespace RoF
std::string old_message = (char *)&__eq_buffer[4]; // unknown01 offset
std::string new_message;
RoFToServerTextLink(new_message, old_message);
RoFToServerSayLink(new_message, old_message);
__packet->size = sizeof(Emote_Struct);
__packet->pBuffer = new unsigned char[__packet->size];
@@ -5916,19 +5917,19 @@ namespace RoF
return (rofCorpseSlot - 1);
}
static inline void ServerToRoFTextLink(std::string& rofTextLink, const std::string& serverTextLink)
static inline void ServerToRoFSayLink(std::string& rofSayLink, const std::string& serverSayLink)
{
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
rofTextLink = serverTextLink;
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
rofSayLink = serverSayLink;
return;
}
auto segments = SplitString(serverTextLink, '\x12');
auto segments = SplitString(serverSayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) {
rofTextLink.append(segments[segment_iter]);
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
rofSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -5938,36 +5939,36 @@ namespace RoF
// RoF: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX X XXXXX XXXXXXXX (55)
// Diff: ^
rofTextLink.push_back('\x12');
rofTextLink.append(segments[segment_iter].substr(0, 41));
rofSayLink.push_back('\x12');
rofSayLink.append(segments[segment_iter].substr(0, 41));
if (segments[segment_iter][41] == '0')
rofTextLink.push_back(segments[segment_iter][42]);
rofSayLink.push_back(segments[segment_iter][42]);
else
rofTextLink.push_back('F');
rofSayLink.push_back('F');
rofTextLink.append(segments[segment_iter].substr(43));
rofTextLink.push_back('\x12');
rofSayLink.append(segments[segment_iter].substr(43));
rofSayLink.push_back('\x12');
}
else {
rofTextLink.append(segments[segment_iter]);
rofSayLink.append(segments[segment_iter]);
}
}
}
static inline void RoFToServerTextLink(std::string& serverTextLink, const std::string& rofTextLink)
static inline void RoFToServerSayLink(std::string& serverSayLink, const std::string& rofSayLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (rofTextLink.find('\x12') == std::string::npos)) {
serverTextLink = rofTextLink;
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (rofSayLink.find('\x12') == std::string::npos)) {
serverSayLink = rofSayLink;
return;
}
auto segments = SplitString(rofTextLink, '\x12');
auto segments = SplitString(rofSayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -5977,14 +5978,14 @@ namespace RoF
// RoF2: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX XX XXXXX XXXXXXXX (56)
// Diff: ^
serverTextLink.push_back('\x12');
serverTextLink.append(segments[segment_iter].substr(0, 41));
serverTextLink.push_back('0');
serverTextLink.append(segments[segment_iter].substr(41));
serverTextLink.push_back('\x12');
serverSayLink.push_back('\x12');
serverSayLink.append(segments[segment_iter].substr(0, 41));
serverSayLink.push_back('0');
serverSayLink.append(segments[segment_iter].substr(41));
serverSayLink.push_back('\x12');
}
else {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
}
}
}
+46 -45
View File
@@ -57,11 +57,11 @@ namespace RoF2
static inline uint32 RoF2ToServerTypelessSlot(structs::TypelessInventorySlot_Struct rof2Slot);
static inline uint32 RoF2ToServerCorpseSlot(uint32 rof2CorpseSlot);
// server to client text link converter
static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink);
// server to client say link converter
static inline void ServerToRoF2SayLink(std::string& rof2SayLink, const std::string& serverSayLink);
// client to server text link converter
static inline void RoF2ToServerTextLink(std::string& serverTextLink, const std::string& rof2TextLink);
// client to server say link converter
static inline void RoF2ToServerSayLink(std::string& serverSayLink, const std::string& rof2SayLink);
static inline CastingSlot ServerToRoF2CastingSlot(EQEmu::CastingSlot slot);
static inline EQEmu::CastingSlot RoF2ToServerCastingSlot(CastingSlot slot);
@@ -232,22 +232,23 @@ namespace RoF2
OUT(level);
eq->unknown06 = 0;
eq->instrument_mod = 1.0f + (emu->instrument_mod - 10) / 10.0f;
eq->bard_focus_id = emu->bard_focus_id;
eq->knockback_angle = emu->sequence;
eq->unknown22 = 0;
OUT(force);
OUT(hit_heading);
OUT(hit_pitch);
OUT(type);
eq->damage = 0;
eq->unknown31 = 0;
OUT(spell);
eq->level2 = eq->level;
eq->effect_flag = emu->buff_unknown;
eq->unknown39 = 14;
eq->unknown43 = 0;
eq->unknown44 = 17;
eq->unknown45 = 0;
eq->unknown46 = -1;
eq->unknown50 = 0;
eq->unknown54 = 0;
OUT(spell_level);
OUT(effect_flag);
eq->spell_gem = 0;
eq->slot.Type = INVALID_INDEX;
eq->slot.Unknown02 = 0;
eq->slot.Slot = INVALID_INDEX;
eq->slot.SubIndex = INVALID_INDEX;
eq->slot.AugIndex = INVALID_INDEX;
eq->slot.Unknown01 = 0;
eq->item_cast_type = 0;
FINISH_ENCODE();
}
@@ -588,7 +589,7 @@ namespace RoF2
std::string old_message = emu->message;
std::string new_message;
ServerToRoF2TextLink(new_message, old_message);
ServerToRoF2SayLink(new_message, old_message);
//in->size = strlen(emu->sender) + 1 + strlen(emu->targetname) + 1 + strlen(emu->message) + 1 + 36;
in->size = strlen(emu->sender) + strlen(emu->targetname) + new_message.length() + 39;
@@ -727,8 +728,8 @@ namespace RoF2
OUT(spellid);
OUT(damage);
OUT(force);
OUT(meleepush_xy);
OUT(meleepush_z);
OUT(hit_heading);
OUT(hit_pitch);
OUT(special);
FINISH_ENCODE();
@@ -915,7 +916,7 @@ namespace RoF2
std::string old_message = emu->message;
std::string new_message;
ServerToRoF2TextLink(new_message, old_message);
ServerToRoF2SayLink(new_message, old_message);
//if (new_message.length() > 512) // length restricted in packet building function due vari-length name size (no nullterm)
// new_message = new_message.substr(0, 512);
@@ -967,7 +968,7 @@ namespace RoF2
for (int i = 0; i < 9; ++i) {
if (old_message_array[i].length() == 0) { break; }
ServerToRoF2TextLink(new_message_array[i], old_message_array[i]);
ServerToRoF2SayLink(new_message_array[i], old_message_array[i]);
new_message_size += new_message_array[i].length() + 1;
}
@@ -3364,7 +3365,7 @@ namespace RoF2
std::string old_message = &emu->message[strlen(emu->sayer)];
std::string new_message;
ServerToRoF2TextLink(new_message, old_message);
ServerToRoF2SayLink(new_message, old_message);
//in->size = 3 + 4 + 4 + strlen(emu->sayer) + 1 + 12 + new_message.length() + 1;
in->size = strlen(emu->sayer) + new_message.length() + 25;
@@ -3438,7 +3439,7 @@ namespace RoF2
std::string old_message = InBuffer; // start 'Reward' as string
std::string new_message;
ServerToRoF2TextLink(new_message, old_message);
ServerToRoF2SayLink(new_message, old_message);
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct)+
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct)+
@@ -4595,7 +4596,7 @@ namespace RoF2
std::string old_message = InBuffer;
std::string new_message;
RoF2ToServerTextLink(new_message, old_message);
RoF2ToServerSayLink(new_message, old_message);
//__packet->size = sizeof(ChannelMessage_Struct)+strlen(InBuffer) + 1;
__packet->size = sizeof(ChannelMessage_Struct) + new_message.length() + 1;
@@ -4706,7 +4707,7 @@ namespace RoF2
IN(type);
IN(spellid);
IN(damage);
IN(meleepush_xy);
IN(hit_heading);
FINISH_DIRECT_DECODE();
}
@@ -4729,7 +4730,7 @@ namespace RoF2
std::string old_message = (char *)&__eq_buffer[4]; // unknown01 offset
std::string new_message;
RoF2ToServerTextLink(new_message, old_message);
RoF2ToServerSayLink(new_message, old_message);
__packet->size = sizeof(Emote_Struct);
__packet->pBuffer = new unsigned char[__packet->size];
@@ -6233,19 +6234,19 @@ namespace RoF2
return (rof2CorpseSlot + EQEmu::legacy::CORPSE_BEGIN - 1);
}
static inline void ServerToRoF2TextLink(std::string& rof2TextLink, const std::string& serverTextLink)
static inline void ServerToRoF2SayLink(std::string& rof2SayLink, const std::string& serverSayLink)
{
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
rof2TextLink = serverTextLink;
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
rof2SayLink = serverSayLink;
return;
}
auto segments = SplitString(serverTextLink, '\x12');
auto segments = SplitString(serverSayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) {
rof2TextLink.append(segments[segment_iter]);
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
rof2SayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -6255,29 +6256,29 @@ namespace RoF2
// RoF2: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX XX XXXXX XXXXXXXX (56)
// Diff:
rof2TextLink.push_back('\x12');
rof2TextLink.append(segments[segment_iter]);
rof2TextLink.push_back('\x12');
rof2SayLink.push_back('\x12');
rof2SayLink.append(segments[segment_iter]);
rof2SayLink.push_back('\x12');
}
else {
rof2TextLink.append(segments[segment_iter]);
rof2SayLink.append(segments[segment_iter]);
}
}
}
static inline void RoF2ToServerTextLink(std::string& serverTextLink, const std::string& rof2TextLink)
static inline void RoF2ToServerSayLink(std::string& serverSayLink, const std::string& rof2SayLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (rof2TextLink.find('\x12') == std::string::npos)) {
serverTextLink = rof2TextLink;
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (rof2SayLink.find('\x12') == std::string::npos)) {
serverSayLink = rof2SayLink;
return;
}
auto segments = SplitString(rof2TextLink, '\x12');
auto segments = SplitString(rof2SayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -6287,12 +6288,12 @@ namespace RoF2
// RoF2: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX XX XXXXX XXXXXXXX (56)
// Diff:
serverTextLink.push_back('\x12');
serverTextLink.append(segments[segment_iter]);
serverTextLink.push_back('\x12');
serverSayLink.push_back('\x12');
serverSayLink.append(segments[segment_iter]);
serverSayLink.push_back('\x12');
}
else {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
}
}
}
+57 -58
View File
@@ -430,7 +430,7 @@ struct Spawn_Struct
/*0000*/ //uint8 nullterm1; // hack to null terminate name
/*0064*/ uint32 spawnId;
/*0068*/ uint8 level;
/*0069*/ float unknown1;
/*0069*/ float bounding_radius; // used in melee, overrides calc
/*0073*/ uint8 NPC; // 0=player,1=npc,2=pc corpse,3=npc corpse
Spawn_Struct_Bitfields Bitfields;
/*0000*/ uint8 otherData; // & 4 - has title, & 8 - has suffix, & 1 - it's a chest or untargetable
@@ -1462,17 +1462,17 @@ struct Action_Struct
{
/*00*/ uint16 target; // id of target
/*02*/ uint16 source; // id of caster
/*04*/ uint16 level; // level of caster - Seen 0
/*06*/ uint32 unknown06;
/*04*/ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/*06*/ uint32 unknown06; // OSX dump says base_damage, was used for bard mod too, this is 0'd :(
/*10*/ float instrument_mod;
/*14*/ uint32 bard_focus_id; // seen 0
/*18*/ float knockback_angle; //seems to go from 0-512 then it rolls over again
/*22*/ uint32 unknown22;
/*26*/ uint8 type;
/*27*/ uint32 damage;
/*31*/ uint16 unknown31;
/*14*/ float force;
/*18*/ float hit_heading;
/*22*/ float hit_pitch;
/*26*/ uint8 type; // 231 (0xE7) for spells, skill
/*27*/ uint32 damage; // OSX says min_damage
/*31*/ uint16 unknown31; // OSX says tohit
/*33*/ uint32 spell; // spell id being cast
/*37*/ uint8 level2; // level of caster again? Or maybe the castee
/*37*/ uint8 spell_level; // level of caster again? Or maybe the castee
/*38*/ uint8 effect_flag; // if this is 4, the effect is valid: or if two are sent at the same time?
/*39*/
};
@@ -1484,25 +1484,21 @@ struct ActionAlt_Struct
{
/*00*/ uint16 target; // id of target
/*02*/ uint16 source; // id of caster
/*04*/ uint16 level; // level of caster - Seen 0
/*06*/ uint32 unknown06;
/*04*/ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/*06*/ uint32 unknown06; // OSX dump says base_damage, was used for bard mod too, this is 0'd :(
/*10*/ float instrument_mod;
/*14*/ uint32 bard_focus_id; // seen 0
/*18*/ float knockback_angle; //seems to go from 0-512 then it rolls over again
/*22*/ uint32 unknown22;
/*26*/ uint8 type;
/*27*/ uint32 damage;
/*31*/ uint16 unknown31;
/*14*/ float force;
/*18*/ float hit_heading;
/*22*/ float hit_pitch;
/*26*/ uint8 type; // 231 (0xE7) for spells, skill
/*27*/ uint32 damage; // OSX says min_damage
/*31*/ uint16 unknown31; // OSX says tohit
/*33*/ uint32 spell; // spell id being cast
/*37*/ uint8 level2; // level of caster again? Or maybe the castee
/*37*/ uint8 spell_level; // level of caster again? Or maybe the castee
/*38*/ uint8 effect_flag; // if this is 4, the effect is valid: or if two are sent at the same time?
/*39*/ uint32 unknown39; // New field to Underfoot - Seen 14
/*43*/ uint8 unknown43; // New field to Underfoot - Seen 0
/*44*/ uint8 unknown44; // New field to Underfoot - Seen 17
/*45*/ uint8 unknown45; // New field to Underfoot - Seen 0
/*46*/ int32 unknown46; // New field to Underfoot - Seen -1
/*50*/ uint32 unknown50; // New field to Underfoot - Seen 0
/*54*/ uint16 unknown54; // New field to Underfoot - Seen 0
/*39*/ uint8 spell_gem;
/*40*/ InventorySlot_Struct slot;
/*52*/ uint32 item_cast_type; // ItemSpellTypes enum from MQ2
/*56*/
};
@@ -1517,9 +1513,9 @@ struct CombatDamage_Struct
/* 05 */ uint32 spellid;
/* 09 */ int32 damage;
/* 13 */ float force; // cd cc cc 3d
/* 17 */ float meleepush_xy; // see above notes in Action_Struct
/* 21 */ float meleepush_z;
/* 25 */ uint8 unknown25; // was [9]
/* 17 */ float hit_heading; // see above notes in Action_Struct
/* 21 */ float hit_pitch;
/* 25 */ uint8 secondary; // 0 for primary hand, 1 for secondary
/* 26 */ uint32 special; // 2 = Rampage, 1 = Wild Rampage
/* 30 */
};
@@ -3605,21 +3601,6 @@ struct GuildSetRank_Struct
/*80*/
};
struct BugStruct{
/*0000*/ char chartype[64];
/*0064*/ char name[96];
/*0160*/ char ui[128];
/*0288*/ float x;
/*0292*/ float y;
/*0296*/ float z;
/*0300*/ float heading;
/*0304*/ uint32 unknown304;
/*0308*/ uint32 type;
/*0312*/ char unknown312[2144];
/*2456*/ char bug[1024];
/*3480*/ char placeholder[2];
/*3482*/ char system_info[4098];
};
struct Make_Pet_Struct { //Simple struct for getting pet info
uint8 level;
uint8 class_;
@@ -3646,20 +3627,21 @@ struct Ground_Spawn{
struct Ground_Spawns {
struct Ground_Spawn spawn[50]; //Assigned max number to allow
};
struct PetitionBug_Struct{
uint32 petition_number;
uint32 unknown4;
char accountname[64];
uint32 zoneid;
char name[64];
uint32 level;
uint32 class_;
uint32 race;
uint32 unknown152[3];
uint32 time;
uint32 unknown168;
char text[1028];
};
//struct PetitionBug_Struct{
// uint32 petition_number;
// uint32 unknown4;
// char accountname[64];
// uint32 zoneid;
// char name[64];
// uint32 level;
// uint32 class_;
// uint32 race;
// uint32 unknown152[3];
// uint32 time;
// uint32 unknown168;
// char text[1028];
//};
struct ApproveZone_Struct {
char name[64];
@@ -5103,6 +5085,23 @@ struct CrystalCountUpdate_Struct
/*012*/ uint32 CareerEbonCrystals;
};
struct SayLinkBodyFrame_Struct {
/*000*/ char ActionID[1];
/*001*/ char ItemID[5];
/*006*/ char Augment1[5];
/*011*/ char Augment2[5];
/*016*/ char Augment3[5];
/*021*/ char Augment4[5];
/*026*/ char Augment5[5];
/*031*/ char Augment6[5];
/*036*/ char IsEvolving[1];
/*037*/ char EvolveGroup[4];
/*041*/ char EvolveLevel[2];
/*043*/ char OrnamentIcon[5];
/*048*/ char Hash[8];
/*056*/
};
}; /*structs*/
}; /*RoF2*/
+57 -58
View File
@@ -408,7 +408,7 @@ struct Spawn_Struct
/*0000*/ //uint8 nullterm1; // hack to null terminate name
/*0064*/ uint32 spawnId;
/*0068*/ uint8 level;
/*0069*/ float unknown1;
/*0069*/ float bounding_radius; // used in melee, overrides calc
/*0073*/ uint8 NPC; // 0=player,1=npc,2=pc corpse,3=npc corpse
Spawn_Struct_Bitfields Bitfields;
/*0000*/ uint8 otherData; // & 4 - has title, & 8 - has suffix, & 1 - it's a chest or untargetable
@@ -1450,17 +1450,17 @@ struct Action_Struct
{
/*00*/ uint16 target; // id of target
/*02*/ uint16 source; // id of caster
/*04*/ uint16 level; // level of caster - Seen 0
/*06*/ uint32 unknown06;
/*04*/ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/*06*/ uint32 unknown06; // OSX dump says base_damage, was used for bard mod too, this is 0'd :(
/*10*/ float instrument_mod;
/*14*/ uint32 bard_focus_id; // seen 0
/*18*/ float knockback_angle; //seems to go from 0-512 then it rolls over again
/*22*/ uint32 unknown22;
/*26*/ uint8 type;
/*27*/ uint32 damage;
/*31*/ uint16 unknown31;
/*14*/ float force;
/*18*/ float hit_heading;
/*22*/ float hit_pitch;
/*26*/ uint8 type; // 231 (0xE7) for spells, skill
/*27*/ uint32 damage; // OSX says min_damage
/*31*/ uint16 unknown31; // OSX says tohit
/*33*/ uint32 spell; // spell id being cast
/*37*/ uint8 level2; // level of caster again? Or maybe the castee
/*37*/ uint8 spell_level; // level of caster again? Or maybe the castee
/*38*/ uint8 effect_flag; // if this is 4, the effect is valid: or if two are sent at the same time?
/*39*/
};
@@ -1472,25 +1472,21 @@ struct ActionAlt_Struct
{
/*00*/ uint16 target; // id of target
/*02*/ uint16 source; // id of caster
/*04*/ uint16 level; // level of caster - Seen 0
/*06*/ uint32 unknown06;
/*04*/ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/*06*/ uint32 unknown06; // OSX dump says base_damage, was used for bard mod too, this is 0'd :(
/*10*/ float instrument_mod;
/*14*/ uint32 bard_focus_id; // seen 0
/*18*/ float knockback_angle; //seems to go from 0-512 then it rolls over again
/*22*/ uint32 unknown22;
/*26*/ uint8 type;
/*27*/ uint32 damage;
/*31*/ uint16 unknown31;
/*14*/ float force;
/*18*/ float hit_heading;
/*22*/ float hit_pitch;
/*26*/ uint8 type; // 231 (0xE7) for spells, skill
/*27*/ uint32 damage; // OSX says min_damage
/*31*/ uint16 unknown31; // OSX says tohit
/*33*/ uint32 spell; // spell id being cast
/*37*/ uint8 level2; // level of caster again? Or maybe the castee
/*37*/ uint8 spell_level; // level of caster again? Or maybe the castee
/*38*/ uint8 effect_flag; // if this is 4, the effect is valid: or if two are sent at the same time?
/*39*/ uint32 unknown39; // New field to Underfoot - Seen 14
/*43*/ uint8 unknown43; // New field to Underfoot - Seen 0
/*44*/ uint8 unknown44; // New field to Underfoot - Seen 17
/*45*/ uint8 unknown45; // New field to Underfoot - Seen 0
/*46*/ int32 unknown46; // New field to Underfoot - Seen -1
/*50*/ uint32 unknown50; // New field to Underfoot - Seen 0
/*54*/ uint16 unknown54; // New field to Underfoot - Seen 0
/*39*/ uint8 spell_gem;
/*40*/ InventorySlot_Struct slot;
/*52*/ uint32 item_cast_type; // ItemSpellTypes enum from MQ2
/*56*/
};
@@ -1505,9 +1501,9 @@ struct CombatDamage_Struct
/* 05 */ uint32 spellid;
/* 09 */ int32 damage;
/* 13 */ float force; // cd cc cc 3d
/* 17 */ float meleepush_xy; // see above notes in Action_Struct
/* 21 */ float meleepush_z;
/* 25 */ uint8 unknown25; // was [9]
/* 17 */ float hit_heading; // see above notes in Action_Struct
/* 21 */ float hit_pitch;
/* 25 */ uint8 secondary; // 0 for primary hand, 1 for secondary
/* 26 */ uint32 special; // 2 = Rampage, 1 = Wild Rampage
/* 30 */
};
@@ -3545,21 +3541,6 @@ struct GuildSetRank_Struct
/*80*/
};
struct BugStruct{
/*0000*/ char chartype[64];
/*0064*/ char name[96];
/*0160*/ char ui[128];
/*0288*/ float x;
/*0292*/ float y;
/*0296*/ float z;
/*0300*/ float heading;
/*0304*/ uint32 unknown304;
/*0308*/ uint32 type;
/*0312*/ char unknown312[2144];
/*2456*/ char bug[1024];
/*3480*/ char placeholder[2];
/*3482*/ char system_info[4098];
};
struct Make_Pet_Struct { //Simple struct for getting pet info
uint8 level;
uint8 class_;
@@ -3586,20 +3567,21 @@ struct Ground_Spawn{
struct Ground_Spawns {
struct Ground_Spawn spawn[50]; //Assigned max number to allow
};
struct PetitionBug_Struct{
uint32 petition_number;
uint32 unknown4;
char accountname[64];
uint32 zoneid;
char name[64];
uint32 level;
uint32 class_;
uint32 race;
uint32 unknown152[3];
uint32 time;
uint32 unknown168;
char text[1028];
};
//struct PetitionBug_Struct{
// uint32 petition_number;
// uint32 unknown4;
// char accountname[64];
// uint32 zoneid;
// char name[64];
// uint32 level;
// uint32 class_;
// uint32 race;
// uint32 unknown152[3];
// uint32 time;
// uint32 unknown168;
// char text[1028];
//};
struct ApproveZone_Struct {
char name[64];
@@ -5020,6 +5002,23 @@ struct MercenaryMerchantRequest_Struct {
struct MercenaryMerchantResponse_Struct {
/*0000*/ uint32 ResponseType;
/*0004*/
};
struct SayLinkBodyFrame_Struct {
/*000*/ char ActionID[1];
/*001*/ char ItemID[5];
/*006*/ char Augment1[5];
/*011*/ char Augment2[5];
/*016*/ char Augment3[5];
/*021*/ char Augment4[5];
/*026*/ char Augment5[5];
/*031*/ char Augment6[5];
/*036*/ char IsEvolving[1];
/*037*/ char EvolveGroup[4];
/*041*/ char EvolveLevel[1];
/*042*/ char OrnamentIcon[5];
/*047*/ char Hash[8];
/*055*/
};
}; /*structs*/
+45 -65
View File
@@ -53,11 +53,11 @@ namespace SoD
static inline uint32 SoDToServerSlot(uint32 sodSlot);
static inline uint32 SoDToServerCorpseSlot(uint32 sodCorpseSlot);
// server to client text link converter
static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink);
// server to client say link converter
static inline void ServerToSoDSayLink(std::string& sodSayLink, const std::string& serverSayLink);
// client to server text link converter
static inline void SoDToServerTextLink(std::string& serverTextLink, const std::string& sodTextLink);
// client to server say link converter
static inline void SoDToServerSayLink(std::string& serverSayLink, const std::string& sodSayLink);
static inline CastingSlot ServerToSoDCastingSlot(EQEmu::CastingSlot slot);
static inline EQEmu::CastingSlot SoDToServerCastingSlot(CastingSlot slot);
@@ -161,15 +161,14 @@ namespace SoD
OUT(source);
OUT(level);
OUT(instrument_mod);
eq->sequence = emu->sequence;
OUT(force);
OUT(hit_heading);
OUT(hit_pitch);
OUT(type);
//OUT(damage);
OUT(spell);
eq->level2 = emu->level;
OUT(buff_unknown); // if this is 4, a buff icon is made
//eq->unknown0036 = -1;
//eq->unknown0040 = -1;
//eq->unknown0044 = -1;
OUT(spell_level);
OUT(effect_flag); // if this is 4, a buff icon is made
FINISH_ENCODE();
}
@@ -346,7 +345,7 @@ namespace SoD
std::string old_message = emu->message;
std::string new_message;
ServerToSoDTextLink(new_message, old_message);
ServerToSoDSayLink(new_message, old_message);
in->size = sizeof(ChannelMessage_Struct) + new_message.length() + 1;
@@ -458,8 +457,8 @@ namespace SoD
OUT(spellid);
OUT(damage);
OUT(force);
OUT(meleepush_xy);
OUT(meleepush_z);
OUT(hit_heading);
OUT(hit_pitch);
OUT(special);
FINISH_ENCODE();
@@ -625,7 +624,7 @@ namespace SoD
std::string old_message = emu->message;
std::string new_message;
ServerToSoDTextLink(new_message, old_message);
ServerToSoDSayLink(new_message, old_message);
//if (new_message.length() > 512) // length restricted in packet building function due vari-length name size (no nullterm)
// new_message = new_message.substr(0, 512);
@@ -677,7 +676,7 @@ namespace SoD
for (int i = 0; i < 9; ++i) {
if (old_message_array[i].length() == 0) { break; }
ServerToSoDTextLink(new_message_array[i], old_message_array[i]);
ServerToSoDSayLink(new_message_array[i], old_message_array[i]);
new_message_size += new_message_array[i].length() + 1;
}
@@ -2156,7 +2155,7 @@ namespace SoD
std::string old_message = &emu->message[strlen(emu->sayer)];
std::string new_message;
ServerToSoDTextLink(new_message, old_message);
ServerToSoDSayLink(new_message, old_message);
//in->size = 3 + 4 + 4 + strlen(emu->sayer) + 1 + 12 + new_message.length() + 1;
in->size = strlen(emu->sayer) + new_message.length() + 25;
@@ -2252,7 +2251,7 @@ namespace SoD
std::string old_message = InBuffer; // start 'Reward' as string
std::string new_message;
ServerToSoDTextLink(new_message, old_message);
ServerToSoDSayLink(new_message, old_message);
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct)+
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct)+
@@ -2933,25 +2932,6 @@ namespace SoD
FINISH_DIRECT_DECODE();
}
DECODE(OP_Bug)
{
DECODE_LENGTH_EXACT(structs::BugStruct);
SETUP_DIRECT_DECODE(BugStruct, structs::BugStruct);
strn0cpy(emu->chartype, eq->chartype, sizeof(emu->chartype));
strn0cpy(emu->name, eq->name, sizeof(emu->name));
strn0cpy(emu->ui, eq->ui, sizeof(emu->ui));
IN(x);
IN(y);
IN(z);
IN(heading);
strn0cpy(emu->target_name, eq->target_name, sizeof(emu->target_name));
strn0cpy(emu->bug, eq->bug, sizeof(emu->bug));
strn0cpy(emu->system_info, eq->system_info, sizeof(emu->system_info));
FINISH_DIRECT_DECODE();
}
DECODE(OP_CastSpell)
{
DECODE_LENGTH_EXACT(structs::CastSpell_Struct);
@@ -2972,7 +2952,7 @@ namespace SoD
std::string old_message = (char *)&__eq_buffer[sizeof(ChannelMessage_Struct)];
std::string new_message;
SoDToServerTextLink(new_message, old_message);
SoDToServerSayLink(new_message, old_message);
__packet->size = sizeof(ChannelMessage_Struct) + new_message.length() + 1;
__packet->pBuffer = new unsigned char[__packet->size];
@@ -3086,7 +3066,7 @@ namespace SoD
std::string old_message = (char *)&__eq_buffer[4]; // unknown01 offset
std::string new_message;
SoDToServerTextLink(new_message, old_message);
SoDToServerSayLink(new_message, old_message);
__packet->size = sizeof(Emote_Struct);
__packet->pBuffer = new unsigned char[__packet->size];
@@ -3936,19 +3916,19 @@ namespace SoD
return (sodCorpseSlot - 1);
}
static inline void ServerToSoDTextLink(std::string& sodTextLink, const std::string& serverTextLink)
static inline void ServerToSoDSayLink(std::string& sodSayLink, const std::string& serverSayLink)
{
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
sodTextLink = serverTextLink;
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
sodSayLink = serverSayLink;
return;
}
auto segments = SplitString(serverTextLink, '\x12');
auto segments = SplitString(serverSayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) {
sodTextLink.append(segments[segment_iter]);
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
sodSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -3958,37 +3938,37 @@ namespace SoD
// SoF: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX X XXXXX XXXXXXXX (50)
// Diff: ^^^^^ ^
sodTextLink.push_back('\x12');
sodTextLink.append(segments[segment_iter].substr(0, 31));
sodTextLink.append(segments[segment_iter].substr(36, 5));
sodSayLink.push_back('\x12');
sodSayLink.append(segments[segment_iter].substr(0, 31));
sodSayLink.append(segments[segment_iter].substr(36, 5));
if (segments[segment_iter][41] == '0')
sodTextLink.push_back(segments[segment_iter][42]);
sodSayLink.push_back(segments[segment_iter][42]);
else
sodTextLink.push_back('F');
sodSayLink.push_back('F');
sodTextLink.append(segments[segment_iter].substr(43));
sodTextLink.push_back('\x12');
sodSayLink.append(segments[segment_iter].substr(43));
sodSayLink.push_back('\x12');
}
else {
sodTextLink.append(segments[segment_iter]);
sodSayLink.append(segments[segment_iter]);
}
}
}
static inline void SoDToServerTextLink(std::string& serverTextLink, const std::string& sodTextLink)
static inline void SoDToServerSayLink(std::string& serverSayLink, const std::string& sodSayLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (sodTextLink.find('\x12') == std::string::npos)) {
serverTextLink = sodTextLink;
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (sodSayLink.find('\x12') == std::string::npos)) {
serverSayLink = sodSayLink;
return;
}
auto segments = SplitString(sodTextLink, '\x12');
auto segments = SplitString(sodSayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -3998,16 +3978,16 @@ namespace SoD
// RoF2: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX XX XXXXX XXXXXXXX (56)
// Diff: ^^^^^ ^
serverTextLink.push_back('\x12');
serverTextLink.append(segments[segment_iter].substr(0, 31));
serverTextLink.append("00000");
serverTextLink.append(segments[segment_iter].substr(31, 5));
serverTextLink.push_back('0');
serverTextLink.append(segments[segment_iter].substr(36));
serverTextLink.push_back('\x12');
serverSayLink.push_back('\x12');
serverSayLink.append(segments[segment_iter].substr(0, 31));
serverSayLink.append("00000");
serverSayLink.append(segments[segment_iter].substr(31, 5));
serverSayLink.push_back('0');
serverSayLink.append(segments[segment_iter].substr(36));
serverSayLink.push_back('\x12');
}
else {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
}
}
}
-1
View File
@@ -104,7 +104,6 @@ D(OP_AugmentInfo)
D(OP_AugmentItem)
D(OP_BazaarSearch)
D(OP_Buff)
D(OP_Bug)
D(OP_CastSpell)
D(OP_ChannelMessage)
D(OP_CharacterCreate)
+62 -68
View File
@@ -292,7 +292,7 @@ struct Spawn_Struct
/*0000*/ //uint8 nullterm1; // hack to null terminate name
/*0064*/ uint32 spawnId;
/*0068*/ uint8 level;
/*0069*/ float unknown1;
/*0069*/ float bounding_radius; // used in melee, overrides calc
/*0073*/ uint8 NPC; // 0=player,1=npc,2=pc corpse,3=npc corpse
Spawn_Struct_Bitfields Bitfields;
/*0000*/ uint8 otherData; // & 4 - has title, & 8 - has suffix, & 1 - it's a chest or untargetable
@@ -1215,20 +1215,18 @@ struct Action_Struct
{
/* 00 */ uint16 target; // id of target
/* 02 */ uint16 source; // id of caster
/* 04 */ uint16 level; // level of caster
/* 06 */ uint16 instrument_mod; // seems to be fixed to 0x0A
/* 08 */ uint32 unknown08;
/* 12 */ uint16 unknown16;
// some kind of sequence that's the same in both actions
// as well as the combat damage, to tie em together?
/* 14 */ float sequence; // was uint32
/* 18 */ uint32 unknown18;
/* 22 */ uint8 type; // 231 (0xE7) for spells
/* 23 */ uint32 unknown23;
/* 04 */ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/* 06 */ uint32 instrument_mod; // OSX dump says base damage, spells use it for bard song (different from newer clients)
/* 10 */ float force;
/* 14 */ float hit_heading;
/* 18 */ float hit_pitch;
/* 22 */ uint8 type; // 231 (0xE7) for spells, skill
/* 23 */ uint16 unknown23; // OSX says min_damage
/* 25 */ uint16 unknown25; // OSX says tohit
/* 27 */ uint16 spell; // spell id being cast
/* 29 */ uint8 level2; // level of caster again? Or maybe the castee
/* 29 */ uint8 spell_level; // level of caster again? Or maybe the castee
// this field seems to be some sort of success flag, if it's 4
/* 30 */ uint8 buff_unknown; // if this is 4, a buff icon is made
/* 30 */ uint8 effect_flag; // if this is 4, a buff icon is made
/* 31 */
};
@@ -1237,26 +1235,23 @@ struct Action_Struct
// has to do with buff blocking??
struct ActionAlt_Struct // ActionAlt_Struct - Size: 56 bytes
{
/*0000*/ uint16 target; // Target ID
/*0002*/ uint16 source; // SourceID
/*0004*/ uint16 level; // level of caster
/*0006*/ uint16 instrument_mod; // seems to be fixed to 0x0A
/*0008*/ uint32 unknown08;
/*0012*/ uint16 unknown16;
/*0014*/ uint32 sequence;
/*0018*/ uint32 unknown18;
/*0022*/ uint8 type; // Casts, Falls, Bashes, etc...
/*0023*/ uint32 damage; // Amount of Damage
/*0027*/ uint16 spell; // SpellID
/*0029*/ uint8 unknown29;
/*0030*/ uint8 buff_unknown; // if this is 4, a buff icon is made
/*0031*/ uint32 unknown0031; // seen 00 00 00 00
/*0035*/ uint8 unknown0035; // seen 00
/*0036*/ uint32 unknown0036; // seen ff ff ff ff
/*0040*/ uint32 unknown0040; // seen ff ff ff ff
/*0044*/ uint32 unknown0044; // seen ff ff ff ff
/*0048*/ uint32 unknown0048; // seen 00 00 00 00
/*0052*/ uint32 unknown0052; // seen 00 00 00 00
/*0000*/ uint16 target; // id of target
/*0002*/ uint16 source; // id of caster
/*0004*/ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/*0006*/ uint32 instrument_mod; // OSX dump says base damage, spells use it for bard song (different from newer clients)
/*0010*/ float force;
/*0014*/ float hit_heading;
/*0018*/ float hit_pitch;
/*0022*/ uint8 type; // 231 (0xE7) for spells, skill
/*0023*/ uint16 unknown23; // OSX says min_damage
/*0025*/ uint16 unknown25; // OSX says tohit
/*0027*/ uint16 spell; // spell id being cast
/*0029*/ uint8 spell_level; // level of caster again? Or maybe the castee
// this field seems to be some sort of success flag, if it's 4
/*0030*/ uint8 effect_flag; // if this is 4, a buff icon is made
/*0031*/ uint8 spell_slot;
/*0032*/ uint32 slot[5];
/*0052*/ uint32 item_cast_type; // ItemSpellTypes enum from MQ2
/*0056*/
};
@@ -1271,9 +1266,9 @@ struct CombatDamage_Struct
/* 05 */ uint16 spellid;
/* 07 */ int32 damage;
/* 11 */ float force; // cd cc cc 3d
/* 15 */ float meleepush_xy; // see above notes in Action_Struct
/* 19 */ float meleepush_z;
/* 23 */ uint8 unknown23; // was [9]
/* 15 */ float hit_heading; // see above notes in Action_Struct
/* 19 */ float hit_pitch;
/* 23 */ uint8 secondary; // 0 for primary hand, 1 for secondary
/* 24 */ uint32 special; // 2 = Rampage, 1 = Wild Rampage
/* 28 */
};
@@ -3008,24 +3003,6 @@ struct GuildMakeLeader{
char target[64];
};
struct BugStruct{
/*0000*/ uint32 type1; //seems to be just a different way of seeing type; seems to be ordered completely differently
/*0004*/ char chartype[64];
/*0068*/ char name[96];
/*0164*/ char ui[128];
/*0292*/ float x;
/*0296*/ float y;
/*0300*/ float z;
/*0304*/ float heading;
/*0308*/ uint32 unknown304;
/*0312*/ char unknown308[160];
/*0472*/ char target_name[64];
/*0536*/ uint32 type;
/*0540*/ char unknown536[2052];
/*2588*/ char bug[2048];
/*4636*/ char unknown4632[6];
/*4642*/ char system_info[4094];
};
struct Make_Pet_Struct { //Simple struct for getting pet info
uint8 level;
uint8 class_;
@@ -3052,20 +3029,21 @@ struct Ground_Spawn{
struct Ground_Spawns {
struct Ground_Spawn spawn[50]; //Assigned max number to allow
};
struct PetitionBug_Struct{
uint32 petition_number;
uint32 unknown4;
char accountname[64];
uint32 zoneid;
char name[64];
uint32 level;
uint32 class_;
uint32 race;
uint32 unknown152[3];
uint32 time;
uint32 unknown168;
char text[1028];
};
//struct PetitionBug_Struct{
// uint32 petition_number;
// uint32 unknown4;
// char accountname[64];
// uint32 zoneid;
// char name[64];
// uint32 level;
// uint32 class_;
// uint32 race;
// uint32 unknown152[3];
// uint32 time;
// uint32 unknown168;
// char text[1028];
//};
struct ApproveZone_Struct {
char name[64];
@@ -4402,6 +4380,22 @@ struct MercenaryAssign_Struct {
/*0004*/ uint32 MercUnk01; //
/*0008*/ uint32 MercUnk02; //
/*0012*/
};
struct SayLinkBodyFrame_Struct {
/*000*/ char ActionID[1];
/*001*/ char ItemID[5];
/*006*/ char Augment1[5];
/*011*/ char Augment2[5];
/*016*/ char Augment3[5];
/*021*/ char Augment4[5];
/*026*/ char Augment5[5];
/*031*/ char IsEvolving[1];
/*032*/ char EvolveGroup[4];
/*036*/ char EvolveLevel[1];
/*037*/ char OrnamentIcon[5];
/*042*/ char Hash[8];
/*050*/
};
}; /*structs*/
+56 -46
View File
@@ -53,11 +53,11 @@ namespace SoF
static inline uint32 SoFToServerSlot(uint32 sofSlot);
static inline uint32 SoFToServerCorpseSlot(uint32 sofCorpseSlot);
// server to client text link converter
static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink);
// server to client say link converter
static inline void ServerToSoFSayLink(std::string& sofSayLink, const std::string& serverSayLink);
// client to server text link converter
static inline void SoFToServerTextLink(std::string& serverTextLink, const std::string& sofTextLink);
// client to server say link converter
static inline void SoFToServerSayLink(std::string& serverSayLink, const std::string& sofSayLink);
static inline CastingSlot ServerToSoFCastingSlot(EQEmu::CastingSlot slot);
static inline EQEmu::CastingSlot SoFToServerCastingSlot(CastingSlot slot, uint32 itemlocation);
@@ -161,15 +161,14 @@ namespace SoF
OUT(source);
OUT(level);
OUT(instrument_mod);
eq->sequence = emu->sequence;
OUT(force);
OUT(hit_heading);
OUT(hit_pitch);
OUT(type);
//OUT(damage);
OUT(spell);
eq->level2 = emu->level;
OUT(buff_unknown); // if this is 4, a buff icon is made
//eq->unknown0036 = -1;
//eq->unknown0040 = -1;
//eq->unknown0044 = -1;
OUT(spell_level);
OUT(effect_flag); // if this is 4, a buff icon is made
FINISH_ENCODE();
}
@@ -328,7 +327,7 @@ namespace SoF
std::string old_message = emu->message;
std::string new_message;
ServerToSoFTextLink(new_message, old_message);
ServerToSoFSayLink(new_message, old_message);
in->size = sizeof(ChannelMessage_Struct) + new_message.length() + 1;
@@ -440,8 +439,8 @@ namespace SoF
OUT(spellid);
OUT(damage);
OUT(force);
OUT(meleepush_xy);
OUT(meleepush_z);
OUT(hit_heading);
OUT(hit_pitch);
FINISH_ENCODE();
}
@@ -613,7 +612,7 @@ namespace SoF
std::string old_message = emu->message;
std::string new_message;
ServerToSoFTextLink(new_message, old_message);
ServerToSoFSayLink(new_message, old_message);
//if (new_message.length() > 512) // length restricted in packet building function due vari-length name size (no nullterm)
// new_message = new_message.substr(0, 512);
@@ -665,7 +664,7 @@ namespace SoF
for (int i = 0; i < 9; ++i) {
if (old_message_array[i].length() == 0) { break; }
ServerToSoFTextLink(new_message_array[i], old_message_array[i]);
ServerToSoFSayLink(new_message_array[i], old_message_array[i]);
new_message_size += new_message_array[i].length() + 1;
}
@@ -1814,7 +1813,7 @@ namespace SoF
std::string old_message = &emu->message[strlen(emu->sayer)];
std::string new_message;
ServerToSoFTextLink(new_message, old_message);
ServerToSoFSayLink(new_message, old_message);
//in->size = 3 + 4 + 4 + strlen(emu->sayer) + 1 + 12 + new_message.length() + 1;
in->size = strlen(emu->sayer) + new_message.length() + 25;
@@ -1882,7 +1881,7 @@ namespace SoF
std::string old_message = InBuffer; // start 'Reward' as string
std::string new_message;
ServerToSoFTextLink(new_message, old_message);
ServerToSoFSayLink(new_message, old_message);
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct)+
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct)+
@@ -2385,6 +2384,17 @@ namespace SoF
FINISH_DIRECT_DECODE();
}
DECODE(OP_Bug)
{
DECODE_LENGTH_EXACT(structs::BugReport_Struct);
SETUP_DIRECT_DECODE(BugReport_Struct, structs::BugReport_Struct);
emu->category_id = EQEmu::bug::CategoryNameToCategoryID(eq->category_name);
memcpy(emu->category_name, eq, sizeof(structs::BugReport_Struct));
FINISH_DIRECT_DECODE();
}
DECODE(OP_CastSpell)
{
DECODE_LENGTH_EXACT(structs::CastSpell_Struct);
@@ -2404,7 +2414,7 @@ namespace SoF
std::string old_message = (char *)&__eq_buffer[sizeof(ChannelMessage_Struct)];
std::string new_message;
SoFToServerTextLink(new_message, old_message);
SoFToServerSayLink(new_message, old_message);
__packet->size = sizeof(ChannelMessage_Struct) + new_message.length() + 1;
__packet->pBuffer = new unsigned char[__packet->size];
@@ -2518,7 +2528,7 @@ namespace SoF
std::string old_message = (char *)&__eq_buffer[4]; // unknown01 offset
std::string new_message;
SoFToServerTextLink(new_message, old_message);
SoFToServerSayLink(new_message, old_message);
__packet->size = sizeof(Emote_Struct);
__packet->pBuffer = new unsigned char[__packet->size];
@@ -3305,19 +3315,19 @@ namespace SoF
return (sofCorpseSlot - 1);
}
static inline void ServerToSoFTextLink(std::string& sofTextLink, const std::string& serverTextLink)
static inline void ServerToSoFSayLink(std::string& sofSayLink, const std::string& serverSayLink)
{
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
sofTextLink = serverTextLink;
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
sofSayLink = serverSayLink;
return;
}
auto segments = SplitString(serverTextLink, '\x12');
auto segments = SplitString(serverSayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) {
sofTextLink.append(segments[segment_iter]);
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
sofSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -3327,37 +3337,37 @@ namespace SoF
// SoF: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX X XXXXX XXXXXXXX (50)
// Diff: ^^^^^ ^
sofTextLink.push_back('\x12');
sofTextLink.append(segments[segment_iter].substr(0, 31));
sofTextLink.append(segments[segment_iter].substr(36, 5));
sofSayLink.push_back('\x12');
sofSayLink.append(segments[segment_iter].substr(0, 31));
sofSayLink.append(segments[segment_iter].substr(36, 5));
if (segments[segment_iter][41] == '0')
sofTextLink.push_back(segments[segment_iter][42]);
sofSayLink.push_back(segments[segment_iter][42]);
else
sofTextLink.push_back('F');
sofSayLink.push_back('F');
sofTextLink.append(segments[segment_iter].substr(43));
sofTextLink.push_back('\x12');
sofSayLink.append(segments[segment_iter].substr(43));
sofSayLink.push_back('\x12');
}
else {
sofTextLink.append(segments[segment_iter]);
sofSayLink.append(segments[segment_iter]);
}
}
}
static inline void SoFToServerTextLink(std::string& serverTextLink, const std::string& sofTextLink)
static inline void SoFToServerSayLink(std::string& serverSayLink, const std::string& sofSayLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (sofTextLink.find('\x12') == std::string::npos)) {
serverTextLink = sofTextLink;
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (sofSayLink.find('\x12') == std::string::npos)) {
serverSayLink = sofSayLink;
return;
}
auto segments = SplitString(sofTextLink, '\x12');
auto segments = SplitString(sofSayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -3367,16 +3377,16 @@ namespace SoF
// RoF2: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX XX XXXXX XXXXXXXX (56)
// Diff: ^^^^^ ^
serverTextLink.push_back('\x12');
serverTextLink.append(segments[segment_iter].substr(0, 31));
serverTextLink.append("00000");
serverTextLink.append(segments[segment_iter].substr(31, 5));
serverTextLink.push_back('0');
serverTextLink.append(segments[segment_iter].substr(36));
serverTextLink.push_back('\x12');
serverSayLink.push_back('\x12');
serverSayLink.append(segments[segment_iter].substr(0, 31));
serverSayLink.append("00000");
serverSayLink.append(segments[segment_iter].substr(31, 5));
serverSayLink.push_back('0');
serverSayLink.append(segments[segment_iter].substr(36));
serverSayLink.push_back('\x12');
}
else {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
}
}
}
+1
View File
@@ -95,6 +95,7 @@ D(OP_ApplyPoison)
D(OP_AugmentInfo)
D(OP_AugmentItem)
D(OP_Buff)
D(OP_Bug)
D(OP_CastSpell)
D(OP_ChannelMessage)
D(OP_CharacterCreate)
+87 -65
View File
@@ -326,7 +326,8 @@ union
/*0725*/ uint8 targetable; // 1 = Targetable 0 = Not Targetable (is_npc?)
/*0726*/ uint8 unknown0726[4];
/*0730*/ uint8 NPC; // 0=player,1=npc,2=pc corpse,3=npc corpse
/*0731*/ uint8 unknown0731[11];
/*0731*/ float bounding_radius; // used in melee, overrides calc
/*0735*/ uint8 unknown0731[7];
/*0742*/ uint8 targetable_with_hotkey;
/*0743*/ signed padding00:12; // ***Placeholder
signed x:19; // x coord
@@ -1214,20 +1215,18 @@ struct Action_Struct
{
/* 00 */ uint16 target; // id of target
/* 02 */ uint16 source; // id of caster
/* 04 */ uint16 level; // level of caster
/* 06 */ uint16 instrument_mod; // seems to be fixed to 0x0A
/* 08 */ uint32 unknown08;
/* 12 */ uint16 unknown16;
// some kind of sequence that's the same in both actions
// as well as the combat damage, to tie em together?
/* 14 */ float sequence; // was uint32
/* 18 */ uint32 unknown18;
/* 22 */ uint8 type; // 231 (0xE7) for spells
/* 23 */ uint32 unknown23;
/* 04 */ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/* 06 */ uint32 instrument_mod; // OSX dump says base damage, spells use it for bard song (different from newer clients)
/* 10 */ float force;
/* 14 */ float hit_heading;
/* 18 */ float hit_pitch;
/* 22 */ uint8 type; // 231 (0xE7) for spells, skill
/* 23 */ uint16 unknown23; // OSX says min_damage
/* 25 */ uint16 unknown25; // OSX says tohit
/* 27 */ uint16 spell; // spell id being cast
/* 29 */ uint8 level2; // level of caster again? Or maybe the castee
/* 29 */ uint8 spell_level; // level of caster again? Or maybe the castee
// this field seems to be some sort of success flag, if it's 4
/* 30 */ uint8 buff_unknown; // if this is 4, a buff icon is made
/* 30 */ uint8 effect_flag; // if this is 4, a buff icon is made
/* 31 */
};
@@ -1236,26 +1235,23 @@ struct Action_Struct
// has to do with buff blocking??
struct ActionAlt_Struct // ActionAlt_Struct - Size: 56 bytes
{
/*0000*/ uint16 target; // Target ID
/*0002*/ uint16 source; // SourceID
/*0004*/ uint16 level; // level of caster
/*0006*/ uint16 instrument_mod; // seems to be fixed to 0x0A
/*0008*/ uint32 unknown08;
/*0012*/ uint16 unknown16;
/*0014*/ uint32 sequence;
/*0018*/ uint32 unknown18;
/*0022*/ uint8 type; // Casts, Falls, Bashes, etc...
/*0023*/ uint32 damage; // Amount of Damage
/*0027*/ uint16 spell; // SpellID
/*0029*/ uint8 unknown29;
/*0030*/ uint8 buff_unknown; // if this is 4, a buff icon is made
/*0031*/ uint32 unknown0031; // seen 00 00 00 00
/*0035*/ uint8 unknown0035; // seen 00
/*0036*/ uint32 unknown0036; // seen ff ff ff ff
/*0040*/ uint32 unknown0040; // seen ff ff ff ff
/*0044*/ uint32 unknown0044; // seen ff ff ff ff
/*0048*/ uint32 unknown0048; // seen 00 00 00 00
/*0052*/ uint32 unknown0052; // seen 00 00 00 00
/*0000*/ uint16 target; // id of target
/*0002*/ uint16 source; // id of caster
/*0004*/ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/*0006*/ uint32 instrument_mod; // OSX dump says base damage, spells use it for bard song (different from newer clients)
/*0010*/ float force;
/*0014*/ float hit_heading;
/*0018*/ float hit_pitch;
/*0022*/ uint8 type; // 231 (0xE7) for spells, skill
/*0023*/ uint16 unknown23; // OSX says min_damage
/*0025*/ uint16 unknown25; // OSX says tohit
/*0027*/ uint16 spell; // spell id being cast
/*0029*/ uint8 spell_level; // level of caster again? Or maybe the castee
// this field seems to be some sort of success flag, if it's 4
/*0030*/ uint8 effect_flag; // if this is 4, a buff icon is made
/*0031*/ uint8 spell_slot;
/*0032*/ uint32 slot[5];
/*0052*/ uint32 item_cast_type; // ItemSpellTypes enum from MQ2
/*0056*/
};
@@ -1270,9 +1266,10 @@ struct CombatDamage_Struct
/* 05 */ uint16 spellid;
/* 07 */ int32 damage;
/* 11 */ float force; // cd cc cc 3d
/* 15 */ float meleepush_xy; // see above notes in Action_Struct
/* 19 */ float meleepush_z;
/* 23 */ uint8 unknown23[5]; // was [9] this appears unrelated to the stuff the other clients do here?
/* 15 */ float hit_heading; // see above notes in Action_Struct
/* 19 */ float hit_pitch;
/* 23 */ uint8 secondary; // 0 for primary hand, 1 for secondary
/* 24 */ uint32 special; // 2 = Rampage, 1 = Wild Rampage, Report function doesn't seem to check this :P
/* 28 */
};
@@ -2906,23 +2903,31 @@ struct GuildMakeLeader{
char target[64];
};
struct BugReport_Struct {
/*0000*/ char category_name[64];
/*0064*/ char character_name[64];
/*0128*/ char unused_0128[32];
/*0160*/ char ui_path[128];
/*0288*/ float pos_x;
/*0292*/ float pos_y;
/*0296*/ float pos_z;
/*0300*/ uint32 heading;
/*0304*/ uint32 unused_0304;
/*0308*/ uint32 time_played;
/*0312*/ char padding_0312[8];
/*0320*/ uint32 target_id;
/*0324*/ char padding_0324[140];
/*0464*/ uint32 unknown_0464; // seems to always be '0'
/*0468*/ char target_name[64];
/*0532*/ uint32 optional_info_mask;
struct BugStruct{
/*0000*/ char chartype[64];
/*0064*/ char name[96];
/*0160*/ char ui[128];
/*0288*/ float x;
/*0292*/ float y;
/*0296*/ float z;
/*0300*/ float heading;
/*0304*/ uint32 unknown304;
/*0308*/ uint32 type;
/*0312*/ char unknown312[2144];
/*2456*/ char bug[1024];
/*3480*/ char placeholder[2];
/*3482*/ char system_info[4098];
// this looks like a butchered 8k buffer with 2 trailing dword fields
/*0536*/ char unused_0536[2052];
/*2588*/ char bug_report[2050];
/*4638*/ char system_info[4098];
/*8736*/
};
struct Make_Pet_Struct { //Simple struct for getting pet info
uint8 level;
uint8 class_;
@@ -2949,20 +2954,21 @@ struct Ground_Spawn{
struct Ground_Spawns {
struct Ground_Spawn spawn[50]; //Assigned max number to allow
};
struct PetitionBug_Struct{
uint32 petition_number;
uint32 unknown4;
char accountname[64];
uint32 zoneid;
char name[64];
uint32 level;
uint32 class_;
uint32 race;
uint32 unknown152[3];
uint32 time;
uint32 unknown168;
char text[1028];
};
//struct PetitionBug_Struct{
// uint32 petition_number;
// uint32 unknown4;
// char accountname[64];
// uint32 zoneid;
// char name[64];
// uint32 level;
// uint32 class_;
// uint32 race;
// uint32 unknown152[3];
// uint32 time;
// uint32 unknown168;
// char text[1028];
//};
struct ApproveZone_Struct {
char name[64];
@@ -4146,6 +4152,22 @@ struct AltCurrencySellItem_Struct {
/*004*/ uint32 slot_id;
/*006*/ uint32 charges;
/*010*/ uint32 cost;
};
struct SayLinkBodyFrame_Struct {
/*000*/ char ActionID[1];
/*001*/ char ItemID[5];
/*006*/ char Augment1[5];
/*011*/ char Augment2[5];
/*016*/ char Augment3[5];
/*021*/ char Augment4[5];
/*026*/ char Augment5[5];
/*031*/ char IsEvolving[1];
/*032*/ char EvolveGroup[4];
/*036*/ char EvolveLevel[1];
/*037*/ char OrnamentIcon[5];
/*042*/ char Hash[8];
/*050*/
};
}; /*structs*/
+58 -44
View File
@@ -52,11 +52,11 @@ namespace Titanium
static inline uint32 TitaniumToServerSlot(int16 titaniumSlot);
static inline uint32 TitaniumToServerCorpseSlot(int16 titaniumCorpseSlot);
// server to client text link converter
static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink);
// server to client say link converter
static inline void ServerToTitaniumSayLink(std::string& titaniumSayLink, const std::string& serverSayLink);
// client to server text link converter
static inline void TitaniumToServerTextLink(std::string& serverTextLink, const std::string& titaniumTextLink);
// client to server say link converter
static inline void TitaniumToServerSayLink(std::string& serverSayLink, const std::string& titaniumSayLink);
static inline CastingSlot ServerToTitaniumCastingSlot(EQEmu::CastingSlot slot);
static inline EQEmu::CastingSlot TitaniumToServerCastingSlot(CastingSlot slot, uint32 itemlocation);
@@ -164,11 +164,14 @@ namespace Titanium
OUT(source);
OUT(level);
OUT(instrument_mod);
OUT(sequence);
OUT(force);
OUT(hit_heading);
OUT(hit_pitch);
OUT(type);
//OUT(damage);
OUT(spell);
OUT(buff_unknown); // if this is 4, a buff icon is made
OUT(spell_level);
OUT(effect_flag); // if this is 4, a buff icon is made
FINISH_ENCODE();
}
@@ -290,7 +293,7 @@ namespace Titanium
std::string old_message = emu->message;
std::string new_message;
ServerToTitaniumTextLink(new_message, old_message);
ServerToTitaniumSayLink(new_message, old_message);
in->size = sizeof(ChannelMessage_Struct) + new_message.length() + 1;
@@ -358,8 +361,8 @@ namespace Titanium
OUT(spellid);
OUT(damage);
OUT(force);
OUT(meleepush_xy);
OUT(meleepush_z);
OUT(hit_heading);
OUT(hit_pitch);
FINISH_ENCODE();
}
@@ -532,7 +535,7 @@ namespace Titanium
std::string old_message = emu->message;
std::string new_message;
ServerToTitaniumTextLink(new_message, old_message);
ServerToTitaniumSayLink(new_message, old_message);
//if (new_message.length() > 512) // length restricted in packet building function due vari-length name size (no nullterm)
// new_message = new_message.substr(0, 512);
@@ -574,7 +577,7 @@ namespace Titanium
for (int i = 0; i < 9; ++i) {
if (old_message_array[i].length() == 0) { break; }
ServerToTitaniumTextLink(new_message_array[i], old_message_array[i]);
ServerToTitaniumSayLink(new_message_array[i], old_message_array[i]);
new_message_size += new_message_array[i].length() + 1;
}
@@ -1402,7 +1405,7 @@ namespace Titanium
std::string old_message = &emu->message[strlen(emu->sayer)];
std::string new_message;
ServerToTitaniumTextLink(new_message, old_message);
ServerToTitaniumSayLink(new_message, old_message);
//in->size = 3 + 4 + 4 + strlen(emu->sayer) + 1 + 12 + new_message.length() + 1;
in->size = strlen(emu->sayer) + new_message.length() + 25;
@@ -1458,7 +1461,7 @@ namespace Titanium
std::string old_message = InBuffer; // start 'Reward' as string
std::string new_message;
ServerToTitaniumTextLink(new_message, old_message);
ServerToTitaniumSayLink(new_message, old_message);
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct) +
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct) +
@@ -1789,6 +1792,17 @@ namespace Titanium
FINISH_DIRECT_DECODE();
}
DECODE(OP_Bug)
{
DECODE_LENGTH_EXACT(structs::BugReport_Struct);
SETUP_DIRECT_DECODE(BugReport_Struct, structs::BugReport_Struct);
emu->category_id = EQEmu::bug::CategoryNameToCategoryID(eq->category_name);
memcpy(emu->category_name, eq, sizeof(structs::BugReport_Struct));
FINISH_DIRECT_DECODE();
}
DECODE(OP_CastSpell)
{
DECODE_LENGTH_EXACT(structs::CastSpell_Struct);
@@ -1808,7 +1822,7 @@ namespace Titanium
std::string old_message = (char *)&__eq_buffer[sizeof(ChannelMessage_Struct)];
std::string new_message;
TitaniumToServerTextLink(new_message, old_message);
TitaniumToServerSayLink(new_message, old_message);
__packet->size = sizeof(ChannelMessage_Struct) + new_message.length() + 1;
__packet->pBuffer = new unsigned char[__packet->size];
@@ -1880,7 +1894,7 @@ namespace Titanium
std::string old_message = (char *)&__eq_buffer[4]; // unknown01 offset
std::string new_message;
TitaniumToServerTextLink(new_message, old_message);
TitaniumToServerSayLink(new_message, old_message);
__packet->size = sizeof(Emote_Struct);
__packet->pBuffer = new unsigned char[__packet->size];
@@ -2474,19 +2488,19 @@ namespace Titanium
return titaniumCorpseSlot;
}
static inline void ServerToTitaniumTextLink(std::string& titaniumTextLink, const std::string& serverTextLink)
static inline void ServerToTitaniumSayLink(std::string& titaniumSayLink, const std::string& serverSayLink)
{
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
titaniumTextLink = serverTextLink;
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
titaniumSayLink = serverSayLink;
return;
}
auto segments = SplitString(serverTextLink, '\x12');
auto segments = SplitString(serverSayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) {
titaniumTextLink.append(segments[segment_iter]);
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
titaniumSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -2496,37 +2510,37 @@ namespace Titanium
// 6.2: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX X XXXXXXXX (45)
// Diff: ^^^^^ ^ ^^^^^
titaniumTextLink.push_back('\x12');
titaniumTextLink.append(segments[segment_iter].substr(0, 31));
titaniumTextLink.append(segments[segment_iter].substr(36, 5));
titaniumSayLink.push_back('\x12');
titaniumSayLink.append(segments[segment_iter].substr(0, 31));
titaniumSayLink.append(segments[segment_iter].substr(36, 5));
if (segments[segment_iter][41] == '0')
titaniumTextLink.push_back(segments[segment_iter][42]);
titaniumSayLink.push_back(segments[segment_iter][42]);
else
titaniumTextLink.push_back('F');
titaniumSayLink.push_back('F');
titaniumTextLink.append(segments[segment_iter].substr(48));
titaniumTextLink.push_back('\x12');
titaniumSayLink.append(segments[segment_iter].substr(48));
titaniumSayLink.push_back('\x12');
}
else {
titaniumTextLink.append(segments[segment_iter]);
titaniumSayLink.append(segments[segment_iter]);
}
}
}
static inline void TitaniumToServerTextLink(std::string& serverTextLink, const std::string& titaniumTextLink)
static inline void TitaniumToServerSayLink(std::string& serverSayLink, const std::string& titaniumSayLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (titaniumTextLink.find('\x12') == std::string::npos)) {
serverTextLink = titaniumTextLink;
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (titaniumSayLink.find('\x12') == std::string::npos)) {
serverSayLink = titaniumSayLink;
return;
}
auto segments = SplitString(titaniumTextLink, '\x12');
auto segments = SplitString(titaniumSayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -2536,18 +2550,18 @@ namespace Titanium
// RoF2: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX XX XXXXX XXXXXXXX (56)
// Diff: ^^^^^ ^ ^^^^^
serverTextLink.push_back('\x12');
serverTextLink.append(segments[segment_iter].substr(0, 31));
serverTextLink.append("00000");
serverTextLink.append(segments[segment_iter].substr(31, 5));
serverTextLink.push_back('0');
serverTextLink.push_back(segments[segment_iter][36]);
serverTextLink.append("00000");
serverTextLink.append(segments[segment_iter].substr(37));
serverTextLink.push_back('\x12');
serverSayLink.push_back('\x12');
serverSayLink.append(segments[segment_iter].substr(0, 31));
serverSayLink.append("00000");
serverSayLink.append(segments[segment_iter].substr(31, 5));
serverSayLink.push_back('0');
serverSayLink.push_back(segments[segment_iter][36]);
serverSayLink.append("00000");
serverSayLink.append(segments[segment_iter].substr(37));
serverSayLink.push_back('\x12');
}
else {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
}
}
}
+1
View File
@@ -78,6 +78,7 @@ D(OP_AdventureMerchantSell)
D(OP_ApplyPoison)
D(OP_AugmentItem)
D(OP_Buff)
D(OP_Bug)
D(OP_CastSpell)
D(OP_ChannelMessage)
D(OP_CharacterCreate)
+69 -44
View File
@@ -327,7 +327,7 @@ union
// horse: 0=brown, 1=white, 2=black, 3=tan
};
/*0340*/ uint32 spawnId; // Spawn Id
/*0344*/ uint8 unknown0344[4];
/*0344*/ float bounding_radius; // used in melee, overrides calc
/*0348*/ TintProfile equipment_tint;
/*0384*/ uint8 lfg; // 0=off, 1=lfg on
/*0385*/
@@ -1119,20 +1119,18 @@ struct Action_Struct
{
/* 00 */ uint16 target; // id of target
/* 02 */ uint16 source; // id of caster
/* 04 */ uint16 level; // level of caster
/* 06 */ uint16 instrument_mod;
/* 08 */ uint32 unknown08;
/* 12 */ uint16 unknown16;
// some kind of sequence that's the same in both actions
// as well as the combat damage, to tie em together?
/* 14 */ uint32 sequence;
/* 18 */ uint32 unknown18;
/* 22 */ uint8 type; // 231 (0xE7) for spells
/* 23 */ uint32 unknown23;
/* 04 */ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/* 06 */ uint32 instrument_mod; // OSX dump says base damage, spells use it for bard song (different from newer clients)
/* 10 */ float force;
/* 14 */ float hit_heading;
/* 18 */ float hit_pitch;
/* 22 */ uint8 type; // 231 (0xE7) for spells, skill
/* 23 */ uint16 unknown23; // OSX says min_damage
/* 25 */ uint16 unknown25; // OSX says tohit
/* 27 */ uint16 spell; // spell id being cast
/* 29 */ uint8 unknown29;
/* 29 */ uint8 spell_level;
// this field seems to be some sort of success flag, if it's 4
/* 30 */ uint8 buff_unknown; // if this is 4, a buff icon is made
/* 30 */ uint8 effect_flag; // if this is 4, a buff icon is made
/* 31 */
};
@@ -1143,12 +1141,12 @@ struct CombatDamage_Struct
{
/* 00 */ uint16 target;
/* 02 */ uint16 source;
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells
/* 04 */ uint8 type; //slashing, etc. 231 (0xE7) for spells, skill
/* 05 */ uint16 spellid;
/* 07 */ uint32 damage;
/* 11 */ float force;
/* 15 */ float meleepush_xy; // see above notes in Action_Struct
/* 19 */ float meleepush_z;
/* 15 */ float hit_heading; // see above notes in Action_Struct
/* 19 */ float hit_pitch;
/* 23 */
};
@@ -2571,21 +2569,32 @@ struct GuildMakeLeader{
char name[64];
char target[64];
};
struct BugStruct{
/*0000*/ char chartype[64];
/*0064*/ char name[96];
/*0160*/ char ui[128];
/*0288*/ float x;
/*0292*/ float y;
/*0296*/ float z;
/*0300*/ float heading;
/*0304*/ uint32 unknown304;
/*0308*/ uint32 type;
/*0312*/ char unknown312[2144];
/*2456*/ char bug[1024];
/*3480*/ char placeholder[2];
/*3482*/ char system_info[4098];
struct BugReport_Struct {
/*0000*/ char category_name[64];
/*0064*/ char character_name[64];
/*0128*/ char unused_0128[32];
/*0160*/ char ui_path[128];
/*0288*/ float pos_x;
/*0292*/ float pos_y;
/*0296*/ float pos_z;
/*0300*/ uint32 heading;
/*0304*/ uint32 unused_0304;
/*0308*/ uint32 time_played;
/*0312*/ char padding_0312[8];
/*0320*/ uint32 target_id;
/*0324*/ char padding_0324[140];
/*0464*/ uint32 unknown_0464; // seems to always be '0'
/*0468*/ char target_name[64];
/*0532*/ uint32 optional_info_mask;
// this looks like a butchered 8k buffer with 2 trailing dword fields
/*0536*/ char unused_0536[2052];
/*2588*/ char bug_report[2050];
/*4638*/ char system_info[4098];
/*8736*/
};
struct Make_Pet_Struct { //Simple struct for getting pet info
uint8 level;
uint8 class_;
@@ -2612,20 +2621,21 @@ struct Ground_Spawn{
struct Ground_Spawns {
struct Ground_Spawn spawn[50]; //Assigned max number to allow
};
struct PetitionBug_Struct{
uint32 petition_number;
uint32 unknown4;
char accountname[64];
uint32 zoneid;
char name[64];
uint32 level;
uint32 class_;
uint32 race;
uint32 unknown152[3];
uint32 time;
uint32 unknown168;
char text[1028];
};
//struct PetitionBug_Struct{
// uint32 petition_number;
// uint32 unknown4;
// char accountname[64];
// uint32 zoneid;
// char name[64];
// uint32 level;
// uint32 class_;
// uint32 race;
// uint32 unknown152[3];
// uint32 time;
// uint32 unknown168;
// char text[1028];
//};
struct ApproveZone_Struct {
char name[64];
@@ -3553,6 +3563,21 @@ struct LFGuild_GuildToggle_Struct
// char ScrollName; // '0'
//};
struct SayLinkBodyFrame_Struct {
/*000*/ char ActionID[1];
/*001*/ char ItemID[5];
/*006*/ char Augment1[5];
/*011*/ char Augment2[5];
/*016*/ char Augment3[5];
/*021*/ char Augment4[5];
/*026*/ char Augment5[5];
/*031*/ char IsEvolving[1];
/*032*/ char EvolveGroup[4];
/*036*/ char EvolveLevel[1];
/*037*/ char Hash[8];
/*045*/
};
}; /*structs*/
}; /*Titanium*/
+53 -62
View File
@@ -53,11 +53,11 @@ namespace UF
static inline uint32 UFToServerSlot(uint32 ufSlot);
static inline uint32 UFToServerCorpseSlot(uint32 ufCorpseSlot);
// server to client text link converter
static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink);
// server to client say link converter
static inline void ServerToUFSayLink(std::string& ufSayLink, const std::string& serverSayLink);
// client to server text link converter
static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink);
// client to server say link converter
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink);
static inline CastingSlot ServerToUFCastingSlot(EQEmu::CastingSlot slot);
static inline EQEmu::CastingSlot UFToServerCastingSlot(CastingSlot slot);
@@ -161,29 +161,20 @@ namespace UF
OUT(source);
OUT(level);
eq->instrument_mod = 1.0f + (emu->instrument_mod - 10) / 10.0f;
eq->knockback_angle = emu->sequence;
OUT(force);
OUT(hit_heading);
OUT(hit_pitch);
OUT(type);
OUT(spell);
eq->level2 = eq->level;
eq->effect_flag = emu->buff_unknown;
eq->unknown37 = 0x01;
eq->unknown44 = 0xFFFFFFFF;
eq->unknown48 = 0xFFFFFFFF;
eq->unknown52 = 0xFFFFFFFF;
/*OUT(target);
OUT(source);
OUT(level);
OUT(instrument_mod);
eq->sequence = emu->sequence;
OUT(type);
//OUT(damage);
OUT(spell);
eq->level2 = emu->level;
OUT(buff_unknown); // if this is 4, a buff icon is made
//eq->unknown0036 = -1;
//eq->unknown0040 = -1;
//eq->unknown0044 = -1;*/
OUT(spell_level);
OUT(effect_flag);
eq->spell_gem = 0;
eq->slot[0] = -1; // type
eq->slot[1] = -1; // slot
eq->slot[2] = -1; // sub index
eq->slot[3] = -1; // aug index
eq->slot[4] = -1; // unknown
eq->item_cast_type = 0;
FINISH_ENCODE();
}
@@ -463,7 +454,7 @@ namespace UF
std::string old_message = emu->message;
std::string new_message;
ServerToUFTextLink(new_message, old_message);
ServerToUFSayLink(new_message, old_message);
//in->size = strlen(emu->sender) + 1 + strlen(emu->targetname) + 1 + strlen(emu->message) + 1 + 36;
in->size = strlen(emu->sender) + strlen(emu->targetname) + new_message.length() + 39;
@@ -586,8 +577,8 @@ namespace UF
OUT(spellid);
OUT(damage);
OUT(force);
OUT(meleepush_xy);
OUT(meleepush_z);
OUT(hit_heading);
OUT(hit_pitch);
OUT(special);
FINISH_ENCODE();
@@ -762,7 +753,7 @@ namespace UF
std::string old_message = emu->message;
std::string new_message;
ServerToUFTextLink(new_message, old_message);
ServerToUFSayLink(new_message, old_message);
//if (new_message.length() > 512) // length restricted in packet building function due vari-length name size (no nullterm)
// new_message = new_message.substr(0, 512);
@@ -814,7 +805,7 @@ namespace UF
for (int i = 0; i < 9; ++i) {
if (old_message_array[i].length() == 0) { break; }
ServerToUFTextLink(new_message_array[i], old_message_array[i]);
ServerToUFSayLink(new_message_array[i], old_message_array[i]);
new_message_size += new_message_array[i].length() + 1;
}
@@ -2469,7 +2460,7 @@ namespace UF
std::string old_message = &emu->message[strlen(emu->sayer)];
std::string new_message;
ServerToUFTextLink(new_message, old_message);
ServerToUFSayLink(new_message, old_message);
//in->size = 3 + 4 + 4 + strlen(emu->sayer) + 1 + 12 + new_message.length() + 1;
in->size = strlen(emu->sayer) + new_message.length() + 25;
@@ -2539,7 +2530,7 @@ namespace UF
std::string old_message = InBuffer; // start 'Reward' as string
std::string new_message;
ServerToUFTextLink(new_message, old_message);
ServerToUFSayLink(new_message, old_message);
in->size = sizeof(TaskDescriptionHeader_Struct) + sizeof(TaskDescriptionData1_Struct)+
sizeof(TaskDescriptionData2_Struct) + sizeof(TaskDescriptionTrailer_Struct)+
@@ -3287,7 +3278,7 @@ namespace UF
std::string old_message = InBuffer;
std::string new_message;
UFToServerTextLink(new_message, old_message);
UFToServerSayLink(new_message, old_message);
//__packet->size = sizeof(ChannelMessage_Struct)+strlen(InBuffer) + 1;
__packet->size = sizeof(ChannelMessage_Struct) + new_message.length() + 1;
@@ -3398,7 +3389,7 @@ namespace UF
IN(type);
IN(spellid);
IN(damage);
IN(meleepush_xy);
IN(hit_heading);
FINISH_DIRECT_DECODE();
}
@@ -3421,7 +3412,7 @@ namespace UF
std::string old_message = (char *)&__eq_buffer[4]; // unknown01 offset
std::string new_message;
UFToServerTextLink(new_message, old_message);
UFToServerSayLink(new_message, old_message);
__packet->size = sizeof(Emote_Struct);
__packet->pBuffer = new unsigned char[__packet->size];
@@ -4290,19 +4281,19 @@ namespace UF
return (ufCorpseSlot - 1);
}
static inline void ServerToUFTextLink(std::string& ufTextLink, const std::string& serverTextLink)
static inline void ServerToUFSayLink(std::string& ufSayLink, const std::string& serverSayLink)
{
if ((constants::SayLinkBodySize == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) || (serverTextLink.find('\x12') == std::string::npos)) {
ufTextLink = serverTextLink;
if ((constants::SayLinkBodySize == EQEmu::constants::SayLinkBodySize) || (serverSayLink.find('\x12') == std::string::npos)) {
ufSayLink = serverSayLink;
return;
}
auto segments = SplitString(serverTextLink, '\x12');
auto segments = SplitString(serverSayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= EQEmu::legacy::TEXT_LINK_BODY_LENGTH) {
ufTextLink.append(segments[segment_iter]);
if (segments[segment_iter].length() <= EQEmu::constants::SayLinkBodySize) {
ufSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -4312,37 +4303,37 @@ namespace UF
// SoF: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX X XXXXX XXXXXXXX (50)
// Diff: ^^^^^ ^
ufTextLink.push_back('\x12');
ufTextLink.append(segments[segment_iter].substr(0, 31));
ufTextLink.append(segments[segment_iter].substr(36, 5));
ufSayLink.push_back('\x12');
ufSayLink.append(segments[segment_iter].substr(0, 31));
ufSayLink.append(segments[segment_iter].substr(36, 5));
if (segments[segment_iter][41] == '0')
ufTextLink.push_back(segments[segment_iter][42]);
ufSayLink.push_back(segments[segment_iter][42]);
else
ufTextLink.push_back('F');
ufSayLink.push_back('F');
ufTextLink.append(segments[segment_iter].substr(43));
ufTextLink.push_back('\x12');
ufSayLink.append(segments[segment_iter].substr(43));
ufSayLink.push_back('\x12');
}
else {
ufTextLink.append(segments[segment_iter]);
ufSayLink.append(segments[segment_iter]);
}
}
}
static inline void UFToServerTextLink(std::string& serverTextLink, const std::string& ufTextLink)
static inline void UFToServerSayLink(std::string& serverSayLink, const std::string& ufSayLink)
{
if ((EQEmu::legacy::TEXT_LINK_BODY_LENGTH == constants::SayLinkBodySize) || (ufTextLink.find('\x12') == std::string::npos)) {
serverTextLink = ufTextLink;
if ((EQEmu::constants::SayLinkBodySize == constants::SayLinkBodySize) || (ufSayLink.find('\x12') == std::string::npos)) {
serverSayLink = ufSayLink;
return;
}
auto segments = SplitString(ufTextLink, '\x12');
auto segments = SplitString(ufSayLink, '\x12');
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
if (segment_iter & 1) {
if (segments[segment_iter].length() <= constants::SayLinkBodySize) {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
// TODO: log size mismatch error
continue;
}
@@ -4352,16 +4343,16 @@ namespace UF
// RoF2: X XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX X XXXX XX XXXXX XXXXXXXX (56)
// Diff: ^^^^^ ^
serverTextLink.push_back('\x12');
serverTextLink.append(segments[segment_iter].substr(0, 31));
serverTextLink.append("00000");
serverTextLink.append(segments[segment_iter].substr(31, 5));
serverTextLink.push_back('0');
serverTextLink.append(segments[segment_iter].substr(36));
serverTextLink.push_back('\x12');
serverSayLink.push_back('\x12');
serverSayLink.append(segments[segment_iter].substr(0, 31));
serverSayLink.append("00000");
serverSayLink.append(segments[segment_iter].substr(31, 5));
serverSayLink.push_back('0');
serverSayLink.append(segments[segment_iter].substr(36));
serverSayLink.push_back('\x12');
}
else {
serverTextLink.append(segments[segment_iter]);
serverSayLink.append(segments[segment_iter]);
}
}
}
+59 -64
View File
@@ -292,7 +292,7 @@ struct Spawn_Struct
/*0000*/ //uint8 nullterm1; // hack to null terminate name
/*0064*/ uint32 spawnId;
/*0068*/ uint8 level;
/*0069*/ float unknown1;
/*0069*/ float bounding_radius; // used in melee, overrides calc
/*0073*/ uint8 NPC; // 0=player,1=npc,2=pc corpse,3=npc corpse
Spawn_Struct_Bitfields Bitfields;
/*0000*/ uint8 otherData; // & 4 - has title, & 8 - has suffix, & 1 - it's a chest or untargetable
@@ -1252,19 +1252,19 @@ struct Action_Struct
{
/*00*/ uint16 target; // id of target
/*02*/ uint16 source; // id of caster
/*04*/ uint16 level; // level of caster - Seen 0
/*06*/ uint32 unknown06;
/*10*/ uint16 instrument_focus;
/*12*/ uint16 unknown12; // seems to always be set to something and it doesn't change between casts except in special cases like changing instrument mods
/*14*/ uint32 unknown14; // seen 0
/*18*/ float knockback_angle; //seems to go from 0-512 then it rolls over again
/*22*/ uint32 unknown22;
/*26*/ uint8 type;
/*27*/ uint32 damage;
/*31*/ uint16 unknown31;
/*04*/ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/*06*/ uint32 unknown06; // OSX dump says base_damage, was used for bard mod too, this is 0'd :(
/*10*/ float instrument_mod;
/*14*/ float force;
/*18*/ float hit_heading;
/*22*/ float hit_pitch;
/*26*/ uint8 type; // 231 (0xE7) for spells, skill
/*27*/ uint32 damage; // OSX says min_damage
/*31*/ uint16 unknown31; // OSX says tohit
/*33*/ uint16 spell; // spell id being cast
/*35*/ uint8 level2; // level of caster again? Or maybe the castee
/*35*/ uint8 spell_level; // level of caster again? Or maybe the castee
/*36*/ uint8 effect_flag; // if this is 4, the effect is valid: or if two are sent at the same time?
/*37*/
};
@@ -1276,27 +1276,22 @@ struct ActionAlt_Struct
{
/*00*/ uint16 target; // id of target
/*02*/ uint16 source; // id of caster
/*04*/ uint16 level; // level of caster - Seen 0
/*06*/ uint32 unknown06;
/*04*/ uint16 level; // level of caster for spells, OSX dump says attack rating, guess spells use it for level
/*06*/ uint32 unknown06; // OSX dump says base_damage, was used for bard mod too, this is 0'd :(
/*10*/ float instrument_mod;
/*14*/ uint32 unknown14; // seen 0
/*18*/ float knockback_angle; //seems to go from 0-512 then it rolls over again
/*22*/ uint32 unknown22;
/*26*/ uint8 type;
/*27*/ uint32 damage;
/*31*/ uint16 unknown31;
/*14*/ float force;
/*18*/ float hit_heading;
/*22*/ float hit_pitch;
/*26*/ uint8 type; // 231 (0xE7) for spells, skill
/*27*/ uint32 damage; // OSX says min_damage
/*31*/ uint16 unknown31; // OSX says tohit
/*33*/ uint16 spell; // spell id being cast
/*35*/ uint8 level2; // level of caster again? Or maybe the castee
/*35*/ uint8 spell_level; // level of caster again? Or maybe the castee
/*36*/ uint8 effect_flag; // if this is 4, the effect is valid: or if two are sent at the same time?
/*37*/ uint32 unknown37; // New field to Underfoot - Seen 14
/*41*/ uint8 unknown41; // New field to Underfoot - Seen 0
/*42*/ uint8 unknown42; // New field to Underfoot - Seen 0
/*43*/ uint8 unknown43; // New field to Underfoot - Seen 0
/*44*/ uint32 unknown44; // New field to Underfoot - Seen 23
/*48*/ uint32 unknown48; // New field to Underfoot - Seen -1
/*52*/ uint32 unknown52; // New field to Underfoot - Seen -1
/*56*/ uint32 unknown56; // New field to Underfoot - Seen 0
/*60*/ uint32 unknown60; // New field to Underfoot - Seen 0
/*37*/ uint8 spell_gem;
/*38*/ uint8 padding38[2];
/*40*/ uint32 slot[5];
/*60*/ uint32 item_cast_type; // ItemSpellTypes enum from MQ2
/*64*/
};
@@ -1311,9 +1306,9 @@ struct CombatDamage_Struct
/* 05 */ uint16 spellid;
/* 07 */ int32 damage;
/* 11 */ float force; // cd cc cc 3d
/* 15 */ float meleepush_xy; // see above notes in Action_Struct
/* 19 */ float meleepush_z;
/* 23 */ uint8 unknown23; // was [9]
/* 15 */ float hit_heading; // see above notes in Action_Struct
/* 19 */ float hit_pitch;
/* 23 */ uint8 secondary; // 0 for primary hand, 1 for secondary
/* 24 */ uint32 special; // 2 = Rampage, 1 = Wild Rampage
/* 28 */
};
@@ -3060,23 +3055,6 @@ struct GuildMakeLeader{
char target[64];
};
struct BugStruct{
/*0000*/ char chartype[64];
/*0064*/ char name[96];
/*0160*/ char ui[128];
/*0288*/ float x;
/*0292*/ float y;
/*0296*/ float z;
/*0300*/ float heading;
/*0304*/ uint32 unknown304;
/*0308*/ uint32 type;
/*0312*/ char unknown312[2144];
/*2456*/ char bug[1024];
/*3480*/ char placeholder[2];
/*3482*/ char system_info[4098];
};
struct Make_Pet_Struct { //Simple struct for getting pet info
uint8 level;
uint8 class_;
@@ -3103,20 +3081,21 @@ struct Ground_Spawn{
struct Ground_Spawns {
struct Ground_Spawn spawn[50]; //Assigned max number to allow
};
struct PetitionBug_Struct{
uint32 petition_number;
uint32 unknown4;
char accountname[64];
uint32 zoneid;
char name[64];
uint32 level;
uint32 class_;
uint32 race;
uint32 unknown152[3];
uint32 time;
uint32 unknown168;
char text[1028];
};
//struct PetitionBug_Struct{
// uint32 petition_number;
// uint32 unknown4;
// char accountname[64];
// uint32 zoneid;
// char name[64];
// uint32 level;
// uint32 class_;
// uint32 race;
// uint32 unknown152[3];
// uint32 time;
// uint32 unknown168;
// char text[1028];
//};
struct ApproveZone_Struct {
char name[64];
@@ -4505,6 +4484,22 @@ struct MercenaryAssign_Struct {
/*0004*/ uint32 MercUnk01; //
/*0008*/ uint32 MercUnk02; //
/*0012*/
};
struct SayLinkBodyFrame_Struct {
/*000*/ char ActionID[1];
/*001*/ char ItemID[5];
/*006*/ char Augment1[5];
/*011*/ char Augment2[5];
/*016*/ char Augment3[5];
/*021*/ char Augment4[5];
/*026*/ char Augment5[5];
/*031*/ char IsEvolving[1];
/*032*/ char EvolveGroup[4];
/*036*/ char EvolveLevel[1];
/*037*/ char OrnamentIcon[5];
/*042*/ char Hash[8];
/*050*/
};
}; /*structs*/
+9
View File
@@ -156,6 +156,7 @@ RULE_BOOL(Character, UseOldBindWound, false) // Uses the original bind wound beh
RULE_BOOL(Character, GrantHoTTOnCreate, false) // Grant Health of Target's Target leadership AA on character creation
RULE_BOOL(Character, UseOldConSystem, false) // Grant Health of Target's Target leadership AA on character creation
RULE_BOOL(Character, OPClientUpdateVisualDebug, false) // Shows a pulse and forward directional particle each time the client sends its position to server
RULE_BOOL(Character, PetsUseReagents, true) //Pets use reagent on spells
RULE_CATEGORY_END()
RULE_CATEGORY(Mercs)
@@ -233,6 +234,7 @@ RULE_INT(World, TitaniumStartZoneID, -1) //Sets the Starting Zone for Titanium C
RULE_INT(World, ExpansionSettings, 16383) // Sets the expansion settings for the server, This is sent on login to world and affects client expansion settings. Defaults to all expansions enabled up to TSS.
RULE_BOOL(World, UseClientBasedExpansionSettings, true) // if true it will overrule World, ExpansionSettings and set someone's expansion based on the client they're using
RULE_INT(World, PVPSettings, 0) // Sets the PVP settings for the server, 1 = Rallos Zek RuleSet, 2 = Tallon/Vallon Zek Ruleset, 4 = Sullon Zek Ruleset, 6 = Discord Ruleset, anything above 6 is the Discord Ruleset without the no-drop restrictions removed. TODO: Edit IsAttackAllowed in Zone to accomodate for these rules.
RULE_INT(World, PVPMinLevel, 0) // minimum level to pvp
RULE_BOOL (World, IsGMPetitionWindowEnabled, false)
RULE_INT (World, FVNoDropFlag, 0) // Sets the Firiona Vie settings on the client. If set to 2, the flag will be set for GMs only, allowing trading of no-drop items.
RULE_BOOL (World, IPLimitDisconnectAll, false)
@@ -400,6 +402,7 @@ RULE_BOOL(Spells, IgnoreSpellDmgLvlRestriction, false) // ignore the 5 level spr
RULE_BOOL(Spells, AllowItemTGB, false) // TGB doesn't work with items on live, custom servers want it though
RULE_BOOL(Spells, NPCInnateProcOverride, true) // NPC innate procs override the target type to single target.
RULE_BOOL(Spells, OldRainTargets, false) // use old incorrectly implemented max targets for rains
RULE_BOOL(Spells, NPCSpellPush, false) // enable spell push on NPCs
RULE_CATEGORY_END()
RULE_CATEGORY(Combat)
@@ -720,6 +723,12 @@ RULE_BOOL(Client, UseLiveFactionMessage, false) // Allows players to see faction
RULE_BOOL(Client, UseLiveBlockedMessage, false) // Allows players to see faction adjustments like Live
RULE_CATEGORY_END()
RULE_CATEGORY(Bugs)
RULE_BOOL(Bugs, ReportingSystemActive, true) // Activates bug reporting
RULE_BOOL(Bugs, UseOldReportingMethod, true) // Forces the use of the old bug reporting system
RULE_BOOL(Bugs, DumpTargetEntity, false) // Dumps the target entity, if one is provided
RULE_CATEGORY_END()
#undef RULE_CATEGORY
#undef RULE_INT
#undef RULE_REAL
+51 -53
View File
@@ -29,10 +29,10 @@
bool EQEmu::saylink::DegenerateLinkBody(SayLinkBody_Struct& say_link_body_struct, const std::string& say_link_body)
{
memset(&say_link_body_struct, 0, sizeof(say_link_body_struct));
if (say_link_body.length() != EQEmu::legacy::TEXT_LINK_BODY_LENGTH)
if (say_link_body.length() != EQEmu::constants::SayLinkBodySize)
return false;
say_link_body_struct.unknown_1 = (uint8)strtol(say_link_body.substr(0, 1).c_str(), nullptr, 16);
say_link_body_struct.action_id = (uint8)strtol(say_link_body.substr(0, 1).c_str(), nullptr, 16);
say_link_body_struct.item_id = (uint32)strtol(say_link_body.substr(1, 5).c_str(), nullptr, 16);
say_link_body_struct.augment_1 = (uint32)strtol(say_link_body.substr(6, 5).c_str(), nullptr, 16);
say_link_body_struct.augment_2 = (uint32)strtol(say_link_body.substr(11, 5).c_str(), nullptr, 16);
@@ -44,7 +44,7 @@ bool EQEmu::saylink::DegenerateLinkBody(SayLinkBody_Struct& say_link_body_struct
say_link_body_struct.evolve_group = (uint32)strtol(say_link_body.substr(37, 4).c_str(), nullptr, 16);
say_link_body_struct.evolve_level = (uint8)strtol(say_link_body.substr(41, 2).c_str(), nullptr, 16);
say_link_body_struct.ornament_icon = (uint32)strtol(say_link_body.substr(43, 5).c_str(), nullptr, 16);
say_link_body_struct.hash = (int)strtol(say_link_body.substr(48, 8).c_str(), nullptr, 16);
say_link_body_struct.hash = (uint32)strtol(say_link_body.substr(48, 8).c_str(), nullptr, 16);
return true;
}
@@ -53,7 +53,7 @@ bool EQEmu::saylink::GenerateLinkBody(std::string& say_link_body, const SayLinkB
{
say_link_body = StringFormat(
"%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%02X" "%05X" "%08X",
(0x0F & say_link_body_struct.unknown_1),
(0x0F & say_link_body_struct.action_id),
(0x000FFFFF & say_link_body_struct.item_id),
(0x000FFFFF & say_link_body_struct.augment_1),
(0x000FFFFF & say_link_body_struct.augment_2),
@@ -68,7 +68,7 @@ bool EQEmu::saylink::GenerateLinkBody(std::string& say_link_body, const SayLinkB
(0xFFFFFFFF & say_link_body_struct.hash)
);
if (say_link_body.length() != EQEmu::legacy::TEXT_LINK_BODY_LENGTH)
if (say_link_body.length() != EQEmu::constants::SayLinkBodySize)
return false;
return true;
@@ -79,7 +79,7 @@ EQEmu::SayLinkEngine::SayLinkEngine()
Reset();
}
std::string EQEmu::SayLinkEngine::GenerateLink()
const std::string& EQEmu::SayLinkEngine::GenerateLink()
{
m_Link.clear();
m_LinkBody.clear();
@@ -88,18 +88,26 @@ std::string EQEmu::SayLinkEngine::GenerateLink()
generate_body();
generate_text();
if ((m_LinkBody.length() == EQEmu::legacy::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) {
if ((m_LinkBody.length() == EQEmu::constants::SayLinkBodySize) && (m_LinkText.length() > 0)) {
m_Link.push_back(0x12);
m_Link.append(m_LinkBody);
m_Link.append(m_LinkText);
m_Link.push_back(0x12);
}
if ((m_Link.length() == 0) || (m_Link.length() > 250)) {
if ((m_Link.length() == 0) || (m_Link.length() > (EQEmu::constants::SayLinkMaximumSize))) {
m_Error = true;
m_Link = "<LINKER ERROR>";
Log(Logs::General, Logs::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})",
m_LinkType, m_Link.length(), m_LinkBody.length(), m_LinkText.length());
Log(Logs::General, Logs::Error, "SayLinkEngine::GenerateLink() failed to generate a useable say link");
Log(Logs::General, Logs::Error, ">> LinkType: %i, Lengths: {link: %u(%u), body: %u(%u), text: %u(%u)}",
m_LinkType,
m_Link.length(),
EQEmu::constants::SayLinkMaximumSize,
m_LinkBody.length(),
EQEmu::constants::SayLinkBodySize,
m_LinkText.length(),
EQEmu::constants::SayLinkTextSize
);
Log(Logs::General, Logs::Error, ">> LinkBody: %s", m_LinkBody.c_str());
Log(Logs::General, Logs::Error, ">> LinkText: %s", m_LinkText.c_str());
}
@@ -113,20 +121,10 @@ void EQEmu::SayLinkEngine::Reset()
m_ItemData = nullptr;
m_LootData = nullptr;
m_ItemInst = nullptr;
m_Proxy_unknown_1 = 0;
m_ProxyItemID = 0;
m_ProxyAugment1ID = 0;
m_ProxyAugment2ID = 0;
m_ProxyAugment3ID = 0;
m_ProxyAugment4ID = 0;
m_ProxyAugment5ID = 0;
m_ProxyAugment6ID = 0;
m_ProxyIsEvolving = 0;
m_ProxyEvolveGroup = 0;
m_ProxyEvolveLevel = 0;
m_ProxyOrnamentIcon = 0;
m_ProxyHash = 0;
m_ProxyText = nullptr;
memset(&m_LinkBodyStruct, 0, sizeof(SayLinkBody_Struct));
memset(&m_LinkProxyStruct, 0, sizeof(SayLinkProxy_Struct));
m_TaskUse = false;
m_Link.clear();
m_LinkBody.clear();
@@ -194,32 +192,32 @@ void EQEmu::SayLinkEngine::generate_body()
break;
}
if (m_Proxy_unknown_1)
m_LinkBodyStruct.unknown_1 = m_Proxy_unknown_1;
if (m_ProxyItemID)
m_LinkBodyStruct.item_id = m_ProxyItemID;
if (m_ProxyAugment1ID)
m_LinkBodyStruct.augment_1 = m_ProxyAugment1ID;
if (m_ProxyAugment2ID)
m_LinkBodyStruct.augment_2 = m_ProxyAugment2ID;
if (m_ProxyAugment3ID)
m_LinkBodyStruct.augment_3 = m_ProxyAugment3ID;
if (m_ProxyAugment4ID)
m_LinkBodyStruct.augment_4 = m_ProxyAugment4ID;
if (m_ProxyAugment5ID)
m_LinkBodyStruct.augment_5 = m_ProxyAugment5ID;
if (m_ProxyAugment6ID)
m_LinkBodyStruct.augment_6 = m_ProxyAugment6ID;
if (m_ProxyIsEvolving)
m_LinkBodyStruct.is_evolving = m_ProxyIsEvolving;
if (m_ProxyEvolveGroup)
m_LinkBodyStruct.evolve_group = m_ProxyEvolveGroup;
if (m_ProxyEvolveLevel)
m_LinkBodyStruct.evolve_level = m_ProxyEvolveLevel;
if (m_ProxyOrnamentIcon)
m_LinkBodyStruct.ornament_icon = m_ProxyOrnamentIcon;
if (m_ProxyHash)
m_LinkBodyStruct.hash = m_ProxyHash;
if (m_LinkProxyStruct.action_id)
m_LinkBodyStruct.action_id = m_LinkProxyStruct.action_id;
if (m_LinkProxyStruct.item_id)
m_LinkBodyStruct.item_id = m_LinkProxyStruct.item_id;
if (m_LinkProxyStruct.augment_1)
m_LinkBodyStruct.augment_1 = m_LinkProxyStruct.augment_1;
if (m_LinkProxyStruct.augment_2)
m_LinkBodyStruct.augment_2 = m_LinkProxyStruct.augment_2;
if (m_LinkProxyStruct.augment_3)
m_LinkBodyStruct.augment_3 = m_LinkProxyStruct.augment_3;
if (m_LinkProxyStruct.augment_4)
m_LinkBodyStruct.augment_4 = m_LinkProxyStruct.augment_4;
if (m_LinkProxyStruct.augment_5)
m_LinkBodyStruct.augment_5 = m_LinkProxyStruct.augment_5;
if (m_LinkProxyStruct.augment_6)
m_LinkBodyStruct.augment_6 = m_LinkProxyStruct.augment_6;
if (m_LinkProxyStruct.is_evolving)
m_LinkBodyStruct.is_evolving = m_LinkProxyStruct.is_evolving;
if (m_LinkProxyStruct.evolve_group)
m_LinkBodyStruct.evolve_group = m_LinkProxyStruct.evolve_group;
if (m_LinkProxyStruct.evolve_level)
m_LinkBodyStruct.evolve_level = m_LinkProxyStruct.evolve_level;
if (m_LinkProxyStruct.ornament_icon)
m_LinkBodyStruct.ornament_icon = m_LinkProxyStruct.ornament_icon;
if (m_LinkProxyStruct.hash)
m_LinkBodyStruct.hash = m_LinkProxyStruct.hash;
if (m_TaskUse)
@@ -227,7 +225,7 @@ void EQEmu::SayLinkEngine::generate_body()
m_LinkBody = StringFormat(
"%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%02X" "%05X" "%08X",
(0x0F & m_LinkBodyStruct.unknown_1),
(0x0F & m_LinkBodyStruct.action_id),
(0x000FFFFF & m_LinkBodyStruct.item_id),
(0x000FFFFF & m_LinkBodyStruct.augment_1),
(0x000FFFFF & m_LinkBodyStruct.augment_2),
@@ -245,8 +243,8 @@ void EQEmu::SayLinkEngine::generate_body()
void EQEmu::SayLinkEngine::generate_text()
{
if (m_ProxyText != nullptr) {
m_LinkText = m_ProxyText;
if (m_LinkProxyStruct.text != nullptr) {
m_LinkText = m_LinkProxyStruct.text;
return;
}
+28 -37
View File
@@ -47,7 +47,7 @@ namespace EQEmu
} /*saylink*/
struct SayLinkBody_Struct {
uint8 unknown_1; /* %1X */
uint8 action_id; /* %1X */
uint32 item_id; /* %05X */
uint32 augment_1; /* %05X */
uint32 augment_2; /* %05X */
@@ -56,13 +56,18 @@ namespace EQEmu
uint32 augment_5; /* %05X */
uint32 augment_6; /* %05X */
uint8 is_evolving; /* %1X */
uint32 evolve_group; /* %05X */
uint32 evolve_group; /* %04X */
uint8 evolve_level; /* %02X */
uint32 ornament_icon; /* %05X */
int hash; /* %08X */
uint32 hash; /* %08X */
};
struct SayLinkProxy_Struct : SayLinkBody_Struct {
const char* text;
};
class SayLinkEngine {
// TODO: consider methods for direct 'saylink' assignments
public:
SayLinkEngine();
@@ -72,29 +77,29 @@ namespace EQEmu
void SetItemInst(const ItemInstance* item_inst) { m_ItemInst = item_inst; }
// mainly for saylinks..but, not limited to
void SetProxyUnknown1(uint8 proxy_unknown_1) { m_Proxy_unknown_1 = proxy_unknown_1; }
void SetProxyItemID(uint32 proxy_item_id) { m_ProxyItemID = proxy_item_id; }
void SetProxyAugment1ID(uint32 proxy_augment_id) { m_ProxyAugment1ID = proxy_augment_id; }
void SetProxyAugment2ID(uint32 proxy_augment_id) { m_ProxyAugment2ID = proxy_augment_id; }
void SetProxyAugment3ID(uint32 proxy_augment_id) { m_ProxyAugment3ID = proxy_augment_id; }
void SetProxyAugment4ID(uint32 proxy_augment_id) { m_ProxyAugment4ID = proxy_augment_id; }
void SetProxyAugment5ID(uint32 proxy_augment_id) { m_ProxyAugment5ID = proxy_augment_id; }
void SetProxyAugment6ID(uint32 proxy_augment_id) { m_ProxyAugment6ID = proxy_augment_id; }
void SetProxyIsEvolving(uint8 proxy_is_evolving) { m_ProxyIsEvolving = proxy_is_evolving; }
void SetProxyEvolveGroup(uint32 proxy_evolve_group) { m_ProxyEvolveGroup = proxy_evolve_group; }
void SetProxyEvolveLevel(uint8 proxy_evolve_level) { m_ProxyEvolveLevel = proxy_evolve_level; }
void SetProxyOrnamentIcon(uint32 proxy_ornament_icon) { m_ProxyOrnamentIcon = proxy_ornament_icon; }
void SetProxyHash(int proxy_hash) { m_ProxyHash = proxy_hash; }
void SetProxyActionID(uint8 proxy_action_id) { m_LinkProxyStruct.action_id = proxy_action_id; } // should always be '0'
void SetProxyItemID(uint32 proxy_item_id) { m_LinkProxyStruct.item_id = proxy_item_id; }
void SetProxyAugment1ID(uint32 proxy_augment_id) { m_LinkProxyStruct.augment_1 = proxy_augment_id; }
void SetProxyAugment2ID(uint32 proxy_augment_id) { m_LinkProxyStruct.augment_2 = proxy_augment_id; }
void SetProxyAugment3ID(uint32 proxy_augment_id) { m_LinkProxyStruct.augment_3 = proxy_augment_id; }
void SetProxyAugment4ID(uint32 proxy_augment_id) { m_LinkProxyStruct.augment_4 = proxy_augment_id; }
void SetProxyAugment5ID(uint32 proxy_augment_id) { m_LinkProxyStruct.augment_5 = proxy_augment_id; }
void SetProxyAugment6ID(uint32 proxy_augment_id) { m_LinkProxyStruct.augment_6 = proxy_augment_id; }
void SetProxyIsEvolving(uint8 proxy_is_evolving) { m_LinkProxyStruct.is_evolving = proxy_is_evolving; }
void SetProxyEvolveGroup(uint32 proxy_evolve_group) { m_LinkProxyStruct.evolve_group = proxy_evolve_group; }
void SetProxyEvolveLevel(uint8 proxy_evolve_level) { m_LinkProxyStruct.evolve_level = proxy_evolve_level; }
void SetProxyOrnamentIcon(uint32 proxy_ornament_icon) { m_LinkProxyStruct.ornament_icon = proxy_ornament_icon; }
void SetProxyHash(uint32 proxy_hash) { m_LinkProxyStruct.hash = proxy_hash; }
void SetProxyText(const char* proxy_text) { m_ProxyText = proxy_text; } // overrides standard text use
void SetProxyText(const char* proxy_text) { m_LinkProxyStruct.text = proxy_text; } // overrides standard text use
void SetTaskUse() { m_TaskUse = true; }
std::string GenerateLink();
const std::string& GenerateLink();
bool LinkError() { return m_Error; }
std::string Link() { return m_Link; } // contains full string format: '/12x' '<LinkBody>' '<LinkText>' '/12x'
std::string LinkBody() { return m_LinkBody; } // contains string format: '<LinkBody>'
std::string LinkText() { return m_LinkText; } // contains string format: '<LinkText>'
const std::string& Link() { return m_Link; } // contains full string format: '\x12' '<LinkBody>' '<LinkText>' '\x12'
const std::string& LinkBody() { return m_LinkBody; } // contains string format: '<LinkBody>'
const std::string& LinkText() { return m_LinkText; } // contains string format: '<LinkText>'
void Reset();
@@ -106,23 +111,9 @@ namespace EQEmu
const ItemData* m_ItemData;
const ServerLootItem_Struct* m_LootData;
const ItemInstance* m_ItemInst;
uint8 m_Proxy_unknown_1;
uint32 m_ProxyItemID;
uint32 m_ProxyAugment1ID;
uint32 m_ProxyAugment2ID;
uint32 m_ProxyAugment3ID;
uint32 m_ProxyAugment4ID;
uint32 m_ProxyAugment5ID;
uint32 m_ProxyAugment6ID;
uint8 m_ProxyIsEvolving;
uint32 m_ProxyEvolveGroup;
uint8 m_ProxyEvolveLevel;
uint32 m_ProxyOrnamentIcon;
int m_ProxyHash;
const char* m_ProxyText;
bool m_TaskUse;
SayLinkBody_Struct m_LinkBodyStruct;
SayLinkProxy_Struct m_LinkProxyStruct;
bool m_TaskUse;
std::string m_Link;
std::string m_LinkBody;
std::string m_LinkText;
+13
View File
@@ -190,6 +190,8 @@
#define ServerOP_ReloadLogs 0x4010
#define ServerOP_ReloadPerlExportSettings 0x4011
#define ServerOP_CZSetEntityVariableByClientName 0x4012
#define ServerOP_UCSServerStatusRequest 0x4013
#define ServerOP_UCSServerStatusReply 0x4014
/* Query Server OP Codes */
#define ServerOP_QSPlayerLogTrades 0x5010
#define ServerOP_QSPlayerLogHandins 0x5011
@@ -1278,6 +1280,17 @@ struct ServerRequestTellQueue_Struct {
char name[64];
};
struct UCSServerStatus_Struct {
uint8 available; // non-zero=true, 0=false
union {
struct {
uint16 port;
uint16 unused;
};
uint32 timestamp;
};
};
#pragma pack()
#endif
+35
View File
@@ -110,6 +110,41 @@ uint32 SharedDatabase::GetTotalTimeEntitledOnAccount(uint32 AccountID) {
return EntitledTime;
}
void SharedDatabase::SetMailKey(int CharID, int IPAddress, int MailKey)
{
char MailKeyString[17];
if (RuleB(Chat, EnableMailKeyIPVerification) == true)
sprintf(MailKeyString, "%08X%08X", IPAddress, MailKey);
else
sprintf(MailKeyString, "%08X", MailKey);
std::string query = StringFormat("UPDATE character_data SET mailkey = '%s' WHERE id = '%i'",
MailKeyString, CharID);
auto results = QueryDatabase(query);
if (!results.Success())
Log(Logs::General, Logs::Error, "SharedDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str());
}
std::string SharedDatabase::GetMailKey(int CharID, bool key_only)
{
std::string query = StringFormat("SELECT `mailkey` FROM `character_data` WHERE `id`='%i' LIMIT 1", CharID);
auto results = QueryDatabase(query);
if (!results.Success()) {
Log(Logs::Detail, Logs::MySQLError, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str());
return std::string();
}
auto row = results.begin();
std::string mail_key = row[0];
if (mail_key.length() > 8 && key_only)
return mail_key.substr(8);
else
return mail_key;
}
bool SharedDatabase::SaveCursor(uint32 char_id, std::list<EQEmu::ItemInstance*>::const_iterator &start, std::list<EQEmu::ItemInstance*>::const_iterator &end)
{
// Delete cursor items
+2
View File
@@ -72,6 +72,8 @@ class SharedDatabase : public Database
void SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* message);
bool GetCommandSettings(std::map<std::string, std::pair<uint8, std::vector<std::string>>> &command_settings);
uint32 GetTotalTimeEntitledOnAccount(uint32 AccountID);
void SetMailKey(int CharID, int IPAddress, int MailKey);
std::string GetMailKey(int CharID, bool key_only = false);
/*
Character InventoryProfile
-1
View File
@@ -972,7 +972,6 @@ bool IsCastWhileInvis(uint16 spell_id);
bool IsEffectIgnoredInStacking(int spa);
int CalcPetHp(int levelb, int classb, int STA = 75);
const char *GetRandPetName();
int GetSpellEffectDescNum(uint16 spell_id);
DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType = 0);
bool DetrimentalSpellAllowsRest(uint16 spell_id);
+1 -1
View File
@@ -30,7 +30,7 @@
Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/
#define CURRENT_BINARY_DATABASE_VERSION 9120
#define CURRENT_BINARY_DATABASE_VERSION 9122
#ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9018
#else