Compare commits

..

4 Commits

Author SHA1 Message Date
8d06546da6 Merge branch 'master' of https://git.worlio.com/bonkmaykr/Tourbot 2024-01-29 04:12:08 -06:00
9b09fb22fd closed #1 2024-01-29 04:11:53 -06:00
89096df226 nope 2024-01-29 04:00:03 -06:00
0dd148f462 attempting fix for #1 2024-01-29 03:55:44 -06:00

View File

@@ -781,17 +781,17 @@ bool handleGroups(char* buffer, std::string from, std::string message) {
// teleport using a markEntry loaded from the database
void handleTeleportRequest(internalTypes::markEntry details) {
std::cout << "info: requesting to join room \"" + details.room + "\"";
std::cout << "info: requesting to join room \"" + details.room + "\"\n";
roomIDReq(&roomsock, details.room);
std::cout << "info: updating goto destination";
std::cout << "info: updating goto destination\n";
realLocation = details.url;
std::cout << "info: setting position at " +
std::to_string(details.position.x) + ", " +
std::to_string(details.position.y) + ", " +
std::to_string(details.position.z) + ", " +
std::to_string(details.position.yaw);
std::to_string(details.position.yaw) + "\n";
teleport(&roomsock,
details.position.x,
details.position.y,
@@ -814,7 +814,24 @@ void lookUpWorldName(std::string alias, char* buffer/*replies*/) {
auto key = worldsmarks.find(alias);
if (key != worldsmarks.end()) {
std::cout << "info: found world \"" + alias + "\" in database, commencing teleport.\n";
internalTypes::markEntry details;
json failsafe = { // leftovers
{"name", "FALLBACK"},
{"url", "rel:GroundZero/GroundZero.world"},
{"room", "GroundZero#Reception"},
{"position", {0, 0, 0, 0}},
{"blacklist", true}
};
if (
typeid((*key)["position"][0]).name() != "int" ||
typeid((*key)["position"][1]).name() != "int" ||
typeid((*key)["position"][2]).name() != "int" ||
typeid((*key)["position"][3]).name() != "int") {
std::cout << "ERROR: expected type int when reading position. PLEASE CHECK your marks.json!!!\n";
}
details.name = (*key)["name"].get<std::string>();
details.url = (*key)["url"].get<std::string>();
details.room = (*key)["room"].get<std::string>();
@@ -822,7 +839,7 @@ void lookUpWorldName(std::string alias, char* buffer/*replies*/) {
details.position.y = (*key)["position"][1];
details.position.z = (*key)["position"][2];
details.position.yaw = (*key)["position"][3];
sprintf(buffer, mainConf->getValue("world_not_found_msg", "Taking you there now, teleport to me!").c_str());
handleTeleportRequest(details);
}