Skocz do zawartości
  • Dołącz do społeczności!

    👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Błędy w GAME podczas kompilacji.


Rekomendowane odpowiedzi

Opublikowano

Hej, niedawno rozpocząłem przygodę z tworzeniem serwera itp...
Zrobiłem system sklepów online z poradnika Paszki na YT i po kompilacji wywaliło mi błąd w Game w plikach, których nawet w tym poradniku nie trzeba było otwierać. Nie wiem jak to naprawić i męczę się z tym od 2 godzin , ktoś pomoże znaleźć błędy,naprawić i ew wytłumaczyć, daje naj za pomoc <3.

ERRORY:

quest.h:86: error: wrong number of template arguments (1, should be 2)
../../../Extern/include/boost/detail/container_fwd.hpp:82: error: provided for 'template<class T, class Allocator> struct std::vector'
quest.h: In member function 'int quest::AStateScriptType::GetSize() const':
quest.h:83: error: request for member 'size' in '((const quest::AStateScriptType*)this)->quest::AStateScriptType::m_code', which is of non-class type 'const int'
quest.h: In member function 'const char* quest::AStateScriptType::GetCode() const':
quest.h:84: error: invalid types 'const int[int]' for array subscript
quest.h: At global scope:
quest.h:98: error: wrong number of template arguments (1, should be 2)
../../../Extern/include/boost/detail/container_fwd.hpp:82: error: provided for 'template<class T, class Allocator> struct std::vector'
quest.h:113: error: 'BYTE' does not name a type
quest.h:125: error: wrong number of template arguments (1, should be 2)
../../../Extern/include/boost/detail/container_fwd.hpp:82: error: provided for 'template<class T, class Allocator> struct std::vector'
quest.h: In constructor 'quest::QuestState::QuestState()':
quest.h:128: error: class 'quest::QuestState' does not have any field named 'suspend_state'
In file included from questnpc.h:4,
                 from questmanager.h:6,
                 from entity_view.cpp:1:
