the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 127 lines 3.5 kB view raw
1#pragma once 2 3#if defined(__PS3__) || defined(__ORBIS__) 4#include "..\..\Common\Network\Sony\SQRNetworkManager.h" 5#endif 6 7 8// A struct that we store in the QoS data when we are hosting the session. Max size 1020 bytes. 9#ifdef _XBOX 10typedef struct _GameSessionData 11{ 12 unsigned short netVersion; // 2 bytes 13 char hostName[XUSER_NAME_SIZE]; // 16 bytes ( 16*1 ) 14 GameSessionUID hostPlayerUID; // 8 bytes ( 8*1 ) on xbox, 24 bytes on PS3 15 GameSessionUID players[MINECRAFT_NET_MAX_PLAYERS]; // 64 bytes ( 8*8 ) on xbox, 192 ( 24*8) on PS3 16 char szPlayers[MINECRAFT_NET_MAX_PLAYERS][XUSER_NAME_SIZE]; // 128 bytes ( 8*16) 17 unsigned int m_uiGameHostSettings; // 4 bytes 18 unsigned int texturePackParentId; // 4 bytes 19 unsigned char subTexturePackId; // 1 byte 20 21 bool isJoinable; // 1 byte 22 23 _GameSessionData() 24 { 25 netVersion = 0; 26 memset(hostName, 0, XUSER_NAME_SIZE); 27 memset(players, 0, MINECRAFT_NET_MAX_PLAYERS * sizeof(players[0])); 28 memset(szPlayers, 0, MINECRAFT_NET_MAX_PLAYERS * XUSER_NAME_SIZE); 29 isJoinable = true; 30 m_uiGameHostSettings = 0; 31 texturePackParentId = 0; 32 subTexturePackId = 0; 33 } 34} GameSessionData; 35#elif defined __PS3__ || defined __ORBIS__ || defined(__PSVITA__) 36typedef struct _GameSessionData 37{ 38 unsigned short netVersion; // 2 bytes 39 GameSessionUID hostPlayerUID; // 8 bytes ( 8*1 ) on xbox, 24 bytes on PS3 40 GameSessionUID players[MINECRAFT_NET_MAX_PLAYERS]; // 64 bytes ( 8*8 ) on xbox, 192 ( 24*8) on PS3 41 unsigned int m_uiGameHostSettings; // 4 bytes 42 unsigned int texturePackParentId; // 4 bytes 43 unsigned char subTexturePackId; // 1 byte 44 45 bool isJoinable; // 1 byte 46 47 unsigned char playerCount; // 1 byte 48 bool isReadyToJoin; // 1 byte 49 50 _GameSessionData() 51 { 52 netVersion = 0; 53 memset(players, 0, MINECRAFT_NET_MAX_PLAYERS * sizeof(players[0])); 54 isJoinable = true; 55 m_uiGameHostSettings = 0; 56 texturePackParentId = 0; 57 subTexturePackId = 0; 58 playerCount = 0; 59 isReadyToJoin = false; 60 61 } 62} GameSessionData; 63#else 64typedef struct _GameSessionData 65{ 66 unsigned short netVersion; 67 unsigned int m_uiGameHostSettings; 68 unsigned int texturePackParentId; 69 unsigned char subTexturePackId; 70 71 bool isReadyToJoin; 72 bool isJoinable; 73 74 char hostIP[64]; 75 int hostPort; 76 wchar_t hostName[XUSER_NAME_SIZE]; 77 unsigned char playerCount; 78 unsigned char maxPlayers; 79 80 _GameSessionData() 81 { 82 netVersion = 0; 83 m_uiGameHostSettings = 0; 84 texturePackParentId = 0; 85 subTexturePackId = 0; 86 isReadyToJoin = false; 87 isJoinable = true; 88 memset(hostIP, 0, sizeof(hostIP)); 89 hostPort = 0; 90 memset(hostName, 0, sizeof(hostName)); 91 playerCount = 0; 92 maxPlayers = MINECRAFT_NET_MAX_PLAYERS; 93 } 94} GameSessionData; 95#endif 96 97class FriendSessionInfo 98{ 99public: 100 SessionID sessionId; 101#ifdef _XBOX 102 XSESSION_SEARCHRESULT searchResult; 103#elif defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) 104 SQRNetworkManager::SessionSearchResult searchResult; 105#elif defined(_DURANGO) 106 DQRNetworkManager::SessionSearchResult searchResult; 107#endif 108 wchar_t* displayLabel; 109 unsigned char displayLabelLength; 110 unsigned char displayLabelViewableStartIndex; 111 GameSessionData data; 112 bool hasPartyMember; 113 114 FriendSessionInfo() 115 { 116 displayLabel = NULL; 117 displayLabelLength = 0; 118 displayLabelViewableStartIndex = 0; 119 hasPartyMember = false; 120 } 121 122 ~FriendSessionInfo() 123 { 124 if (displayLabel != NULL) 125 delete displayLabel; 126 } 127};