blob: cd0833f84360e8c42f7d2d963b6bef9dec556283 (
plain)
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
|
#ifndef GAME_INTEGRATION_WINDOW_H
#define GAME_INTEGRATION_WINDOW_H
#include <QWidget>
#include <QDebug>
#include <QTcpServer>
#include <QTcpSocket>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QLabel>
namespace Ui {
class game_integration_window;
}
class game_integration_window : public QWidget
{
Q_OBJECT
public:
explicit game_integration_window(QWidget *parent = 0);
~game_integration_window();
private:
Ui::game_integration_window *ui;
void write_console(QString color, QString line);
void handle_data(QString data);
void display_data();
QTcpServer *server; /* our server instance */
struct game_data {
QJsonDocument json_doc;
QJsonObject json_object;
QVariantMap main_map;
QVariantMap map_map;
QVariantMap player_map;
QVariantMap round_map;
QVariantMap weapon_map;
QVariantMap stats_map;
QVariantMap ct_score_map;
QVariantMap t_score_map;
QVariantMap weapon_1_map;
QVariantMap weapon_2_map;
QVariantMap weapon_3_map;
QVariantMap weapon_4_map;
QVariantMap weapon_5_map;
QVariantMap weapon_6_map;
QVariantMap weapon_7_map;
QVariantMap weapon_8_map;
QVariantMap weapon_9_map;
QVariantMap weapon_10_map;
QString current_user_id;
QString current_map;
QString current_team;
QList<QLabel *> weapon_labels;
} game;
protected:
void showEvent(QShowEvent *ev);
signals:
void window_loaded();
private slots:
void window_open();
void new_connection();
void on_start_server_button_clicked();
void on_stop_server_button_clicked();
void on_close_window_button_clicked();
};
#endif // GAME_INTEGRATION_WINDOW_H
|