Skip to content

Commit

Permalink
Added some info about realm list and auth response packets.
Browse files Browse the repository at this point in the history
Added few dbc structs and updated related enums.
  • Loading branch information
tomrus88 committed Apr 5, 2010
1 parent 2ef8ad9 commit 54c038b
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 23 deletions.
18 changes: 18 additions & 0 deletions src/game/DBCStructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 31 additions & 8 deletions src/game/World.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
37 changes: 22 additions & 15 deletions src/realmd/AuthSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
}
Expand Down
13 changes: 13 additions & 0 deletions src/realmd/AuthSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 54c038b

Please sign in to comment.