forked from Wirlaburla/P3NG0
Compare commits
13 Commits
55addb09d9
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b5fe2aa64d | |||
| 5986f861c5 | |||
| 2c1740cd1c | |||
| a91c9064ac | |||
| ca5fcc734d | |||
| 3a758e1ab7 | |||
| 1201257b11 | |||
| 5d8b8e0f39 | |||
| ba4fda62ee | |||
| 8d06546da6 | |||
| 9b09fb22fd | |||
| 89096df226 | |||
| 0dd148f462 |
@@ -57,6 +57,7 @@ help_whisper_message=%s, you have been whispered with more information.
|
||||
time_msg=It is %s.
|
||||
roll_msg=%s rolled a %i.
|
||||
world_not_found_msg=Sorry, I don't know that one.
|
||||
world_found_msg=Taking you there now, teleport to me!
|
||||
roomusers_msg=There are %i users in this room.
|
||||
conf_reload_msg=My configuration has been reloaded.
|
||||
ping_msg=Response recieved in %ims.
|
||||
|
||||
51
readme.md
51
readme.md
@@ -1,7 +1,7 @@
|
||||
# Tourbot
|
||||
### The Friendly Worlds Tour Guide
|
||||
### Progress: Not finished (teleport needs work)
|
||||

|
||||

