forked from Wirlaburla/P3NG0
Compare commits
4 Commits
55addb09d9
...
8d06546da6
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d06546da6 | |||
| 9b09fb22fd | |||
| 89096df226 | |||
| 0dd148f462 |
25
src/main.cpp
25
src/main.cpp
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user