GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/net/eathena/rouletterecv.cpp Lines: 0 36 0.0 %
Date: 2018-09-20 Branches: 0 4 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2011-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/rouletterecv.h"
22
23
#include "logger.h"
24
25
#include "net/messagein.h"
26
27
#include "debug.h"
28
29
namespace EAthena
30
{
31
32
void RouletteRecv::processRouletteInfoAckType(Net::MessageIn &msg)
33
{
34
    UNIMPLEMENTEDPACKET;
35
    const int count = (msg.readInt16("len") - 8) / 8;
36
    msg.readInt32("serial");
37
38
    for (int f = 0; f < count; f ++)
39
    {
40
        msg.readInt16("row");
41
        msg.readInt16("position");
42
        if (msg.getVersion() >= 20180511)
43
        {
44
            msg.readInt32("item id");
45
            msg.readInt16("count");
46
            msg.readInt16("unused");
47
        }
48
        else
49
        {
50
            msg.readInt16("item id");
51
            msg.readInt16("count");
52
        }
53
    }
54
}
55
56
void RouletteRecv::processRouletteItemAck(Net::MessageIn &msg)
57
{
58
    UNIMPLEMENTEDPACKET;
59
    msg.readUInt8("result");
60
    msg.readItemId("item id");
61
}
62
63
void RouletteRecv::processRouletteGenerateAckType(Net::MessageIn &msg)
64
{
65
    UNIMPLEMENTEDPACKET;
66
    msg.readUInt8("result");
67
    msg.readInt16("step");
68
    msg.readInt16("idx");
69
    msg.readItemId("item id");
70
    msg.readInt32("remain gold");
71
    msg.readInt32("remain silver");
72
    msg.readInt32("remain bronze");
73
}
74
75
void RouletteRecv::processRouletteOpenAck(Net::MessageIn &msg)
76
{
77
    UNIMPLEMENTEDPACKET;
78
    msg.readUInt8("result");
79
    msg.readInt32("serial");
80
    msg.readUInt8("step");
81
    msg.readUInt8("idx");
82
    msg.readItemId("additional item id");
83
    msg.readInt32("gold point");
84
    msg.readInt32("silver point");
85
    msg.readInt32("bronze point");
86
}
87
88
}  // namespace EAthena