#include "stdafx.h" #include "Orbis_PlayerUID.h" #include "..\Minecraft.World\StringHelpers.h" #include // taken from Boost, there is no TR1 equivalent template inline void hash_combine(std::size_t& seed, T const& v) { hash hasher; seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2); } std::size_t PlayerUID::Hash::operator()(const PlayerUID& k) const { // now only hashing against the local ID, as this is now unique across the network too. std::size_t seed = 0; hash_combine(seed, k.m_userID); for(int i=0; i(macDigit); } int userIdLen = 0; // parse the userID wstring userIDDigits = L""; while(fromString.at(15 + userIdLen) != L'_') { userIDDigits.push_back(fromString.at(15 + userIdLen)); ++userIdLen; } fromString.substr(15,8); m_userID = _fromString(userIDDigits); // finally, the onlineID, if there is one wstring onlineID = fromString.substr(15 + userIdLen + 1); if(onlineID.size() > 0) { m_bSignedIntoPSN = true; } else { m_bSignedIntoPSN = false; } } bool PlayerUID::operator==(const PlayerUID& rhs) const { // comparing offline IDs if(XUID != rhs.XUID) return false; for(int i=0; i