#include "RakNetConnector.h"

#include "Utils/FileUtils.h"

auto RakNetConnector::getRakPeer() -> RakPeer* {
	return *reinterpret_cast<RakPeer**>((uintptr_t)this + 0x2A0);
}

auto RakNetConnector::getJoinedIP() -> std::string {
	if (Utils::File::getVersion() == _("1.21.80"))
		return *reinterpret_cast<std::string*>((uintptr_t)this + 0x3A0);
	if (Utils::File::getVersion() == _("1.21.73"))
		return *reinterpret_cast<std::string*>((uintptr_t)this + 0x398);
	if (Utils::File::getVersion() == _("1.21.72"))
		return *reinterpret_cast<std::string*>((uintptr_t)this + 0x398);
	if (Utils::File::getVersion() == _("1.21.71"))
		return *reinterpret_cast<std::string*>((uintptr_t)this + 0x398);
	if (Utils::File::getVersion() == _("1.21.70"))
		return *reinterpret_cast<std::string*>((uintptr_t)this + 0x398);
	else
		return *reinterpret_cast<std::string*>((uintptr_t)this + 0x398);
}
