forked from H-uru/MoulKI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtAuthClient.h
100 lines (82 loc) · 3.23 KB
/
qtAuthClient.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef QTAUTHCLIENT_H
#define QTAUTHCLIENT_H
#include <auth/pnAuthClient.h>
#include <Stream/hsRAMStream.h>
#include <QObject>
#include <QList>
#include <QMap>
#include "qtVault.h"
class MoulKI;
struct authPlayer {
uint32_t ID;
plString Name;
plString avatar;
};
class qtAuthClient : public QObject, public pnAuthClient
{
Q_OBJECT
private:
MoulKI* parent;
/* the fetch queue acts as a comprehensive list of all nodes fetched
and pending fetch by the client */
QList<uint32_t> fetchQueue;
plString user;
plString pass;
struct queuedRef {
uint32_t fTransId;
uint32_t fParent;
bool operator==(const queuedRef& ref);
};
QList<queuedRef> refQueue;
QMap<uint32_t, hsStream*> sdlFiles;
public:
QList<authPlayer> players;
plUuid acctUuid;
qtAuthClient(MoulKI* ki);
~qtAuthClient();
void startLogin(QString user, QString pass);
void onClientRegisterReply(uint32_t serverChallenge);
void onAcctLoginReply(uint32_t transId, ENetError result,
const plUuid& acctUuid, uint32_t acctFlags,
uint32_t billingType, const uint32_t* encryptKey);
void onAcctPlayerInfo(uint32_t transId, uint32_t playerId,
const plString &playerName, const plString& avatarModel,
uint32_t explorer);
void onAgeReply(uint32_t transId, ENetError result, uint32_t mcpId,
const plUuid &ageInstanceId, uint32_t ageVaultId,
uint32_t gameServerAddress);
void onPublicAgeList(uint32_t transId, ENetError result, size_t count,
const pnNetAgeInfo* ages);
void onFileListReply(uint32_t transId, ENetError ,
size_t count, const pnAuthFileItem* files);
void onFileDownloadChunk(uint32_t transId, ENetError result,
uint32_t totalSize, uint32_t chunkOffset,
size_t chunkSize, const unsigned char* chunkData);
void onVaultNodeRefsFetched(uint32_t transId, ENetError result,
size_t count, const pnVaultNodeRef* refs);
void onVaultNodeFetched(uint32_t transId, ENetError result,
const pnVaultNode& node);
void onVaultNodeChanged(uint32_t nodeId, const plUuid& revisionId);
void onVaultNodeAdded(uint32_t parent, uint32_t child, uint32_t owner);
void onVaultNodeRemoved(uint32_t parent, uint32_t child);
void onVaultNodeCreated(uint32_t transId, ENetError result,
uint32_t nodeId);
void onVaultNodeFindReply(uint32_t transId, ENetError result,
size_t count, const uint32_t *nodes);
void onVaultSaveNodeReply(uint32_t transId, ENetError result);
void onVaultAddNodeReply(uint32_t transId, ENetError result);
void onVaultRemoveNodeReply(uint32_t transId, ENetError result);
void setStatus(const char* msg);
void setStatus(plString msg);
void queueRef(uint32_t transId, uint32_t parent);
signals:
void sigStatus(plString msg);
void foundNodes(QList<uint32_t> nodes);
void loginSuccessful();
void gotAge(uint32_t gameServerAddr, plUuid ageId, uint32_t mcpId,
uint32_t vaultId);
void gotEncKeys(uint32_t k0, uint32_t k1, uint32_t k2, uint32_t k3);
void gotSDLFile(hsStream* file);
void gotPublicAges(QList< QPair<QString, plUuid> >);
};
#endif // QTAUTHCLIENT_H