From 68e73f105e9e513d6bf4a9327617f26f6519d93a Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Sun, 4 Apr 2010 01:14:16 +0400 Subject: [PATCH] Added some info about realm list and auth response packets. Added few dbc structs and updated related enums. --- src/game/DBCStructure.h | 18 ++++++++++++++++++ src/game/World.h | 39 +++++++++++++++++++++++++++++++-------- src/realmd/AuthSocket.cpp | 37 ++++++++++++++++++++++--------------- src/realmd/AuthSocket.h | 13 +++++++++++++ 4 files changed, 84 insertions(+), 23 deletions(-) diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 2d8fec60d..4f8013618 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -576,6 +576,24 @@ struct BattlemasterListEntry //uint32 HolidayWorldStateId; // 30 new 3.1 }; +/*struct Cfg_CategoriesEntry +{ + uint32 Index; // categoryId, sent in RealmList packet + uint32 Unk1; + uint32 Unk2; + uint32 IsTournamentRealm; + char *categoryName[16]; + uint32 categoryNameFlags; +}*/ + +/*struct Cfg_ConfigsEntry +{ + uint32 Id; + uint32 Type; // sent in RealmList packet + uint32 IsPvp; + uint32 IsRp; +};*/ + #define MAX_OUTFIT_ITEMS 24 struct CharStartOutfitEntry diff --git a/src/game/World.h b/src/game/World.h index f65015ced..47e822f26 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -305,18 +305,33 @@ enum eConfigBoolValues CONFIG_BOOL_VALUE_COUNT }; -/// Type of server +/// Can be used in SMSG_AUTH_RESPONSE packet +enum BillingPlanFlags +{ + SESSION_NONE = 0x00, + SESSION_UNUSED = 0x01, + SESSION_RECURRING_BILL = 0x02, + SESSION_FREE_TRIAL = 0x04, + SESSION_IGR = 0x08, + SESSION_USAGE = 0x10, + SESSION_TIME_MIXTURE = 0x20, + SESSION_RESTRICTED = 0x40, + SESSION_ENABLE_CAIS = 0x80, +}; + +/// Type of server, this is values from second column of Cfg_Configs.dbc enum RealmType { - REALM_TYPE_NORMAL = 0, - REALM_TYPE_PVP = 1, - REALM_TYPE_NORMAL2 = 4, - REALM_TYPE_RP = 6, - REALM_TYPE_RPPVP = 8, - REALM_TYPE_FFA_PVP = 16 // custom, free for all pvp mode like arena PvP in all zones except rest activated places and sanctuaries + REALM_TYPE_NORMAL = 0, + REALM_TYPE_PVP = 1, + REALM_TYPE_NORMAL2 = 4, + REALM_TYPE_RP = 6, + REALM_TYPE_RPPVP = 8, + REALM_TYPE_FFA_PVP = 16 // custom, free for all pvp mode like arena PvP in all zones except rest activated places and sanctuaries // replaced by REALM_PVP in realm list }; +/// This is values from first column of Cfg_Categories.dbc enum RealmZone { REALM_ZONE_UNKNOWN = 0, // any language @@ -348,7 +363,15 @@ enum RealmZone REALM_ZONE_TEST_SERVER = 26, // any language REALM_ZONE_TOURNAMENT_27 = 27, // basic-Latin at create, any at login REALM_ZONE_QA_SERVER = 28, // any language - REALM_ZONE_CN9 = 29 // basic-Latin at create, any at login + REALM_ZONE_CN9 = 29, // basic-Latin at create, any at login + REALM_ZONE_TEST_SERVER_2 = 30, // any language + REALM_ZONE_CN10 = 31, // basic-Latin at create, any at login + REALM_ZONE_CTC = 32, + REALM_ZONE_CNC = 33, + REALM_ZONE_CN1_4 = 34, // basic-Latin at create, any at login + REALM_ZONE_CN2_6_9 = 35, // basic-Latin at create, any at login + REALM_ZONE_CN3_7 = 36, // basic-Latin at create, any at login + REALM_ZONE_CN5_8 = 37 // basic-Latin at create, any at login }; // DB scripting commands diff --git a/src/realmd/AuthSocket.cpp b/src/realmd/AuthSocket.cpp index 17206f030..c956e6049 100644 --- a/src/realmd/AuthSocket.cpp +++ b/src/realmd/AuthSocket.cpp @@ -964,14 +964,14 @@ void AuthSocket::LoadRealmlist(ByteBuffer &pkt, uint32 acctid) uint8 color = (std::find(i->second.realmbuilds.begin(), i->second.realmbuilds.end(), _build) != i->second.realmbuilds.end()) ? i->second.color : 2; color = (i->second.allowedSecurityLevel > _accountSecurityLevel) ? 2 : color; - pkt << uint32(i->second.icon); // realm type - pkt << uint8(color); // if 2, then realm is offline - pkt << i->first; // name - pkt << i->second.address; // address + pkt << uint32(i->second.icon); // realm type + pkt << uint8(color); // if 2, then realm is offline + pkt << i->first; // name + pkt << i->second.address; // address pkt << float(i->second.populationLevel); pkt << uint8(AmountOfCharacters); - pkt << uint8(i->second.timezone); // realm category - pkt << uint8(0x00); // unk, may be realm number/id? + pkt << uint8(i->second.timezone); // realm category + pkt << uint8(0x00); // unk, may be realm number/id? } pkt << uint8(0x00); @@ -1008,19 +1008,26 @@ void AuthSocket::LoadRealmlist(ByteBuffer &pkt, uint32 acctid) // Show offline state for unsupported client builds uint8 color = (std::find(i->second.realmbuilds.begin(), i->second.realmbuilds.end(), _build) != i->second.realmbuilds.end()) ? i->second.color : 2; - pkt << uint8(i->second.icon); // realm type - pkt << uint8(lock); // if 1, then realm locked - pkt << uint8(color); // if 2, then realm is offline - pkt << i->first; // name - pkt << i->second.address; // address + pkt << uint8(i->second.icon); // realm type (this is second column in Cfg_Configs.dbc) + pkt << uint8(lock); // flags, if 0x01, then realm locked + pkt << uint8(color); // see enum RealmFlags + pkt << i->first; // name + pkt << i->second.address; // address pkt << float(i->second.populationLevel); pkt << uint8(AmountOfCharacters); - pkt << uint8(i->second.timezone); // realm category - pkt << uint8(0x2C); // unk, may be realm number/id? + pkt << uint8(i->second.timezone); // realm category (Cfg_Categories.dbc) + pkt << uint8(0x2C); // unk, may be realm number/id? + + /*if(realmFlags & REALM_FLAG_SPECIFYBUILD) + { + pkt << uint8(0); // major + pkt << uint8(0); // minor + pkt << uint8(0); // revision + pkt << uint16(0); // build + }*/ } - pkt << uint8(0x10); - pkt << uint8(0x00); + pkt << uint16(0x0010); break; } } diff --git a/src/realmd/AuthSocket.h b/src/realmd/AuthSocket.h index a3ce60d49..881b53918 100644 --- a/src/realmd/AuthSocket.h +++ b/src/realmd/AuthSocket.h @@ -34,6 +34,19 @@ #include "Auth/Sha1.h" #include "ByteBuffer.h" +enum RealmFlags +{ + REALM_FLAG_NONE = 0x00, + REALM_FLAG_INVALID = 0x01, + REALM_FLAG_OFFLINE = 0x02, + REALM_FLAG_SPECIFYBUILD = 0x04, // client will show realm version in RealmList screen in form "RealmName (major.minor.revision.build)" + REALM_FLAG_UNK1 = 0x08, + REALM_FLAG_UNK2 = 0x10, + REALM_FLAG_RECOMMENDED = 0x20, // client checks pop == 600f + REALM_FLAG_NEW = 0x40, // client checks pop == 200f + REALM_FLAG_FULL = 0x80 // client checks pop == 400f +}; + /// Handle login commands class AuthSocket: public TcpSocket {