-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We are almost there folks!
- Loading branch information
Showing
24 changed files
with
241 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,3 +72,8 @@ CMakeLists.txt.user* | |
*.dll | ||
*.exe | ||
|
||
# Project Files | ||
# -------- | ||
bin/config | ||
bin/storage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"backgrounds" : "default", | ||
"musiclist" : "default", | ||
"characters": "default", | ||
"locations": [ | ||
{ | ||
"name": "Area1", | ||
"background": "default", | ||
"color": 123123123, | ||
"description": "" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{ | ||
"name": "default", | ||
"sides": [ | ||
{ | ||
"name":"witness", | ||
"image":"witnessempty.png", | ||
"overlay": "" | ||
} | ||
] | ||
} | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ | ||
{ | ||
"category": "Sample Category", | ||
"songs": [ | ||
"song.opus", | ||
"song2.opus" | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "banmanager.h" | ||
#include "client.h" | ||
#include "packet_hello.h" | ||
#include "packet_selectarea.h" | ||
#include "packetrelay.h" | ||
|
||
#include <QDebug> | ||
|
||
BanManager::BanManager(QObject *parent, PacketRelay *f_relay) : | ||
QObject{parent}, | ||
relay{f_relay} | ||
{ | ||
qDebug() << "Creating BanManager"; | ||
connect(relay, &PacketRelay::clientHello, this, &BanManager::onHELLOReceived); | ||
} | ||
|
||
void BanManager::onHELLOReceived(Packet *f_packet, Client *f_client) | ||
{ | ||
PacketHello *packet = static_cast<PacketHello *>(f_packet); | ||
qDebug() << "Received HELLO from ClientID" << f_client->id() << "at" << f_client->getIP().toString(); | ||
qDebug() << "App-Name:" << packet->appName(); | ||
qDebug() << "App-Version:" << packet->appVersion().toString(); | ||
qDebug() << "Identifier:" << packet->hwid(); | ||
delete packet; | ||
|
||
PacketSelectArea *l_packet = new PacketSelectArea(); | ||
l_packet->setArea(0); | ||
l_packet->setLocation(0); | ||
relay->routeInternalPacket(l_packet, f_client); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef BANMANAGER_H | ||
#define BANMANAGER_H | ||
|
||
#include <QObject> | ||
|
||
class PacketRelay; | ||
class Packet; | ||
class Client; | ||
|
||
class BanManager : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
explicit BanManager(QObject *parent = nullptr, PacketRelay *f_relay = nullptr); | ||
|
||
private slots: | ||
void onHELLOReceived(Packet *f_packet, Client *f_client); | ||
|
||
public: | ||
PacketRelay *relay; | ||
}; | ||
|
||
#endif // BANMANAGER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "packet_selectarea.h" | ||
|
||
#include "QJsonObject" | ||
|
||
bool PacketSelectArea::fromJsonValue(const QJsonValue &f_in) | ||
{ | ||
if (!f_in.isObject()) { | ||
return false; | ||
} | ||
QJsonObject l_data = f_in.toObject(); | ||
area = l_data["area"].toInt(0); | ||
location = l_data["location"].toInt(0); | ||
return true; | ||
} | ||
|
||
QString PacketSelectArea::header() const | ||
{ | ||
return "SELECT_AREA"; | ||
} | ||
|
||
int PacketSelectArea::getArea() const | ||
{ | ||
return area; | ||
} | ||
|
||
int PacketSelectArea::getLocation() const | ||
{ | ||
return location; | ||
} | ||
|
||
void PacketSelectArea::setArea(const int f_area) | ||
{ | ||
area = f_area; | ||
} | ||
|
||
void PacketSelectArea::setLocation(const int f_location) | ||
{ | ||
location = f_location; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef PACKETSELECTAREA_H | ||
#define PACKETSELECTAREA_H | ||
|
||
#include "packet.h" | ||
|
||
class PacketSelectArea : public Packet | ||
{ | ||
public: | ||
PacketSelectArea() = default; | ||
bool fromJsonValue(const QJsonValue &f_in) override; | ||
QString header() const override; | ||
int getArea() const; | ||
int getLocation() const; | ||
void setArea(const int f_area); | ||
void setLocation(const int f_location); | ||
|
||
private: | ||
int area; | ||
int location; | ||
}; | ||
|
||
#endif // PACKETSELECTAREA_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.