forked from H-uru/MoulKI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MoulKI.h
128 lines (110 loc) · 3.55 KB
/
MoulKI.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#ifndef MOULKI_H
#define MOULKI_H
#include <SDL/plSDLMgr.h>
#include <QtGui/QMainWindow>
#include "qtAuthClient.h"
#include "qtGameClient.h"
#include "qtVault.h"
#define BUILD_NUMBER 912
static const plUuid s_moulUuid("ea489821-6c35-4bd0-9dae-bb17c585e680");
class QTableWidgetItem;
namespace Ui
{
class MoulKIClass;
}
class MoulKI : public QMainWindow
{
Q_OBJECT
public:
MoulKI(QWidget *parent = 0);
~MoulKI();
qtVault vault;
uint32_t activePlayer;
uint32_t buddyListFolder;
QList<uint32_t> buddyInfoIds;
uint32_t neighborListFolder;
QList<uint32_t> neighborInfoIds;
plString currentAgeName;
uint32_t currentAgeId;
struct {
struct {
unsigned char N[64];
unsigned char X[64];
} Auth;
struct {
unsigned char N[64];
unsigned char X[64];
} Game;
} Keys;
QString Host;
private:
Ui::MoulKIClass *ui;
qtAuthClient* authClient;
qtGameClient* gameClient;
plResManager* resmgr;
plSDLMgr* sdlmgr;
uint32_t ntdKeys[4];
void addItemChild(QTreeWidgetItem* item, qtVaultNode* node);
bool itemHasChild(QTreeWidgetItem* item, qtVaultNode* node);
void removeTreeNodes(QTreeWidgetItem* item, qtVaultNode* node);
void addContextMenuToItem(QTreeWidgetItem* item);
void closeEvent(QCloseEvent* event);
QTreeWidgetItem* agePlayersItem;
QTreeWidgetItem* buddiesItem;
QTreeWidgetItem* neighborsItem;
public:
plResManager* getResManager() const { return resmgr; }
plSDLMgr* getSDLMgr() const { return sdlmgr; }
public slots:
void showLoginDialog();
void login(QString user, QString pass, QString iniFilename);
void setStatus(plString msg);
void showPlayers();
void addNode(uint32_t parent, uint32_t child);
void removeNode(uint32_t parent, uint32_t child);
void updateNode(uint32_t idx);
void setActive(uint32_t playerId);
void addRoot(uint32_t idx);
// node editing slots
void saveNodeData();
void revertNode();
void nodeDirty(bool);
void setShownNode();
// context menu and associated vault manipulation slots
void showRefDialog();
void showCreateDialog();
void showFindDialog();
void showFetchDialog();
void sendAdd(uint32_t parent, uint32_t child, uint32_t owner);
void sendCreate(pnVaultNode& node, uint32_t parent);
void sendFind(pnVaultNode& node);
void showFoundDialog(QList<uint32_t> nodes);
void showItemContextMenu(QPoint pos);
void subscribe();
void fetchTree(uint32_t idx);
void sendRemove();
void writeVault();
void readVault();
void logoutActivePlayer();
void getPublicAgeList();
// authserver events
void setEncryptionKeys(uint32_t k0, uint32_t k1, uint32_t k2, uint32_t k3);
void loadStateDescriptors(hsStream* S);
// gameserver events
void showJoinAgeDialog();
void joinAge(plString name, plUuid uuid);
void joinSelectedAge();
void startGameServer(uint32_t serverAddr, plUuid ageId, uint32_t mcpId, uint32_t ageVaultId);
void addChatLine(QString line);
void setOnline(uint32_t playerId, plString ageFilename, plUuid ageUuid);
void sendGameChat();
void checkCurrentAge();
// target manipulation
void addAgePlayer(uint32_t, plString);
void removeAgePlayer(uint32_t, plString);
void clearAgeList();
void clearChatTargetList(QTreeWidgetItem* item);
void addRemoveChatTargetItem(QTreeWidgetItem* item, qtVaultNode* infoNode, bool remove=0);
bool itemTreeContains(QTreeWidgetItem* item, uint32_t playerId);
};
#endif // MOULKI_H