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_NP_ONLINEID_MAX_LENGTH];
15 char term;
16 bool m_bSignedIntoPSN : 1;
17 unsigned char m_quadrant : 2;
18 uint8_t m_macAddress[SCE_NET_ETHER_ADDR_LEN];
19 int 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(int 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 int 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; }
48 void setForAdhoc();
49private:
50};
51
52
53
54
55
56class GameSessionUID
57{
58 char m_onlineID[SCE_NP_ONLINEID_MAX_LENGTH];
59 char term;
60 bool m_bSignedIntoPSN : 1;
61 unsigned char m_quadrant : 2;
62public:
63 GameSessionUID();
64 GameSessionUID(int nullVal);
65
66 bool operator==(const GameSessionUID& rhs) const;
67 bool operator!=(const GameSessionUID& rhs);
68 GameSessionUID& operator=(const PlayerUID& rhs);
69
70 const char* getOnlineID() const { return m_onlineID; }
71 int getQuadrant() const { return m_quadrant; }
72 bool isSignedIntoPSN() const { return m_bSignedIntoPSN; }
73 void setForAdhoc();
74
75};