GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/net/eathena/updateprotocol.cpp Lines: 0 22 0.0 %
Date: 2018-07-14 Branches: 0 8 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2015-2018  The ManaPlus Developers
4
 *
5
 *  This file is part of The ManaPlus Client.
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; either version 2 of the License, or
10
 *  any later version.
11
 *
12
 *  This program is distributed in the hope that it will be useful,
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *  GNU General Public License for more details.
16
 *
17
 *  You should have received a copy of the GNU General Public License
18
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
#include "net/eathena/updateprotocol.h"
22
23
#include "logger.h"
24
25
#include "net/eathena/network.h"
26
#include "net/eathena/protocolout.h"
27
28
#include "debug.h"
29
30
extern int packetVersion;
31
extern int packetVersionMain;
32
extern int packetVersionRe;
33
extern int packetVersionZero;
34
extern int serverVersion;
35
extern int evolPacketOffset;
36
extern bool packets_main;
37
extern bool packets_re;
38
extern bool packets_zero;
39
40
namespace EAthena
41
{
42
43
void updateProtocol()
44
{
45
    logger->log("packet version: %d", packetVersion);
46
    if (packets_main == true)
47
    {
48
        logger->log("packets version type: main");
49
        packetVersionMain = packetVersion;
50
        packetVersionRe = 0;
51
        packetVersionZero = 0;
52
    }
53
    else if (packets_re == true)
54
    {
55
        logger->log("packets version type: re");
56
        packetVersionRe = packetVersion;
57
        packetVersionMain = 0;
58
        packetVersionZero = 0;
59
    }
60
    else if (packets_zero == true)
61
    {
62
        logger->log("packets version type: zero");
63
        packetVersionZero = packetVersion;
64
        packetVersionMain = 0;
65
        packetVersionRe = 0;
66
    }
67
#define PACKETS_UPDATE
68
#include "net/protocoloutupdate.h"
69
#include "net/eathena/packetsout.inc"
70
#include "net/eathena/packetsout_shuffle_main.inc"
71
#include "net/eathena/packetsout_shuffle_zero.inc"
72
#undef packet
73
    Network *const network = Network::mInstance;
74
    if (network != nullptr)
75
    {
76
        network->clearHandlers();
77
        network->registerHandlers();
78
        network->registerFakeHandlers();
79
    }
80
}
81
82
PACKETSOUT_VOID
83
PACKETSOUT_SHUFFLE_MAIN_VOID
84
PACKETSOUT_SHUFFLE_ZERO_VOID
85
PROTOCOLOUTUPDATE_VOID
86
PROTOCOLOUT_VOID
87
88
}  // namespace EAthena