diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/PS3/PS3_PlayerUID.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.Client/PS3/PS3_PlayerUID.h')
| -rw-r--r-- | Minecraft.Client/PS3/PS3_PlayerUID.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/Minecraft.Client/PS3/PS3_PlayerUID.h b/Minecraft.Client/PS3/PS3_PlayerUID.h new file mode 100644 index 00000000..669461a5 --- /dev/null +++ b/Minecraft.Client/PS3/PS3_PlayerUID.h @@ -0,0 +1,72 @@ + + + +#pragma once + + +// Note - there are now 3 types of PlayerUID +// (1) A full online ID - either the primary login, or a sub-signin through to PSN. This has m_onlineID set up as a normal SceNpOnlineId, with dummy[0] set to 0 +// (2) An offline ID, where there is also a primary login on the system. This has m_onlineID set up to copy the primary SceNpOnlineId, except with dummy[0] set to the controller ID of this other player +// (3) An offline ID, where there isn't a primary PSN login on the system. This has SceNpOnlineId fully zeroed. + +class PlayerUID +{ + char m_onlineID[SCE_NET_NP_ONLINEID_MAX_LENGTH]; + char term; + bool m_bSignedIntoPSN : 1; + unsigned char m_quadrant : 2; + uint8_t m_macAddress[CELL_NET_CTL_ETHER_ADDR_LEN]; + CellSysutilUserId m_userID; // user logged on to the XMB + +public: + + class Hash + { + public: + std::size_t operator()(const PlayerUID& k) const; + }; + + PlayerUID(); + PlayerUID(CellSysutilUserId userID, SceNpOnlineId& onlineID, bool bSignedInPSN, int quadrant); + PlayerUID(std::wstring fromString); + + bool operator==(const PlayerUID& rhs) const; + bool operator!=(const PlayerUID& rhs); + void setCurrentMacAddress(); + std::wstring macAddressStr() const; + std::wstring userIDStr() const; + std::wstring toString() const; + void setOnlineID(SceNpOnlineId& id, bool bSignedIntoPSN); + void setUserID(unsigned int id); + + + const char* getOnlineID() const { return m_onlineID; } + CellSysutilUserId getUserID() const { return m_userID; } + int getQuadrant() const { return m_quadrant; } + bool isPrimaryUser() const; // only true if we're on the local machine and signed into the first quadrant; + bool isSignedIntoPSN() const { return m_bSignedIntoPSN; } +private: +}; + + + + + +class GameSessionUID +{ + char m_onlineID[SCE_NET_NP_ONLINEID_MAX_LENGTH]; + char term; + bool m_bSignedIntoPSN : 1; + unsigned char m_quadrant : 2; +public: + GameSessionUID(); + GameSessionUID(int nullVal); + + bool operator==(const GameSessionUID& rhs) const; + bool operator!=(const GameSessionUID& rhs); + GameSessionUID& operator=(const PlayerUID& rhs); + + const char* getOnlineID() const { return m_onlineID; } + int getQuadrant() const { return m_quadrant; } + bool isSignedIntoPSN() const { return m_bSignedIntoPSN; } +}; |
