Jump to content

Player Rank System


Recommended Posts

  • 3 weeks later...

Hello! I have problem in packet.h

 

In file included from OXEvent.cpp:6:
packet.h:1302: error: ISO C++ forbids initialization of member 'header'
packet.h:1302: error: making 'header' static
packet.h:1302: error: ISO C++ forbids in-class initialization of non-const stati                                        c member 'header'
packet.h:1303: error: ISO C++ forbids initialization of member 'subheader'
packet.h:1303: error: making 'subheader' static
packet.h:1303: error: ISO C++ forbids in-class initialization of non-const stati                                        c member 'subheader'
packet.h:1306: error: ISO C++ forbids initialization of member 'level'
packet.h:1306: error: making 'level' static
packet.h:1306: error: ISO C++ forbids in-class initialization of non-const stati                                        c member 'level'
packet.h:1307: error: ISO C++ forbids initialization of member 'job'
packet.h:1307: error: making 'job' static
packet.h:1307: error: ISO C++ forbids in-class initialization of non-const stati                                        c member 'job'
packet.h:1308: error: ISO C++ forbids initialization of member 'empire'
packet.h:1308: error: making 'empire' static
packet.h:1308: error: ISO C++ forbids in-class initialization of non-const stati                                        c member 'empire'
packet.h: In constructor 'packet_ranking_send::packet_ranking_send(const char*,                                         int, int, int, const char*)':
packet.h:1297: error: 'BYTE packet_ranking_send::subheader' is a static data mem                                        ber; it can only be initialized at its definition
packet.h:1297: error: 'RANK' is not a class or namespace
packet.h:1297: error: 'int packet_ranking_send::level' is a static data member;                                         it can only be initialized at its definition
packet.h:1297: error: 'BYTE packet_ranking_send::job' is a static data member; i                                        t can only be initialized at its definition
packet.h:1297: error: 'BYTE packet_ranking_send::empire' is a static data member                                        ; it can only be initialized at its definition
gmake: *** [OBJDIR/OXEvent.o] B▒▒d 1

 

 

Packet.h

Spoiler

#if defined(__BL_RANKING__)
enum RANK 
{
    SUBHEADER_RANKING_SEND,
    SUBHEADER_RANKING_OPEN,
    RANKING_MAX_NUM = 500,
    HEADER_GC_RANKING = 160,
};
typedef struct packet_ranking_send
{
    packet_ranking_send()
    {
        std::strncpy(szName, "", sizeof(szName));
        std::strncpy(szGuildName, "", sizeof(szGuildName));
    }
    packet_ranking_send(const char* name, int c_level, int c_job, int c_empire, const char* guild)
        : subheader(RANK::SUBHEADER_RANKING_SEND), level(c_level), job(c_job), empire(c_empire)
    {
        std::strncpy(szName, name, sizeof(szName));
        std::strncpy(szGuildName, guild, sizeof(szGuildName));
    }
    BYTE    header = HEADER_GC_RANKING;
    BYTE    subheader = SUBHEADER_RANKING_OPEN;
    char    szName[CHARACTER_NAME_MAX_LEN + 1];
    char    szGuildName[GUILD_NAME_MAX_LEN + 1];
    int        level = 0;
    BYTE    job = 0;
    BYTE    empire = 0;
} TPacketGCRankingSend;
#endif

 

Link to post
  • 1 month later...
  • 3 months later...
Posted (edited)
On 12/7/2020 at 5:55 PM, Finnis said:

Good job!

But if you continue releasing free things I think I will lose all my customers  XD

this.

+1

 

Edited by Flourine
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.