questpc.h: At global scope:
questpc.h:21: error: 'DWORD' does not name a type
questpc.h:24: error: 'DWORD' has not been declared
questpc.h: In constructor 'quest::RewardData::RewardData(quest::RewardData::RewardType, int, int)':
questpc.h:26: error: class 'quest::RewardData' does not have any field named 'value1'
questpc.h: At global scope:
questpc.h:46: error: wrong number of template arguments (2, should be 4)
../../../Extern/include/boost/detail/container_fwd.hpp:83: error: provided for 'template<class Key, class T, class Compare, class Allocator> struct std::map'
questpc.h:47: error: typedef name may not be a nested-name-specifier
questpc.h:47: error: expected ';' before 'QuestInfoIterator'
questpc.h:53: error: 'DWORD' has not been declared
questpc.h:54: error: 'DWORD' does not name a type
questpc.h:59: error: 'QuestInfoIterator' does not name a type
questpc.h:60: error: 'QuestInfoIterator' does not name a type
questpc.h:61: error: 'QuestInfoIterator' does not name a type
questpc.h:83: error: 'DWORD' does not name a type
questpc.h:87: error: expected `)' before '_quest_idx'
questpc.h:95: error: wrong number of template arguments (1, should be 2)
../../../Extern/include/boost/detail/container_fwd.hpp:82: error: provided for 'template<class T, class Allocator> struct std::vector'
questpc.h:107: error: 'LPEVENT' has not been declared
questpc.h:129: error: 'LPCHARACTER' has not been declared
questpc.h:131: error: 'DWORD' has not been declared
questpc.h:132: error: 'DWORD' has not been declared
questpc.h:137: error: 'LPCHARACTER' has not been declared
questpc.h:141: error: 'DWORD' has not been declared
questpc.h:144: error: 'DWORD' has not been declared
questpc.h:158: error: wrong number of template arguments (1, should be 2)
../../../Extern/include/boost/detail/container_fwd.hpp:82: error: provided for 'template<class T, class Allocator> struct std::vector'
questpc.h:163: error: 'DWORD' does not name a type
questpc.h:170: error: wrong number of template arguments (2, should be 4)
../../../Extern/include/boost/detail/container_fwd.hpp:83: error: provided for 'template<class Key, class T, class Compare, class Allocator> struct std::map'
questpc.h:175: error: 'LPEVENT' was not declared in this scope
questpc.h:175: error: wrong number of template arguments (2, should be 4)
../../../Extern/include/boost/detail/container_fwd.hpp:83: error: provided for 'template<class Key, class T, class Compare, class Allocator> struct std::map'
questpc.h:183: error: 'DWORD' does not name a type
questpc.h: In member function 'bool quest::PC::HasReward()':
questpc.h:128: error: request for member 'empty' in '((quest::PC*)this)->quest::PC::m_vRewardData', which is of non-class type 'int'
questpc.h: In member function 'void quest::PC::SetConfirmWait(int)':
questpc.h:141: error: 'm_dwWaitConfirmFromPID' was not declared in this scope
questpc.h: In member function 'bool quest::PC::IsConfirmWait(int) const':
questpc.h:144: error: 'm_dwWaitConfirmFromPID' was not declared in this scope
questpc.h: At global scope:
questpc.h:187: error: 'QuestInfoIterator' in class 'quest::PC' does not name a type
questpc.h:192: error: 'QuestInfoIterator' in class 'quest::PC' does not name a type
questpc.h:197: error: 'QuestInfoIterator' in class 'quest::PC' does not name a type
In file included from questmanager.h:6,
                 from entity_view.cpp:1:
questnpc.h:26: error: wrong number of template arguments (2, should be 4)
../../../Extern/include/boost/detail/container_fwd.hpp:83: error: provided for 'template<class Key, class T, class Compare, class Allocator> struct std::map'
questnpc.h:28: error: wrong number of template arguments (2, should be 4)
../../../Extern/include/boost/detail/container_fwd.hpp:83: error: provided for 'template<class Key, class T, class Compare, class Allocator> struct std::map'
questnpc.h:32: error: wrong number of template arguments (1, should be 2)
../../../Extern/include/boost/detail/container_fwd.hpp:82: error: provided for 'template<class T, class Allocator> struct std::vector'
questnpc.h:32: error: wrong number of template arguments (2, should be 4)
../../../Extern/include/boost/detail/container_fwd.hpp:83: error: provided for 'template<class Key, class T, class Compare, class Allocator> struct std::map'
questnpc.h:34: error: wrong number of template arguments (2, should be 4)
../../../Extern/include/boost/detail/container_fwd.hpp:83: error: provided for 'template<class Key, class T, class Compare, class Allocator> struct std::map'
questnpc.h:46: error: 'static bool quest::NPC::HasStartState(const int&)' cannot be overloaded
questnpc.h:41: error: with 'static bool quest::NPC::HasStartState(const int&)'
questnpc.h:66: error: 'DWORD' has not been declared
questnpc.h:67: error: 'DWORD' has not been declared
questnpc.h:68: error: 'DWORD' has not been declared
questnpc.h:74: error: 'DWORD' has not been declared
questnpc.h:87: error: 'DWORD' has not been declared
questnpc.h: In static member function 'static bool quest::NPC::HasStartState(const int&)':
questnpc.h:43: error: request for member 'find' in 'q', which is of non-class type 'const int'
questnpc.h:43: error: request for member 'end' in 'q', which is of non-class type 'const int'
questnpc.h: In static member function 'static bool quest::NPC::HasStartState(const int&)':
questnpc.h:48: error: request for member 'find' in 'q', which is of non-class type 'const int'
questnpc.h:48: error: request for member 'end' in 'q', which is of non-class type 'const int'
questnpc.h: In member function 'void quest::NPC::MatchingQuest(quest::PC&, TQuestMapType&, FuncMatch&, FuncMiss&)':
questnpc.h:110: error: there are no arguments to 'sys_log' that depend on a template parameter, so a declaration of 'sys_log' must be available
questnpc.h:110: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
questnpc.h:112: error: 'QuestInfoIterator' is not a member of 'quest::PC'
questnpc.h:112: error: expected `;' before 'itPCQuest'
questnpc.h:117: error: 'itPCQuest' was not declared in this scope
questnpc.h:117: error: 'class quest::PC' has no member named 'quest_end'
In file included from entity_view.cpp:1:
questmanager.h: At global scope:
questmanager.h:19: error: expected template-name before '<' token
questmanager.h:19: error: expected `{' before '<' token
questmanager.h:19: error: expected unqualified-id before '<' token
In file included from ../../common/tables.h:5,
                 from constants.h:4,
                 from horse_rider.h:4,
                 from char.h:9,
                 from entity_view.cpp:5:
../../common/length.h:717: error: expected `}' before end of line
../../common/length.h:717: error: expected declaration before end of lineGAME_ERROR_LOG.txt.txt

