mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Implemented per-client character creation limits
This commit is contained in:
@@ -49,7 +49,6 @@ public:
|
||||
// database
|
||||
static const ClientVersion CHARACTER_CREATION_CLIENT = ClientVersion::RoF2; // adjust according to starting item placement and target client
|
||||
|
||||
// This value should be at least 8 or Titanium will have issues (tested at 6)
|
||||
static const size_t CHARACTER_CREATION_LIMIT = RoF2::consts::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
// inventory
|
||||
|
||||
+38
-24
@@ -158,32 +158,46 @@ struct CharSelectEquip
|
||||
Color_Struct Color;
|
||||
};
|
||||
|
||||
struct CharacterSelectEntry_Struct
|
||||
{
|
||||
char Name[64];
|
||||
uint8 Class;
|
||||
uint32 Race;
|
||||
uint8 Level;
|
||||
uint8 ShroudClass;
|
||||
uint32 ShroudRace;
|
||||
uint16 Zone;
|
||||
uint16 Instance;
|
||||
uint8 Gender;
|
||||
uint8 Face;
|
||||
CharSelectEquip Equip[9];
|
||||
uint8 Unknown15; // Seen FF
|
||||
uint8 Unknown19; // Seen FF
|
||||
uint32 DrakkinTattoo;
|
||||
uint32 DrakkinDetails;
|
||||
uint32 Deity;
|
||||
uint32 PrimaryIDFile;
|
||||
uint32 SecondaryIDFile;
|
||||
uint8 HairColor;
|
||||
uint8 BeardColor;
|
||||
uint8 EyeColor1;
|
||||
uint8 EyeColor2;
|
||||
uint8 HairStyle;
|
||||
uint8 Beard;
|
||||
uint8 Enabled;
|
||||
uint8 Tutorial; // Seen 1 for new char or 0 for existing
|
||||
uint32 DrakkinHeritage;
|
||||
uint8 Unknown1; // Seen 0
|
||||
uint8 GoHome; // Seen 0 for new char and 1 for existing
|
||||
uint32 LastLogin;
|
||||
uint8 Unknown2; // Seen 0
|
||||
};
|
||||
|
||||
struct CharacterSelect_Struct
|
||||
{
|
||||
uint32 Race[10]; // Characters Race
|
||||
uint8 BeardColor[10]; // Characters beard Color
|
||||
uint8 HairStyle[10]; // Characters hair style
|
||||
CharSelectEquip Equip[10][9];
|
||||
uint32 Secondary[10]; // Characters secondary IDFile number
|
||||
uint32 DrakkinHeritage[10]; // added for SoF
|
||||
uint32 DrakkinTattoo[10]; // added for SoF
|
||||
uint32 DrakkinDetails[10]; // added for SoF
|
||||
uint32 Deity[10]; // Characters Deity
|
||||
uint8 GoHome[10]; // 1=Go Home available, 0=not
|
||||
uint8 Tutorial[10]; // 1=Tutorial available, 0=not
|
||||
uint8 Beard[10]; // Characters Beard Type
|
||||
uint8 Unknown902[10]; // 10x ff
|
||||
uint32 Primary[10]; // Characters primary IDFile number
|
||||
uint8 HairColor[10]; // Characters Hair Color
|
||||
uint8 Unknown0962[2]; // 2x 00
|
||||
uint32 Zone[10]; // Characters Current Zone
|
||||
uint8 Class_[10]; // Characters Classes
|
||||
uint8 Face[10]; // Characters Face Type
|
||||
char Name[10][64]; // Characters Names
|
||||
uint8 Gender[10]; // Characters Gender
|
||||
uint8 EyeColor1[10]; // Characters Eye Color
|
||||
uint8 EyeColor2[10]; // Characters Eye 2 Color
|
||||
uint8 Level[10]; // Characters Levels
|
||||
uint32 CharCount; //number of chars in this packet
|
||||
uint32 TotalChars; //total number of chars allowed?
|
||||
CharacterSelectEntry_Struct Entries[0];
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
+82
-68
@@ -2897,85 +2897,99 @@ namespace RoF
|
||||
|
||||
ENCODE(OP_SendCharInfo)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(CharacterSelect_Struct);
|
||||
ENCODE_LENGTH_ATLEAST(CharacterSelect_Struct);
|
||||
SETUP_VAR_ENCODE(CharacterSelect_Struct);
|
||||
|
||||
//EQApplicationPacket *packet = *p;
|
||||
//const CharacterSelect_Struct *emu = (CharacterSelect_Struct *) packet->pBuffer;
|
||||
// Zero-character count shunt
|
||||
if (emu->CharCount == 0) {
|
||||
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, sizeof(structs::CharacterSelect_Struct));
|
||||
eq->CharCount = emu->CharCount;
|
||||
|
||||
int char_count;
|
||||
int namelen = 0;
|
||||
for (char_count = 0; char_count < 10; char_count++) {
|
||||
if (emu->Name[char_count][0] == '\0')
|
||||
break;
|
||||
if (strcmp(emu->Name[char_count], "<none>") == 0)
|
||||
break;
|
||||
namelen += strlen(emu->Name[char_count]);
|
||||
FINISH_ENCODE();
|
||||
return;
|
||||
}
|
||||
|
||||
int total_length = sizeof(structs::CharacterSelect_Struct)
|
||||
+ char_count * sizeof(structs::CharacterSelectEntry_Struct)
|
||||
+ namelen;
|
||||
unsigned char *emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
CharacterSelectEntry_Struct *emu_cse = (CharacterSelectEntry_Struct *)nullptr;
|
||||
|
||||
size_t names_length = 0;
|
||||
size_t character_count = 0;
|
||||
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
names_length += strlen(emu_cse->Name);
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
}
|
||||
|
||||
size_t total_length = sizeof(structs::CharacterSelect_Struct)
|
||||
+ character_count * sizeof(structs::CharacterSelectEntry_Struct)
|
||||
+ names_length;
|
||||
|
||||
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, total_length);
|
||||
structs::CharacterSelectEntry_Struct *eq_cse = (structs::CharacterSelectEntry_Struct *)nullptr;
|
||||
|
||||
//unsigned char *eq_buffer = new unsigned char[total_length];
|
||||
//structs::CharacterSelect_Struct *eq_head = (structs::CharacterSelect_Struct *) eq_buffer;
|
||||
eq->CharCount = character_count;
|
||||
//eq->TotalChars = emu->TotalChars;
|
||||
|
||||
eq->CharCount = char_count;
|
||||
//eq->total_chars = 10;
|
||||
//if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
||||
// eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
unsigned char *bufptr = (unsigned char *)eq->Entries;
|
||||
int r;
|
||||
for (r = 0; r < char_count; r++) {
|
||||
{ //pre-name section...
|
||||
structs::CharacterSelectEntry_Struct *eq2 = (structs::CharacterSelectEntry_Struct *) bufptr;
|
||||
memcpy(eq2->Name, emu->Name[r], strlen(emu->Name[r]) + 1);
|
||||
emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
|
||||
unsigned char *eq_ptr = __packet->pBuffer;
|
||||
eq_ptr += sizeof(structs::CharacterSelect_Struct);
|
||||
|
||||
for (int counter = 0; counter < character_count; ++counter) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
eq_cse = (structs::CharacterSelectEntry_Struct *)eq_ptr;
|
||||
|
||||
strcpy(eq_cse->Name, emu_cse->Name);
|
||||
eq_ptr += strlen(eq_cse->Name);
|
||||
eq_cse = (structs::CharacterSelectEntry_Struct *)eq_ptr;
|
||||
|
||||
eq_cse->Class = emu_cse->Class;
|
||||
eq_cse->Race = emu_cse->Race;
|
||||
eq_cse->Level = emu_cse->Level;
|
||||
eq_cse->ShroudClass = emu_cse->ShroudClass;
|
||||
eq_cse->ShroudRace = emu_cse->ShroudRace;
|
||||
eq_cse->Zone = emu_cse->Zone;
|
||||
eq_cse->Instance = emu_cse->Instance;
|
||||
eq_cse->Gender = emu_cse->Gender;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < _MaterialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
|
||||
eq_cse->Equip[equip_index].HeroForgeModel = emu_cse->Equip[equip_index].HeroForgeModel;
|
||||
eq_cse->Equip[equip_index].Material2 = emu_cse->Equip[equip_index].Material2;
|
||||
eq_cse->Equip[equip_index].Color.Color = emu_cse->Equip[equip_index].Color.Color;
|
||||
}
|
||||
//adjust for name.
|
||||
bufptr += strlen(emu->Name[r]);
|
||||
{ //post-name section...
|
||||
structs::CharacterSelectEntry_Struct *eq2 = (structs::CharacterSelectEntry_Struct *) bufptr;
|
||||
eq2->Class_ = emu->Class_[r];
|
||||
eq2->Race = emu->Race[r];
|
||||
eq2->Level = emu->Level[r];
|
||||
eq2->Class_2 = emu->Class_[r];
|
||||
eq2->Race2 = emu->Race[r];
|
||||
eq2->Zone = emu->Zone[r];
|
||||
eq2->Instance = 0;
|
||||
eq2->Gender = emu->Gender[r];
|
||||
eq2->Face = emu->Face[r];
|
||||
int k;
|
||||
for (k = 0; k < _MaterialCount; k++) {
|
||||
eq2->Equip[k].Material = emu->Equip[r][k].Material;
|
||||
eq2->Equip[k].Unknown1 = emu->Equip[r][k].Unknown1;
|
||||
eq2->Equip[k].EliteMaterial = emu->Equip[r][k].EliteMaterial;
|
||||
eq2->Equip[k].HeroForgeModel = emu->Equip[r][k].HeroForgeModel;
|
||||
eq2->Equip[k].Material2 = emu->Equip[r][k].Material2;
|
||||
eq2->Equip[k].Color.Color = emu->Equip[r][k].Color.Color;
|
||||
}
|
||||
eq2->Unknown15 = 0xFF;
|
||||
eq2->Uknown19 = 0xFF;
|
||||
eq2->DrakkinTattoo = emu->DrakkinTattoo[r];
|
||||
eq2->DrakkinDetails = emu->DrakkinDetails[r];
|
||||
eq2->Deity = emu->Deity[r];
|
||||
eq2->Primary = emu->Primary[r];
|
||||
eq2->Secondary = emu->Secondary[r];
|
||||
eq2->HairColor = emu->HairColor[r];
|
||||
eq2->BeardColor = emu->BeardColor[r];
|
||||
eq2->EyeColor1 = emu->EyeColor1[r];
|
||||
eq2->EyeColor2 = emu->EyeColor2[r];
|
||||
eq2->HairStyle = emu->HairStyle[r];
|
||||
eq2->Beard = emu->Beard[r];
|
||||
eq2->CharEnabled = 1;
|
||||
eq2->Tutorial = emu->Tutorial[r];
|
||||
eq2->DrakkinHeritage = emu->DrakkinHeritage[r];
|
||||
eq2->Unknown1 = 0;
|
||||
eq2->GoHome = emu->GoHome[r];
|
||||
eq2->LastLogin = 1212696584;
|
||||
eq2->Unknown2 = 0;
|
||||
}
|
||||
bufptr += sizeof(structs::CharacterSelectEntry_Struct);
|
||||
|
||||
eq_cse->Unknown15 = emu_cse->Unknown15;
|
||||
eq_cse->Unknown19 = emu_cse->Unknown19;
|
||||
eq_cse->DrakkinTattoo = emu_cse->DrakkinTattoo;
|
||||
eq_cse->DrakkinDetails = emu_cse->DrakkinDetails;
|
||||
eq_cse->Deity = emu_cse->Deity;
|
||||
eq_cse->PrimaryIDFile = emu_cse->PrimaryIDFile;
|
||||
eq_cse->SecondaryIDFile = emu_cse->SecondaryIDFile;
|
||||
eq_cse->HairColor = emu_cse->HairColor;
|
||||
eq_cse->BeardColor = emu_cse->BeardColor;
|
||||
eq_cse->EyeColor1 = emu_cse->EyeColor1;
|
||||
eq_cse->EyeColor2 = emu_cse->EyeColor2;
|
||||
eq_cse->HairStyle = emu_cse->HairStyle;
|
||||
eq_cse->Beard = emu_cse->Beard;
|
||||
eq_cse->Enabled = emu_cse->Enabled;
|
||||
eq_cse->Tutorial = emu_cse->Tutorial;
|
||||
eq_cse->DrakkinHeritage = emu_cse->DrakkinHeritage;
|
||||
eq_cse->Unknown1 = emu_cse->Unknown1;
|
||||
eq_cse->GoHome = emu_cse->GoHome;
|
||||
eq_cse->LastLogin = emu_cse->LastLogin;
|
||||
eq_cse->Unknown2 = emu_cse->Unknown2;
|
||||
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
eq_ptr += sizeof(structs::CharacterSelectEntry_Struct);
|
||||
}
|
||||
|
||||
FINISH_ENCODE();
|
||||
|
||||
+82
-68
@@ -2981,85 +2981,99 @@ namespace RoF2
|
||||
|
||||
ENCODE(OP_SendCharInfo)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(CharacterSelect_Struct);
|
||||
ENCODE_LENGTH_ATLEAST(CharacterSelect_Struct);
|
||||
SETUP_VAR_ENCODE(CharacterSelect_Struct);
|
||||
|
||||
//EQApplicationPacket *packet = *p;
|
||||
//const CharacterSelect_Struct *emu = (CharacterSelect_Struct *) packet->pBuffer;
|
||||
// Zero-character count shunt
|
||||
if (emu->CharCount == 0) {
|
||||
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, sizeof(structs::CharacterSelect_Struct));
|
||||
eq->CharCount = emu->CharCount;
|
||||
|
||||
int char_count;
|
||||
int namelen = 0;
|
||||
for (char_count = 0; char_count < 10; char_count++) {
|
||||
if (emu->Name[char_count][0] == '\0')
|
||||
break;
|
||||
if (strcmp(emu->Name[char_count], "<none>") == 0)
|
||||
break;
|
||||
namelen += strlen(emu->Name[char_count]);
|
||||
FINISH_ENCODE();
|
||||
return;
|
||||
}
|
||||
|
||||
int total_length = sizeof(structs::CharacterSelect_Struct)
|
||||
+ char_count * sizeof(structs::CharacterSelectEntry_Struct)
|
||||
+ namelen;
|
||||
unsigned char *emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
CharacterSelectEntry_Struct *emu_cse = (CharacterSelectEntry_Struct *)nullptr;
|
||||
|
||||
size_t names_length = 0;
|
||||
size_t character_count = 0;
|
||||
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
names_length += strlen(emu_cse->Name);
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
}
|
||||
|
||||
size_t total_length = sizeof(structs::CharacterSelect_Struct)
|
||||
+ character_count * sizeof(structs::CharacterSelectEntry_Struct)
|
||||
+ names_length;
|
||||
|
||||
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, total_length);
|
||||
structs::CharacterSelectEntry_Struct *eq_cse = (structs::CharacterSelectEntry_Struct *)nullptr;
|
||||
|
||||
//unsigned char *eq_buffer = new unsigned char[total_length];
|
||||
//structs::CharacterSelect_Struct *eq_head = (structs::CharacterSelect_Struct *) eq_buffer;
|
||||
eq->CharCount = character_count;
|
||||
//eq->TotalChars = emu->TotalChars;
|
||||
|
||||
eq->CharCount = char_count;
|
||||
//eq->total_chars = 10;
|
||||
//if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
||||
// eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
unsigned char *bufptr = (unsigned char *)eq->Entries;
|
||||
int r;
|
||||
for (r = 0; r < char_count; r++) {
|
||||
{ //pre-name section...
|
||||
structs::CharacterSelectEntry_Struct *eq2 = (structs::CharacterSelectEntry_Struct *) bufptr;
|
||||
memcpy(eq2->Name, emu->Name[r], strlen(emu->Name[r]) + 1);
|
||||
emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
|
||||
unsigned char *eq_ptr = __packet->pBuffer;
|
||||
eq_ptr += sizeof(structs::CharacterSelect_Struct);
|
||||
|
||||
for (int counter = 0; counter < character_count; ++counter) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
eq_cse = (structs::CharacterSelectEntry_Struct *)eq_ptr;
|
||||
|
||||
strcpy(eq_cse->Name, emu_cse->Name);
|
||||
eq_ptr += strlen(eq_cse->Name);
|
||||
eq_cse = (structs::CharacterSelectEntry_Struct *)eq_ptr;
|
||||
|
||||
eq_cse->Class = emu_cse->Class;
|
||||
eq_cse->Race = emu_cse->Race;
|
||||
eq_cse->Level = emu_cse->Level;
|
||||
eq_cse->ShroudClass = emu_cse->ShroudClass;
|
||||
eq_cse->ShroudRace = emu_cse->ShroudRace;
|
||||
eq_cse->Zone = emu_cse->Zone;
|
||||
eq_cse->Instance = emu_cse->Instance;
|
||||
eq_cse->Gender = emu_cse->Gender;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < _MaterialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
|
||||
eq_cse->Equip[equip_index].HeroForgeModel = emu_cse->Equip[equip_index].HeroForgeModel;
|
||||
eq_cse->Equip[equip_index].Material2 = emu_cse->Equip[equip_index].Material2;
|
||||
eq_cse->Equip[equip_index].Color.Color = emu_cse->Equip[equip_index].Color.Color;
|
||||
}
|
||||
//adjust for name.
|
||||
bufptr += strlen(emu->Name[r]);
|
||||
{ //post-name section...
|
||||
structs::CharacterSelectEntry_Struct *eq2 = (structs::CharacterSelectEntry_Struct *) bufptr;
|
||||
eq2->Class_ = emu->Class_[r];
|
||||
eq2->Race = emu->Race[r];
|
||||
eq2->Level = emu->Level[r];
|
||||
eq2->Class_2 = emu->Class_[r];
|
||||
eq2->Race2 = emu->Race[r];
|
||||
eq2->Zone = emu->Zone[r];
|
||||
eq2->Instance = 0;
|
||||
eq2->Gender = emu->Gender[r];
|
||||
eq2->Face = emu->Face[r];
|
||||
int k;
|
||||
for (k = 0; k < _MaterialCount; k++) {
|
||||
eq2->Equip[k].Material = emu->Equip[r][k].Material;
|
||||
eq2->Equip[k].Unknown1 = emu->Equip[r][k].Unknown1;
|
||||
eq2->Equip[k].EliteMaterial = emu->Equip[r][k].EliteMaterial;
|
||||
eq2->Equip[k].HeroForgeModel = emu->Equip[r][k].HeroForgeModel;
|
||||
eq2->Equip[k].Material2 = emu->Equip[r][k].Material2;
|
||||
eq2->Equip[k].Color.Color = emu->Equip[r][k].Color.Color;
|
||||
}
|
||||
eq2->Unknown15 = 0xFF;
|
||||
eq2->Unknown19 = 0xFF;
|
||||
eq2->DrakkinTattoo = emu->DrakkinTattoo[r];
|
||||
eq2->DrakkinDetails = emu->DrakkinDetails[r];
|
||||
eq2->Deity = emu->Deity[r];
|
||||
eq2->Primary = emu->Primary[r];
|
||||
eq2->Secondary = emu->Secondary[r];
|
||||
eq2->HairColor = emu->HairColor[r];
|
||||
eq2->BeardColor = emu->BeardColor[r];
|
||||
eq2->EyeColor1 = emu->EyeColor1[r];
|
||||
eq2->EyeColor2 = emu->EyeColor2[r];
|
||||
eq2->HairStyle = emu->HairStyle[r];
|
||||
eq2->Beard = emu->Beard[r];
|
||||
eq2->CharEnabled = 1;
|
||||
eq2->Tutorial = emu->Tutorial[r];
|
||||
eq2->DrakkinHeritage = emu->DrakkinHeritage[r];
|
||||
eq2->Unknown1 = 0;
|
||||
eq2->GoHome = emu->GoHome[r];
|
||||
eq2->LastLogin = 1212696584;
|
||||
eq2->Unknown2 = 0;
|
||||
}
|
||||
bufptr += sizeof(structs::CharacterSelectEntry_Struct);
|
||||
|
||||
eq_cse->Unknown15 = emu_cse->Unknown15;
|
||||
eq_cse->Unknown19 = emu_cse->Unknown19;
|
||||
eq_cse->DrakkinTattoo = emu_cse->DrakkinTattoo;
|
||||
eq_cse->DrakkinDetails = emu_cse->DrakkinDetails;
|
||||
eq_cse->Deity = emu_cse->Deity;
|
||||
eq_cse->PrimaryIDFile = emu_cse->PrimaryIDFile;
|
||||
eq_cse->SecondaryIDFile = emu_cse->SecondaryIDFile;
|
||||
eq_cse->HairColor = emu_cse->HairColor;
|
||||
eq_cse->BeardColor = emu_cse->BeardColor;
|
||||
eq_cse->EyeColor1 = emu_cse->EyeColor1;
|
||||
eq_cse->EyeColor2 = emu_cse->EyeColor2;
|
||||
eq_cse->HairStyle = emu_cse->HairStyle;
|
||||
eq_cse->Beard = emu_cse->Beard;
|
||||
eq_cse->Enabled = emu_cse->Enabled;
|
||||
eq_cse->Tutorial = emu_cse->Tutorial;
|
||||
eq_cse->DrakkinHeritage = emu_cse->DrakkinHeritage;
|
||||
eq_cse->Unknown1 = emu_cse->Unknown1;
|
||||
eq_cse->GoHome = emu_cse->GoHome;
|
||||
eq_cse->LastLogin = emu_cse->LastLogin;
|
||||
eq_cse->Unknown2 = emu_cse->Unknown2;
|
||||
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
eq_ptr += sizeof(structs::CharacterSelectEntry_Struct);
|
||||
}
|
||||
|
||||
FINISH_ENCODE();
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace RoF2 {
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 10;
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
|
||||
@@ -166,11 +166,11 @@ struct CharSelectEquip
|
||||
struct CharacterSelectEntry_Struct
|
||||
{
|
||||
/*0000*/ char Name[1]; // Name null terminated
|
||||
/*0000*/ uint8 Class_;
|
||||
/*0000*/ uint8 Class;
|
||||
/*0000*/ uint32 Race;
|
||||
/*0000*/ uint8 Level;
|
||||
/*0000*/ uint8 Class_2;
|
||||
/*0000*/ uint32 Race2;
|
||||
/*0000*/ uint8 ShroudClass;
|
||||
/*0000*/ uint32 ShroudRace;
|
||||
/*0000*/ uint16 Zone;
|
||||
/*0000*/ uint16 Instance;
|
||||
/*0000*/ uint8 Gender;
|
||||
@@ -181,15 +181,15 @@ struct CharacterSelectEntry_Struct
|
||||
/*0000*/ uint32 DrakkinTattoo;
|
||||
/*0000*/ uint32 DrakkinDetails;
|
||||
/*0000*/ uint32 Deity;
|
||||
/*0000*/ uint32 Primary;
|
||||
/*0000*/ uint32 Secondary;
|
||||
/*0000*/ uint32 PrimaryIDFile;
|
||||
/*0000*/ uint32 SecondaryIDFile;
|
||||
/*0000*/ uint8 HairColor;
|
||||
/*0000*/ uint8 BeardColor;
|
||||
/*0000*/ uint8 EyeColor1;
|
||||
/*0000*/ uint8 EyeColor2;
|
||||
/*0000*/ uint8 HairStyle;
|
||||
/*0000*/ uint8 Beard;
|
||||
/*0000*/ uint8 CharEnabled;
|
||||
/*0000*/ uint8 Enabled;
|
||||
/*0000*/ uint8 Tutorial; // Seen 1 for new char or 0 for existing
|
||||
/*0000*/ uint32 DrakkinHeritage;
|
||||
/*0000*/ uint8 Unknown1; // Seen 0
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace RoF {
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 10;
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
|
||||
@@ -165,37 +165,37 @@ struct CharSelectEquip
|
||||
|
||||
struct CharacterSelectEntry_Struct
|
||||
{
|
||||
/*0000*/ char Name[1]; // Name null terminated
|
||||
/*0000*/ uint8 Class_;
|
||||
/*0000*/ char Name[1]; // Name null terminated
|
||||
/*0000*/ uint8 Class;
|
||||
/*0000*/ uint32 Race;
|
||||
/*0000*/ uint8 Level;
|
||||
/*0000*/ uint8 Class_2;
|
||||
/*0000*/ uint32 Race2;
|
||||
/*0000*/ uint8 ShroudClass;
|
||||
/*0000*/ uint32 ShroudRace;
|
||||
/*0000*/ uint16 Zone;
|
||||
/*0000*/ uint16 Instance;
|
||||
/*0000*/ uint8 Gender;
|
||||
/*0000*/ uint8 Face;
|
||||
/*0000*/ CharSelectEquip Equip[9];
|
||||
/*0000*/ uint8 Unknown15; // Seen FF
|
||||
/*0000*/ uint8 Uknown19; // Seen FF
|
||||
/*0000*/ uint8 Unknown15; // Seen FF
|
||||
/*0000*/ uint8 Unknown19; // Seen FF
|
||||
/*0000*/ uint32 DrakkinTattoo;
|
||||
/*0000*/ uint32 DrakkinDetails;
|
||||
/*0000*/ uint32 Deity;
|
||||
/*0000*/ uint32 Primary;
|
||||
/*0000*/ uint32 Secondary;
|
||||
/*0000*/ uint32 PrimaryIDFile;
|
||||
/*0000*/ uint32 SecondaryIDFile;
|
||||
/*0000*/ uint8 HairColor;
|
||||
/*0000*/ uint8 BeardColor;
|
||||
/*0000*/ uint8 EyeColor1;
|
||||
/*0000*/ uint8 EyeColor2;
|
||||
/*0000*/ uint8 HairStyle;
|
||||
/*0000*/ uint8 Beard;
|
||||
/*0000*/ uint8 CharEnabled;
|
||||
/*0000*/ uint8 Tutorial; // Seen 1 for new char or 0 for existing
|
||||
/*0000*/ uint8 Enabled;
|
||||
/*0000*/ uint8 Tutorial; // Seen 1 for new char or 0 for existing
|
||||
/*0000*/ uint32 DrakkinHeritage;
|
||||
/*0000*/ uint8 Unknown1; // Seen 0
|
||||
/*0000*/ uint8 GoHome; // Seen 0 for new char and 1 for existing
|
||||
/*0000*/ uint8 Unknown1; // Seen 0
|
||||
/*0000*/ uint8 GoHome; // Seen 0 for new char and 1 for existing
|
||||
/*0000*/ uint32 LastLogin;
|
||||
/*0000*/ uint8 Unknown2; // Seen 0
|
||||
/*0000*/ uint8 Unknown2; // Seen 0
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
+78
-59
@@ -1911,76 +1911,95 @@ namespace SoD
|
||||
|
||||
ENCODE(OP_SendCharInfo)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(CharacterSelect_Struct);
|
||||
ENCODE_LENGTH_ATLEAST(CharacterSelect_Struct);
|
||||
SETUP_VAR_ENCODE(CharacterSelect_Struct);
|
||||
|
||||
//EQApplicationPacket *packet = *p;
|
||||
//const CharacterSelect_Struct *emu = (CharacterSelect_Struct *) packet->pBuffer;
|
||||
// Zero-character count shunt
|
||||
if (emu->CharCount == 0) {
|
||||
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, sizeof(structs::CharacterSelect_Struct));
|
||||
eq->CharCount = emu->CharCount;
|
||||
eq->TotalChars = eq->TotalChars;
|
||||
|
||||
int char_count;
|
||||
int namelen = 0;
|
||||
for (char_count = 0; char_count < 10; char_count++) {
|
||||
if (emu->Name[char_count][0] == '\0')
|
||||
break;
|
||||
if (strcmp(emu->Name[char_count], "<none>") == 0)
|
||||
break;
|
||||
namelen += strlen(emu->Name[char_count]);
|
||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
FINISH_ENCODE();
|
||||
return;
|
||||
}
|
||||
|
||||
int total_length = sizeof(structs::CharacterSelect_Struct)
|
||||
+ char_count * sizeof(structs::CharacterSelectEntry_Struct)
|
||||
+ namelen;
|
||||
unsigned char *emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
CharacterSelectEntry_Struct *emu_cse = (CharacterSelectEntry_Struct *)nullptr;
|
||||
|
||||
size_t names_length = 0;
|
||||
size_t character_count = 0;
|
||||
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
names_length += strlen(emu_cse->Name);
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
}
|
||||
|
||||
size_t total_length = sizeof(structs::CharacterSelect_Struct)
|
||||
+ character_count * sizeof(structs::CharacterSelectEntry_Struct)
|
||||
+ names_length;
|
||||
|
||||
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, total_length);
|
||||
structs::CharacterSelectEntry_Struct *eq_cse = (structs::CharacterSelectEntry_Struct *)nullptr;
|
||||
|
||||
//unsigned char *eq_buffer = new unsigned char[total_length];
|
||||
//structs::CharacterSelect_Struct *eq_head = (structs::CharacterSelect_Struct *) eq_buffer;
|
||||
eq->CharCount = character_count;
|
||||
eq->TotalChars = emu->TotalChars;
|
||||
|
||||
eq->CharCount = char_count;
|
||||
eq->TotalChars = 10;
|
||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
unsigned char *bufptr = (unsigned char *)eq->Entries;
|
||||
int r;
|
||||
for (r = 0; r < char_count; r++) {
|
||||
{ //pre-name section...
|
||||
structs::CharacterSelectEntry_Struct *eq2 = (structs::CharacterSelectEntry_Struct *) bufptr;
|
||||
eq2->Level = emu->Level[r];
|
||||
eq2->HairStyle = emu->HairStyle[r];
|
||||
eq2->Gender = emu->Gender[r];
|
||||
memcpy(eq2->Name, emu->Name[r], strlen(emu->Name[r]) + 1);
|
||||
emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
|
||||
unsigned char *eq_ptr = __packet->pBuffer;
|
||||
eq_ptr += sizeof(structs::CharacterSelect_Struct);
|
||||
|
||||
for (int counter = 0; counter < character_count; ++counter) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
eq_cse = (structs::CharacterSelectEntry_Struct *)eq_ptr;
|
||||
|
||||
eq_cse->Level = emu_cse->Level;
|
||||
eq_cse->HairStyle = emu_cse->HairStyle;
|
||||
eq_cse->Gender = emu_cse->Gender;
|
||||
|
||||
strcpy(eq_cse->Name, emu_cse->Name);
|
||||
eq_ptr += strlen(eq_cse->Name);
|
||||
eq_cse = (structs::CharacterSelectEntry_Struct *)eq_ptr;
|
||||
|
||||
eq_cse->Beard = emu_cse->Beard;
|
||||
eq_cse->HairColor = emu_cse->HairColor;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < _MaterialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
|
||||
eq_cse->Equip[equip_index].Color.Color = emu_cse->Equip[equip_index].Color.Color;
|
||||
}
|
||||
//adjust for name.
|
||||
bufptr += strlen(emu->Name[r]);
|
||||
{ //post-name section...
|
||||
structs::CharacterSelectEntry_Struct *eq2 = (structs::CharacterSelectEntry_Struct *) bufptr;
|
||||
eq2->Beard = emu->Beard[r];
|
||||
eq2->HairColor = emu->HairColor[r];
|
||||
eq2->Face = emu->Face[r];
|
||||
int k;
|
||||
for (k = 0; k < _MaterialCount; k++) {
|
||||
eq2->Equip[k].Material = emu->Equip[r][k].Material;
|
||||
eq2->Equip[k].Unknown1 = emu->Equip[r][k].Unknown1;
|
||||
eq2->Equip[k].EliteMaterial = emu->Equip[r][k].EliteMaterial;
|
||||
eq2->Equip[k].Color.Color = emu->Equip[r][k].Color.Color;
|
||||
}
|
||||
eq2->Primary = emu->Primary[r];
|
||||
eq2->Secondary = emu->Secondary[r];
|
||||
eq2->Tutorial = emu->Tutorial[r]; // was u15
|
||||
eq2->Unknown15 = 0xFF;
|
||||
eq2->Deity = emu->Deity[r];
|
||||
eq2->Zone = emu->Zone[r];
|
||||
eq2->Unknown19 = 0xFF;
|
||||
eq2->Race = emu->Race[r];
|
||||
eq2->GoHome = emu->GoHome[r];
|
||||
eq2->Class_ = emu->Class_[r];
|
||||
eq2->EyeColor1 = emu->EyeColor1[r];
|
||||
eq2->BeardColor = emu->BeardColor[r];
|
||||
eq2->EyeColor2 = emu->EyeColor2[r];
|
||||
eq2->DrakkinHeritage = emu->DrakkinHeritage[r];
|
||||
eq2->DrakkinTattoo = emu->DrakkinTattoo[r];
|
||||
eq2->DrakkinDetails = emu->DrakkinDetails[r];
|
||||
}
|
||||
bufptr += sizeof(structs::CharacterSelectEntry_Struct);
|
||||
|
||||
eq_cse->PrimaryIDFile = emu_cse->PrimaryIDFile;
|
||||
eq_cse->SecondaryIDFile = emu_cse->SecondaryIDFile;
|
||||
eq_cse->Tutorial = emu_cse->Tutorial;
|
||||
eq_cse->Unknown15 = emu_cse->Unknown15;
|
||||
eq_cse->Deity = emu_cse->Deity;
|
||||
eq_cse->Zone = emu_cse->Zone;
|
||||
eq_cse->Unknown19 = emu_cse->Unknown19;
|
||||
eq_cse->Race = emu_cse->Race;
|
||||
eq_cse->GoHome = emu_cse->GoHome;
|
||||
eq_cse->Class = emu_cse->Class;
|
||||
eq_cse->EyeColor1 = emu_cse->EyeColor1;
|
||||
eq_cse->BeardColor = emu_cse->BeardColor;
|
||||
eq_cse->EyeColor2 = emu_cse->EyeColor2;
|
||||
eq_cse->DrakkinHeritage = emu_cse->DrakkinHeritage;
|
||||
eq_cse->DrakkinTattoo = emu_cse->DrakkinTattoo;
|
||||
eq_cse->DrakkinDetails = emu_cse->DrakkinDetails;
|
||||
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
eq_ptr += sizeof(structs::CharacterSelectEntry_Struct);
|
||||
}
|
||||
|
||||
FINISH_ENCODE();
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace SoD {
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 10;
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
|
||||
@@ -132,8 +132,8 @@ struct CharacterSelectEntry_Struct
|
||||
/*0001*/ uint8 HairColor; //
|
||||
/*0000*/ uint8 Face; //
|
||||
/*0000*/ CharSelectEquip Equip[9];
|
||||
/*0000*/ uint32 Primary; //
|
||||
/*0000*/ uint32 Secondary; //
|
||||
/*0000*/ uint32 PrimaryIDFile; //
|
||||
/*0000*/ uint32 SecondaryIDFile; //
|
||||
/*0000*/ uint8 Unknown15; // 0xff
|
||||
/*0000*/ uint32 Deity; //
|
||||
/*0000*/ uint16 Zone; //
|
||||
@@ -142,7 +142,7 @@ struct CharacterSelectEntry_Struct
|
||||
/*0000*/ uint8 Unknown19; // 0xff
|
||||
/*0000*/ uint32 Race; //
|
||||
/*0000*/ uint8 Tutorial; //
|
||||
/*0000*/ uint8 Class_; //
|
||||
/*0000*/ uint8 Class; //
|
||||
/*0000*/ uint8 EyeColor1; //
|
||||
/*0000*/ uint8 BeardColor; //
|
||||
/*0000*/ uint8 EyeColor2; //
|
||||
|
||||
+78
-59
@@ -1570,76 +1570,95 @@ namespace SoF
|
||||
|
||||
ENCODE(OP_SendCharInfo)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(CharacterSelect_Struct);
|
||||
ENCODE_LENGTH_ATLEAST(CharacterSelect_Struct);
|
||||
SETUP_VAR_ENCODE(CharacterSelect_Struct);
|
||||
|
||||
//EQApplicationPacket *packet = *p;
|
||||
//const CharacterSelect_Struct *emu = (CharacterSelect_Struct *) packet->pBuffer;
|
||||
// Zero-character count shunt
|
||||
if (emu->CharCount == 0) {
|
||||
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, sizeof(structs::CharacterSelect_Struct));
|
||||
eq->CharCount = emu->CharCount;
|
||||
eq->TotalChars = eq->TotalChars;
|
||||
|
||||
int char_count;
|
||||
int namelen = 0;
|
||||
for (char_count = 0; char_count < 10; char_count++) {
|
||||
if (emu->Name[char_count][0] == '\0')
|
||||
break;
|
||||
if (strcmp(emu->Name[char_count], "<none>") == 0)
|
||||
break;
|
||||
namelen += strlen(emu->Name[char_count]);
|
||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
FINISH_ENCODE();
|
||||
return;
|
||||
}
|
||||
|
||||
int total_length = sizeof(structs::CharacterSelect_Struct)
|
||||
+ char_count * sizeof(structs::CharacterSelectEntry_Struct)
|
||||
+ namelen;
|
||||
unsigned char *emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
CharacterSelectEntry_Struct *emu_cse = (CharacterSelectEntry_Struct *)nullptr;
|
||||
|
||||
size_t names_length = 0;
|
||||
size_t character_count = 0;
|
||||
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
names_length += strlen(emu_cse->Name);
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
}
|
||||
|
||||
size_t total_length = sizeof(structs::CharacterSelect_Struct)
|
||||
+ character_count * sizeof(structs::CharacterSelectEntry_Struct)
|
||||
+ names_length;
|
||||
|
||||
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, total_length);
|
||||
structs::CharacterSelectEntry_Struct *eq_cse = (structs::CharacterSelectEntry_Struct *)nullptr;
|
||||
|
||||
//unsigned char *eq_buffer = new unsigned char[total_length];
|
||||
//structs::CharacterSelect_Struct *eq_head = (structs::CharacterSelect_Struct *) eq_buffer;
|
||||
eq->CharCount = character_count;
|
||||
eq->TotalChars = emu->TotalChars;
|
||||
|
||||
eq->CharCount = char_count;
|
||||
eq->TotalChars = 10;
|
||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
unsigned char *bufptr = (unsigned char *)eq->Entries;
|
||||
int r;
|
||||
for (r = 0; r < char_count; r++) {
|
||||
{ //pre-name section...
|
||||
structs::CharacterSelectEntry_Struct *eq2 = (structs::CharacterSelectEntry_Struct *) bufptr;
|
||||
eq2->Level = emu->Level[r];
|
||||
eq2->HairStyle = emu->HairStyle[r];
|
||||
eq2->Gender = emu->Gender[r];
|
||||
memcpy(eq2->Name, emu->Name[r], strlen(emu->Name[r]) + 1);
|
||||
emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
|
||||
unsigned char *eq_ptr = __packet->pBuffer;
|
||||
eq_ptr += sizeof(structs::CharacterSelect_Struct);
|
||||
|
||||
for (int counter = 0; counter < character_count; ++counter) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
eq_cse = (structs::CharacterSelectEntry_Struct *)eq_ptr;
|
||||
|
||||
eq_cse->Level = emu_cse->Level;
|
||||
eq_cse->HairStyle = emu_cse->HairStyle;
|
||||
eq_cse->Gender = emu_cse->Gender;
|
||||
|
||||
strcpy(eq_cse->Name, emu_cse->Name);
|
||||
eq_ptr += strlen(eq_cse->Name);
|
||||
eq_cse = (structs::CharacterSelectEntry_Struct *)eq_ptr;
|
||||
|
||||
eq_cse->Beard = emu_cse->Beard;
|
||||
eq_cse->HairColor = emu_cse->HairColor;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < _MaterialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
|
||||
eq_cse->Equip[equip_index].Color.Color = emu_cse->Equip[equip_index].Color.Color;
|
||||
}
|
||||
//adjust for name.
|
||||
bufptr += strlen(emu->Name[r]);
|
||||
{ //post-name section...
|
||||
structs::CharacterSelectEntry_Struct *eq2 = (structs::CharacterSelectEntry_Struct *) bufptr;
|
||||
eq2->Beard = emu->Beard[r];
|
||||
eq2->HairColor = emu->HairColor[r];
|
||||
eq2->Face = emu->Face[r];
|
||||
int k;
|
||||
for (k = 0; k < _MaterialCount; k++) {
|
||||
eq2->Equip[k].Material = emu->Equip[r][k].Material;
|
||||
eq2->Equip[k].Unknown1 = emu->Equip[r][k].Unknown1;
|
||||
eq2->Equip[k].EliteMaterial = emu->Equip[r][k].EliteMaterial;
|
||||
eq2->Equip[k].Color.Color = emu->Equip[r][k].Color.Color;
|
||||
}
|
||||
eq2->Primary = emu->Primary[r];
|
||||
eq2->Secondary = emu->Secondary[r];
|
||||
eq2->Tutorial = emu->Tutorial[r]; // was u15
|
||||
eq2->Unknown15 = 0xff;
|
||||
eq2->Deity = emu->Deity[r];
|
||||
eq2->Zone = emu->Zone[r];
|
||||
eq2->Unknown19 = 0xFF;
|
||||
eq2->Race = emu->Race[r];
|
||||
eq2->GoHome = emu->GoHome[r];
|
||||
eq2->Class_ = emu->Class_[r];
|
||||
eq2->EyeColor1 = emu->EyeColor1[r];
|
||||
eq2->BeardColor = emu->BeardColor[r];
|
||||
eq2->EyeColor2 = emu->EyeColor2[r];
|
||||
eq2->DrakkinHeritage = emu->DrakkinHeritage[r];
|
||||
eq2->DrakkinTattoo = emu->DrakkinTattoo[r];
|
||||
eq2->DrakkinDetails = emu->DrakkinDetails[r];
|
||||
}
|
||||
bufptr += sizeof(structs::CharacterSelectEntry_Struct);
|
||||
|
||||
eq_cse->PrimaryIDFile = emu_cse->PrimaryIDFile;
|
||||
eq_cse->SecondaryIDFile = emu_cse->SecondaryIDFile;
|
||||
eq_cse->Tutorial = emu_cse->Tutorial;
|
||||
eq_cse->Unknown15 = emu_cse->Unknown15;
|
||||
eq_cse->Deity = emu_cse->Deity;
|
||||
eq_cse->Zone = emu_cse->Zone;
|
||||
eq_cse->Unknown19 = emu_cse->Unknown19;
|
||||
eq_cse->Race = emu_cse->Race;
|
||||
eq_cse->GoHome = emu_cse->GoHome;
|
||||
eq_cse->Class = emu_cse->Class;
|
||||
eq_cse->EyeColor1 = emu_cse->EyeColor1;
|
||||
eq_cse->BeardColor = emu_cse->BeardColor;
|
||||
eq_cse->EyeColor2 = emu_cse->EyeColor2;
|
||||
eq_cse->DrakkinHeritage = emu_cse->DrakkinHeritage;
|
||||
eq_cse->DrakkinTattoo = emu_cse->DrakkinTattoo;
|
||||
eq_cse->DrakkinDetails = emu_cse->DrakkinDetails;
|
||||
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
eq_ptr += sizeof(structs::CharacterSelectEntry_Struct);
|
||||
}
|
||||
|
||||
FINISH_ENCODE();
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace SoF {
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 10;
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
|
||||
@@ -132,17 +132,17 @@ struct CharacterSelectEntry_Struct
|
||||
/*0001*/ uint8 HairColor; //
|
||||
/*0000*/ uint8 Face; //
|
||||
/*0000*/ CharSelectEquip Equip[9];
|
||||
/*0000*/ uint32 Primary; //
|
||||
/*0000*/ uint32 Secondary; //
|
||||
/*0000*/ uint8 Unknown15; // 0xff
|
||||
/*0000*/ uint32 PrimaryIDFile; //
|
||||
/*0000*/ uint32 SecondaryIDFile; //
|
||||
/*0000*/ uint8 Unknown15; // 0xff
|
||||
/*0000*/ uint32 Deity; //
|
||||
/*0000*/ uint16 Zone; //
|
||||
/*0000*/ uint16 Instance;
|
||||
/*0000*/ uint8 GoHome; //
|
||||
/*0000*/ uint8 Unknown19; // 0xff
|
||||
/*0000*/ uint8 Unknown19; // 0xff
|
||||
/*0000*/ uint32 Race; //
|
||||
/*0000*/ uint8 Tutorial; //
|
||||
/*0000*/ uint8 Class_; //
|
||||
/*0000*/ uint8 Class; //
|
||||
/*0000*/ uint8 EyeColor1; //
|
||||
/*0000*/ uint8 BeardColor; //
|
||||
/*0000*/ uint8 EyeColor2; //
|
||||
|
||||
+87
-30
@@ -1155,39 +1155,96 @@ namespace Titanium
|
||||
|
||||
ENCODE(OP_SendCharInfo)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(CharacterSelect_Struct);
|
||||
ENCODE_LENGTH_ATLEAST(CharacterSelect_Struct);
|
||||
SETUP_DIRECT_ENCODE(CharacterSelect_Struct, structs::CharacterSelect_Struct);
|
||||
|
||||
int r;
|
||||
for (r = 0; r < 10; r++) {
|
||||
OUT(Zone[r]);
|
||||
OUT(EyeColor1[r]);
|
||||
OUT(EyeColor2[r]);
|
||||
OUT(HairStyle[r]);
|
||||
OUT(Primary[r]);
|
||||
if (emu->Race[r] > 473)
|
||||
eq->Race[r] = 1;
|
||||
else
|
||||
eq->Race[r] = emu->Race[r];
|
||||
OUT(Class_[r]);
|
||||
OUT_str(Name[r]);
|
||||
OUT(Gender[r]);
|
||||
OUT(Level[r]);
|
||||
OUT(Secondary[r]);
|
||||
OUT(Face[r]);
|
||||
OUT(Beard[r]);
|
||||
int k;
|
||||
for (k = 0; k < 9; k++) {
|
||||
eq->Equip[r][k] = emu->Equip[r][k].Material;
|
||||
eq->CS_Colors[r][k].Color = emu->Equip[r][k].Color.Color;
|
||||
unsigned char *emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
CharacterSelectEntry_Struct *emu_cse = (CharacterSelectEntry_Struct *)nullptr;
|
||||
|
||||
for (size_t index = 0; index < 10; ++index) {
|
||||
memset(eq->Name[index], 0, 64);
|
||||
}
|
||||
|
||||
// Non character-indexed packet fields
|
||||
eq->Unknown830[0] = 0;
|
||||
eq->Unknown830[1] = 0;
|
||||
eq->Unknown0962[0] = 0;
|
||||
eq->Unknown0962[1] = 0;
|
||||
|
||||
size_t char_index = 0;
|
||||
for (; char_index < emu->CharCount && char_index < 8; ++char_index) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
|
||||
eq->Race[char_index] = emu_cse->Race;
|
||||
if (eq->Race[char_index] > 473)
|
||||
eq->Race[char_index] = 1;
|
||||
|
||||
for (int index = 0; index < _MaterialCount; ++index) {
|
||||
eq->CS_Colors[char_index][index].Color = emu_cse->Equip[index].Color.Color;
|
||||
}
|
||||
OUT(HairColor[r]);
|
||||
OUT(GoHome[r]);
|
||||
OUT(Tutorial[r]);
|
||||
OUT(Deity[r]);
|
||||
OUT(BeardColor[r]);
|
||||
eq->Unknown820[r] = 0xFF;
|
||||
eq->Unknown902[r] = 0xFF;
|
||||
|
||||
eq->BeardColor[char_index] = emu_cse->BeardColor;
|
||||
eq->HairStyle[char_index] = emu_cse->HairStyle;
|
||||
|
||||
for (int index = 0; index < _MaterialCount; ++index) {
|
||||
eq->Equip[char_index][index] = emu_cse->Equip[index].Material;
|
||||
}
|
||||
|
||||
eq->SecondaryIDFile[char_index] = emu_cse->SecondaryIDFile;
|
||||
eq->Unknown820[char_index] = 0xFF;
|
||||
eq->Deity[char_index] = emu_cse->Deity;
|
||||
eq->GoHome[char_index] = emu_cse->GoHome;
|
||||
eq->Tutorial[char_index] = emu_cse->Tutorial;
|
||||
eq->Beard[char_index] = emu_cse->Beard;
|
||||
eq->Unknown902[char_index] = 0xFF;
|
||||
eq->PrimaryIDFile[char_index] = emu_cse->PrimaryIDFile;
|
||||
eq->HairColor[char_index] = emu_cse->HairColor;
|
||||
eq->Zone[char_index] = emu_cse->Zone;
|
||||
eq->Class[char_index] = emu_cse->Class;
|
||||
eq->Face[char_index] = emu_cse->Face;
|
||||
|
||||
memcpy(eq->Name[char_index], emu_cse->Name, 64);
|
||||
|
||||
eq->Gender[char_index] = emu_cse->Gender;
|
||||
eq->EyeColor1[char_index] = emu_cse->EyeColor1;
|
||||
eq->EyeColor2[char_index] = emu_cse->EyeColor2;
|
||||
eq->Level[char_index] = emu_cse->Level;
|
||||
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
}
|
||||
|
||||
for (; char_index < 10; ++char_index) {
|
||||
eq->Race[char_index] = 0;
|
||||
|
||||
for (int index = 0; index < _MaterialCount; ++index) {
|
||||
eq->CS_Colors[char_index][index].Color = 0;
|
||||
}
|
||||
|
||||
eq->BeardColor[char_index] = 0;
|
||||
eq->HairStyle[char_index] = 0;
|
||||
|
||||
for (int index = 0; index < _MaterialCount; ++index) {
|
||||
eq->Equip[char_index][index] = 0;
|
||||
}
|
||||
|
||||
eq->SecondaryIDFile[char_index] = 0;
|
||||
eq->Unknown820[char_index] = 0xFF;
|
||||
eq->Deity[char_index] = 0;
|
||||
eq->GoHome[char_index] = 0;
|
||||
eq->Tutorial[char_index] = 0;
|
||||
eq->Beard[char_index] = 0;
|
||||
eq->Unknown902[char_index] = 0xFF;
|
||||
eq->PrimaryIDFile[char_index] = 0;
|
||||
eq->HairColor[char_index] = 0;
|
||||
eq->Zone[char_index] = 0;
|
||||
eq->Class[char_index] = 0;
|
||||
eq->Face[char_index] = 0;
|
||||
//eq->Name[char_index][0] = '\0'; // Cleared above
|
||||
eq->Gender[char_index] = 0;
|
||||
eq->EyeColor1[char_index] = 0;
|
||||
eq->EyeColor2[char_index] = 0;
|
||||
eq->Level[char_index] = 0;
|
||||
}
|
||||
|
||||
FINISH_ENCODE();
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Titanium {
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 8;
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 8; // Hard-coded in client - DO NOT ALTER
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 16;
|
||||
|
||||
@@ -122,7 +122,7 @@ struct CharacterSelect_Struct
|
||||
/*0400*/ uint8 BeardColor[10]; // Characters beard Color
|
||||
/*0410*/ uint8 HairStyle[10]; // Characters hair style
|
||||
/*0420*/ uint32 Equip[10][9]; // 0=helm, 1=chest, 2=arm, 3=bracer, 4=hand, 5=leg, 6=boot, 7=melee1, 8=melee2 (Might not be)
|
||||
/*0780*/ uint32 Secondary[10]; // Characters secondary IDFile number
|
||||
/*0780*/ uint32 SecondaryIDFile[10]; // Characters secondary IDFile number
|
||||
/*0820*/ uint8 Unknown820[10]; // 10x ff
|
||||
/*0830*/ uint8 Unknown830[2]; // 2x 00
|
||||
/*0832*/ uint32 Deity[10]; // Characters Deity
|
||||
@@ -130,11 +130,11 @@ struct CharacterSelect_Struct
|
||||
/*0882*/ uint8 Tutorial[10]; // 1=Tutorial available, 0=not
|
||||
/*0892*/ uint8 Beard[10]; // Characters Beard Type
|
||||
/*0902*/ uint8 Unknown902[10]; // 10x ff
|
||||
/*0912*/ uint32 Primary[10]; // Characters primary IDFile number
|
||||
/*0912*/ uint32 PrimaryIDFile[10]; // Characters primary IDFile number
|
||||
/*0952*/ uint8 HairColor[10]; // Characters Hair Color
|
||||
/*0962*/ uint8 Unknown0962[2]; // 2x 00
|
||||
/*0964*/ uint32 Zone[10]; // Characters Current Zone
|
||||
/*1004*/ uint8 Class_[10]; // Characters Classes
|
||||
/*1004*/ uint8 Class[10]; // Characters Classes
|
||||
/*1014*/ uint8 Face[10]; // Characters Face Type
|
||||
/*1024*/ char Name[10][64]; // Characters Names
|
||||
/*1664*/ uint8 Gender[10]; // Characters Gender
|
||||
|
||||
+85
-59
@@ -2194,77 +2194,103 @@ namespace UF
|
||||
|
||||
ENCODE(OP_SendCharInfo)
|
||||
{
|
||||
ENCODE_LENGTH_EXACT(CharacterSelect_Struct);
|
||||
ENCODE_LENGTH_ATLEAST(CharacterSelect_Struct);
|
||||
SETUP_VAR_ENCODE(CharacterSelect_Struct);
|
||||
|
||||
//EQApplicationPacket *packet = *p;
|
||||
//const CharacterSelect_Struct *emu = (CharacterSelect_Struct *) packet->pBuffer;
|
||||
// Zero-character count shunt
|
||||
if (emu->CharCount == 0) {
|
||||
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, sizeof(structs::CharacterSelect_Struct));
|
||||
eq->CharCount = emu->CharCount;
|
||||
eq->TotalChars = eq->TotalChars;
|
||||
|
||||
int char_count;
|
||||
int namelen = 0;
|
||||
for (char_count = 0; char_count < 10; char_count++) {
|
||||
if (emu->Name[char_count][0] == '\0')
|
||||
break;
|
||||
if (strcmp(emu->Name[char_count], "<none>") == 0)
|
||||
break;
|
||||
namelen += strlen(emu->Name[char_count]);
|
||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
// Special Underfoot adjustment - field should really be 'AdditionalChars' or 'BonusChars'
|
||||
uint32 adjusted_total = eq->TotalChars - 8; // Yes, it rolls under for '< 8' - probably an int32 field
|
||||
eq->TotalChars = adjusted_total;
|
||||
|
||||
FINISH_ENCODE();
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned char *emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
CharacterSelectEntry_Struct *emu_cse = (CharacterSelectEntry_Struct *)nullptr;
|
||||
|
||||
size_t names_length = 0;
|
||||
size_t character_count = 0;
|
||||
for (; character_count < emu->CharCount && character_count < consts::CHARACTER_CREATION_LIMIT; ++character_count) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
names_length += strlen(emu_cse->Name);
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
}
|
||||
|
||||
int total_length = sizeof(structs::CharacterSelect_Struct)
|
||||
+ char_count * sizeof(structs::CharacterSelectEntry_Struct)
|
||||
+ namelen;
|
||||
size_t total_length = sizeof(structs::CharacterSelect_Struct)
|
||||
+ character_count * sizeof(structs::CharacterSelectEntry_Struct)
|
||||
+ names_length;
|
||||
|
||||
ALLOC_VAR_ENCODE(structs::CharacterSelect_Struct, total_length);
|
||||
structs::CharacterSelectEntry_Struct *eq_cse = (structs::CharacterSelectEntry_Struct *)nullptr;
|
||||
|
||||
//unsigned char *eq_buffer = new unsigned char[total_length];
|
||||
//structs::CharacterSelect_Struct *eq_head = (structs::CharacterSelect_Struct *) eq_buffer;
|
||||
eq->CharCount = character_count;
|
||||
eq->TotalChars = emu->TotalChars;
|
||||
|
||||
eq->CharCount = char_count;
|
||||
eq->TotalChars = 10;
|
||||
if (eq->TotalChars > consts::CHARACTER_CREATION_LIMIT)
|
||||
eq->TotalChars = consts::CHARACTER_CREATION_LIMIT;
|
||||
|
||||
unsigned char *bufptr = (unsigned char *)eq->Entries;
|
||||
int r;
|
||||
for (r = 0; r < char_count; r++) {
|
||||
{ //pre-name section...
|
||||
structs::CharacterSelectEntry_Struct *eq2 = (structs::CharacterSelectEntry_Struct *) bufptr;
|
||||
eq2->Level = emu->Level[r];
|
||||
eq2->HairStyle = emu->HairStyle[r];
|
||||
eq2->Gender = emu->Gender[r];
|
||||
memcpy(eq2->Name, emu->Name[r], strlen(emu->Name[r]) + 1);
|
||||
}
|
||||
//adjust for name.
|
||||
bufptr += strlen(emu->Name[r]);
|
||||
{ //post-name section...
|
||||
structs::CharacterSelectEntry_Struct *eq2 = (structs::CharacterSelectEntry_Struct *) bufptr;
|
||||
eq2->Beard = emu->Beard[r];
|
||||
eq2->HairColor = emu->HairColor[r];
|
||||
eq2->Face = emu->Face[r];
|
||||
int k;
|
||||
for (k = 0; k < _MaterialCount; k++) {
|
||||
eq2->Equip[k].Material = emu->Equip[r][k].Material;
|
||||
eq2->Equip[k].Unknown1 = emu->Equip[r][k].Unknown1;
|
||||
eq2->Equip[k].EliteMaterial = emu->Equip[r][k].EliteMaterial;
|
||||
eq2->Equip[k].Color.Color = emu->Equip[r][k].Color.Color;
|
||||
}
|
||||
eq2->Primary = emu->Primary[r];
|
||||
eq2->Secondary = emu->Secondary[r];
|
||||
eq2->Tutorial = emu->Tutorial[r]; // was u15
|
||||
eq2->Unknown15 = 0xFF;
|
||||
eq2->Deity = emu->Deity[r];
|
||||
eq2->Zone = emu->Zone[r];
|
||||
eq2->Unknown19 = 0xFF;
|
||||
eq2->Race = emu->Race[r];
|
||||
eq2->GoHome = emu->GoHome[r];
|
||||
eq2->Class_ = emu->Class_[r];
|
||||
eq2->EyeColor1 = emu->EyeColor1[r];
|
||||
eq2->BeardColor = emu->BeardColor[r];
|
||||
eq2->EyeColor2 = emu->EyeColor2[r];
|
||||
eq2->DrakkinHeritage = emu->DrakkinHeritage[r];
|
||||
eq2->DrakkinTattoo = emu->DrakkinTattoo[r];
|
||||
eq2->DrakkinDetails = emu->DrakkinDetails[r];
|
||||
// Special Underfoot adjustment - field should really be 'AdditionalChars' or 'BonusChars' in this client
|
||||
uint32 adjusted_total = eq->TotalChars - 8; // Yes, it rolls under for '< 8' - probably an int32 field
|
||||
eq->TotalChars = adjusted_total;
|
||||
|
||||
emu_ptr = __emu_buffer;
|
||||
emu_ptr += sizeof(CharacterSelect_Struct);
|
||||
|
||||
unsigned char *eq_ptr = __packet->pBuffer;
|
||||
eq_ptr += sizeof(structs::CharacterSelect_Struct);
|
||||
|
||||
for (int counter = 0; counter < character_count; ++counter) {
|
||||
emu_cse = (CharacterSelectEntry_Struct *)emu_ptr;
|
||||
eq_cse = (structs::CharacterSelectEntry_Struct *)eq_ptr;
|
||||
|
||||
eq_cse->Level = emu_cse->Level;
|
||||
eq_cse->HairStyle = emu_cse->HairStyle;
|
||||
eq_cse->Gender = emu_cse->Gender;
|
||||
|
||||
strcpy(eq_cse->Name, emu_cse->Name);
|
||||
eq_ptr += strlen(eq_cse->Name);
|
||||
eq_cse = (structs::CharacterSelectEntry_Struct *)eq_ptr;
|
||||
|
||||
eq_cse->Beard = emu_cse->Beard;
|
||||
eq_cse->HairColor = emu_cse->HairColor;
|
||||
eq_cse->Face = emu_cse->Face;
|
||||
|
||||
for (int equip_index = 0; equip_index < _MaterialCount; equip_index++) {
|
||||
eq_cse->Equip[equip_index].Material = emu_cse->Equip[equip_index].Material;
|
||||
eq_cse->Equip[equip_index].Unknown1 = emu_cse->Equip[equip_index].Unknown1;
|
||||
eq_cse->Equip[equip_index].EliteMaterial = emu_cse->Equip[equip_index].EliteMaterial;
|
||||
eq_cse->Equip[equip_index].Color.Color = emu_cse->Equip[equip_index].Color.Color;
|
||||
}
|
||||
|
||||
bufptr += sizeof(structs::CharacterSelectEntry_Struct);
|
||||
eq_cse->PrimaryIDFile = emu_cse->PrimaryIDFile;
|
||||
eq_cse->SecondaryIDFile = emu_cse->SecondaryIDFile;
|
||||
eq_cse->Tutorial = emu_cse->Tutorial;
|
||||
eq_cse->Unknown15 = emu_cse->Unknown15;
|
||||
eq_cse->Deity = emu_cse->Deity;
|
||||
eq_cse->Zone = emu_cse->Zone;
|
||||
eq_cse->Unknown19 = emu_cse->Unknown19;
|
||||
eq_cse->Race = emu_cse->Race;
|
||||
eq_cse->GoHome = emu_cse->GoHome;
|
||||
eq_cse->Class = emu_cse->Class;
|
||||
eq_cse->EyeColor1 = emu_cse->EyeColor1;
|
||||
eq_cse->BeardColor = emu_cse->BeardColor;
|
||||
eq_cse->EyeColor2 = emu_cse->EyeColor2;
|
||||
eq_cse->DrakkinHeritage = emu_cse->DrakkinHeritage;
|
||||
eq_cse->DrakkinTattoo = emu_cse->DrakkinTattoo;
|
||||
eq_cse->DrakkinDetails = emu_cse->DrakkinDetails;
|
||||
|
||||
emu_ptr += sizeof(CharacterSelectEntry_Struct);
|
||||
eq_ptr += sizeof(structs::CharacterSelectEntry_Struct);
|
||||
}
|
||||
|
||||
FINISH_ENCODE();
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace UF {
|
||||
}
|
||||
|
||||
namespace consts {
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 10;
|
||||
static const size_t CHARACTER_CREATION_LIMIT = 12;
|
||||
|
||||
static const uint16 MAP_POSSESSIONS_SIZE = slots::_MainCount;
|
||||
static const uint16 MAP_BANK_SIZE = 24;
|
||||
|
||||
@@ -132,8 +132,8 @@ struct CharacterSelectEntry_Struct
|
||||
/*0001*/ uint8 HairColor; //
|
||||
/*0000*/ uint8 Face; //
|
||||
/*0000*/ CharSelectEquip Equip[9];
|
||||
/*0000*/ uint32 Primary; //
|
||||
/*0000*/ uint32 Secondary; //
|
||||
/*0000*/ uint32 PrimaryIDFile; //
|
||||
/*0000*/ uint32 SecondaryIDFile; //
|
||||
/*0000*/ uint8 Unknown15; // 0xff
|
||||
/*0000*/ uint32 Deity; //
|
||||
/*0000*/ uint16 Zone; //
|
||||
@@ -142,7 +142,7 @@ struct CharacterSelectEntry_Struct
|
||||
/*0000*/ uint8 Unknown19; // 0xff
|
||||
/*0000*/ uint32 Race; //
|
||||
/*0000*/ uint8 Tutorial; //
|
||||
/*0000*/ uint8 Class_; //
|
||||
/*0000*/ uint8 Class; //
|
||||
/*0000*/ uint8 EyeColor1; //
|
||||
/*0000*/ uint8 BeardColor; //
|
||||
/*0000*/ uint8 EyeColor2; //
|
||||
|
||||
Reference in New Issue
Block a user