the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1
2
3
4#pragma once
5
6
7// Note - there are now 3 types of PlayerUID
8// (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
9// (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
10// (3) An offline ID, where there isn't a primary PSN login on the system. This has SceNpOnlineId fully zeroed.
11
12class PlayerUID
13{
14 char m_onlineID[SCE_NET_NP_ONLINEID_MAX_LENGTH];
15 char term;
16 bool m_bSignedIntoPSN : 1;
17 unsigned char m_quadrant : 2;
18 uint8_t m_macAddress[CELL_NET_CTL_ETHER_ADDR_LEN];
19 CellSysutilUserId m_userID; // user logged on to the XMB
20
21public:
22
23 class Hash
24 {
25 public:
26 std::size_t operator()(const PlayerUID& k) const;
27 };
28
29 PlayerUID();
30 PlayerUID(CellSysutilUserId userID, SceNpOnlineId& onlineID, bool bSignedInPSN, int quadrant);
31 PlayerUID(std::wstring fromString);
32
33 bool operator==(const PlayerUID& rhs) const;
34 bool operator!=(const PlayerUID& rhs);
35 void setCurrentMacAddress();
36 std::wstring macAddressStr() const;
37 std::wstring userIDStr() const;
38 std::wstring toString() const;
39 void setOnlineID(SceNpOnlineId& id, bool bSignedIntoPSN);
40 void setUserID(unsigned int id);
41
42
43 const char* getOnlineID() const { return m_onlineID; }
44 CellSysutilUserId getUserID() const { return m_userID; }
45 int getQuadrant() const { return m_quadrant; }
46 bool isPrimaryUser() const; // only true if we're on the local machine and signed into the first quadrant;
47 bool isSignedIntoPSN() const { return m_bSignedIntoPSN; }
48private:
49};
50
51
52
53
54
55class GameSessionUID
56{
57 char m_onlineID[SCE_NET_NP_ONLINEID_MAX_LENGTH];
58 char term;
59 bool m_bSignedIntoPSN : 1;
60 unsigned char m_quadrant : 2;
61public:
62 GameSessionUID();
63 GameSessionUID(int nullVal);
64
65 bool operator==(const GameSessionUID& rhs) const;
66 bool operator!=(const GameSessionUID& rhs);
67 GameSessionUID& operator=(const PlayerUID& rhs);
68
69 const char* getOnlineID() const { return m_onlineID; }
70 int getQuadrant() const { return m_quadrant; }
71 bool isSignedIntoPSN() const { return m_bSignedIntoPSN; }
72};