QUEST PC 

#ifndef __METIN2_SERVER_QUEST_H__
#define __METIN2_SERVER_QUEST_H__

#define INDUCTION_LEVEL3    (1 << 0)
#define INDUCTION_LEVEL8    (1 << 1)
#define INDUCTION_LEVEL2    (1 << 2)

//#define QUEST_DIR "./quest/"

#include "lua_incl.h"

namespace quest
{
    enum
    {
        QUEST_NO_NPC,
        QUEST_ATTR_NPC_START = 100000,
        QUEST_ATTR0_NPC = QUEST_ATTR_NPC_START,
        QUEST_ATTR1_NPC = 100000,
        QUEST_ATTR2_NPC = 100001,
        QUEST_ATTR3_NPC = 100002,
        QUEST_ATTR4_NPC = 100003,
        QUEST_ATTR5_NPC = 100004,
        QUEST_ATTR6_NPC = 100005,
        QUEST_ATTR7_NPC = 100006,
        QUEST_ATTR8_NPC = 100007,
        QUEST_ATTR9_NPC = 100008,
        QUEST_ATTR10_NPC = 100009,
        QUEST_ATTR11_NPC = 100010,
        QUEST_ATTR12_NPC = 100011,
        QUEST_ATTR13_NPC = 100012,
        QUEST_ATTR14_NPC = 100013,
        QUEST_ATTR15_NPC = 100014,
    };

    enum
    {
        QUEST_CLICK_EVENT,
        QUEST_KILL_EVENT,
        QUEST_TIMER_EVENT,
        QUEST_LEVELUP_EVENT,
        QUEST_LOGIN_EVENT,
        QUEST_LOGOUT_EVENT,
        QUEST_BUTTON_EVENT,
        QUEST_INFO_EVENT,
        QUEST_CHAT_EVENT,
        QUEST_ATTR_IN_EVENT,
        QUEST_ATTR_OUT_EVENT,
        QUEST_ITEM_USE_EVENT,
        QUEST_SERVER_TIMER_EVENT,
        QUEST_ENTER_STATE_EVENT,
        QUEST_LEAVE_STATE_EVENT,
        QUEST_LETTER_EVENT,
        QUEST_ITEM_TAKE_EVENT,
        QUEST_TARGET_EVENT,
        QUEST_PARTY_KILL_EVENT,
        QUEST_UNMOUNT_EVENT,
        QUEST_ITEM_PICK_EVENT,
        QUEST_SIG_USE_EVENT,
        QUEST_ITEM_INFORMER_EVENT,
        QUEST_EVENT_COUNT
    };

    enum 
    {
        SUSPEND_STATE_NONE,
        SUSPEND_STATE_PAUSE,
        SUSPEND_STATE_SELECT,
        SUSPEND_STATE_INPUT,
        SUSPEND_STATE_CONFIRM,
        SUSPEND_STATE_SELECT_ITEM,
    };

    enum EQuestConfirmType
    {
        CONFIRM_NO,
        CONFIRM_YES,
        CONFIRM_TIMEOUT,
    };

    struct AStateScriptType
    {
        int        GetSize() const { return m_code.size(); }
        const char*    GetCode() const { return &m_code[0]; }

        std::vector<char> m_code;
    };

    struct AArgScript
    {
        //
        // script syntax example
        // 
        // when namespace.func.arg with when_condition begin ...
        //                     ---      --------------
        //                      |             + 
        std::string arg;  // <--+             |
        std::vector<char> when_condition;// <-+
        AStateScriptType script;
        unsigned int quest_index;
        int state_index;

        AArgScript()
            : quest_index(0), state_index(0)
        {}
    };

    struct QuestState
    {
        lua_State *    co;
        int        ico;
        short int    args;
        BYTE        suspend_state;
        int        iIndex;
        bool        bStart;
        int        st;

        std::string    _title;
        std::string    _clock_name;
        std::string    _counter_name;
        int        _clock_value;
        int        _counter_value;
        std::string    _icon_file;

        std::vector<AArgScript *> chat_scripts;

        QuestState()
            : co(NULL), ico(0), args(0), suspend_state(SUSPEND_STATE_NONE), iIndex(0), bStart(false), st(-1),
            _clock_value(0), _counter_value(0)
        {}
    };
}
#endif


QUEST NPC
 

#ifndef __QUEST_PC_H
#define __QUEST_PC_H

#include "quest.h"

class CHARACTER;

namespace quest
{
    using namespace std;

    struct RewardData
    {
        enum RewardType
        {
            REWARD_TYPE_NONE,
            REWARD_TYPE_EXP,
            REWARD_TYPE_ITEM,
        } type;

        DWORD value1;
        int value2;    

        RewardData(RewardType t, DWORD value1, int value2 = 0) : 
            type(t),
            value1(value1),
            value2(value2)
        {
        }
    };

    class PC
    {
        public:
            enum 
            {
                QUEST_SEND_ISBEGIN        = (1 << 0),
                QUEST_SEND_TITLE        = (1 << 1),  // 30자 까지 
                QUEST_SEND_CLOCK_NAME        = (1 << 2),  // 16자 까지        
                QUEST_SEND_CLOCK_VALUE        = (1 << 3),
                QUEST_SEND_COUNTER_NAME        = (1 << 4),  // 16자 까지    
                QUEST_SEND_COUNTER_VALUE    = (1 << 5),
                QUEST_SEND_ICON_FILE        = (1 << 6),  // 24자 까지
            };

            typedef map<unsigned int, QuestState>    QuestInfo;
            typedef QuestInfo::iterator                QuestInfoIterator;

            PC();
            ~PC();

            void        Destroy();
            void        SetID(DWORD dwID);
            DWORD        GetID() { return m_dwID; }

            bool        HasQuest(const string & quest_name);
            QuestState & GetQuest(const string& quest_name);

            inline QuestInfoIterator quest_begin();
            inline QuestInfoIterator quest_end();
            inline QuestInfoIterator quest_find(DWORD quest_index);

            inline bool IsRunning();

            void        EndRunning();
            void        CancelRunning();

            inline QuestState *    GetRunningQuestState();

            void        SetQuest(const string& quest_name, QuestState& qs);
            void        SetCurrentQuestStateName(const string& state_name);
            void        SetQuestState(const string& quest_name, const string& state_name);
            void        SetQuestState(const string& quest_name, int new_state_index);

            void        ClearQuest(const string& quest_name);

        private:
            void        AddQuestStateChange(const string& quest_name, int prev_state, int next_state);
            void        DoQuestStateChange();

            struct TQuestStateChangeInfo
            {
                DWORD quest_idx;
                int prev_state;
                int next_state;

                TQuestStateChangeInfo(DWORD _quest_idx, int _prev_state, int _next_state) :
                    quest_idx(_quest_idx),
                    prev_state(_prev_state),
                    next_state(_next_state)
                {
                }
            };

            vector<TQuestStateChangeInfo> m_QuestStateChange;

        public:
            void        SetFlag(const string & name, int value, bool bSkipSave = false);
            int            GetFlag(const string & name);
            bool        DeleteFlag(const string & name);

            const string &    GetCurrentQuestName() const;
            int            GetCurrentQuestIndex();

            void        RemoveTimer(const string& name);
            void        RemoveTimerNotCancel(const string& name);
            void        AddTimer(const string& name, LPEVENT pEvent);
            void        ClearTimer();

            void        SetCurrentQuestStartFlag();
            void        SetCurrentQuestDoneFlag();

            void        SetQuestTitle(const string& quest,const string & title);

            void        SetCurrentQuestTitle(const string & title);
            void        SetCurrentQuestClockName(const string & name);
            void        SetCurrentQuestClockValue(int value);
            void        SetCurrentQuestCounterName(const string & name);
            void        SetCurrentQuestCounterValue(int value);
            void        SetCurrentQuestIconFile(const string& icon_file);

            bool        IsLoaded() const    { return m_bLoaded; }
            void        SetLoaded()    { m_bLoaded = true; }
            void        Build();
            // DB에 저장
            void        Save();

            bool        HasReward() { return !m_vRewardData.empty() || m_bIsGivenReward; }
            void        Reward(LPCHARACTER ch);

            void        GiveItem(const string& label, DWORD dwVnum, int count);
            void        GiveExp(const string& label, DWORD exp);

            void         SetSendDoneFlag() { m_bShouldSendDone = true; }
            bool        GetAndResetDoneFlag() { bool temp = m_bShouldSendDone; m_bShouldSendDone = false; return temp; }

            void        SendFlagList(LPCHARACTER ch);

            void        SetQuestState(const char* szQuestName, const char* szStateName);

            void        SetConfirmWait(DWORD dwPID) { m_bConfirmWait = true; m_dwWaitConfirmFromPID = dwPID; }
            void        ClearConfirmWait() { m_bConfirmWait = false; }
            bool        IsConfirmWait() const    { return m_bConfirmWait; }
            bool        IsConfirmWait(DWORD dwPID) const    { return m_bConfirmWait && dwPID == m_dwWaitConfirmFromPID; }

        private:
            void        SetSendFlag(int idx);
            void        ClearSendFlag() { m_iSendToClient = 0; }
            void        SaveFlag(const string & name, int value);

            void        ClearCurrentQuestBeginFlag();
            void        SetCurrentQuestBeginFlag();
            int            GetCurrentQuestBeginFlag();

            void        SendQuestInfoPakcet();

        private:
            vector<RewardData>    m_vRewardData;
            bool        m_bIsGivenReward;

            bool        m_bShouldSendDone;

            DWORD        m_dwID;

            QuestInfo        m_QuestInfo;

            QuestState *    m_RunningQuestState;
            string        m_stCurQuest;

            typedef map<string, int> TFlagMap;
            TFlagMap        m_FlagMap;

            TFlagMap        m_FlagSaveMap;

            typedef map<string, LPEVENT> TTimerMap;
            TTimerMap        m_TimerMap;

            int            m_iSendToClient;
            bool        m_bLoaded; // 로드는 한번만 한다.

            int            m_iLastState;

            DWORD        m_dwWaitConfirmFromPID;
            bool        m_bConfirmWait;
    };

    inline PC::QuestInfoIterator PC::quest_begin()
    {
        return m_QuestInfo.begin();
    }

    inline PC::QuestInfoIterator PC::quest_end()
    {
        return m_QuestInfo.end();
    }

    inline PC::QuestInfoIterator PC::quest_find(DWORD quest_index)
    {
        return m_QuestInfo.find(quest_index);
    }

    inline bool PC::IsRunning()
    {
        return m_RunningQuestState != NULL;
    }

    inline QuestState* PC::GetRunningQuestState()
    {
        return m_RunningQuestState;
    }
}

#endif
 

 

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Zaloguj się poniżej.

Zaloguj się
×
×
  • Dodaj nową pozycję...