summaryrefslogtreecommitdiff
path: root/src/mmo/version.cpp
blob: dd18fe1df8245968a0c9395ef5a0fcb241d9a95c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "version.hpp"

#include "../conf/version.hpp"

#include "../strings/xstring.hpp"

#include "extract.hpp"

#include "../poison.hpp"

Version CURRENT_VERSION =
{
    VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH,
    VERSION_DEVEL,

    0, 0,
    VENDOR_VERSION,
};
Version CURRENT_LOGIN_SERVER_VERSION =
{
    VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH,
    VERSION_DEVEL,

    0, TMWA_SERVER_LOGIN,
    VENDOR_VERSION,
};
Version CURRENT_CHAR_SERVER_VERSION =
{
    VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH,
    VERSION_DEVEL,

    0, TMWA_SERVER_CHAR | TMWA_SERVER_INTER,
    VENDOR_VERSION,
};
Version CURRENT_MAP_SERVER_VERSION =
{
    VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH,
    VERSION_DEVEL,

    0, TMWA_SERVER_MAP,
    VENDOR_VERSION,
};

#define S2(a) #a
#define S(a) S2(a)

const char CURRENT_VERSION_STRING[] = "TMWA "
        S(VERSION_MAJOR) "." S(VERSION_MINOR) "." S(VERSION_PATCH)
        " dev" S(VERSION_DEVEL) " (" VENDOR " " S(VENDOR_VERSION) ")";

bool extract(XString str, Version *vers)
{
    *vers = {};
    return extract(str, record<'.'>(&vers->major, &vers->minor, &vers->patch));
}