mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-22 08:08:25 +00:00
Implemented 'enum class ClientVersion' -- added 'RoF2' to lua client version enumeration
This commit is contained in:
+24
-26
@@ -509,7 +509,7 @@ void Client::CompleteConnect()
|
||||
|
||||
if (IsInAGuild()){
|
||||
uint8 rank = GuildRank();
|
||||
if (GetClientVersion() >= EQClientRoF)
|
||||
if (GetClientVersion() >= ClientVersion::RoF)
|
||||
{
|
||||
switch (rank) {
|
||||
case 0: { rank = 5; break; } // GUILD_MEMBER 0
|
||||
@@ -823,7 +823,7 @@ void Client::CompleteConnect()
|
||||
if (zone->GetZoneID() == RuleI(World, GuildBankZoneID) && GuildBanks)
|
||||
GuildBanks->SendGuildBank(this);
|
||||
|
||||
if (GetClientVersion() >= EQClientSoD)
|
||||
if (GetClientVersion() >= ClientVersion::SoD)
|
||||
entity_list.SendFindableNPCList(this);
|
||||
|
||||
if (IsInAGuild()) {
|
||||
@@ -1035,7 +1035,7 @@ void Client::Handle_Connect_OP_ReqClientSpawn(const EQApplicationPacket *app)
|
||||
outapp = new EQApplicationPacket(OP_SendExpZonein, 0);
|
||||
FastQueuePacket(&outapp);
|
||||
|
||||
if (GetClientVersion() >= EQClientRoF)
|
||||
if (GetClientVersion() >= ClientVersion::RoF)
|
||||
{
|
||||
outapp = new EQApplicationPacket(OP_ClientReady, 0);
|
||||
FastQueuePacket(&outapp);
|
||||
@@ -1309,14 +1309,12 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
|
||||
conn_state = ReceivedZoneEntry;
|
||||
|
||||
ClientVersion = Connection()->ClientVersion();
|
||||
if (ClientVersion != EQClientUnknown)
|
||||
ClientVersionBit = 1 << (ClientVersion - 1);
|
||||
else
|
||||
ClientVersionBit = 0;
|
||||
ClientVersion = Connection()->GetClientVersion();
|
||||
if (ClientVersion != ClientVersion::Unknown)
|
||||
ClientVersionBit = 1 << (static_cast<unsigned int>(ClientVersion) - 1);
|
||||
|
||||
bool siv = m_inv.SetInventoryVersion(ClientVersion);
|
||||
LogFile->write(EQEmuLog::Debug, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion);
|
||||
LogFile->write(EQEmuLog::Debug, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), ClientVersionName(ClientVersion), ClientVersion);
|
||||
|
||||
/* Antighost code
|
||||
tmp var is so the search doesnt find this object
|
||||
@@ -1499,7 +1497,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
m_pp.guild_id = GuildID();
|
||||
uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
|
||||
// FIXME: RoF guild rank
|
||||
if (GetClientVersion() >= EQClientRoF) {
|
||||
if (GetClientVersion() >= ClientVersion::RoF) {
|
||||
switch (rank) {
|
||||
case 0:
|
||||
rank = 5;
|
||||
@@ -1850,7 +1848,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
|
||||
/* Task Packets */
|
||||
LoadClientTaskState();
|
||||
|
||||
if (GetClientVersion() >= EQClientRoF) {
|
||||
if (GetClientVersion() >= ClientVersion::RoF) {
|
||||
outapp = new EQApplicationPacket(OP_ReqNewZone, 0);
|
||||
Handle_Connect_OP_ReqNewZone(outapp);
|
||||
safe_delete(outapp);
|
||||
@@ -3079,7 +3077,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
|
||||
// Delegate to tradeskill object to perform combine
|
||||
AugmentItem_Struct* in_augment = (AugmentItem_Struct*)app->pBuffer;
|
||||
bool deleteItems = false;
|
||||
if (GetClientVersion() >= EQClientRoF)
|
||||
if (GetClientVersion() >= ClientVersion::RoF)
|
||||
{
|
||||
ItemInst *itemOneToPush = nullptr, *itemTwoToPush = nullptr;
|
||||
|
||||
@@ -5162,7 +5160,7 @@ void Client::Handle_OP_DeleteItem(const EQApplicationPacket *app)
|
||||
int16 AlcoholTolerance = GetSkill(SkillAlcoholTolerance);
|
||||
int16 IntoxicationIncrease;
|
||||
|
||||
if (GetClientVersion() < EQClientSoD)
|
||||
if (GetClientVersion() < ClientVersion::SoD)
|
||||
IntoxicationIncrease = (200 - AlcoholTolerance) * 30 / 200 + 10;
|
||||
else
|
||||
IntoxicationIncrease = (270 - AlcoholTolerance) * 0.111111108 + 10;
|
||||
@@ -5479,7 +5477,7 @@ void Client::Handle_OP_EndLootRequest(const EQApplicationPacket *app)
|
||||
Entity* entity = entity_list.GetID(*((uint16*)app->pBuffer));
|
||||
if (entity == 0) {
|
||||
Message(13, "Error: OP_EndLootRequest: Corpse not found (ent = 0)");
|
||||
if (GetClientVersion() >= EQClientSoD)
|
||||
if (GetClientVersion() >= ClientVersion::SoD)
|
||||
Corpse::SendEndLootErrorPacket(this);
|
||||
else
|
||||
Corpse::SendLootReqErrorPacket(this);
|
||||
@@ -6845,7 +6843,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
||||
uint32 Action = VARSTRUCT_DECODE_TYPE(uint32, Buffer);
|
||||
uint32 sentAction = Action;
|
||||
|
||||
if (GetClientVersion() >= EQClientRoF)
|
||||
if (GetClientVersion() >= ClientVersion::RoF)
|
||||
{
|
||||
Action += 1;
|
||||
/*
|
||||
@@ -7412,7 +7410,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
|
||||
|
||||
GuildInviteAccept_Struct* gj = (GuildInviteAccept_Struct*)app->pBuffer;
|
||||
|
||||
if (GetClientVersion() >= EQClientRoF)
|
||||
if (GetClientVersion() >= ClientVersion::RoF)
|
||||
{
|
||||
if (gj->response > 9)
|
||||
{
|
||||
@@ -7472,7 +7470,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app)
|
||||
|
||||
uint32 guildrank = gj->response;
|
||||
|
||||
if (GetClientVersion() >= EQClientRoF)
|
||||
if (GetClientVersion() >= ClientVersion::RoF)
|
||||
{
|
||||
if (gj->response == 8)
|
||||
{
|
||||
@@ -8081,7 +8079,7 @@ void Client::Handle_OP_InspectRequest(const EQApplicationPacket *app)
|
||||
Mob* tmp = entity_list.GetMob(ins->TargetID);
|
||||
|
||||
if (tmp != 0 && tmp->IsClient()) {
|
||||
if (tmp->CastToClient()->GetClientVersion() < EQClientSoF) { tmp->CastToClient()->QueuePacket(app); } // Send request to target
|
||||
if (tmp->CastToClient()->GetClientVersion() < ClientVersion::SoF) { tmp->CastToClient()->QueuePacket(app); } // Send request to target
|
||||
// Inspecting an SoF or later client will make the server handle the request
|
||||
else { ProcessInspectRequest(tmp->CastToClient(), this); }
|
||||
}
|
||||
@@ -8601,7 +8599,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetClientVersion() >= EQClientSoD && !inst->IsEquipable(GetBaseRace(), GetClass()))
|
||||
if (GetClientVersion() >= ClientVersion::SoD && !inst->IsEquipable(GetBaseRace(), GetClass()))
|
||||
{
|
||||
if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol)
|
||||
{
|
||||
@@ -9436,14 +9434,14 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
mercTypeCount = tar->GetNumMercTypes(GetClientVersion());
|
||||
mercCount = tar->GetNumMercs(GetClientVersion());
|
||||
mercTypeCount = tar->GetNumMercTypes(static_cast<unsigned int>(GetClientVersion()));
|
||||
mercCount = tar->GetNumMercs(static_cast<unsigned int>(GetClientVersion()));
|
||||
|
||||
if (mercCount > MAX_MERC)
|
||||
return;
|
||||
|
||||
std::list<MercType> mercTypeList = tar->GetMercTypesList(GetClientVersion());
|
||||
std::list<MercData> mercDataList = tar->GetMercsList(GetClientVersion());
|
||||
std::list<MercType> mercTypeList = tar->GetMercTypesList(static_cast<unsigned int>(GetClientVersion()));
|
||||
std::list<MercData> mercDataList = tar->GetMercsList(static_cast<unsigned int>(GetClientVersion()));
|
||||
|
||||
int i = 0;
|
||||
int StanceCount = 0;
|
||||
@@ -11343,7 +11341,7 @@ void Client::Handle_OP_ReadBook(const EQApplicationPacket *app)
|
||||
}
|
||||
BookRequest_Struct* book = (BookRequest_Struct*)app->pBuffer;
|
||||
ReadBook(book);
|
||||
if (GetClientVersion() >= EQClientSoF)
|
||||
if (GetClientVersion() >= ClientVersion::SoF)
|
||||
{
|
||||
EQApplicationPacket EndOfBook(OP_FinishWindow, 0);
|
||||
QueuePacket(&EndOfBook);
|
||||
@@ -12660,7 +12658,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app)
|
||||
{
|
||||
if (!HasSkill(SkillHide) && GetSkill(SkillHide) == 0)
|
||||
{
|
||||
if (GetClientVersion() < EQClientSoF)
|
||||
if (GetClientVersion() < ClientVersion::SoF)
|
||||
{
|
||||
char *hack_str = nullptr;
|
||||
MakeAnyLenString(&hack_str, "Player sent OP_SpawnAppearance with AT_Invis: %i", sa->parameter);
|
||||
@@ -13497,7 +13495,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app)
|
||||
|
||||
this->Trader_StartTrader();
|
||||
|
||||
if (GetClientVersion() >= EQClientRoF)
|
||||
if (GetClientVersion() >= ClientVersion::RoF)
|
||||
{
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_Trader, sizeof(TraderStatus_Struct));
|
||||
TraderStatus_Struct* tss = (TraderStatus_Struct*)outapp->pBuffer;
|
||||
|
||||
Reference in New Issue
Block a user