GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/mumblemanager.h Lines: 0 3 0.0 %
Date: 2021-03-17 Branches: 0 20 0.0 %

Line Branch Exec Source
1
/*
2
 *  Code taken from: http://mumble.sourceforge.net/Link
3
 *
4
 *  All code listed below is in the public domain and can be used, shared or
5
 *  modified freely
6
 *
7
 *  Copyright (C) 2011-2019  The ManaPlus Developers
8
 *  Copyright (C) 2019-2021  Andrei Karas
9
 */
10
11
#ifndef MUMBLEMANAGER_H
12
#define MUMBLEMANAGER_H
13
14
#ifdef USE_MUMBLE
15
16
#include <string>
17
#if defined (__FreeBSD__) || (defined __DragonFly__)
18
#include <sys/stat.h>
19
#endif  // defined (__FreeBSD__) || (defined __DragonFly__)
20
21
#include "localconsts.h"
22
23
struct LinkedMem final
24
{
25
    LinkedMem() :
26
        uiVersion(0U),
27
        uiTick(0U),
28
        fAvatarPosition(),
29
        fAvatarFront(),
30
        fAvatarTop(),
31
        name(),
32
        fCameraPosition(),
33
        fCameraFront(),
34
        fCameraTop(),
35
        identity(),
36
        context_len(0U),
37
        context(),
38
        description()
39
    { }
40
41
    A_DELETE_COPY(LinkedMem)
42
43
    uint32_t uiVersion;
44
    uint32_t uiTick;
45
    float fAvatarPosition[3];
46
    float fAvatarFront[3];
47
    float fAvatarTop[3];
48
    wchar_t name[256];
49
    float fCameraPosition[3];
50
    float fCameraFront[3];
51
    float fCameraTop[3];
52
    wchar_t identity[256];
53
    uint32_t context_len;
54
    char context[256];
55
    wchar_t description[2048];
56
};
57
58
class MumbleManager final
59
{
60
    public:
61
        MumbleManager();
62
63
        A_DELETE_COPY(MumbleManager)
64
65
        ~MumbleManager();
66
67
        void init();
68
69
        void setPlayer(const std::string &userName);
70
71
        void setAction(const int action);
72
73
        void setPos(const int tileX, const int tileY, const int direction);
74
75
        void setMap(const std::string &mapName);
76
77
        void setServer(const std::string &serverName);
78
79
    private:
80
        static uint16_t getMapId(std::string mapName) A_WARN_UNUSED;
81
82
        void setMapBase(uint16_t mapid);
83
84
        LinkedMem *mLinkedMem;
85
        LinkedMem mLinkedMemCache;
86
        float mMapBase[3];
87
};
88
89
extern MumbleManager *mumbleManager;
90
91
#endif  // USE_MUMBLE
92
#endif  // MUMBLEMANAGER_H