From e188d455d7f2e3b78d102e285c8ecf009f8f63a4 Mon Sep 17 00:00:00 2001 From: bonkmaykr Date: Sat, 27 Jan 2024 23:37:57 -0500 Subject: [PATCH] initial client header --- src/client.h | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/src/client.h b/src/client.h index 0af3921..381ed55 100644 --- a/src/client.h +++ b/src/client.h @@ -9,7 +9,7 @@ #include "acfile.h" #define BUFFERSIZE 4096 -bool debug = false; +bool debug = true; std::random_device rd; std::mt19937 rng(rd()); @@ -23,6 +23,7 @@ const std::string user_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537. std::string confFile = "conf/bot.conf"; ACFile* mainConf; ACFile* worldlist; +ACFile* marksLUT; ACFile* replylist; AMFile* messages; ALFile* filth; @@ -49,7 +50,7 @@ uint16_t roomport = 5672; std::string login_username; std::string login_password; -std::string avatar = "avatar:pengo.mov"; +std::string avatar = "http://files.worlio.com/users/bonkmaykr/avatarsforme/gabu1s*4h*4v*.mov"; // Needs to include dimension too std::string room; @@ -57,7 +58,7 @@ uint16_t roomID = 1; int protocol = 24; char* version = "1000000000"; -int avatars = 253; +int avatars = 253; // avoid culling users if possible... what could go wrong? int keepAliveTime; uint16_t xPos = 0; @@ -70,6 +71,30 @@ std::map properties; std::map objects; std::vector groups; +namespace internalTypes { + struct dronePositionI { + int x; + int y; + int z; + int yaw; + }; + + struct dronePositionF { + float x; + float y; + float z; + float yaw; + }; + + struct markEntry { + std::string name; + std::string url; + std::string room; + dronePositionI position; + bool blacklist; + }; +} + void loadConfig(); int deinit(int response); void autoInit(); @@ -101,6 +126,10 @@ void sendGroupMessage(Group* g, int *sock, std::string message); void safeDeleteGroupMember(Group* g, std::string member); void qsend(int *sock, unsigned char str[], bool queue); +void handleTeleportRequest(internalTypes::markEntry details); +void handleTour(std::string destination[4]); +void lookUpWorldName(std::string alias, char* buffer); + Drone* getDrone(std::string name) { for (auto o : objects) if (o.second->name == name) return o.second;