attempt at trying to get XB360 to work
This commit is contained in:
@@ -66,7 +66,7 @@ void CGameNetworkManager::Initialise()
|
||||
ServerStoppedCreate( false );
|
||||
ServerReadyCreate( false );
|
||||
int flagIndexSize = LevelRenderer::getGlobalChunkCount() / (Level::maxBuildHeight / 16); // dividing here by number of renderer chunks in one column
|
||||
#ifdef _XBOX
|
||||
#if !defined(_DISABLE_XBLIVE) && defined _XBOX
|
||||
s_pPlatformNetworkManager = new CPlatformNetworkManagerXbox();
|
||||
#elif !defined(DISABLE_PSN) && defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
s_pPlatformNetworkManager = new CPlatformNetworkManagerSony();
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#pragma once
|
||||
using namespace std;
|
||||
#include <vector>
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#include <qnet.h>
|
||||
#endif
|
||||
#include "..\..\..\Minecraft.World\C4JThread.h"
|
||||
#include "NetworkPlayerInterface.h"
|
||||
#ifdef _XBOX
|
||||
#if defined _XBOX && !defined _DISABLE_XBLIVE
|
||||
#include "..\..\Xbox\Network\PlatformNetworkManagerXbox.h"
|
||||
#elif !defined DISABLE_PSN && defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
#include "..\..\Common\Network\Sony\PlatformNetworkManagerSony.h"
|
||||
@@ -30,7 +32,7 @@ const int NON_QNET_SENDDATA_ACK_REQUIRED = 1;
|
||||
|
||||
class CGameNetworkManager
|
||||
{
|
||||
#ifdef _XBOX
|
||||
#if defined _XBOX && !defined _DISABLE_XBLIVE
|
||||
friend class CPlatformNetworkManagerXbox;
|
||||
#elif !defined DISABLE_PSN && defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
friend class CPlatformNetworkManagerSony;
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
const int QNET_GETSENDQUEUESIZE_SECONDARY_TYPE = 0;
|
||||
const int QNET_GETSENDQUEUESIZE_MESSAGES = 0;
|
||||
const int QNET_GETSENDQUEUESIZE_BYTES = 0;
|
||||
|
||||
const int QNET_SENDDATA_LOW_PRIORITY = 0;
|
||||
const int QNET_SENDDATA_SECONDARY = 0;
|
||||
|
||||
const int QNET_SENDDATA_RELIABLE = 0;
|
||||
const int QNET_SENDDATA_SEQUENTIAL = 0;
|
||||
|
||||
#define QNET_E_SESSION_FULL 0
|
||||
#define QNET_USER_MASK_USER0 1
|
||||
#define QNET_USER_MASK_USER1 2
|
||||
#define QNET_USER_MASK_USER2 4
|
||||
#define QNET_USER_MASK_USER3 8
|
||||
|
||||
typedef enum _QNET_STATE
|
||||
{
|
||||
QNET_STATE_IDLE,
|
||||
QNET_STATE_SESSION_HOSTING,
|
||||
QNET_STATE_SESSION_JOINING,
|
||||
QNET_STATE_GAME_LOBBY,
|
||||
QNET_STATE_SESSION_REGISTERING,
|
||||
QNET_STATE_SESSION_STARTING,
|
||||
QNET_STATE_GAME_PLAY,
|
||||
QNET_STATE_SESSION_ENDING,
|
||||
QNET_STATE_SESSION_LEAVING,
|
||||
QNET_STATE_SESSION_DELETING
|
||||
} QNET_STATE, * PQNET_STATE;
|
||||
|
||||
class IQNetPlayer
|
||||
{
|
||||
public:
|
||||
BYTE GetSmallId();
|
||||
void SendData(IQNetPlayer *player, const void *pvData, DWORD dwDataSize, DWORD dwFlags);
|
||||
bool IsSameSystem(IQNetPlayer *player);
|
||||
DWORD GetSendQueueSize( IQNetPlayer *player, DWORD dwFlags );
|
||||
DWORD GetCurrentRtt();
|
||||
bool IsHost();
|
||||
bool IsGuest();
|
||||
bool IsLocal();
|
||||
PlayerUID GetXuid();
|
||||
LPCWSTR GetGamertag();
|
||||
int GetSessionIndex();
|
||||
bool IsTalking();
|
||||
bool IsMutedByLocalUser(DWORD dwUserIndex);
|
||||
bool HasVoice();
|
||||
bool HasCamera();
|
||||
int GetUserIndex();
|
||||
void SetCustomDataValue(ULONG_PTR ulpCustomDataValue);
|
||||
ULONG_PTR GetCustomDataValue();
|
||||
|
||||
BYTE m_smallId;
|
||||
bool m_isRemote;
|
||||
bool m_isHostPlayer;
|
||||
wchar_t m_gamertag[32];
|
||||
private:
|
||||
ULONG_PTR m_customData;
|
||||
};
|
||||
|
||||
void Win64_SetupRemoteQNetPlayer(IQNetPlayer *player, BYTE smallId, bool isHost, bool isLocal);
|
||||
|
||||
class IQNetCallbacks
|
||||
{
|
||||
};
|
||||
|
||||
class IQNetGameSearch
|
||||
{
|
||||
};
|
||||
|
||||
class IQNet
|
||||
{
|
||||
public:
|
||||
HRESULT AddLocalPlayerByUserIndex(DWORD dwUserIndex);
|
||||
IQNetPlayer *GetHostPlayer();
|
||||
IQNetPlayer *GetLocalPlayerByUserIndex(DWORD dwUserIndex);
|
||||
IQNetPlayer *GetPlayerByIndex(DWORD dwPlayerIndex);
|
||||
IQNetPlayer *GetPlayerBySmallId(BYTE SmallId);
|
||||
IQNetPlayer *GetPlayerByXuid(PlayerUID xuid);
|
||||
DWORD GetPlayerCount();
|
||||
QNET_STATE GetState();
|
||||
bool IsHost();
|
||||
HRESULT JoinGameFromInviteInfo(DWORD dwUserIndex, DWORD dwUserMask, const INVITE_INFO *pInviteInfo);
|
||||
void HostGame();
|
||||
void ClientJoinGame();
|
||||
void EndGame();
|
||||
|
||||
static IQNetPlayer m_player[MINECRAFT_NET_MAX_PLAYERS];
|
||||
static DWORD s_playerCount;
|
||||
static bool s_isHosting;
|
||||
};
|
||||
@@ -1,7 +1,11 @@
|
||||
#pragma once
|
||||
using namespace std;
|
||||
#include <vector>
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#include <qnet.h>
|
||||
#else
|
||||
#include "IQNet.h"
|
||||
#endif
|
||||
#include "..\..\..\Minecraft.World\C4JThread.h"
|
||||
#include "NetworkPlayerInterface.h"
|
||||
#include "SessionInfo.h"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "..\..\Xbox\Network\NetworkPlayerXbox.h" // TODO - stub version of this?
|
||||
#include "..\..\Minecraft.h"
|
||||
#include "..\..\User.h"
|
||||
#if defined _WINDOWS64 || defined __PS3__
|
||||
#if defined _WINDOWS64 || defined __PS3__ || defined _XBOX
|
||||
#include "..\..\Common\Network\WinsockNetLayer.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,11 +23,7 @@ public:
|
||||
virtual bool RemoveLocalPlayerByUserIndex( int userIndex );
|
||||
virtual INetworkPlayer *GetLocalPlayerByUserIndex( int userIndex );
|
||||
virtual INetworkPlayer *GetPlayerByIndex(int playerIndex);
|
||||
#ifdef __PS3
|
||||
virtual INetworkPlayer * GetPlayerByXuid(PlayerUID* xuid)
|
||||
#else
|
||||
virtual INetworkPlayer * GetPlayerByXuid(PlayerUID xuid);
|
||||
#endif
|
||||
virtual INetworkPlayer * GetPlayerBySmallId(unsigned char smallId);
|
||||
virtual bool ShouldMessageForFullSession();
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
// A struct that we store in the QoS data when we are hosting the session. Max size 1020 bytes.
|
||||
#ifdef _XBOX
|
||||
#if defined _XBOX && !defined _DISABLE_XBLIVE
|
||||
typedef struct _GameSessionData
|
||||
{
|
||||
unsigned short netVersion; // 2 bytes
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "..\..\Common\Network\PlatformNetworkManagerStub.h"
|
||||
#include "..\..\..\Minecraft.World\Socket.h"
|
||||
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
SOCKET WinsockNetLayer::s_listenSocket = INVALID_SOCKET;
|
||||
SOCKET WinsockNetLayer::s_hostConnectionSocket = INVALID_SOCKET;
|
||||
SOCKET WinsockNetLayer::s_advertiseSock = INVALID_SOCKET;
|
||||
@@ -61,7 +61,7 @@ char g_Win64MultiplayerIP[256] = "127.0.0.1";
|
||||
bool WinsockNetLayer::Initialize()
|
||||
{
|
||||
if (s_initialized) return true;
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
WSADATA wsaData;
|
||||
int result = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
if (result != 0)
|
||||
@@ -106,7 +106,7 @@ void WinsockNetLayer::Shutdown()
|
||||
s_active = false;
|
||||
s_connected = false;
|
||||
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (s_listenSocket != INVALID_SOCKET)
|
||||
{
|
||||
closesocket(s_listenSocket);
|
||||
@@ -137,7 +137,7 @@ void WinsockNetLayer::Shutdown()
|
||||
for (size_t i = 0; i < s_connections.size(); i++)
|
||||
{
|
||||
s_connections[i].active = false;
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (s_connections[i].tcpSocket != INVALID_SOCKET)
|
||||
#elif defined __PS3__
|
||||
if (s_connections[i].tcpSocket >= 0)
|
||||
@@ -219,6 +219,18 @@ bool WinsockNetLayer::HostGame(int port)
|
||||
freeaddrinfo(result);
|
||||
return false;
|
||||
}
|
||||
#elif defined _XBOX
|
||||
struct sockaddr_in addr = {};
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
addr.sin_port = htons((WORD)port);
|
||||
|
||||
s_listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (s_listenSocket == INVALID_SOCKET)
|
||||
{
|
||||
app.DebugPrintf("socket() failed: %d\n", WSAGetLastError());
|
||||
return false;
|
||||
}
|
||||
#elif defined __PS3__
|
||||
struct sockaddr_in addr = {};
|
||||
addr.sin_family = AF_INET;
|
||||
@@ -247,6 +259,24 @@ bool WinsockNetLayer::HostGame(int port)
|
||||
return false;
|
||||
}
|
||||
|
||||
iResult = listen(s_listenSocket, SOMAXCONN);
|
||||
if (iResult == SOCKET_ERROR)
|
||||
{
|
||||
app.DebugPrintf("listen() failed: %d\n", WSAGetLastError());
|
||||
closesocket(s_listenSocket);
|
||||
s_listenSocket = INVALID_SOCKET;
|
||||
return false;
|
||||
}
|
||||
#elif defined _XBOX
|
||||
iResult = ::bind(s_listenSocket, (struct sockaddr*)&addr, sizeof(addr));
|
||||
if (iResult == SOCKET_ERROR)
|
||||
{
|
||||
app.DebugPrintf("bind() failed: %d\n", WSAGetLastError());
|
||||
closesocket(s_listenSocket);
|
||||
s_listenSocket = INVALID_SOCKET;
|
||||
return false;
|
||||
}
|
||||
|
||||
iResult = listen(s_listenSocket, SOMAXCONN);
|
||||
if (iResult == SOCKET_ERROR)
|
||||
{
|
||||
@@ -330,6 +360,51 @@ bool WinsockNetLayer::JoinGame(const char *ip, int port)
|
||||
s_hostConnectionSocket = INVALID_SOCKET;
|
||||
return false;
|
||||
}
|
||||
#elif defined _XBOX
|
||||
XNDNS *pDns = NULL;
|
||||
int iResult = XNetDnsLookup(ip, NULL, &pDns);
|
||||
if (iResult != 0 || pDns == NULL)
|
||||
{
|
||||
app.DebugPrintf("XNetDnsLookup failed for %s - %d\n", ip, iResult);
|
||||
return false;
|
||||
}
|
||||
|
||||
while (pDns->iStatus == WSAEINPROGRESS)
|
||||
{
|
||||
Sleep(10);
|
||||
}
|
||||
|
||||
if (pDns->iStatus != 0 || pDns->cina == 0)
|
||||
{
|
||||
app.DebugPrintf("pDns->iStatus failed for %s - %d\n", ip, iResult);
|
||||
XNetDnsRelease(pDns);
|
||||
return false;
|
||||
}
|
||||
|
||||
struct sockaddr_in addr = {};
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons((WORD)port);
|
||||
addr.sin_addr = pDns->aina[0];
|
||||
XNetDnsRelease(pDns);
|
||||
|
||||
s_hostConnectionSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (s_hostConnectionSocket == INVALID_SOCKET)
|
||||
{
|
||||
app.DebugPrintf("socket() failed: %d\n", WSAGetLastError());
|
||||
return false;
|
||||
}
|
||||
|
||||
int noDelay = 1;
|
||||
setsockopt(s_hostConnectionSocket, IPPROTO_TCP, TCP_NODELAY, (const char *)&noDelay, sizeof(noDelay));
|
||||
|
||||
iResult = connect(s_hostConnectionSocket, (struct sockaddr*)&addr, sizeof(addr));
|
||||
if (iResult == SOCKET_ERROR)
|
||||
{
|
||||
app.DebugPrintf("connect() to %s:%d failed: %d\n", ip, port, WSAGetLastError());
|
||||
closesocket(s_hostConnectionSocket);
|
||||
s_hostConnectionSocket = INVALID_SOCKET;
|
||||
return false;
|
||||
}
|
||||
#elif defined __PS3__
|
||||
struct sockaddr_in addr = {};
|
||||
|
||||
@@ -388,7 +463,7 @@ bool WinsockNetLayer::JoinGame(const char *ip, int port)
|
||||
|
||||
bool WinsockNetLayer::SendOnSocket(SOCKET sock, const void *data, int dataSize)
|
||||
{
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (sock == INVALID_SOCKET || dataSize <= 0) return false;
|
||||
#elif defined __PS3__
|
||||
if (sock < 0 || dataSize <= 0) return false;
|
||||
@@ -407,7 +482,7 @@ bool WinsockNetLayer::SendOnSocket(SOCKET sock, const void *data, int dataSize)
|
||||
while (totalSent < toSend)
|
||||
{
|
||||
int sent = send(sock, (const char *)header + totalSent, toSend - totalSent, 0);
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (sent == SOCKET_ERROR || sent == 0)
|
||||
#elif defined __PS3__
|
||||
if (sent < 0 || sent == 0)
|
||||
@@ -424,7 +499,7 @@ bool WinsockNetLayer::SendOnSocket(SOCKET sock, const void *data, int dataSize)
|
||||
{
|
||||
int sent = send(sock, (const char *)data + totalSent, dataSize - totalSent, 0);
|
||||
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (sent == SOCKET_ERROR || sent == 0)
|
||||
#elif defined __PS3__
|
||||
if (sent < 0 || sent == 0)
|
||||
@@ -447,7 +522,7 @@ bool WinsockNetLayer::SendToSmallId(BYTE targetSmallId, const void *data, int da
|
||||
if (s_isHost)
|
||||
{
|
||||
SOCKET sock = GetSocketForSmallId(targetSmallId);
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (sock == INVALID_SOCKET) return false;
|
||||
#elif defined __PS3__
|
||||
if (sock < 0) return false;
|
||||
@@ -473,7 +548,7 @@ SOCKET WinsockNetLayer::GetSocketForSmallId(BYTE smallId)
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&s_connectionsLock);
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
return INVALID_SOCKET;
|
||||
#elif defined __PS3__
|
||||
return -1;
|
||||
@@ -518,7 +593,7 @@ int WinsockNetLayer::AcceptThreadProc(LPVOID param)
|
||||
while (s_active)
|
||||
{
|
||||
SOCKET clientSocket = accept(s_listenSocket, NULL, NULL);
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (clientSocket == INVALID_SOCKET)
|
||||
{
|
||||
if (s_active)
|
||||
@@ -698,7 +773,7 @@ int WinsockNetLayer::ClientRecvThreadProc(LPVOID param)
|
||||
{
|
||||
BYTE *recvBuf = new BYTE[WIN64_NET_RECV_BUFFER_SIZE];
|
||||
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
while (s_active && s_hostConnectionSocket != INVALID_SOCKET)
|
||||
#elif defined __PS3__
|
||||
while (s_active && s_hostConnectionSocket >= 0)
|
||||
@@ -755,7 +830,7 @@ bool WinsockNetLayer::StartAdvertising(int gamePort, const wchar_t *hostName, un
|
||||
LeaveCriticalSection(&s_advertiseLock);
|
||||
|
||||
s_advertiseSock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (s_advertiseSock == INVALID_SOCKET)
|
||||
{
|
||||
app.DebugPrintf("Win64 LAN: Failed to create advertise socket: %d\n", WSAGetLastError());
|
||||
@@ -842,7 +917,7 @@ int WinsockNetLayer::AdvertiseThreadProc(LPVOID param)
|
||||
int sent = sendto(s_advertiseSock, (const char *)&data, sizeof(data), 0,
|
||||
(struct sockaddr *)&broadcastAddr, sizeof(broadcastAddr));
|
||||
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (sent == SOCKET_ERROR && s_advertising)
|
||||
{
|
||||
app.DebugPrintf("Win64 LAN: Broadcast sendto failed: %d\n", WSAGetLastError());
|
||||
@@ -866,7 +941,7 @@ bool WinsockNetLayer::StartDiscovery()
|
||||
if (!s_initialized) return false;
|
||||
|
||||
s_discoverySock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (s_discoverySock == INVALID_SOCKET)
|
||||
{
|
||||
app.DebugPrintf("Win64 LAN: Failed to create discovery socket: %d\n", WSAGetLastError());
|
||||
@@ -892,7 +967,7 @@ bool WinsockNetLayer::StartDiscovery()
|
||||
bindAddr.sin_port = htons(WIN64_LAN_DISCOVERY_PORT);
|
||||
bindAddr.sin_addr.s_addr = INADDR_ANY;
|
||||
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (::bind(s_discoverySock, (struct sockaddr *)&bindAddr, sizeof(bindAddr)) == SOCKET_ERROR)
|
||||
{
|
||||
app.DebugPrintf("Win64 LAN: Discovery bind failed: %d\n", WSAGetLastError());
|
||||
@@ -924,7 +999,7 @@ void WinsockNetLayer::StopDiscovery()
|
||||
{
|
||||
s_discovering = false;
|
||||
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (s_discoverySock != INVALID_SOCKET)
|
||||
{
|
||||
closesocket(s_discoverySock);
|
||||
@@ -967,7 +1042,7 @@ int WinsockNetLayer::DiscoveryThreadProc(LPVOID param)
|
||||
while (s_discovering)
|
||||
{
|
||||
struct sockaddr_in senderAddr;
|
||||
#if defined _WINDOWS64
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
int senderLen = sizeof(senderAddr);
|
||||
#elif defined __PS3__
|
||||
socklen_t senderLen = sizeof(senderAddr);
|
||||
@@ -1003,7 +1078,14 @@ int WinsockNetLayer::DiscoveryThreadProc(LPVOID param)
|
||||
continue;
|
||||
|
||||
char senderIP[64];
|
||||
#if defined _XBOX
|
||||
unsigned char *ipBytes = (unsigned char *)&senderAddr.sin_addr;
|
||||
sprintf_s(senderIP, sizeof(senderIP), "%d.%d.%d.%d",
|
||||
ipBytes[0], ipBytes[1], ipBytes[2], ipBytes[3]);
|
||||
|
||||
#else
|
||||
inet_ntop(AF_INET, &senderAddr.sin_addr, senderIP, sizeof(senderIP));
|
||||
#endif
|
||||
|
||||
DWORD now = GetTickCount();
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#if defined _WINDOWS64
|
||||
#include <WinSock2.h>
|
||||
#include <WS2tcpip.h>
|
||||
#elif defined _XBOX
|
||||
#include <winsockx.h>
|
||||
#include <xtl.h>
|
||||
#elif defined __PS3__
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -1105,6 +1105,7 @@ void CScene_Leaderboards::CopyLeaderboardEntry(PXUSER_STATS_ROW statsRow, Leader
|
||||
}
|
||||
|
||||
//Is the player
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
if( statsRow->xuid == ((XboxLeaderboardManager*)LeaderboardManager::Instance())->GetMyXUID() )
|
||||
{
|
||||
leaderboardEntry->m_bPlayer = true;
|
||||
@@ -1143,6 +1144,7 @@ void CScene_Leaderboards::CopyLeaderboardEntry(PXUSER_STATS_ROW statsRow, Leader
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void CScene_Leaderboards::SetLeaderboardHeader()
|
||||
|
||||
@@ -37,6 +37,7 @@ HRESULT CScene_MultiGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled
|
||||
// 4J-PB - don't delete this - it's part of the joinload structure
|
||||
//delete initData;
|
||||
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i)
|
||||
{
|
||||
if( m_selectedSession->data.players[i] != NULL )
|
||||
@@ -59,6 +60,7 @@ HRESULT CScene_MultiGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
unsigned int uiGameHostSettings = m_selectedSession->data.m_uiGameHostSettings;
|
||||
switch(app.GetGameHostOption(uiGameHostSettings,eGameHostOption_Difficulty))
|
||||
@@ -185,12 +187,14 @@ HRESULT CScene_MultiGameInfo::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHan
|
||||
rfHandled = TRUE;
|
||||
break;
|
||||
case VK_PAD_Y:
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
if(m_selectedSession != NULL && playersList.TreeHasFocus() && playersList.GetItemCount() > 0)
|
||||
{
|
||||
PlayerUID xuid = m_selectedSession->data.players[playersList.GetCurSel()];
|
||||
if( xuid != INVALID_XUID )
|
||||
hr = XShowGamerCardUI(ProfileManager.GetLockedProfile(), xuid);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -351,6 +355,7 @@ HRESULT CScene_MultiGameInfo::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled )
|
||||
{
|
||||
if ( pTimer->nId == UPDATE_PLAYERS_TIMER_ID)
|
||||
{
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
PlayerUID selectedPlayerXUID = m_selectedSession->data.players[playersList.GetCurSel()];
|
||||
|
||||
bool success = g_NetworkManager.GetGameSessionInfo(m_iPad, m_selectedSession->sessionId,m_selectedSession);
|
||||
@@ -384,6 +389,7 @@ HRESULT CScene_MultiGameInfo::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled )
|
||||
}
|
||||
playersList.SetCurSel(selectedIndex);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
using namespace std;
|
||||
#include <vector>
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#include <qnet.h>
|
||||
#endif
|
||||
#include "..\Media\xuiscene_multi_gameinfo.h"
|
||||
|
||||
class FriendSessionInfo;
|
||||
|
||||
@@ -648,9 +648,11 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r
|
||||
DWORD nIndex = m_pGamesList->GetCurSel();
|
||||
FriendSessionInfo *pSelectedSession = currentSessions.at( nIndex );
|
||||
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
PlayerUID xuid = pSelectedSession->data.hostPlayerUID;
|
||||
if( xuid != INVALID_XUID )
|
||||
hr = XShowGamerCardUI(ProfileManager.GetLockedProfile(), xuid);
|
||||
#endif
|
||||
CXuiSceneBase::PlayUISFX(eSFX_Press);
|
||||
}
|
||||
else if(DoesSavesListHaveFocus())
|
||||
|
||||
+138
-127
@@ -28,6 +28,13 @@
|
||||
#include "PSVita\Social\SocialManager.h"
|
||||
#include "PSVita\Sentient\DynamicConfigurations.h"
|
||||
#include <libperf.h>
|
||||
#elif defined _XBOX
|
||||
#include "Xbox\Sentient\SentientManager.h"
|
||||
#include "Common\Network\WinsockNetLayer.h"
|
||||
#include "StatsCounter.h"
|
||||
#include "Xbox\Social\SocialManager.h"
|
||||
#include "Xbox\Sentient\DynamicConfigurations.h"x
|
||||
#include "Common\Network\IQNet.h"
|
||||
#else
|
||||
#include "Orbis\Sentient\SentientManager.h"
|
||||
#include "StatsCounter.h"
|
||||
@@ -36,6 +43,7 @@
|
||||
#include <perf.h>
|
||||
#endif
|
||||
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#if !defined(__PS3__) && !defined(__ORBIS__) && !defined(__PSVITA__)
|
||||
#ifdef _WINDOWS64
|
||||
//C4JStorage StorageManager;
|
||||
@@ -189,133 +197,6 @@ D3DXVECTOR3::D3DXVECTOR3() {}
|
||||
D3DXVECTOR3::D3DXVECTOR3(float x,float y,float z) : x(x), y(y), z(z) {}
|
||||
D3DXVECTOR3& D3DXVECTOR3::operator += ( CONST D3DXVECTOR3& add ) { x += add.x; y += add.y; z += add.z; return *this; }
|
||||
|
||||
BYTE IQNetPlayer::GetSmallId() { return m_smallId; }
|
||||
void IQNetPlayer::SendData(IQNetPlayer *player, const void *pvData, DWORD dwDataSize, DWORD dwFlags)
|
||||
{
|
||||
if (WinsockNetLayer::IsActive())
|
||||
{
|
||||
WinsockNetLayer::SendToSmallId(player->m_smallId, pvData, dwDataSize);
|
||||
}
|
||||
}
|
||||
bool IQNetPlayer::IsSameSystem(IQNetPlayer *player) { return (this == player) || (!m_isRemote && !player->m_isRemote); }
|
||||
DWORD IQNetPlayer::GetSendQueueSize( IQNetPlayer *player, DWORD dwFlags ) { return 0; }
|
||||
DWORD IQNetPlayer::GetCurrentRtt() { return 0; }
|
||||
bool IQNetPlayer::IsHost() { return m_isHostPlayer; }
|
||||
bool IQNetPlayer::IsGuest() { return false; }
|
||||
bool IQNetPlayer::IsLocal() { return !m_isRemote; }
|
||||
PlayerUID IQNetPlayer::GetXuid() { return (PlayerUID)(0xe000d45248242f2e + m_smallId); }
|
||||
LPCWSTR IQNetPlayer::GetGamertag() { return m_gamertag; }
|
||||
int IQNetPlayer::GetSessionIndex() { return m_smallId; }
|
||||
bool IQNetPlayer::IsTalking() { return false; }
|
||||
bool IQNetPlayer::IsMutedByLocalUser(DWORD dwUserIndex) { return false; }
|
||||
bool IQNetPlayer::HasVoice() { return false; }
|
||||
bool IQNetPlayer::HasCamera() { return false; }
|
||||
int IQNetPlayer::GetUserIndex() { return this - &IQNet::m_player[0]; }
|
||||
void IQNetPlayer::SetCustomDataValue(ULONG_PTR ulpCustomDataValue) {
|
||||
m_customData = ulpCustomDataValue;
|
||||
}
|
||||
ULONG_PTR IQNetPlayer::GetCustomDataValue() {
|
||||
return m_customData;
|
||||
}
|
||||
|
||||
IQNetPlayer IQNet::m_player[MINECRAFT_NET_MAX_PLAYERS];
|
||||
DWORD IQNet::s_playerCount = 1;
|
||||
bool IQNet::s_isHosting = true;
|
||||
|
||||
QNET_STATE _iQNetStubState = QNET_STATE_IDLE;
|
||||
|
||||
void Win64_SetupRemoteQNetPlayer(IQNetPlayer *player, BYTE smallId, bool isHost, bool isLocal)
|
||||
{
|
||||
player->m_smallId = smallId;
|
||||
player->m_isRemote = !isLocal;
|
||||
player->m_isHostPlayer = isHost;
|
||||
swprintf(player->m_gamertag, 32, L"Player%d", smallId);
|
||||
if (smallId >= IQNet::s_playerCount)
|
||||
IQNet::s_playerCount = smallId + 1;
|
||||
}
|
||||
|
||||
HRESULT IQNet::AddLocalPlayerByUserIndex(DWORD dwUserIndex){ return S_OK; }
|
||||
IQNetPlayer *IQNet::GetHostPlayer() { return &m_player[0]; }
|
||||
IQNetPlayer *IQNet::GetLocalPlayerByUserIndex(DWORD dwUserIndex)
|
||||
{
|
||||
if (s_isHosting)
|
||||
{
|
||||
if (dwUserIndex < MINECRAFT_NET_MAX_PLAYERS && !m_player[dwUserIndex].m_isRemote)
|
||||
return &m_player[dwUserIndex];
|
||||
return NULL;
|
||||
}
|
||||
if (dwUserIndex != 0)
|
||||
return NULL;
|
||||
for (DWORD i = 0; i < s_playerCount; i++)
|
||||
{
|
||||
if (!m_player[i].m_isRemote)
|
||||
return &m_player[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
static bool Win64_IsActivePlayer(IQNetPlayer *p, DWORD index)
|
||||
{
|
||||
if (index == 0) return true;
|
||||
return (p->GetCustomDataValue() != 0);
|
||||
}
|
||||
|
||||
IQNetPlayer *IQNet::GetPlayerByIndex(DWORD dwPlayerIndex)
|
||||
{
|
||||
DWORD found = 0;
|
||||
for (DWORD i = 0; i < s_playerCount; i++)
|
||||
{
|
||||
if (Win64_IsActivePlayer(&m_player[i], i))
|
||||
{
|
||||
if (found == dwPlayerIndex) return &m_player[i];
|
||||
found++;
|
||||
}
|
||||
}
|
||||
return &m_player[0];
|
||||
}
|
||||
IQNetPlayer *IQNet::GetPlayerBySmallId(BYTE SmallId)
|
||||
{
|
||||
for (DWORD i = 0; i < s_playerCount; i++)
|
||||
{
|
||||
if (m_player[i].m_smallId == SmallId && Win64_IsActivePlayer(&m_player[i], i)) return &m_player[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
IQNetPlayer *IQNet::GetPlayerByXuid(PlayerUID xuid)
|
||||
{
|
||||
for (DWORD i = 0; i < s_playerCount; i++)
|
||||
{
|
||||
if (Win64_IsActivePlayer(&m_player[i], i) && m_player[i].GetXuid() == xuid) return &m_player[i];
|
||||
}
|
||||
return &m_player[0];
|
||||
}
|
||||
DWORD IQNet::GetPlayerCount()
|
||||
{
|
||||
DWORD count = 0;
|
||||
for (DWORD i = 0; i < s_playerCount; i++)
|
||||
{
|
||||
if (Win64_IsActivePlayer(&m_player[i], i)) count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
QNET_STATE IQNet::GetState() { return _iQNetStubState; }
|
||||
bool IQNet::IsHost() { return s_isHosting; }
|
||||
HRESULT IQNet::JoinGameFromInviteInfo(DWORD dwUserIndex, DWORD dwUserMask, const INVITE_INFO *pInviteInfo) { return S_OK; }
|
||||
void IQNet::HostGame() { _iQNetStubState = QNET_STATE_SESSION_STARTING; s_isHosting = true; }
|
||||
void IQNet::ClientJoinGame() { _iQNetStubState = QNET_STATE_SESSION_STARTING; s_isHosting = false; }
|
||||
void IQNet::EndGame()
|
||||
{
|
||||
_iQNetStubState = QNET_STATE_IDLE;
|
||||
s_isHosting = false;
|
||||
s_playerCount = 1;
|
||||
for (int i = 1; i < MINECRAFT_NET_MAX_PLAYERS; i++)
|
||||
{
|
||||
m_player[i].m_smallId = 0;
|
||||
m_player[i].m_isRemote = false;
|
||||
m_player[i].m_isHostPlayer = false;
|
||||
m_player[i].m_gamertag[0] = 0;
|
||||
m_player[i].SetCustomDataValue(0);
|
||||
}
|
||||
}
|
||||
DWORD MinecraftDynamicConfigurations::GetTrialTime() { return DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; }
|
||||
|
||||
void XSetThreadProcessor(HANDLE a, int b) {}
|
||||
@@ -537,6 +418,135 @@ void C_4JProfile::Initialise( DWORD dwTitleID,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // DISABLE_XBLIVE
|
||||
BYTE IQNetPlayer::GetSmallId() { return m_smallId; }
|
||||
void IQNetPlayer::SendData(IQNetPlayer *player, const void *pvData, DWORD dwDataSize, DWORD dwFlags)
|
||||
{
|
||||
if (WinsockNetLayer::IsActive())
|
||||
{
|
||||
WinsockNetLayer::SendToSmallId(player->m_smallId, pvData, dwDataSize);
|
||||
}
|
||||
}
|
||||
bool IQNetPlayer::IsSameSystem(IQNetPlayer *player) { return (this == player) || (!m_isRemote && !player->m_isRemote); }
|
||||
DWORD IQNetPlayer::GetSendQueueSize( IQNetPlayer *player, DWORD dwFlags ) { return 0; }
|
||||
DWORD IQNetPlayer::GetCurrentRtt() { return 0; }
|
||||
bool IQNetPlayer::IsHost() { return m_isHostPlayer; }
|
||||
bool IQNetPlayer::IsGuest() { return false; }
|
||||
bool IQNetPlayer::IsLocal() { return !m_isRemote; }
|
||||
PlayerUID IQNetPlayer::GetXuid() { return (PlayerUID)(0xe000d45248242f2e + m_smallId); }
|
||||
LPCWSTR IQNetPlayer::GetGamertag() { return m_gamertag; }
|
||||
int IQNetPlayer::GetSessionIndex() { return m_smallId; }
|
||||
bool IQNetPlayer::IsTalking() { return false; }
|
||||
bool IQNetPlayer::IsMutedByLocalUser(DWORD dwUserIndex) { return false; }
|
||||
bool IQNetPlayer::HasVoice() { return false; }
|
||||
bool IQNetPlayer::HasCamera() { return false; }
|
||||
int IQNetPlayer::GetUserIndex() { return this - &IQNet::m_player[0]; }
|
||||
void IQNetPlayer::SetCustomDataValue(ULONG_PTR ulpCustomDataValue) {
|
||||
m_customData = ulpCustomDataValue;
|
||||
}
|
||||
ULONG_PTR IQNetPlayer::GetCustomDataValue() {
|
||||
return m_customData;
|
||||
}
|
||||
|
||||
IQNetPlayer IQNet::m_player[MINECRAFT_NET_MAX_PLAYERS];
|
||||
DWORD IQNet::s_playerCount = 1;
|
||||
bool IQNet::s_isHosting = true;
|
||||
|
||||
QNET_STATE _iQNetStubState = QNET_STATE_IDLE;
|
||||
|
||||
void Win64_SetupRemoteQNetPlayer(IQNetPlayer *player, BYTE smallId, bool isHost, bool isLocal)
|
||||
{
|
||||
player->m_smallId = smallId;
|
||||
player->m_isRemote = !isLocal;
|
||||
player->m_isHostPlayer = isHost;
|
||||
swprintf(player->m_gamertag, 32, L"Player%d", smallId);
|
||||
if (smallId >= IQNet::s_playerCount)
|
||||
IQNet::s_playerCount = smallId + 1;
|
||||
}
|
||||
|
||||
HRESULT IQNet::AddLocalPlayerByUserIndex(DWORD dwUserIndex){ return S_OK; }
|
||||
IQNetPlayer *IQNet::GetHostPlayer() { return &m_player[0]; }
|
||||
IQNetPlayer *IQNet::GetLocalPlayerByUserIndex(DWORD dwUserIndex)
|
||||
{
|
||||
if (s_isHosting)
|
||||
{
|
||||
if (dwUserIndex < MINECRAFT_NET_MAX_PLAYERS && !m_player[dwUserIndex].m_isRemote)
|
||||
return &m_player[dwUserIndex];
|
||||
return NULL;
|
||||
}
|
||||
if (dwUserIndex != 0)
|
||||
return NULL;
|
||||
for (DWORD i = 0; i < s_playerCount; i++)
|
||||
{
|
||||
if (!m_player[i].m_isRemote)
|
||||
return &m_player[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
static bool Win64_IsActivePlayer(IQNetPlayer *p, DWORD index)
|
||||
{
|
||||
if (index == 0) return true;
|
||||
return (p->GetCustomDataValue() != 0);
|
||||
}
|
||||
|
||||
IQNetPlayer *IQNet::GetPlayerByIndex(DWORD dwPlayerIndex)
|
||||
{
|
||||
DWORD found = 0;
|
||||
for (DWORD i = 0; i < s_playerCount; i++)
|
||||
{
|
||||
if (Win64_IsActivePlayer(&m_player[i], i))
|
||||
{
|
||||
if (found == dwPlayerIndex) return &m_player[i];
|
||||
found++;
|
||||
}
|
||||
}
|
||||
return &m_player[0];
|
||||
}
|
||||
IQNetPlayer *IQNet::GetPlayerBySmallId(BYTE SmallId)
|
||||
{
|
||||
for (DWORD i = 0; i < s_playerCount; i++)
|
||||
{
|
||||
if (m_player[i].m_smallId == SmallId && Win64_IsActivePlayer(&m_player[i], i)) return &m_player[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
IQNetPlayer *IQNet::GetPlayerByXuid(PlayerUID xuid)
|
||||
{
|
||||
for (DWORD i = 0; i < s_playerCount; i++)
|
||||
{
|
||||
if (Win64_IsActivePlayer(&m_player[i], i) && m_player[i].GetXuid() == xuid) return &m_player[i];
|
||||
}
|
||||
return &m_player[0];
|
||||
}
|
||||
DWORD IQNet::GetPlayerCount()
|
||||
{
|
||||
DWORD count = 0;
|
||||
for (DWORD i = 0; i < s_playerCount; i++)
|
||||
{
|
||||
if (Win64_IsActivePlayer(&m_player[i], i)) count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
QNET_STATE IQNet::GetState() { return _iQNetStubState; }
|
||||
bool IQNet::IsHost() { return s_isHosting; }
|
||||
HRESULT IQNet::JoinGameFromInviteInfo(DWORD dwUserIndex, DWORD dwUserMask, const INVITE_INFO *pInviteInfo) { return S_OK; }
|
||||
void IQNet::HostGame() { _iQNetStubState = QNET_STATE_SESSION_STARTING; s_isHosting = true; }
|
||||
void IQNet::ClientJoinGame() { _iQNetStubState = QNET_STATE_SESSION_STARTING; s_isHosting = false; }
|
||||
void IQNet::EndGame()
|
||||
{
|
||||
_iQNetStubState = QNET_STATE_IDLE;
|
||||
s_isHosting = false;
|
||||
s_playerCount = 1;
|
||||
for (int i = 1; i < MINECRAFT_NET_MAX_PLAYERS; i++)
|
||||
{
|
||||
m_player[i].m_smallId = 0;
|
||||
m_player[i].m_isRemote = false;
|
||||
m_player[i].m_isHostPlayer = false;
|
||||
m_player[i].m_gamertag[0] = 0;
|
||||
m_player[i].SetCustomDataValue(0);
|
||||
}
|
||||
}
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#if defined _WINDOWS64 || (defined(__PS3__) && defined(DISABLE_PSN))
|
||||
void C_4JProfile::SetTrialTextStringTable(CXuiStringTable *pStringTable,int iAccept,int iReject) {}
|
||||
void C_4JProfile::SetTrialAwardText(eAwardType AwardType,int iTitle,int iText) {}
|
||||
@@ -757,4 +767,5 @@ void StatsCounter::WipeLeaderboards() {}
|
||||
|
||||
#ifdef __PS3__
|
||||
bool C_4JProfile::IsFullVersion() { return true; }
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="ContentPackage_NO_TU|Durango">
|
||||
@@ -988,7 +988,7 @@
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;NDEBUG;_XBOX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DISABLE_XBLIVE;_ITERATOR_DEBUG_LEVEL=0;NDEBUG;_XBOX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
@@ -3190,6 +3190,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<FileType>XML</FileType>
|
||||
<SubType>Designer</SubType>
|
||||
</Xml>
|
||||
<None Include="ClassDiagram1.cd" />
|
||||
<None Include="Common\Postbuilds\Durango-postbuild.ps1" />
|
||||
<None Include="Common\Postbuilds\Orbis-postbuild.ps1" />
|
||||
<None Include="Common\Postbuilds\PS3-postbuild.ps1" />
|
||||
@@ -5103,6 +5104,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\Network\GameNetworkManager.h" />
|
||||
<ClInclude Include="Common\Network\IQNet.h" />
|
||||
<ClInclude Include="Common\Network\NetworkPlayerInterface.h" />
|
||||
<ClInclude Include="Common\Network\PlatformNetworkManagerInterface.h" />
|
||||
<ClInclude Include="Common\Network\PlatformNetworkManagerStub.h">
|
||||
@@ -5111,7 +5113,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|PS3'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|PSVita'">true</ExcludedFromBuild>
|
||||
@@ -18982,7 +18984,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|x64'">false</ExcludedFromBuild>
|
||||
@@ -19982,7 +19984,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ORBIS'">true</ExcludedFromBuild>
|
||||
@@ -20092,6 +20094,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Xbox\Resource.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">true</ExcludedFromBuild>
|
||||
@@ -25273,7 +25276,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|PS3'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|PSVita'">true</ExcludedFromBuild>
|
||||
@@ -29969,7 +29972,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ClCompile Include="ExplodeParticle.cpp" />
|
||||
<ClCompile Include="Extrax64Stubs.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
|
||||
@@ -34037,7 +34040,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|ORBIS'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|ORBIS'">true</ExcludedFromBuild>
|
||||
@@ -34369,7 +34372,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ORBIS'">true</ExcludedFromBuild>
|
||||
@@ -34478,6 +34481,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Xbox\Sentient\DynamicConfigurations.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
|
||||
@@ -726,6 +726,9 @@
|
||||
<Filter Include="net\minecraft\client\resources">
|
||||
<UniqueIdentifier>{889a84db-3009-4a7c-8234-4bf93d412690}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Windows64\Network">
|
||||
<UniqueIdentifier>{a86cfe95-eafc-414e-8ba4-190ff049fde4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
@@ -890,6 +893,7 @@
|
||||
<None Include="Common\Postbuilds\Windows64-postbuild.ps1" />
|
||||
<None Include="Common\Postbuilds\Xbox-postbuild.ps1" />
|
||||
<None Include="Common\Postbuilds\PSVita-postbuild.ps1" />
|
||||
<None Include="ClassDiagram1.cd" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
@@ -3778,6 +3782,9 @@
|
||||
<ClInclude Include="Common\Network\WinsockNetLayer.h">
|
||||
<Filter>Common\Source Files\Network</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\Network\IQNet.h">
|
||||
<Filter>Common\Source Files\Network</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
|
||||
@@ -171,26 +171,26 @@ void PendingConnection::handleLogin(shared_ptr<LoginPacket> packet)
|
||||
{
|
||||
vector<shared_ptr<ServerPlayer> > &pl = server->getPlayers()->players;
|
||||
|
||||
for (unsigned int i = 0; i < pl.size(); i++)
|
||||
{
|
||||
if (pl[i] != NULL && pl[i]->name == name)
|
||||
{
|
||||
nameTaken = true;
|
||||
break;
|
||||
}
|
||||
for (unsigned int i = 0; i < pl.size(); i++)
|
||||
{
|
||||
if (pl[i] != NULL && pl[i]->name == name)
|
||||
{
|
||||
nameTaken = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (nameTaken)
|
||||
{
|
||||
app.DebugPrintf("Rejecting duplicate name: %ls\n", name.c_str());
|
||||
|
||||
// to do: replace this with a dedicated duplicate name
|
||||
// message
|
||||
disconnect(DisconnectPacket::eDisconnect_Banned);
|
||||
}
|
||||
else
|
||||
{
|
||||
handleAcceptedLogin(packet);
|
||||
if (nameTaken)
|
||||
{
|
||||
app.DebugPrintf("Rejecting duplicate name: %ls\n", name.c_str());
|
||||
|
||||
// to do: replace this with a dedicated duplicate name
|
||||
// message
|
||||
disconnect(DisconnectPacket::eDisconnect_Banned);
|
||||
}
|
||||
else
|
||||
{
|
||||
handleAcceptedLogin(packet);
|
||||
}
|
||||
}
|
||||
//else
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
#include "PlayerList.h"
|
||||
#include "EntityTracker.h"
|
||||
#include "PlayerChunkMap.h"
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#include <qnet.h>
|
||||
#endif
|
||||
|
||||
TrackedEntity::TrackedEntity(shared_ptr<Entity> e, int range, int updateInterval, bool trackDelta)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
using namespace std;
|
||||
#include <vector>
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#include <qnet.h>
|
||||
#endif
|
||||
#include "..\..\..\Minecraft.World\C4JThread.h"
|
||||
#include "..\..\Common\Network\NetworkPlayerInterface.h"
|
||||
#include "..\..\Common\Network\PlatformNetworkManagerInterface.h"
|
||||
|
||||
@@ -24,7 +24,11 @@
|
||||
#include "..\..\Minecraft.Client\StatsCounter.h"
|
||||
#include "..\ConnectScreen.h"
|
||||
#include "Social\SocialManager.h"
|
||||
#include "Leaderboards\XboxLeaderboardManager.h"
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#include "Leaderboards\XboxLeaderboardManager.h"
|
||||
#else
|
||||
#include "..\Windows64\Leaderboards\WindowsLeaderboardManager.h"
|
||||
#endif
|
||||
#include "..\Common\XUI\XUI_Scene_Container.h"
|
||||
#include "..\..\Minecraft.Client\Tesselator.h"
|
||||
#include "..\..\Minecraft.Client\Options.h"
|
||||
|
||||
@@ -101,10 +101,17 @@ using namespace DirectX;
|
||||
#include <xuiapp.h>
|
||||
#include <xact3.h>
|
||||
#include <xact3d3.h>
|
||||
#ifdef _DISABLE_XBLIVE
|
||||
typedef ULONGLONG PlayerUID;
|
||||
typedef ULONGLONG SessionID;
|
||||
typedef PlayerUID GameSessionUID;
|
||||
class INVITE_INFO;
|
||||
#else
|
||||
typedef XINVITE_INFO INVITE_INFO;
|
||||
typedef XUID PlayerUID;
|
||||
typedef XNKID SessionID;
|
||||
typedef XUID GameSessionUID;
|
||||
#endif // _DISABLE_XBLIVE
|
||||
#define HRESULT_SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)
|
||||
|
||||
#include "..\Minecraft.Client\xbox\network\extra.h"
|
||||
@@ -231,7 +238,11 @@ typedef XUID GameSessionUID;
|
||||
#include "Xbox\GameConfig\Minecraft.spa.h"
|
||||
#include "XboxMedia\4J_strings.h"
|
||||
#include "Xbox\XML\ATGXmlParser.h"
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#include "Xbox\Leaderboards\XboxLeaderboardManager.h"
|
||||
#else
|
||||
#include "Windows64\Leaderboards\WindowsLeaderboardManager.h"
|
||||
#endif
|
||||
#include "Xbox\Social\SocialManager.h"
|
||||
#include "Xbox\Audio\SoundEngine.h"
|
||||
#include "Xbox\Xbox_UIController.h"
|
||||
@@ -292,7 +303,7 @@ typedef XUID GameSessionUID;
|
||||
#include "PSVita\Iggy\include\iggy.h"
|
||||
#include "PSVita\Iggy\gdraw\gdraw_psp2.h"
|
||||
#include "PSVita\PSVita_UIController.h"
|
||||
#else
|
||||
#elif !defined _XBOX
|
||||
#include "Orbis\Sentient\MinecraftTelemetry.h"
|
||||
#include "OrbisMedia\strings.h"
|
||||
#include "Orbis\Orbis_App.h"
|
||||
@@ -349,4 +360,4 @@ typedef XUID GameSessionUID;
|
||||
#define OutputDebugStringW BREAKTHECOMPILE
|
||||
#endif
|
||||
|
||||
void MemSect(int sect);
|
||||
void MemSect(int sect);
|
||||
@@ -255,7 +255,7 @@ bool Connection::writeTick()
|
||||
// 4J Stu - Changed this so that rather than writing to the network stream through a buffered stream we want to:
|
||||
// a) Only push whole "game" packets to QNet, rather than amalgamated chunks of data that may include many packets, and partial packets
|
||||
// b) To be able to change the priority and queue of a packet if required
|
||||
#ifdef _XBOX
|
||||
#if defined _XBOX && !defined _DISABLE_XBLIVE
|
||||
int flags = QNET_SENDDATA_LOW_PRIORITY | QNET_SENDDATA_SECONDARY;
|
||||
#else
|
||||
int flags = NON_QNET_SENDDATA_ACK_REQUIRED;
|
||||
|
||||
@@ -589,6 +589,7 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">
|
||||
<OutputFile>$(OutDir)$(ProjectName).lib</OutputFile>
|
||||
<IncludePath>$(Xbox360TechPreviewInclude);$(XDKInstallDir)\include\xbox;</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">
|
||||
<OutputFile>$(OutDir)$(ProjectName).lib</OutputFile>
|
||||
@@ -884,7 +885,7 @@
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_ITERATOR_DEBUG_LEVEL=0;NDEBUG;_XBOX;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DISABLE_XBLIVE;_ITERATOR_DEBUG_LEVEL=0;NDEBUG;_XBOX;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<ShowIncludes>false</ShowIncludes>
|
||||
<UseFullPaths>false</UseFullPaths>
|
||||
@@ -2589,7 +2590,9 @@
|
||||
<ClInclude Include="WoolCarpetTile.h" />
|
||||
<ClInclude Include="WorldlyContainer.h" />
|
||||
<ClInclude Include="WrittenBookItem.h" />
|
||||
<ClInclude Include="x64headers\extraX64.h" />
|
||||
<ClInclude Include="x64headers\extraX64.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">false</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="x64headers\qnet.h" />
|
||||
<ClInclude Include="x64headers\xmcore.h" />
|
||||
<ClInclude Include="x64headers\xrnm.h" />
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
#include "net.minecraft.world.entity.player.h"
|
||||
#include "..\Minecraft.Client\ServerPlayer.h"
|
||||
#include "..\Minecraft.Client\PlayerConnection.h"
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#include <qnet.h>
|
||||
#endif
|
||||
#include "PacketListener.h"
|
||||
#include "InputOutputStream.h"
|
||||
#include "PlayerInfoPacket.h"
|
||||
|
||||
@@ -500,7 +500,7 @@ void Socket::SocketOutputStreamNetwork::writeWithFlags(byteArray b, unsigned int
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef _XBOX
|
||||
#if defined _XBOX && !defined _DISABLE_XBLIVE
|
||||
bool lowPriority = ( ( flags & QNET_SENDDATA_LOW_PRIORITY ) == QNET_SENDDATA_LOW_PRIORITY );
|
||||
bool requireAck = lowPriority;
|
||||
#else
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#pragma once
|
||||
#include <xrnm.h>
|
||||
#include <queue>
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#include <qnet.h>
|
||||
#endif
|
||||
#include "InputStream.h"
|
||||
#include "OutputStream.h"
|
||||
|
||||
|
||||
@@ -53,10 +53,17 @@ using namespace DirectX;
|
||||
#include <xboxmath.h>
|
||||
#include <xuiapp.h>
|
||||
#include <xact3.h>
|
||||
#ifdef _DISABLE_XBLIVE
|
||||
typedef ULONGLONG PlayerUID;
|
||||
typedef ULONGLONG SessionID;
|
||||
typedef PlayerUID GameSessionUID;
|
||||
class INVITE_INFO;
|
||||
#else
|
||||
typedef XINVITE_INFO INVITE_INFO;
|
||||
typedef XUID PlayerUID;
|
||||
typedef XNKID SessionID;
|
||||
typedef XUID GameSessionUID;
|
||||
#endif // _DISABLE_XBLIVE
|
||||
#endif
|
||||
|
||||
#ifdef __PS3__
|
||||
|
||||
Reference in New Issue
Block a user