Secrets: Identified OP_GuildPromote for RoF clients.

Secrets: Fixed promotion, demotion, transferring a leader and displaying of client ranks in the Rain of Fear client. The rain of fear client, as such, will only have 3 ranks like the other clients, but supports a theoretical 8 ranks later.
Secrets/Akkadius: Fixed an issue involving character name lookup in the new DB code.
This commit is contained in:
SecretsOTheP
2014-09-02 21:16:20 -04:00
parent 8422178233
commit 832e5e90d1
14 changed files with 158 additions and 33 deletions
+3 -1
View File
@@ -771,7 +771,9 @@ void Database::GetCharName(uint32 char_id, char* name) {
}
auto row = results.begin();
strcpy(name, row[0]);
for (auto row = results.begin(); row != results.end(); ++row) {
strcpy(name, row[0]);
}
}
bool Database::LoadVariables() {
+1
View File
@@ -540,3 +540,4 @@ N(OP_OpenInventory),
N(OP_OpenContainer),
N(OP_Marquee),
N(OP_ClientTimeStamp),
N(OP_GuildPromote),
+8
View File
@@ -4461,6 +4461,14 @@ struct GuildBankPromote_Struct
/*12*/ uint32 Slot2; // Always appears to be the same as Slot for Action code 3
};
struct GuildPromoteStruct {
/*000*/ char target[64];
/*064*/ char name[64];
/*128*/ uint32 rank;
/*132*/ uint32 myrank;
/*136*/
};
struct GuildBankPermissions_Struct
{
/*00*/ uint32 Action; // 6
+1 -1
View File
@@ -534,7 +534,7 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req)
uint16 opcode = (*OpMgr)->EmuToEQ(pack->emu_opcode);
_log(NET__APP_TRACE, "Queueing %sacked packet with opcode 0x%x (%s) and length %d", ack_req?"":"non-", opcode, OpcodeManager::EmuToName(pack->emu_opcode), pack->size);
//_log(NET__APP_TRACE, "Queueing %sacked packet with opcode 0x%x (%s) and length %d", ack_req?"":"non-", opcode, OpcodeManager::EmuToName(pack->emu_opcode), pack->size);
if (!ack_req) {
NonSequencedPush(new EQProtocolPacket(opcode, pack->pBuffer, pack->size));
+5
View File
@@ -474,6 +474,11 @@ bool BaseGuildManager::SetBankerFlag(uint32 charid, bool is_banker) {
return(true);
}
bool BaseGuildManager::ForceRankUpdate(uint32 charid) {
SendRankUpdate(charid);
return(true);
}
bool BaseGuildManager::SetAltFlag(uint32 charid, bool is_alt)
{
if(!DBSetAltFlag(charid, is_alt))
+1
View File
@@ -54,6 +54,7 @@ public:
bool SetGuild(uint32 charid, uint32 guild_id, uint8 rank);
bool SetGuildRank(uint32 charid, uint8 rank);
bool SetBankerFlag(uint32 charid, bool is_banker);
bool ForceRankUpdate(uint32 charid);
bool GetAltFlag(uint32 CharID);
bool SetAltFlag(uint32 charid, bool is_alt);
bool GetBankerFlag(uint32 CharID);
+26 -4
View File
@@ -1,4 +1,3 @@
#include "../debug.h"
#include "rof.h"
#include "../opcodemgr.h"
@@ -1974,7 +1973,14 @@ ENCODE(OP_ZoneSpawns)
else
{
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->guildID);
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->guildrank);
/* Translate older ranks to new values */
switch (emu->guildrank) {
case 0: { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 5); break; } // GUILD_MEMBER 0
case 1: { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 3); break; } // GUILD_OFFICER 1
case 2: { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 1); break; } // GUILD_LEADER 2
default: { VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->guildrank); break; } //
}
}
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, emu->class_);
@@ -2406,7 +2412,15 @@ ENCODE(OP_GuildMemberList) {
PutFieldN(level);
PutFieldN(banker);
PutFieldN(class_);
PutFieldN(rank);
/* Translate older ranks to new values */
switch (emu_e->rank) {
case 0: { e->rank = htonl(5); break; } // GUILD_MEMBER 0
case 1: { e->rank = htonl(3); break; } // GUILD_OFFICER 1
case 2: { e->rank = htonl(1); break; } // GUILD_LEADER 2
default: { e->rank = htonl(emu_e->rank); break; } // GUILD_NONE
}
PutFieldN(time_last_on);
PutFieldN(tribute_enable);
e->unknown01 = 0;
@@ -3330,7 +3344,15 @@ ENCODE(OP_SetGuildRank)
ENCODE_LENGTH_EXACT(GuildSetRank_Struct);
SETUP_DIRECT_ENCODE(GuildSetRank_Struct, structs::GuildSetRank_Struct);
eq->GuildID = emu->Unknown00;
OUT(Rank);
/* Translate older ranks to new values */
switch (emu->Rank) {
case 0: { eq->Rank = 5; break; } // GUILD_MEMBER 0
case 1: { eq->Rank = 3; break; } // GUILD_OFFICER 1
case 2: { eq->Rank = 1; break; } // GUILD_LEADER 2
default: { eq->Rank = emu->Rank; break; }
}
memcpy(eq->MemberName, emu->MemberName, sizeof(eq->MemberName));
OUT(Banker);
eq->Unknown76 = 1;