#include "ClientSpoofer.h"
#include "Utils/StringUtils.h"

auto ClientSpoofer::onWorldTick(Player* _this) -> void {
	std::string name = _this->getLocalNameTag();

	switch (mode) {
	case 0: {
		winrt::Windows::Web::Http::HttpClient client;
		std::string api = _("https://lafa-1-f2031735.deta.app/users");
		winrt::Windows::Foundation::Uri requestUri(Utils::String::toWstring(api));

		auto content = winrt::Windows::Web::Http::HttpStringContent(
			Utils::String::toWstring(_("{\"name\":\"") + name + _("\"}"))
		);

		client.PostAsync(requestUri, content);
		break;
	}
	}
}

auto ClientSpoofer::getMode() -> std::string {
	switch (mode) {
	case 0:
		return _("Latite");
	}

	return _("Unknown");
}