|
||||
Tourbot is an automated chatbot for the Worlds.com online 3D chat service (specifically WorldsPlayer from 1998 and onward). It is based off of P3NG0 by Wirlaburla, the FIRST Worlds chatbot to ever be created and operated live in public. Tourbot retains several features from P3NG0 as well as new features, with the primary selling point being to provide both new and old users an exciting and easy way to explore new worlds, without having to dig through endless archives and file servers like Worlio or jett.dacii.net. This is especially important today as several HOSTs on Worlds have departed or otherwise become inactive, leaving many of the weekly and monthly events abandoned, including tours.
|
||||
|
||||
This project is a gift to the Worlds community, and I owe a special thanks to the endless line of nerds who came before me and reverse-engineered the chat protocol so that this could happen.
|
||||
@@ -14,9 +14,9 @@ Underlined tasks are tasks currently being worked on
|
||||
- [ ] <ins>New commands</ins>
|
||||
- [ ] <ins>Teleport-on-request routine</ins>
|
||||
- [ ] Basic Tour Guide routine
|
||||
- [ ] Tour communication (prioritize leader commands, whispering users out of range, etc)
|
||||
- [ ] Tour communication (tracking users, prioritize leader commands, whispering users out of range, etc)
|
||||
- [ ] Ability to join another user's ongoing tour
|
||||
- [ ] Database Building
|
||||
- [ ] World Database Building
|
||||
- [ ] Spanish Localization
|
||||
- [ ] Tour Guide Avatar
|
||||
- [ ] Contextual Avatars: on tour
|
||||
@@ -26,38 +26,41 @@ Underlined tasks are tasks currently being worked on
|
||||
- [ ] New User Recognition and Welcome
|
||||
|
||||
# Runtime Requirements
|
||||
- An active internet connection
|
||||
- A computer running Linux or any other compatible UNIX derivative
|
||||
- An active IPv4 internet connection
|
||||
- A valid Worlds.com account which you registered using the WorldsPlayer
|
||||
- Linux or any other compatible UNIX derivative
|
||||
- The latest version of glibc
|
||||
- The actual version required will depend on the version of glibc linked during compile time.
|
||||
I compile Tourbot on Arch-based distributions which usually have the latest version.
|
||||
If you use a distro such as Ubuntu or Debian then you may need to compile the bot yourself.
|
||||
- A working brain
|
||||
|
||||
# Building Requirements
|
||||
- CMake
|
||||
- GCC
|
||||
- C++ header/source files from Nlohmann's JSON library
|
||||
- If you are compiling on an Arch-based Linux system then you can get these instantly by running `sudo pacman -Sy nlohmann-json`
|
||||
- A few Linux distributions have this library available as an installable package. Please check the repo in your package manager.
|
||||
- Otherwise you just need to put the required `json.hpp` file in your include path and make sure CMake and GCC can see it.
|
||||
|
||||
# Building
|
||||
## Arch Linux / endeavourOS
|
||||
1. Install nlohmann-json if you haven't already: `sudo pacman -Sy nlohmann-json`
|
||||
2. Enter the root directory (where `src` is) and run `cmake --build bin/` to create an executable file in the bin folder.
|
||||
3. `cd` to `bin/` and run `./p3ng0`. (Your working directory needs to be the same directory where `conf/` is located.)
|
||||
|
||||
## Other Linux systems
|
||||
## Linux, MINIX and BSD
|
||||
1. Make sure nlohmann JSON is in your INCLUDE path so your compiler can find it's headers.
|
||||
2. Enter the root directory (where `src` is) and run `cmake --build bin/` to create an executable file in the bin folder.
|
||||
3. `cd` to `bin/` and run `./p3ng0`. (Your working directory needs to be the same directory where `conf/` is located.)
|
||||
- On Arch Linux / endeavourOS: `sudo pacman -Sy nlohmann-json`
|
||||
- On Ubuntu / Mint / PopOS: `sudo apt-get install nlohmann-json3-dev`
|
||||
- Other systems: Install and link the library's source files manually.
|
||||
2. Enter the root directory (where `src` is) and run `cmake -S src/ -B bin/` to create the neccessary files to compile the program.
|
||||
3. Run `cmake --build bin/` to create an executable file in the bin folder.
|
||||
4. `cd` to `bin/` and run `./p3ng0`. (Your working directory needs to be the same directory where `conf/` is located.)
|
||||
|
||||
## Windows
|
||||
Get WSL or a remote Linux machine and try again.
|
||||
Tourbot isn't designed for Windows right now. As such, I haven't set up the project files to be compilable on Windows, even with Linux as the target. You can either install WSL and compile there, or set up the compiler yourself if you know what you're doing.
|
||||
|
||||
## Mac
|
||||
I don't use Mac, I can't help you.
|
||||
I don't use Mac and I never plan to support it, I can't help you.
|
||||
|
||||
# FAQ
|
||||
## When are you going to finish this?
|
||||
To quote our lord and savior John Carmack, "It will be done when it's done." I'm the only person working on this and I have a real life (crazy I know).
|
||||
## Can I copy your code?
|
||||
Yes, but you have to keep the GNU GPL 3 license.
|
||||
## Where do I report bugs?
|
||||
@@ -68,12 +71,12 @@ I can't stop you from doing whatever you want with it, but if you do bad things
|
||||
## When I try to log in, the console says "Account is no longer valid".
|
||||
Double check your spelling.
|
||||
|
||||
If you know your username is spelled correctly and the account hasn't been deleted/banned, make sure you saved bot.conf with Unix line endings. Windows line endings use a really funny looking two-byte control code for new lines, and Tourbot doesn't understand how to read them yet. It probably thinks that your username is something like "John<68>" instead of "John". Many text editors on Windows allow you to change this setting so Tourbot can read your configs correctly, unfortunately the default notepad.exe doesn't include this.
|
||||
## Why isn't there a Windows version?
|
||||
Two reasons.
|
||||
1. Wirlaburla doesn't use Windows, and when he made P3NG0, his target platform was Linux and nothing else. Refactoring the code to eliminate any cross-platform compatibility issues so it compiles and runs on Windows isn't worth it in my opinion. I host Tourbot on a separate Linux server myself so my daily tasks on my main machine don't interfere with it, I don't have a need to port it.
|
||||
2. The point of Tourbot is to be an automated chatbot. It's essentially a headless WorldsPlayer client that acts on it's own. It doesn't need a GUI, or anything fancy to work, or to even interact with users. So Tourbot is at home on headless servers, and Linux has always been a lot better for servers because of how flexible it is. Windows is built mostly with end users in mind, and the amount of people hosting VPSes who prefer to use Windows Server is pretty small. There just isn't any benefit to porting the bot. It would take infinitely less effort to just set up WSL on your Windows system and run the bot from there if you absolutely needed a Windows host.
|
||||
## Why are passwords stored in plaintext? That's not safe!
|
||||
Worlds doesn't have SSL or TLS, all your traffic to the roomserver is unencrypted. When you start a session on your Worlds account you are transmitting your login details unprotected over the public internet. They aren't hashed on the server either. No token system or anything, this is a very old chat program with very old security standards. Thus there's no point to protecting the passwords when they're sitting on your system.
|
||||
If you know your username is spelled correctly and the account hasn't been deleted/banned, make sure you saved bot.conf with Unix line endings. Windows line endings use a really funny looking two-byte control code for new lines, and Tourbot doesn't understand how to read them yet. It probably thinks that your username is something like "John<68>" instead of "John". I plan to fix this if a Windows port is ever released, but for now, you will need to be careful with your .conf files.
|
||||
|
||||
Ideally you should create a unique password specifically for Tourbot and not share it with anything else. That way, if something bad does happen, your other more secure stuff doesn't get stolen.
|
||||
Many text editors on Windows allow you to change this setting so Tourbot can read your configs correctly, unfortunately the default notepad.exe doesn't include this.
|
||||
## Why isn't there a Windows version?
|
||||
P3NG0 was designed from the very beginning with Linux in mind. When it came time to make Tourbot, the same was true; it's designed to be run headless, 24/7, on a server. Meaning you are expected to have a spare computer handy or a cloud VPS rented in order to run the bot. Just about every sane sysadmin uses Linux for headless systems, since Windows was always optimized around it's user interface and not much else.
|
||||
|
||||
I could make a Windows version, doing so is actually not very difficult. The code for Tourbot is pretty small and it very rarely interacts with system APIs if at all. It's just a matter of if I want to or not.
|
||||
## Why are passwords stored in plaintext? That's not safe!
|
||||
Worlds doesn't have SSL or TLS, doesn't hash passwords, and doesn't have session tokens or revocable sessions. It's a very old program with extremely outdated security. Tourbot isn't secure because the weakest link in the chain makes any security effort on my part pointless. <ins>If you want to remain safe, use a *unique password* for the bot so that it can't be reused in the event it gets stolen.</ins>
|
||||
45
src/main.cpp
45
src/main.cpp
@@ -781,22 +781,28 @@ 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 + "\"";
|
||||
roomIDReq(&roomsock, details.room);
|
||||
std::cout << "info: delaying teleport by 1000ms to avoid race condition\n";
|
||||
sleep(1);
|
||||
|
||||
std::cout << "info: updating goto destination";
|
||||
realLocation = details.url;
|
||||
std::cout << "info: requesting to join room \"" + details.room + "\"\n";
|
||||
//roomIDReq(&roomsock, details.room); //fatal error
|
||||
//room = details.room;
|
||||
|
||||
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);
|
||||
teleport(&roomsock,
|
||||
details.position.x,
|
||||
details.position.y,
|
||||
details.position.z,
|
||||
details.position.yaw);
|
||||
std::to_string(details.position.yaw) + "\n";
|
||||
xPos = details.position.x; // remember so that the idle thread doesn't rubberband us
|
||||
yPos = details.position.y;
|
||||
zPos = details.position.z;
|
||||
direction = details.position.yaw;
|
||||
teleport(&roomsock, xPos, yPos, zPos, direction); // force positional update immediately
|
||||
|
||||
std::cout << "info: updating goto destination\n";
|
||||
realLocation = details.url;
|
||||
|
||||
std::cout << "info: done! initiating watchdog\n";
|
||||
}
|
||||
|
||||
// unimplemented
|
||||
@@ -814,7 +820,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>();
|
||||
@@ -823,7 +846,7 @@ void lookUpWorldName(std::string alias, char* buffer/*replies*/) {
|
||||
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());
|
||||
sprintf(buffer, mainConf->getValue("world_found_msg", "Taking you there now, teleport to me!").c_str());
|
||||
handleTeleportRequest(details);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user