-
Notifications
You must be signed in to change notification settings - Fork 35
/
character.h
85 lines (71 loc) · 1.57 KB
/
character.h
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef CHARACTER_H
#define CHARACTER_H
#include <QObject>
#include <QString>
#include "dataType.h"
class SceneEntity
{
public:
SceneEntity();
public:
// Infos
QString modelName;
quint16 id;
quint16 netviewId;
// Pos
QString sceneName;
UVector pos;
UQuaternion rot;
};
class Pony : public SceneEntity
{
public:
Pony();
public:
QByteArray ponyData;
};
class Player
{
public:
Player();
static void savePonies(Player& player,QList<Pony> ponies);
static QList<Pony> loadPonies(Player& player);
static bool savePlayers(QList<Player> playersData);
static QList<Player> loadPlayers();
static Player& findPlayer(QList<Player>& players, QString uname);
static Player& findPlayer(QList<Player>& players, QString uIP, quint16 uport);
static Player& findPlayer(QList<Player>& players, quint16 netviewId);
static void removePlayer(QList<Player> *players, QString uIP, quint16 uport);
static void disconnectPlayerCleanup(Player& player);
public:
void reset();
public:
QString IP;
quint16 port;
QString name;
QString passhash;
float lastPingTime;
int lastPingNumber;
bool connected;
quint16 udpSequenceNumbers[33];
quint16 udpRecvSequenceNumbers[33];
QByteArray *receivedDatas;
Pony pony;
quint8 inGame; // 0:Not in game, 1:Loading, 2:In game and loaded
};
class WearableItem
{
public:
WearableItem();
public:
quint8 index;
quint32 id;
};
class InventoryItem : public WearableItem
{
public:
InventoryItem();
public:
quint32 amount;
};
#endif // CHARACTER_H