Changeset 78 for trunk/src/game

Show
Ignore:
Timestamp:
11/19/08 13:32:10 (17 years ago)
Author:
yumileroy
Message:

[svn] * fixed help for subcommands - source mangos
* Renamed accounts column tbc to expansion and it only took a little over 4 hours o.O

Original author: KingPin?
Date: 2008-10-20 12:23:56-05:00

Location:
trunk/src/game
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/CharacterHandler.cpp

    r74 r78  
    180180    std::string name; 
    181181    uint8 race_,class_; 
    182     bool pTbc = this->IsTBC() && sWorld.getConfig(CONFIG_EXPANSION) > 0; 
    183182    recv_data >> name; 
    184183 
     
    213212    } 
    214213 
    215     if (!sChrClassesStore.LookupEntry(class_)|| 
    216         !sChrRacesStore.LookupEntry(race_)) 
     214    ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_); 
     215    ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race_); 
     216    if( !classEntry || !raceEntry ) 
    217217    { 
    218218        data << (uint8)CHAR_CREATE_FAILED; 
     
    223223 
    224224    // prevent character creating Expansion race without Expansion account 
    225     if (!pTbc&&(race_>RACE_TROLL)) 
     225    if (raceEntry->addon > Expansion()) 
    226226    { 
    227227        data << (uint8)CHAR_CREATE_EXPANSION; 
    228         sLog.outError("No Expansion Account:[%d] but tried to Create TBC character",GetAccountId()); 
     228        sLog.outError("Not Expansion 1 account:[%d] but tried to Create character with expansion 1 race (%u)",GetAccountId(),race_); 
     229        SendPacket( &data ); 
     230        return; 
     231    } 
     232 
     233    // prevent character creating Expansion class without Expansion account 
     234    // TODO: use possible addon field in ChrClassesEntry in next dbc version 
     235    if (Expansion() < 2 && class_ == CLASS_DEATH_KNIGHT) 
     236    { 
     237        data << (uint8)CHAR_CREATE_EXPANSION; 
     238        sLog.outError("Not Expansion 2 account:[%d] but tried to Create character with expansion 2 class (%u)",GetAccountId(),class_); 
    229239        SendPacket( &data ); 
    230240        return; 
  • trunk/src/game/Chat.cpp

    r62 r78  
    627627    for(uint32 i = 0; table[i].Name != NULL; i++) 
    628628    { 
    629         if( !hasStringAbbr(table[i].Name, cmd.c_str()) ) 
     629        if( *subcmd && !hasStringAbbr(table[i].Name, subcmd)) 
    630630            continue; 
    631631 
  • trunk/src/game/Map.cpp

    r61 r78  
    1919 */ 
    2020 
     21#include "MapManager.h" 
    2122#include "Player.h" 
    2223#include "GridNotifiers.h" 
     
    3637#include "Group.h" 
    3738 
    38 #include "MapManager.h" 
    3939#include "MapInstanced.h" 
    4040#include "InstanceSaveMgr.h" 
  • trunk/src/game/ObjectMgr.cpp

    r44 r78  
    23702370            // skip expansion races if not playing with expansion 
    23712371            if (sWorld.getConfig(CONFIG_EXPANSION) < 1 && (race == RACE_BLOODELF || race == RACE_DRAENEI)) 
     2372                continue; 
     2373                 
     2374            // skip expansion classes if not playing with expansion 
     2375            if (sWorld.getConfig(CONFIG_EXPANSION) < 2 && class_ == CLASS_DEATH_KNIGHT) 
    23722376                continue; 
    23732377 
  • trunk/src/game/Player.cpp

    r76 r78  
    15161516        return false; 
    15171517 
    1518     bool tbc = GetSession()->IsTBC() && sWorld.getConfig(CONFIG_EXPANSION) > 0; 
    1519  
    1520     // normal client and TBC map 
    1521     if(!tbc && mEntry->IsExpansionMap()) 
    1522     { 
    1523         sLog.outDebug("Player %s using Normal client and tried teleport to non existing map %u", GetName(), mapid); 
     1518    // client without expansion support 
     1519    if(GetSession()->Expansion() < mEntry->Expansion()) 
     1520    { 
     1521        sLog.outDebug("Player %s using client without required expansion tried teleport to non accessable map %u", GetName(), mapid); 
    15241522 
    15251523        if(GetTransport()) 
     
    15301528        return false;                                       // normal client can't teleport to this map... 
    15311529    } 
    1532     else if(tbc)                                            // can teleport to any existing map 
    1533     { 
    1534         sLog.outDebug("Player %s have TBC client and will teleported to map %u", GetName(), mapid); 
    1535     } 
    15361530    else 
    15371531    { 
    1538         sLog.outDebug("Player %s have normal client and will teleported to standard map %u", GetName(), mapid); 
    1539     } 
    1540     /* 
    1541     only TBC (no 0x80000 and 0x10 flags...) 
    1542     3604590=0x37006E=0x200000 + 0x100000 + 0x40000 + 0x20000 + 0x10000 + 0x40 + 0x20 + 0x8 + 0x4 + 0x2 
    1543  
    1544     Kharazan (normal/TBC??), but not have 0x10 flag (accessible by normal client?) 
    1545     4128878=0x3F006E=0x200000 + 0x100000 + 0x80000 + 0x40000 + 0x20000 + 0x10000 + 0x40 + 0x20 + 0x8 + 0x4 + 0x2 
    1546  
    1547     normal+TBC maps 
    1548     4128894=0x3F007E=0x200000 + 0x100000 + 0x80000 + 0x40000 + 0x20000 + 0x10000 + 0x40 + 0x20 + 0x10 + 0x8 + 0x4 + 0x2 
    1549  
    1550     normal+TBC maps 
    1551     8323198=0x7F007E=0x400000 + 0x200000 + 0x100000 + 0x80000 + 0x40000 + 0x20000 + 0x10000 + 0x40 + 0x20 + 0x10 + 0x8 + 0x4 + 0x2 
    1552     */ 
     1532        sLog.outDebug("Player %s will teleported to map %u", GetName(), mapid); 
     1533    } 
    15531534 
    15541535    // if we were on a transport, leave 
  • trunk/src/game/SharedDefines.h

    r53 r78  
    6767    CLASS_ROGUE         = 4, 
    6868    CLASS_PRIEST        = 5, 
    69     // CLASS_UNK1       = 6, DK 
     69    CLASS_DEATH_KNIGHT  = 6, 
    7070    CLASS_SHAMAN        = 7, 
    7171    CLASS_MAGE          = 8, 
     
    962962    GAMEOBJECT_TYPE_AURA_GENERATOR         = 30, 
    963963    GAMEOBJECT_TYPE_DUNGEON_DIFFICULTY     = 31, 
    964     GAMEOBJECT_TYPE_DO_NOT_USE_YET         = 32, 
     964    GAMEOBJECT_TYPE_BARBER_CHAIR           = 32, 
    965965    GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING  = 33, 
    966966    GAMEOBJECT_TYPE_GUILD_BANK             = 34, 
     
    15501550{ 
    15511551    CREATURE_TYPE_BEAST            = 1, 
    1552     CREATURE_TYPE_DRAGON           = 2, 
     1552    CREATURE_TYPE_DRAGONKIN        = 2, 
    15531553    CREATURE_TYPE_DEMON            = 3, 
    15541554    CREATURE_TYPE_ELEMENTAL        = 4, 
     
    15581558    CREATURE_TYPE_CRITTER          = 8, 
    15591559    CREATURE_TYPE_MECHANICAL       = 9, 
    1560     CREATURE_TYPE_NOTSPECIFIED     = 10, 
     1560    CREATURE_TYPE_NOT_SPECIFIED    = 10, 
    15611561    CREATURE_TYPE_TOTEM            = 11, 
    15621562    CREATURE_TYPE_NON_COMBAT_PET   = 12, 
  • trunk/src/game/WorldSession.cpp

    r73 r78  
    4545 
    4646/// WorldSession constructor 
    47 WorldSession::WorldSession(uint32 id, WorldSocket *sock, uint32 sec, bool tbc, time_t mute_time, LocaleConstant locale) : 
     47WorldSession::WorldSession(uint32 id, WorldSocket *sock, uint32 sec, uint8 expansion, time_t mute_time, LocaleConstant locale) : 
    4848LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time), 
    49 _player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_isTBC(tbc), 
     49_player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion), 
    5050m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(objmgr.GetIndexForLocale(locale)), 
    5151_logoutTime(0), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false), m_latency(0) 
  • trunk/src/game/WorldSession.h

    r44 r78  
    7272    friend class CharacterHandler; 
    7373    public: 
    74         WorldSession(uint32 id, WorldSocket *sock, uint32 sec, bool tbc, time_t mute_time, LocaleConstant locale); 
     74        WorldSession(uint32 id, WorldSocket *sock, uint32 sec, uint8 expansion, time_t mute_time, LocaleConstant locale); 
    7575        ~WorldSession(); 
    7676 
     
    8989        uint32 GetSecurity() const { return _security; } 
    9090        uint32 GetAccountId() const { return _accountId; } 
     91        //std::string const& GetRemoteAddress() const { return m_remoteaddress; } 
    9192        Player* GetPlayer() const { return _player; } 
    9293        char const* GetPlayerName() const; 
     
    9495        std::string& GetRemoteAddress() { return m_Address; } 
    9596        void SetPlayer(Player *plr) { _player = plr; } 
    96         bool IsTBC() const { return m_isTBC; } 
     97        uint8 Expansion() const { return m_expansion; } 
    9798 
    9899        /// Is the user engaged in a log out process? 
     
    630631        uint32 _security; 
    631632        uint32 _accountId; 
    632         bool m_isTBC; 
     633        uint8 m_expansion; 
    633634 
    634635        time_t _logoutTime; 
  • trunk/src/game/WorldSocket.cpp

    r44 r78  
    679679  uint32 BuiltNumberClient; 
    680680  uint32 id, security; 
    681   bool tbc = false; 
     681  uint8 expansion = 0; 
    682682  LocaleConstant locale; 
    683683  std::string account; 
     
    729729                                "v, " //6 
    730730                                "s, " //7 
    731                                 "tbc, " //8 
     731                                "expansion, " //8 
    732732                                "mutetime, " //9 
    733733                                "locale " //10 
     
    750750  Field* fields = result->Fetch (); 
    751751 
    752   tbc = fields[8].GetUInt8 () && sWorld.getConfig (CONFIG_EXPANSION) > 0; 
     752    uint8 expansion = fields[8].GetUInt8(); 
     753    uint32 world_expansion = sWorld.getConfig(CONFIG_EXPANSION); 
     754    if(expansion > world_expansion) 
     755        expansion = world_expansion; 
    753756 
    754757  N.SetHexStr ("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"); 
     
    910913  // TODO protect here probably ? 
    911914  // Althought atm the socket is singlethreaded 
    912   ACE_NEW_RETURN (m_Session, WorldSession (id, this, security, tbc, mutetime, locale), -1); 
     915  ACE_NEW_RETURN (m_Session, WorldSession (id, this, security, expansion, mutetime, locale), -1); 
    913916 
    914917  m_Crypt.SetKey (&K);