diff options
| author | megamage <none@none> | 2009-02-04 17:22:43 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2009-02-04 17:22:43 -0600 |
| commit | d69198732e65002b53bab3a85779107490fe4dd2 (patch) | |
| tree | e1f4b11f1964cc42ac05c79bdc43eedc1db16866 /src/trinityrealm | |
| parent | 5d4d9530556eb66940775f12c3cc5f3c115447ca (diff) | |
| parent | c745eba4a1d122b4184b27a982674c86ff193c23 (diff) | |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/trinityrealm')
| -rw-r--r-- | src/trinityrealm/AuthCodes.h | 75 | ||||
| -rw-r--r-- | src/trinityrealm/RealmList.cpp | 2 | ||||
| -rw-r--r-- | src/trinityrealm/RealmList.h | 68 | ||||
| -rw-r--r-- | src/trinityrealm/resource.h | 15 |
4 files changed, 159 insertions, 1 deletions
diff --git a/src/trinityrealm/AuthCodes.h b/src/trinityrealm/AuthCodes.h new file mode 100644 index 00000000000..14a65b89504 --- /dev/null +++ b/src/trinityrealm/AuthCodes.h @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * + * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/** \file + \ingroup realmd +*/ + +#ifndef _AUTHCODES_H +#define _AUTHCODES_H + +enum eAuthResults +{ + REALM_AUTH_SUCCESS = 0x00, + REALM_AUTH_FAILURE = 0x01, ///< Unable to connect + REALM_AUTH_UNKNOWN1 = 0x02, ///< Unable to connect + REALM_AUTH_ACCOUNT_BANNED = 0x03, ///< This <game> account has been closed and is no longer available for use. Please go to <site>/banned.html for further information. + REALM_AUTH_NO_MATCH = 0x04, ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see <site> for more information + REALM_AUTH_UNKNOWN2 = 0x05, ///< The information you have entered is not valid. Please check the spelling of the account name and password. If you need help in retrieving a lost or stolen password, see <site> for more information + REALM_AUTH_ACCOUNT_IN_USE = 0x06, ///< This account is already logged into <game>. Please check the spelling and try again. + REALM_AUTH_PREPAID_TIME_LIMIT = 0x07, ///< You have used up your prepaid time for this account. Please purchase more to continue playing + REALM_AUTH_SERVER_FULL = 0x08, ///< Could not log in to <game> at this time. Please try again later. + REALM_AUTH_WRONG_BUILD_NUMBER = 0x09, ///< Unable to validate game version. This may be caused by file corruption or interference of another program. Please visit <site> for more information and possible solutions to this issue. + REALM_AUTH_UPDATE_CLIENT = 0x0a, ///< Downloading + REALM_AUTH_UNKNOWN3 = 0x0b, ///< Unable to connect + REALM_AUTH_ACCOUNT_FREEZED = 0x0c, ///< This <game> account has been temporarily suspended. Please go to <site>/banned.html for further information + REALM_AUTH_UNKNOWN4 = 0x0d, ///< Unable to connect + REALM_AUTH_UNKNOWN5 = 0x0e, ///< Connected. + REALM_AUTH_PARENTAL_CONTROL = 0x0f ///< Access to this account has been blocked by parental controls. Your settings may be changed in your account preferences at <site> +}; + +enum LoginResult +{ + LOGIN_OK = 0x00, + LOGIN_FAILED = 0x01, + LOGIN_FAILED2 = 0x02, + LOGIN_BANNED = 0x03, + LOGIN_UNKNOWN_ACCOUNT = 0x04, + LOGIN_UNKNOWN_ACCOUNT3 = 0x05, + LOGIN_ALREADYONLINE = 0x06, + LOGIN_NOTIME = 0x07, + LOGIN_DBBUSY = 0x08, + LOGIN_BADVERSION = 0x09, + LOGIN_DOWNLOAD_FILE = 0x0A, + LOGIN_FAILED3 = 0x0B, + LOGIN_SUSPENDED = 0x0C, + LOGIN_FAILED4 = 0x0D, + LOGIN_CONNECTED = 0x0E, + LOGIN_PARENTALCONTROL = 0x0F, + LOGIN_LOCKED_ENFORCED = 0x10, +}; + +// we need to stick to 1 version or half of the stuff will work for someone +// others will not and opposite +// will only support WoW and WoW:TBC 2.4.3 client build 8606... + +#define EXPECTED_TRINITY_CLIENT_BUILD {8606, 0} + +#endif diff --git a/src/trinityrealm/RealmList.cpp b/src/trinityrealm/RealmList.cpp index 490850a3631..6a3d6b47e0f 100644 --- a/src/trinityrealm/RealmList.cpp +++ b/src/trinityrealm/RealmList.cpp @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/> diff --git a/src/trinityrealm/RealmList.h b/src/trinityrealm/RealmList.h new file mode 100644 index 00000000000..842482bb75a --- /dev/null +++ b/src/trinityrealm/RealmList.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> + * + * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/// \addtogroup realmd +/// @{ +/// \file + +#ifndef _REALMLIST_H +#define _REALMLIST_H + +#include "Common.h" + +/// Storage object for a realm +struct Realm +{ + std::string name; + std::string address; + uint8 icon; + uint8 color; + uint8 timezone; + uint32 m_ID; + AccountTypes allowedSecurityLevel; + float populationLevel; +}; + +/// Storage object for the list of realms on the server +class RealmList +{ + public: + typedef std::map<std::string, Realm> RealmMap; + + RealmList(); + ~RealmList() {} + + void Initialize(uint32 updateInterval); + + void UpdateIfNeed(); + + RealmMap::const_iterator begin() const { return m_realms.begin(); } + RealmMap::const_iterator end() const { return m_realms.end(); } + uint32 size() const { return m_realms.size(); } + private: + void UpdateRealms(bool init); + void UpdateRealm( uint32 ID, const std::string& name, const std::string& address, uint32 port, uint8 icon, uint8 color, uint8 timezone, AccountTypes allowedSecurityLevel, float popu); + private: + RealmMap m_realms; ///< Internal map of realms + uint32 m_UpdateInterval; + time_t m_NextUpdateTime; +}; +#endif +/// @} diff --git a/src/trinityrealm/resource.h b/src/trinityrealm/resource.h new file mode 100644 index 00000000000..7dc5cb9ef7b --- /dev/null +++ b/src/trinityrealm/resource.h @@ -0,0 +1,15 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by TrinityCore.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif |
