Yardım Boss Damage Ranking de sıkıntı (Vatansever Filesinden Söküyorum)

Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

Tugian2Mt2shop

Tugian2-Modern PVP
MT Üye
Mesaj
577
Çözümler
6
Beğeni
470
Puan
839
Ticaret Puanı
0
Derlerken hata:
Genişlet Daralt Kopyala
In file included from char_battle.cpp:42:
BossDamageRanking.h:31:32: error: use of 'auto' in parameter declaration only available with '-std=c++14' or '-std=gnu++14'
   31 |         bool operator < (const auto& a) const {
      |                                ^~~~
In file included from input_db.cpp:51:
BossDamageRanking.h:31:32: error: use of 'auto' in parameter declaration only available with '-std=c++14' or '-std=gnu++14'
   31 |         bool operator < (const auto& a) const {
      |                                ^~~~
In file included from cmd_general.cpp:42:
BossDamageRanking.h:31:32: error: use of 'auto' in parameter declaration only available with '-std=c++14' or '-std=gnu++14'
   31 |         bool operator < (const auto& a) const {
      |                                ^~~~
BossDamageRanking.h:64:9: error: 'SetReturnTime' function uses 'auto' type specifier without trailing return type
   64 |         auto    SetReturnTime(const WORD val) { m_Info.wReturnMin = val; }
      |         ^~~~
BossDamageRanking.h:64:9: error: 'SetReturnTime' function uses 'auto' type specifier without trailing return type
   64 |         auto    SetReturnTime(const WORD val) { m_Info.wReturnMin = val; }
      |         ^~~~
BossDamageRanking.h:64:9: error: 'SetReturnTime' function uses 'auto' type specifier without trailing return type
   64 |         auto    SetReturnTime(const WORD val) { m_Info.wReturnMin = val; }
      |         ^~~~
In file included from char.cpp:65:
BossDamageRanking.h:31:32: error: use of 'auto' in parameter declaration only available with '-std=c++14' or '-std=gnu++14'
   31 |         bool operator < (const auto& a) const {
      |                                ^~~~
BossDamageRanking.h:64:9: note: deduced return type only available with '-std=c++14' or '-std=gnu++14'
BossDamageRanking.h:64:9: note: deduced return type only available with '-std=c++14' or '-std=gnu++14'
BossDamageRanking.h:64:9: note: deduced return type only available with '-std=c++14' or '-std=gnu++14'
BossDamageRanking.h:64:9: error: 'SetReturnTime' function uses 'auto' type specifier without trailing return type
   64 |         auto    SetReturnTime(const WORD val) { m_Info.wReturnMin = val; }
      |         ^~~~
BossDamageRanking.h:66:9: error: 'SetIsSpawn' function uses 'auto' type specifier without trailing return type
   66 |         auto    SetIsSpawn(const bool val) { m_Info.bIsSpawn = val; }
      |         ^~~~
BossDamageRanking.h:66:9: error: 'SetIsSpawn' function uses 'auto' type specifier without trailing return type
   66 |         auto    SetIsSpawn(const bool val) { m_Info.bIsSpawn = val; }
      |         ^~~~
BossDamageRanking.h:66:9: error: 'SetIsSpawn' function uses 'auto' type specifier without trailing return type
   66 |         auto    SetIsSpawn(const bool val) { m_Info.bIsSpawn = val; }
      |         ^~~~
BossDamageRanking.h:66:9: note: deduced return type only available with '-std=c++14' or '-std=gnu++14'
BossDamageRanking.h:66:9: note: deduced return type only available with '-std=c++14' or '-std=gnu++14'
BossDamageRanking.h:64:9: note: deduced return type only available with '-std=c++14' or '-std=gnu++14'
BossDamageRanking.h:66:9: note: deduced return type only available with '-std=c++14' or '-std=gnu++14'
BossDamageRanking.h: In member function 'bool BossDamageInfo::SPlayerInfo::operator<(const int&) const':
BossDamageRanking.h:32:33: error: request for member 'dwDamage' in 'a', which is of non-class type 'const int'
   32 |             return dwDamage > a.dwDamage;
      |                                 ^~~~~~~~
BossDamageRanking.h: In member function 'bool BossDamageInfo::SPlayerInfo::operator<(const int&) const':
BossDamageRanking.h:32:33: error: request for member 'dwDamage' in 'a', which is of non-class type 'const int'
   32 |             return dwDamage > a.dwDamage;
      |                                 ^~~~~~~~
BossDamageRanking.h:66:9: error: 'SetIsSpawn' function uses 'auto' type specifier without trailing return type
   66 |         auto    SetIsSpawn(const bool val) { m_Info.bIsSpawn = val; }
      |         ^~~~
BossDamageRanking.h: In member function 'bool BossDamageInfo::SPlayerInfo::operator<(const int&) const':
BossDamageRanking.h:32:33: error: request for member 'dwDamage' in 'a', which is of non-class type 'const int'
   32 |             return dwDamage > a.dwDamage;
      |                                 ^~~~~~~~
BossDamageRanking.h:66:9: note: deduced return type only available with '-std=c++14' or '-std=gnu++14'
BossDamageRanking.h: In member function 'bool BossDamageInfo::SPlayerInfo::operator<(const int&) const':
BossDamageRanking.h:32:33: error: request for member 'dwDamage' in 'a', which is of non-class type 'const int'
   32 |             return dwDamage > a.dwDamage;
      |                                 ^~~~~~~~
gmake: *** [Makefile:126: OBJDIR/cmd_general.o] Error 1
gmake: *** Waiting for unfinished jobs....
gmake: *** [Makefile:126: OBJDIR/input_db.o] Error 1
gmake: *** [Makefile:125: OBJDIR/char_battle.o] Error 1
gmake: *** [Makefile:125: OBJDIR/char.o] Error 1

Dostlar Vatansever filesinden Söküyorum acaba sıkıntı ne yardımcı olabilirmisiniz?
 
Son düzenleme:
Hata kodunda aslında problemi çok net anlatmış. C++14 istiyor min. Fakat tahminimce o files c++20 olabilir.
 
auto olan yerleri uygun veritipleri ile değiştir. Eğer bunu yapmak istemiyorsan filesinin c++ sürümünü yükseltmen lazım
 
dene:
Genişlet Daralt Kopyala
#pragma once
#include <vector>
#include <map>
#include <memory>
#include <algorithm>

struct SBossInfo
{
    DWORD   dwVnum;
    DWORD   dwMaxHP;
    DWORD   dwMapIDX;
    long    posX;
    long    posY;
    WORD    wReturnMin;
    bool    bIsSpawn;
    std::vector<std::pair<DWORD, DWORD>> gift_info;
};

typedef SBossInfo TBossInfo;


class BossDamageInfo
{
    public:
        struct SPlayerInfo
        {
            DWORD   dwID;
            BYTE    bRace;
            const char* cName;
            BYTE    bLevel;
            BYTE    bEmpire;
            DWORD   dwDamage;

            bool operator < (const SPlayerInfo& a) const
            {
                return dwDamage > a.dwDamage;
            }
        };

        typedef std::vector<SPlayerInfo> DAMAGE_VEC;

    public:
        BossDamageInfo(const TBossInfo& info);
        ~BossDamageInfo();

        void    AddPlayer(LPCHARACTER ch, DWORD dam);
        void    PlayerAction(LPCHARACTER ch, DWORD dam);
        void    SendRankings(bool isDead = false);
        void    SpawnMob();
        void    ErasePlayer(uint32_t pid);
        void    Destroy();

        void    SetVnum(const DWORD val) { m_Info.dwVnum = val; }
        DWORD   GetVnum() const { return m_Info.dwVnum; }

        void    SetHP(const DWORD val) { m_Info.dwMaxHP = val; }
        DWORD   GetHP() const { return m_Info.dwMaxHP; }

        void    SetMapIDX(const DWORD val) { m_Info.dwMapIDX = val; }
        DWORD   GetMapIDX() const { return m_Info.dwMapIDX; }

        void    SetPosX(const long val) { m_Info.posX = val; }
        long    GetPosX() const { return m_Info.posX; }

        void    SetPosY(const long val) { m_Info.posY = val; }
        long    GetPosY() const { return m_Info.posY; }

        void    SetReturnTime(const WORD val) { m_Info.wReturnMin = val; }
        WORD    GetReturnTime() const { return m_Info.wReturnMin; }

        void    SetIsSpawn(const bool val) { m_Info.bIsSpawn = val; }
        bool    GetIsSpawn() const { return m_Info.bIsSpawn; }

        std::pair<DWORD, DWORD> GetGiftWithIDX(const BYTE idx);

    private:
        DAMAGE_VEC  m_DmgVec;
        TBossInfo   m_Info;
};


class CBossDamageRanking : public singleton<CBossDamageRanking>
{
    public:
        CBossDamageRanking() {}
        ~CBossDamageRanking() {}

        BossDamageInfo* FindBossClass(DWORD dwID) const;

        bool    Initialize();
        void    CheckBoss(const int hour, const int min) const;
        void    CreateTimer();
        void    CloseTimer();
        void    Destroy();
        bool    IsRankingBoss(const DWORD dwVnum) const;
        void    SendGUIData(LPCHARACTER ch);

        void    CheckPlayerID(uint32_t pid);

    private:
        std::map<DWORD, std::unique_ptr<BossDamageInfo>> boss_Map;
        LPEVENT spawnEvent;
};
 
Geri
Üst