CSCommon: MMatchObject.h 소스 파일

MAIET

MMatchObject.h

00001 #ifndef MMATCHOBJECT_H
00002 #define MMATCHOBJECT_H
00003 
00004 #include <vector>
00005 #include <map>
00006 #include <algorithm>
00007 #include <string>
00008 using namespace std;
00009 #include "MMatchItem.h"
00010 #include "MUID.h"
00011 #include "MObject.h"
00012 #include "MMatchGlobal.h"
00013 #include "MMatchFriendInfo.h"
00014 #include "MMatchClan.h"
00015 #include "MMatchChannel.h"
00016 #include "MSmartRefreshImpl.h"
00017 
00018 #ifdef _QUEST_ITEM
00019 #include "MQuestItem.h"
00020 #endif
00021 
00022 // 등급 - 이것은 디비의 UserGrade테이블과 싱크가 맞아야 한다.
00023 enum MMatchUserGradeID
00024 {
00025     MMUG_FREE           = 0,    // 무료 계정
00026     MMUG_REGULAR        = 1,    // 정액 유저
00027     MMUG_STAR           = 2,    // 스타유저(게임짱)
00028 
00029     MMUG_CRIMINAL       = 100,  // 전과자
00030     MMUG_WARNING_1      = 101,  // 1차 경고
00031     MMUG_WARNING_2      = 102,  // 2차 경고
00032     MMUG_WARNING_3      = 103,  // 3차 경고
00033     MMUG_CHAT_LIMITED   = 104,  // 채팅 금지
00034     MMUG_PENALTY        = 105,  // 기간 정지
00035 
00036     MMUG_EVENTMASTER    = 252,  // 이벤트 진행자
00037     MMUG_BLOCKED        = 253,  // 사용 정지
00038     MMUG_DEVELOPER      = 254,  // 개발자
00039     MMUG_ADMIN          = 255   // 관리자
00040 };
00041 
00042 // 유료이용자 권한 - 이것은 디비의 PremiumGrade테이블과 싱크가 맞아야 한다.
00043 enum MMatchPremiumGradeID
00044 {
00045     MMPG_FREE = 0   // 무료
00046 };
00047 
00048 // 성별 - 이것은 디비의 성별정보와 싱크가 맞아야 한다.
00049 enum MMatchSex
00050 {
00051     MMS_MALE = 0,       // 남자
00052     MMS_FEMALE = 1      // 여자
00053 };
00054 
00055 
00057 struct MMatchAccountInfo
00058 {
00059     int                     m_nAID;
00060     char                    m_szUserID[32];         // 계정ID
00061     MMatchUserGradeID       m_nUGrade;              // 등급
00062     MMatchPremiumGradeID    m_nPGrade;              // 유료 이용자 권한
00063     MMatchAccountInfo() : m_nAID(-1), m_nUGrade(MMUG_FREE), m_nPGrade(MMPG_FREE)
00064     {
00065         memset(m_szUserID, 0, sizeof(m_szUserID));
00066     }
00067 };
00068 
00069 // 플레이어가 현재 위치하고 있는 곳
00070 enum MMatchPlace
00071 {
00072     MMP_OUTSIDE = 0,
00073     MMP_LOBBY = 1,
00074     MMP_STAGE   = 2,
00075     MMP_BATTLE  = 3,
00076     MMP_END
00077 };
00078 
00079 enum MMatchObjectStageState
00080 {
00081     MOSS_NONREADY   = 0,
00082     MOSS_READY      = 1,
00083     MOSS_SHOP       = 2,
00084     MOSS_EQUIPMENT  = 3,
00085     MOSS_END
00086 };
00087 
00088 #define DEFAULT_CHAR_HP             100
00089 #define DEFAULT_CHAR_AP             0
00090 
00091 #define DBCACHING_REQUEST_POINT     40
00092 struct DBCharCachingData
00093 {
00094     int nAddedXP;
00095     int nAddedBP;
00096     int nAddedKillCount;
00097     int nAddedDeathCount;
00098     void Reset()
00099     {
00100         nAddedXP = 0;
00101         nAddedBP = 0;
00102         nAddedKillCount = 0;
00103         nAddedDeathCount = 0;
00104     }
00105     bool IsRequestUpdate()
00106     {
00107         if ((nAddedKillCount > DBCACHING_REQUEST_POINT) || (nAddedDeathCount > DBCACHING_REQUEST_POINT))
00108             return true;
00109 
00110         return false;
00111     }
00112 };
00113 
00114 
00115 // 캐릭터의 클랜정보
00116 struct MMatchCharClanInfo
00117 {
00118     int                 m_nClanID;                          // db상의 클랜 ID
00119     char                m_szClanName[CLAN_NAME_LENGTH];     // 클랜 이름
00120     MMatchClanGrade     m_nGrade;                           // 클랜에서의 권한
00121     int                 m_nContPoint;                       // 클랜 기여도
00122     MMatchCharClanInfo() {  Clear(); }
00123     void Clear()
00124     {
00125         m_nClanID = 0; 
00126         m_szClanName[0] = 0; 
00127         m_nGrade=MCG_NONE;
00128         m_nContPoint = 0;
00129     }
00130     bool IsJoined() { return (m_nClanID == 0) ? false : true; }
00131 };
00132 
00133 
00134 #define DEFAULT_CHARINFO_MAXWEIGHT      100
00135 #define DEFAULT_CHARINFO_SAFEFALLS      0.0f
00136 #define DEFAULT_CHARINFO_BONUSRATE      0
00137 #define DEFAULT_CHARINFO_PRIZE          0
00138 
00139 
00141 class MMatchCharInfo
00142 {
00143 public:
00144     unsigned long int   m_nCID;
00145     int                 m_nCharNum;
00146     char                m_szName[MATCHOBJECT_NAME_LENGTH];
00147     int                 m_nLevel;
00148     MMatchSex           m_nSex;         // 성별
00149     int                 m_nHair;        // 머리
00150     int                 m_nFace;        // 얼굴
00151     unsigned long int   m_nXP;
00152     int                 m_nBP;
00153     float               m_fBonusRate;
00154     int                 m_nPrize;
00155     int                 m_nHP;
00156     int                 m_nAP;
00157     int                 m_nMaxWeight;
00158     int                 m_nSafeFalls;
00159     int                 m_nFR;
00160     int                 m_nCR;
00161     int                 m_nER;
00162     int                 m_nWR;
00163     unsigned long int   m_nEquipedItemCIID[MMCIP_END];
00164     MMatchItemMap       m_ItemList;         // 아이템 정보
00165     MMatchEquipedItem   m_EquipedItem;      // 장비하고 있는 아이템 정보
00166     MMatchCharClanInfo  m_ClanInfo;         // 클랜 정보
00167 
00168 #ifdef _QUEST_ITEM
00169     MQuestMonster       m_QuestMonster;
00170     MQuestItemMap       m_QuestItemList;
00171     DBQuestCashingData  m_DBQuestCashingData;
00172 
00173     DBQuestCashingData& GetDBQuestCashingData() { return m_DBQuestCashingData; }
00174 #endif
00175 
00176 
00177     unsigned long int   m_nTotalPlayTimeSec;    // 플레이 시간
00178     unsigned long int   m_nConnTime;            // 접속한 시간(1초 = 1000)
00179 
00180     unsigned long int   m_nTotalKillCount;          // 전체 킬수
00181     unsigned long int   m_nTotalDeathCount;         // 전체 데쓰수
00182     unsigned long int   m_nConnKillCount;           // 접속이후로 누적된 킬수
00183     unsigned long int   m_nConnDeathCount;          // 접속이후로 누적된 데쓰수
00184     unsigned long int   m_nConnXP;                  // 접속이후로 누적된 경험치
00185 
00186 protected:
00187     DBCharCachingData   m_DBCachingData;
00188 public:
00189     MMatchCharInfo() : m_nCID(0), m_nCharNum(0), m_nLevel(0), m_nSex(MMS_MALE), m_nFace(0),
00190                        m_nHair(0), m_nXP(0), m_nBP(0), m_fBonusRate(DEFAULT_CHARINFO_BONUSRATE), m_nPrize(DEFAULT_CHARINFO_PRIZE), m_nHP(0),
00191                        m_nAP(0), m_nMaxWeight(DEFAULT_CHARINFO_MAXWEIGHT), m_nSafeFalls(DEFAULT_CHARINFO_SAFEFALLS),
00192                        m_nFR(0), m_nCR(0), m_nER(0), m_nWR(0),
00193                        m_nConnTime(0), m_nTotalKillCount(0), m_nTotalDeathCount(0), m_nConnKillCount(0), m_nConnDeathCount(0), 
00194                        m_nConnXP(0)
00195     {
00196         memset(m_szName, 0, sizeof(m_szName));
00197         memset(m_nEquipedItemCIID, 0, sizeof(m_nEquipedItemCIID));
00198         memset(&m_DBCachingData, 0, sizeof(m_DBCachingData));
00199     }
00200     void EquipFromItemList();
00201     void ClearItems();
00202     void Clear();
00203     void GetTotalWeight(int* poutWeight, int* poutMaxWeight);
00204 
00205 
00206     // db caching까지 함께 더해준다.
00207     void IncKill()
00208     { 
00209         m_nTotalKillCount += 1;
00210         m_nConnKillCount += 1;
00211         m_DBCachingData.nAddedKillCount += 1;
00212     }
00213     void IncDeath()
00214     { 
00215         m_nTotalDeathCount += 1;
00216         m_nConnDeathCount += 1;
00217         m_DBCachingData.nAddedDeathCount += 1;
00218     }
00219     void IncBP(int nAddedBP)        
00220     { 
00221         m_nBP += nAddedBP;
00222         m_DBCachingData.nAddedBP += nAddedBP;
00223     }
00224     void DecBP(int nDecBP)
00225     { 
00226         m_nBP -= nDecBP;
00227         m_DBCachingData.nAddedBP -= nDecBP;
00228     }
00229     void IncXP(int nAddedXP)
00230     { 
00231         m_nConnXP += nAddedXP;
00232         m_nXP += nAddedXP;
00233         m_DBCachingData.nAddedXP += nAddedXP;
00234     }
00235     void DecXP(int nDecXP)
00236     { 
00237         m_nConnXP -= nDecXP; 
00238         m_nXP -= nDecXP; 
00239         m_DBCachingData.nAddedXP -= nDecXP; 
00240     }
00241 
00242     DBCharCachingData* GetDBCachingData() { return &m_DBCachingData; }
00243 };
00244 
00245 class MMatchTimeSyncInfo {
00246 protected:
00247     int             m_nFoulCount;
00248     unsigned long   m_nLastSyncClock;
00249 public:
00250     MMatchTimeSyncInfo()                { m_nFoulCount=0; m_nLastSyncClock=0; }
00251     virtual ~MMatchTimeSyncInfo()       {}
00252 
00253     int GetFoulCount()                  { return m_nFoulCount; }
00254     void AddFoulCount()                 { m_nFoulCount++; }
00255     void ResetFoulCount()               { m_nFoulCount = 0; }
00256     unsigned long GetLastSyncClock()    { return m_nLastSyncClock; }
00257     void Update(unsigned long nClock)   { m_nLastSyncClock = nClock; }
00258 };
00259 
00260 // MatchObject가 게임안에서 사용하는 변수들
00261 struct MMatchObjectGameInfo
00262 {
00263     bool        bJoinedGame;        // 게임에 참가중인지 여부 - 팀전에서 난입했을때
00264 };
00265 
00266 struct MMatchObjectChannelInfo
00267 {
00268     MUID            uidChannel;
00269     MUID            uidRecentChannel;
00270     bool            bChannelListTransfer;
00271     MCHANNEL_TYPE   nChannelListType;
00272     unsigned long   nChannelListChecksum;
00273     int             nTimeLastChannelListTrans;
00274     void Clear()
00275     {
00276         uidChannel = MUID(0,0);
00277         uidRecentChannel = MUID(0,0);
00278         bChannelListTransfer = false;
00279         nChannelListType = MCHANNEL_TYPE_PRESET;
00280         nChannelListChecksum = 0;
00281         nTimeLastChannelListTrans = 0;
00282     }
00283 };
00284 
00285 class MMatchObject : public MObject {
00286 protected:
00287     MMatchAccountInfo           m_AccountInfo;      // 계정 정보
00288     MMatchCharInfo*             m_pCharInfo;        // 캐릭터 정보
00289     MMatchFriendInfo*           m_pFriendInfo;      // 친구정보
00290     MMatchPlace                 m_nPlace;           // 위치 정보
00291     MMatchTimeSyncInfo          m_nTimeSyncInfo;    // 스피드핵 감시    
00292     MMatchObjectChannelInfo     m_ChannelInfo;      // 채널 정보
00293     MMatchObjectGameInfo        m_GameInfo;         // 게임안에서의 정보
00294 
00295     bool            m_bBridgePeer;
00296     bool            m_bRelayPeer;
00297     MUID            m_uidAgent;
00298 
00299     char            m_szIP[64];
00300     unsigned int    m_nPort;
00301     bool            m_bFreeLoginIP;                 // 인원제한 상관없이 로그인 허용된 클라이언트
00302 
00303     unsigned char   m_nPlayerFlags;                 // 휘발성 속성등 (MTD_PlayerFlags)
00304     unsigned long   m_nUserOptionFlags;             // 귓말,초대 거부등의 옵션
00305 
00306     MUID            m_uidStage;
00307     MUID            m_uidChatRoom;
00308 
00309     bool            m_bStageListTransfer;
00310     unsigned long   m_nStageListChecksum;
00311     unsigned long   m_nStageListLastChecksum;
00312     int             m_nTimeLastStageListTrans;
00313     int             m_nStageCursor;
00314 
00315     MRefreshClientChannelImpl       m_RefreshClientChannelImpl;
00316     MRefreshClientClanMemberImpl    m_RefreshClientClanMemberImpl;
00317 
00318     MMatchObjectStageState  m_nStageState;  // 대기방에서의 상태정보
00319     unsigned int            m_nTeam;
00320     int                     m_nLadderGroupID;
00321     bool            m_bLadderChallenging;   // 클랜전 상대팀 대기중인지 여부
00322 
00323 //  bool            m_bStageMaster; 
00324     bool            m_bEnterBattle;
00325     bool            m_bAlive;
00326 
00327     bool            m_bNewbie;              // 자신의 캐릭터들의 최고레벨이 10레벨이상이면 입문채널에 들어갈 수 없다.
00328     bool            m_bForcedEntried;       // 난입한 플레이어인지 여부.
00329     bool            m_bLaunchedGame;
00330 
00331     unsigned int            m_nKillCount;   // 한라운드 죽인수
00332     unsigned int            m_nDeathCount;  // 한라운드 죽은수
00333     unsigned long int       m_nAllRoundKillCount;   // 전체 라운드의 킬수
00334     unsigned long int       m_nAllRoundDeathCount;  // 전체 라운드의 데쓰수
00335 
00336     bool            m_bWasCallVote;     // 한 게임 안에서 투표건의를 했는가?
00337 
00338     bool            m_bDBFriendListRequested;       // 친구리스트 DB에 정보요청을 했는지 여부
00339     
00340 protected:
00341     void UpdateChannelListChecksum(unsigned long nChecksum) { m_ChannelInfo.nChannelListChecksum = nChecksum; }
00342     unsigned long GetChannelListChecksum()                  { return m_ChannelInfo.nChannelListChecksum; }
00343 
00344     void UpdateStageListChecksum(unsigned long nChecksum)   { m_nStageListChecksum = nChecksum; }
00345     unsigned long GetStageListChecksum()                    { return m_nStageListChecksum; }
00346     MMatchObject() : MObject() 
00347     {
00348     }
00349 public:
00350     MMatchObject(const MUID& uid);
00351     virtual ~MMatchObject();
00352 
00353     char* GetName() { 
00354         if (m_pCharInfo)
00355             return m_pCharInfo->m_szName; 
00356         else
00357             return "Unknown";
00358     }
00359     char* GetAccountName()          { return m_AccountInfo.m_szUserID; }
00360 
00361     bool GetBridgePeer()            { return m_bBridgePeer; }
00362     void SetBridgePeer(bool bValue) { m_bBridgePeer = bValue; }
00363     bool GetRelayPeer()             { return m_bRelayPeer; }
00364     void SetRelayPeer(bool bRelay)  { m_bRelayPeer = bRelay; }
00365     const MUID& GetAgentUID()       { return m_uidAgent; }
00366     void SetAgentUID(const MUID& uidAgent)  { m_uidAgent = uidAgent; }
00367 
00368     void SetPeerAddr(char* szIP, unsigned short nPort)  { strcpy(m_szIP, szIP); m_nPort = nPort; }
00369     char* GetIP()                   { return m_szIP; }
00370     unsigned short GetPort()        { return m_nPort; }
00371     bool GetFreeLoginIP()           { return m_bFreeLoginIP; }
00372     void SetFreeLoginIP(bool bFree) { m_bFreeLoginIP = bFree; }
00373 
00374     void ResetPlayerFlags()                     { m_nPlayerFlags = 0; }
00375     unsigned char GetPlayerFlags()              { return m_nPlayerFlags; }
00376     bool CheckPlayerFlags(unsigned char nFlag)  { return (m_nPlayerFlags&nFlag?true:false); }
00377     void SetPlayerFlag(unsigned char nFlagIdx, bool bSet)   
00378     { 
00379         if (bSet) m_nPlayerFlags |= nFlagIdx; 
00380         else m_nPlayerFlags &= (0xff ^ nFlagIdx);
00381     }
00382 
00383     void SetUserOption(unsigned long nFlags)    { m_nUserOptionFlags = nFlags; }
00384     bool CheckUserOption(unsigned long nFlag)   { return (m_nUserOptionFlags&nFlag?true:false); }
00385 
00386     MUID GetChannelUID()                        { return m_ChannelInfo.uidChannel; }
00387     void SetChannelUID(const MUID& uid)         { SetRecentChannelUID(m_ChannelInfo.uidChannel); m_ChannelInfo.uidChannel = uid; }
00388     MUID GetRecentChannelUID()                  { return m_ChannelInfo.uidRecentChannel; }
00389     void SetRecentChannelUID(const MUID& uid)   { m_ChannelInfo.uidRecentChannel = uid; }
00390 
00391     MUID GetStageUID()                  { return m_uidStage; }
00392     void SetStageUID(const MUID& uid)   { m_uidStage = uid; }
00393     MUID GetChatRoomUID()               { return m_uidChatRoom; }
00394     void SetChatRoomUID(const MUID& uid){ m_uidChatRoom = uid; }
00395 
00396     bool CheckChannelListTransfer() { return m_ChannelInfo.bChannelListTransfer; }
00397     void SetChannelListTransfer(const bool bVal, const MCHANNEL_TYPE nChannelType=MCHANNEL_TYPE_PRESET);
00398 
00399     bool CheckStageListTransfer()   { return m_bStageListTransfer; }
00400     void SetStageListTransfer(bool bVal)    { m_bStageListTransfer = bVal; UpdateStageListChecksum(0); }
00401 
00402     MRefreshClientChannelImpl* GetRefreshClientChannelImplement()       { return &m_RefreshClientChannelImpl; }
00403     MRefreshClientClanMemberImpl* GetRefreshClientClanMemberImplement() { return &m_RefreshClientClanMemberImpl; }
00404 
00405     unsigned int GetTeam()          { return m_nTeam; }
00406     void SetTeam(unsigned int nTeam);
00407     MMatchObjectStageState GetStageState()  { return m_nStageState; }
00408     void SetStageState(MMatchObjectStageState nStageState)  { m_nStageState = nStageState; }
00409     bool GetEnterBattle()           { return m_bEnterBattle; }
00410     void SetEnterBattle(bool bEnter){ m_bEnterBattle = bEnter; }
00411     bool CheckAlive()               { return m_bAlive; }
00412     void SetAlive(bool bVal)        { m_bAlive = bVal; }
00413     void KillCount()                { m_nKillCount++; m_nAllRoundKillCount++; }
00414     void SetKillCount(unsigned int nKillCount) { m_nKillCount = nKillCount; }
00415     unsigned int GetKillCount()     { return m_nKillCount; }
00416     void DeathCount()               { m_nDeathCount++; m_nAllRoundDeathCount++; }
00417     void SetDeathCount(unsigned int nDeathCount) { m_nDeathCount = nDeathCount; }
00418     unsigned int GetDeathCount()    { return m_nDeathCount; }
00419     unsigned int GetAllRoundKillCount() { return m_nAllRoundKillCount; }
00420     unsigned int GetAllRoundDeathCount()    { return m_nAllRoundDeathCount; }
00421     void SetAllRoundKillCount(unsigned int nAllRoundKillCount) { m_nAllRoundKillCount = nAllRoundKillCount; }
00422     void SetAllRoundDeathCount(unsigned int nAllRoundDeathCount) { m_nAllRoundDeathCount = nAllRoundDeathCount; }
00423     void FreeCharInfo();
00424     void FreeFriendInfo();
00425 
00426     void SetForcedEntry(bool bVal) { m_bForcedEntried = bVal; }
00427     bool IsForcedEntried() { return m_bForcedEntried; }
00428     void SetLaunchedGame(bool bVal) { m_bLaunchedGame = bVal; }
00429     bool IsLaunchedGame() { return m_bLaunchedGame; }
00430     void CheckNewbie(int nCharMaxLevel);
00431     bool IsNewbie()                 { return m_bNewbie; }
00432 
00433     inline bool WasCallVote()                       { return m_bWasCallVote; }
00434     inline void SetVoteState( const bool bState )   { m_bWasCallVote = bState; }
00435 
00436 public:
00437     // Ladder 관련
00438     int GetLadderGroupID()          { return m_nLadderGroupID; }
00439     void SetLadderGroupID(int nID)  { m_nLadderGroupID = nID; }
00440     void SetLadderChallenging(bool bVal) { m_bLadderChallenging = bVal; }
00441     bool IsLadderChallenging()          { return m_bLadderChallenging; }        // 클랜전 상대팀 대기중인지 여부
00442 public:
00443     MMatchAccountInfo* GetAccountInfo() { return &m_AccountInfo; }
00444     MMatchCharInfo* GetCharInfo()   { return m_pCharInfo; }
00445     void SetCharInfo(MMatchCharInfo* pCharInfo)
00446     { 
00447         m_pCharInfo = pCharInfo; 
00448 #ifdef _QUEST_ITEM
00449         m_pCharInfo->m_DBQuestCashingData.SetCharObject( this );
00450 #endif
00451     }
00452     MMatchFriendInfo* GetFriendInfo()   { return m_pFriendInfo; }
00453     void SetFriendInfo(MMatchFriendInfo* pFriendInfo);
00454     bool DBFriendListRequested()    { return m_bDBFriendListRequested; }
00455     MMatchPlace GetPlace()          { return m_nPlace; }
00456     void SetPlace(MMatchPlace nPlace);
00457     MMatchTimeSyncInfo* GetSyncInfo()   { return &m_nTimeSyncInfo; }
00458 
00460     virtual void Tick(unsigned long int nTime);
00461 
00462     void OnStageJoin();
00463     void OnInitRound();
00464 
00465     void SetStageCursor(int nStageCursor);
00466     const MMatchObjectGameInfo* GetGameInfo() { return &m_GameInfo; }
00467 
00468 public:
00469     enum MMO_ACTION
00470     {
00471         MMOA_STAGE_FOLLOW,
00472         MMOA_MAX
00473     };
00474     bool CheckEnableAction(MMO_ACTION nAction);     // 해당 액션이 가능한지 여부 - 필요할때마다 추가한다.
00475 };
00476 
00477 class MMatchObjectList : public map<MUID, MMatchObject*>{};
00478 
00479 // 캐릭터 생성할때 주는 기본 아이템
00480 struct MINITIALCOSTUME
00481 {
00482     // 무기
00483     unsigned int nMeleeItemID;
00484     unsigned int nPrimaryItemID;
00485     unsigned int nSecondaryItemID;
00486     unsigned int nCustom1ItemID;
00487     unsigned int nCustom2ItemID;
00488 
00489     // 장비 아이템
00490     unsigned int nChestItemID;
00491     unsigned int nHandsItemID;
00492     unsigned int nLegsItemID;
00493     unsigned int nFeetItemID;
00494 };
00495 
00496 #define MAX_COSTUME_TEMPLATE        6
00497 const MINITIALCOSTUME g_InitialCostume[MAX_COSTUME_TEMPLATE][2] = 
00498 { 
00499     {{1, 5001, 4001, 30301, 0,     21001, 0, 23001, 0}, {1, 5001, 4001, 30301, 0,     21501, 0, 23501, 0}}, // 건나이트
00500     {{2, 5002, 0,    30301, 0,     21001, 0, 23001, 0}, {2, 5002,    0, 30301, 0,     21501, 0, 23501, 0}}, // 건파이터
00501     {{1, 4005, 5001, 30401, 0,     21001, 0, 23001, 0}, {1, 4005, 5001, 30401, 0,     21501, 0, 23501, 0}}, // 애서신
00502     {{2, 4001, 4006, 30401, 0,     21001, 0, 23001, 0}, {2, 4001, 4006, 30401, 0,     21501, 0, 23501, 0}}, // 스카우트
00503     {{2, 4002, 0,    30401, 30001, 21001, 0, 23001, 0}, {2, 4002,    0, 30401, 30001, 21501, 0, 23501, 0}}, // 건프리스트
00504     {{1, 4006, 0,    30101, 30001, 21001, 0, 23001, 0}, {1, 4006, 4006, 30101, 30001, 21501, 0, 23501, 0}}  // 닥터
00505 };
00506 
00507 /*
00508 const unsigned int g_InitialHair[4][2] = 
00509 {
00510     {10000, 10022},
00511     {10001, 10023},
00512     {10002, 10024},
00513     {10003, 10025}
00514 };
00515 */
00516 
00517 #define MAX_COSTUME_HAIR        5
00518 const string g_szHairMeshName[MAX_COSTUME_HAIR][2] = 
00519 {
00520     {"eq_head_01", "eq_head_pony"},
00521     {"eq_head_02", "eq_head_hair001"},
00522     {"eq_head_08", "eq_head_hair04"},
00523     {"eq_head_05", "eq_head_hair006"},
00524     {"eq_head_08", "eq_head_hair002"}       // 이건 현재 사용안함 - 나중에 다른 모델로 대체해도 됨
00525 };
00526 
00527 #define MAX_COSTUME_FACE        5
00528 const string g_szFaceMeshName[MAX_COSTUME_FACE][2] = 
00529 {
00530     {"eq_face_01", "eq_face_001"},
00531     {"eq_face_02", "eq_face_002"},
00532     {"eq_face_04", "eq_face_003"},
00533     {"eq_face_05", "eq_face_004"},
00534     {"eq_face_06", "eq_face_001"}
00535 };
00536 
00537 
00538 // MC_MATCH_STAGE_ENTERBATTLE 커맨드에서 쓰이는 파라메타
00539 enum MCmdEnterBattleParam
00540 {
00541     MCEP_NORMAL = 0,
00542     MCEP_FORCED = 1,        // 난입
00543     MCEP_END
00544 };
00545 
00546 // 입을 수 있는 아이템인지 체크
00547 bool IsEquipableItem(unsigned long int nItemID, int nPlayerLevel, MMatchSex nPlayerSex);
00548 
00549 inline bool IsEnabledObject(MMatchObject* pObject) 
00550 {
00551     if ((pObject == NULL) || (pObject->GetCharInfo() == NULL)) return false;
00552     return true;
00553 }
00554 
00555 inline bool IsAdminGrade(MMatchUserGradeID nGrade) 
00556 {
00557     if ((nGrade == MMUG_EVENTMASTER) || 
00558         (nGrade == MMUG_ADMIN) || 
00559         (nGrade == MMUG_DEVELOPER))
00560         return true;
00561 
00562     return false;
00563 }
00564 
00565 inline bool IsAdminGrade(MMatchObject* pObject) 
00566 {
00567     if (pObject == NULL) return false;
00568 
00569     return IsAdminGrade(pObject->GetAccountInfo()->m_nUGrade);
00570 }
00571 
00572 #endif


MAIET entertainment