forked from pieeebot/cafeberry
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce3e83039d | ||
|
|
42f09f93e5 | ||
|
|
9f8dab8ebb | ||
|
|
bd6eca9d44 | ||
|
|
236e3a80f6 | ||
|
|
689848ac45 | ||
|
|
b7e90137b9 | ||
|
|
14ceff64d9 | ||
|
|
5600ce994b | ||
|
|
766888e6d5 | ||
|
|
5febd74496 |
@@ -7,6 +7,12 @@ on:
|
||||
description: 'Configuration for the build (e.g. Debug, Release).'
|
||||
required: true
|
||||
default: 'Release'
|
||||
type: choice
|
||||
options:
|
||||
- Debug
|
||||
- Release
|
||||
- ContentPackage
|
||||
- ReleaseForArt
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -14,27 +20,32 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ORBIS]
|
||||
platform: [Orbis]
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
lfs: false
|
||||
|
||||
- name: Build Cafeberry
|
||||
run: |
|
||||
$platform = if ("${{ matrix.platform }}" -eq "Orbis") { "ORBIS" }
|
||||
|
||||
& "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" MinecraftConsoles.sln `
|
||||
/p:Configuration=${{ inputs.configuration }} `
|
||||
/p:Platform=${{ matrix.platform }} `
|
||||
"/p:Platform=$platform" `
|
||||
/m
|
||||
|
||||
- name: Zip Build (Consoles)
|
||||
if: matrix.platform != 'Windows64'
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./${{ matrix.platform }}_${{ inputs.configuration }}/* "-x!*.ipdb" "-x!*.iobj"
|
||||
- name: Zip Build
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./${{ matrix.platform }}_${{ inputs.configuration }}/PS4_GAME/* "-x!*.ipdb" "-x!*.iobj"
|
||||
|
||||
- name: Stage artifacts
|
||||
run: |
|
||||
New-Item -ItemType Directory -Force -Path staging
|
||||
Copy-Item LCE${{ matrix.platform }}.zip staging/
|
||||
Copy-Item LCE${{ matrix.platform }}.zip staging/
|
||||
Copy-Item "./ORBIS_${{ inputs.configuration }}/Minecraft.Client.pkg" staging/LCEOrbis.pkg
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: https://github.com/actions/upload-artifact@v3
|
||||
|
||||
@@ -7,6 +7,12 @@ on:
|
||||
description: 'Configuration for the build (e.g. Debug, Release).'
|
||||
required: true
|
||||
default: 'Release'
|
||||
type: choice
|
||||
options:
|
||||
- Debug
|
||||
- Release
|
||||
- ContentPackage
|
||||
- ReleaseForArt
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -19,6 +25,9 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
lfs: false
|
||||
|
||||
- name: Build Cafeberry
|
||||
run: |
|
||||
@@ -27,8 +36,7 @@ jobs:
|
||||
/p:Platform=${{ matrix.platform }} `
|
||||
/m
|
||||
|
||||
- name: Zip Build (Consoles)
|
||||
if: matrix.platform != 'Windows64'
|
||||
- name: Zip Build
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./${{ matrix.platform }}_${{ inputs.configuration }}/* "-x!*.ipdb" "-x!*.iobj"
|
||||
|
||||
- name: Stage artifacts
|
||||
|
||||
@@ -7,6 +7,12 @@ on:
|
||||
description: 'Configuration for the build (e.g. Debug, Release).'
|
||||
required: true
|
||||
default: 'Release'
|
||||
type: choice
|
||||
options:
|
||||
- Debug
|
||||
- Release
|
||||
- ContentPackage
|
||||
- ReleaseForArt
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -19,6 +25,9 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
lfs: false
|
||||
|
||||
- name: Build Cafeberry
|
||||
run: |
|
||||
@@ -27,14 +36,14 @@ jobs:
|
||||
/p:Platform=${{ matrix.platform }} `
|
||||
/m
|
||||
|
||||
- name: Zip Build (Consoles)
|
||||
if: matrix.platform != 'Windows64'
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./${{ matrix.platform }}_${{ inputs.configuration }}/* "-x!*.ipdb" "-x!*.iobj"
|
||||
- name: Zip Build
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./${{ matrix.platform }}_${{ inputs.configuration }}/PSVITA_GAME/*
|
||||
|
||||
- name: Stage artifacts
|
||||
run: |
|
||||
New-Item -ItemType Directory -Force -Path staging
|
||||
Copy-Item LCE${{ matrix.platform }}.zip staging/
|
||||
Copy-Item LCE${{ matrix.platform }}.zip staging/
|
||||
Copy-Item "./PSVita_${{ inputs.configuration }}/Minecraft.Client.vpk" staging/LCEPSVita.vpk
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: https://github.com/actions/upload-artifact@v3
|
||||
|
||||
@@ -24,41 +24,58 @@ jobs:
|
||||
}
|
||||
|
||||
build:
|
||||
needs: validate
|
||||
runs-on: windows-2022
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
configuration: [Release]
|
||||
platform: [PS3, Windows64] #[PS3, PSVita, Xbox 360, ORBIS, Windows64]
|
||||
platform: [PS3, Windows64, Orbis] #[PS3, PSVita, Xbox360, ORBIS, Windows64]
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
lfs: false
|
||||
|
||||
- name: Build Cafeberry
|
||||
run: |
|
||||
$platform = if ("${{ matrix.platform }}" -eq "Xbox360") { "Xbox 360" } elseif ("${{ matrix.platform }}" -eq "Orbis") { "ORBIS" } else { "${{ matrix.platform }}" }
|
||||
|
||||
& "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" MinecraftConsoles.sln `
|
||||
/p:Configuration=${{ matrix.configuration }} `
|
||||
/p:Platform=${{ matrix.platform }} `
|
||||
"/p:Platform=$platform" `
|
||||
/m
|
||||
|
||||
- name: Zip Build (Consoles)
|
||||
if: matrix.platform != 'Windows64'
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./${{ matrix.platform }}_${{ matrix.configuration }}/* "-x!*.ipdb" "-x!*.iobj"
|
||||
|
||||
- name: Zip Build (Windows64)
|
||||
if: matrix.platform == 'Windows64'
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./x64/${{ matrix.configuration }}/* "-x!*.ipdb" "-x!*.iobj"
|
||||
- name: Zip Build
|
||||
run: |
|
||||
if ("${{ matrix.platform }}" -eq "Windows64") {
|
||||
7z a -r "LCEWindows64.zip" "./x64/${{ matrix.configuration }}/*" "-x!*.pdb" "-x!*.pch" "-x!*.ilk"
|
||||
} elseif ("${{ matrix.platform }}" -eq "Orbis") {
|
||||
7z a -r "LCEOrbis.zip" "./ORBIS_${{ matrix.configuration }}/PS4_GAME/*"
|
||||
} elseif ("${{ matrix.platform }}" -eq "PSVita") {
|
||||
7z a -r "LCEPSVita.zip" "./PSVita_${{ matrix.configuration }}/PSVITA_GAME/*"
|
||||
} elseif ("${{ matrix.platform }}" -eq "PS3") {
|
||||
7z a -r "LCEPS3.zip" "./PS3_${{ matrix.configuration }}/PS3_GAME/*"
|
||||
} elseif ("${{ matrix.platform }}" -eq "Xbox360") {
|
||||
7z a -r "LCEXbox360.zip" "./X360_${{ matrix.configuration }}/*" "-x!*.pdb" "-x!*.pch" "-x!*.xdb"
|
||||
} else {
|
||||
7z a -r "LCE${{ matrix.platform }}.zip" "./${{ matrix.platform }}/${{ matrix.configuration }}/*" "-x!*.ipdb" "-x!*.iobj" "-x!*.pdb" "-x!*.pch" "-x!*.ilk"
|
||||
}
|
||||
|
||||
- name: Stage artifacts
|
||||
run: |
|
||||
New-Item -ItemType Directory -Force -Path staging
|
||||
Copy-Item LCE${{ matrix.platform }}.zip staging/
|
||||
Copy-Item "LCE${{ matrix.platform }}.zip" staging/
|
||||
|
||||
- name: Stage exe
|
||||
if: matrix.platform == 'Windows64'
|
||||
run: |
|
||||
Copy-Item ./x64/${{ matrix.configuration }}/Minecraft.Client.exe staging/
|
||||
if ("${{ matrix.platform }}" -eq "Windows64") {
|
||||
Copy-Item "./x64/${{ matrix.configuration }}/Minecraft.Client.exe" staging/
|
||||
} elseif ("${{ matrix.platform }}" -eq "PSVita") {
|
||||
Copy-Item "./PSVita_${{ matrix.configuration }}/Minecraft.Client.vpk" staging/LCEPSVita.vpk
|
||||
} elseif ("${{ matrix.platform }}" -eq "Orbis") {
|
||||
Copy-Item "./ORBIS_${{ matrix.configuration }}/Minecraft.Client.pkg" staging/LCEOrbis.pkg
|
||||
}
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: https://github.com/actions/upload-artifact@v3
|
||||
@@ -88,9 +105,14 @@ jobs:
|
||||
} catch {
|
||||
$body = $fallback
|
||||
}
|
||||
} else {
|
||||
$body = $fallback
|
||||
}
|
||||
|
||||
"description<<EOF`n$body`nEOF" | Out-File -Append -Encoding utf8 -NoNewline:$false $env:GITHUB_OUTPUT
|
||||
$delimiter = "EOF_$([System.Guid]::NewGuid().ToString('N'))"
|
||||
"description<<$delimiter" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8NoBOM
|
||||
$body | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8NoBOM
|
||||
"$delimiter" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8NoBOM
|
||||
|
||||
- name: Publish Release
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
|
||||
@@ -7,6 +7,12 @@ on:
|
||||
description: 'Configuration for the build (e.g. Debug, Release).'
|
||||
required: true
|
||||
default: 'Release'
|
||||
type: choice
|
||||
options:
|
||||
- Debug
|
||||
- Release
|
||||
- ContentPackage
|
||||
- ReleaseForArt
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -19,6 +25,9 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
lfs: false
|
||||
|
||||
- name: Build Cafeberry
|
||||
run: |
|
||||
@@ -29,7 +38,7 @@ jobs:
|
||||
|
||||
- name: Zip Build (Consoles)
|
||||
if: matrix.platform != 'Windows64'
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./${{ matrix.platform }}_${{ inputs.configuration }}/* "-x!*.ipdb" "-x!*.iobj"
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./${{ matrix.platform }}_${{ inputs.configuration }}/* "-x!*.pdb" "-x!*.pch" "-x!*.ilk"
|
||||
|
||||
- name: Stage artifacts
|
||||
run: |
|
||||
|
||||
@@ -7,6 +7,12 @@ on:
|
||||
description: 'Configuration for the build (e.g. Debug, Release).'
|
||||
required: true
|
||||
default: 'Release'
|
||||
type: choice
|
||||
options:
|
||||
- Debug
|
||||
- Release
|
||||
- ContentPackage
|
||||
- ReleaseForArt
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -14,22 +20,27 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [Xbox 360]
|
||||
platform: [Xbox360]
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
lfs: false
|
||||
|
||||
- name: Build Cafeberry
|
||||
run: |
|
||||
$platform = if ("${{ matrix.platform }}" -eq "Xbox360") { "Xbox 360" }
|
||||
|
||||
& "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" MinecraftConsoles.sln `
|
||||
/p:Configuration=${{ inputs.configuration }} `
|
||||
/p:Platform=${{ matrix.platform }} `
|
||||
"/p:Platform=$platform" `
|
||||
/m
|
||||
|
||||
- name: Zip Build (Consoles)
|
||||
if: matrix.platform != 'Windows64'
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./${{ matrix.platform }}_${{ inputs.configuration }}/* "-x!*.ipdb" "-x!*.iobj"
|
||||
|
||||
- name: Zip Build
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./X360_${{ inputs.configuration }}/* "-x!*.pdb" "-x!*.pch" "-x!*.xdb"
|
||||
|
||||
- name: Stage artifacts
|
||||
run: |
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
#if defined _WINDOWS64 || defined DISABLE_PSN || defined _DISABLE_XBLIVE
|
||||
#include "Xbox\Network\NetworkPlayerXbox.h"
|
||||
#include "Common\Network\PlatformNetworkManagerStub.h"
|
||||
#include "Common\Network\PlatformNetworkManager.h"
|
||||
#endif
|
||||
|
||||
#ifdef _DURANGO
|
||||
|
||||
@@ -13,7 +13,7 @@ using namespace std;
|
||||
#elif defined _DURANGO
|
||||
#include "..\..\Durango\Network\PlatformNetworkManagerDurango.h"
|
||||
#else
|
||||
#include "PlatformNetworkManagerStub.h"
|
||||
#include "PlatformNetworkManager.h"
|
||||
#endif
|
||||
#include "SessionInfo.h"
|
||||
|
||||
|
||||
+81
-81
@@ -1,19 +1,19 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "WinsockNetLayer.h"
|
||||
#include "..\..\Common\Network\PlatformNetworkManagerStub.h"
|
||||
#include "NetworkSocketLayer.h"
|
||||
#include "..\..\Common\Network\PlatformNetworkManager.h"
|
||||
#include "..\..\..\Minecraft.World\Socket.h"
|
||||
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
SOCKET WinsockNetLayer::s_listenSocket = INVALID_SOCKET;
|
||||
SOCKET WinsockNetLayer::s_hostConnectionSocket = INVALID_SOCKET;
|
||||
SOCKET WinsockNetLayer::s_advertiseSock = INVALID_SOCKET;
|
||||
SOCKET WinsockNetLayer::s_discoverySock = INVALID_SOCKET;
|
||||
SOCKET NetworkSocketLayer::s_listenSocket = INVALID_SOCKET;
|
||||
SOCKET NetworkSocketLayer::s_hostConnectionSocket = INVALID_SOCKET;
|
||||
SOCKET NetworkSocketLayer::s_advertiseSock = INVALID_SOCKET;
|
||||
SOCKET NetworkSocketLayer::s_discoverySock = INVALID_SOCKET;
|
||||
#elif defined __PS3__ || defined __ORBIS__
|
||||
SOCKET WinsockNetLayer::s_listenSocket = -1;
|
||||
SOCKET WinsockNetLayer::s_hostConnectionSocket = -1;
|
||||
SOCKET WinsockNetLayer::s_advertiseSock = -1;
|
||||
SOCKET WinsockNetLayer::s_discoverySock = -1;
|
||||
SOCKET NetworkSocketLayer::s_listenSocket = -1;
|
||||
SOCKET NetworkSocketLayer::s_hostConnectionSocket = -1;
|
||||
SOCKET NetworkSocketLayer::s_advertiseSock = -1;
|
||||
SOCKET NetworkSocketLayer::s_discoverySock = -1;
|
||||
|
||||
#if defined __PS3__
|
||||
int closesocket(int s) { return socketclose(s); };
|
||||
@@ -22,50 +22,50 @@ void terminate_networking() { cellNetCtlTerm(); sys_net_finalize_network(); };
|
||||
int closesocket(int s) { return sceNetSocketClose(s); };
|
||||
int socketclose(int s) { return sceNetSocketClose(s); };
|
||||
void terminate_networking() {};
|
||||
#endif
|
||||
void WSACleanup() {};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
C4JThread* WinsockNetLayer::s_acceptThread = NULL;
|
||||
C4JThread* WinsockNetLayer::s_clientRecvThread = NULL;
|
||||
C4JThread* NetworkSocketLayer::s_acceptThread = NULL;
|
||||
C4JThread* NetworkSocketLayer::s_clientRecvThread = NULL;
|
||||
|
||||
bool WinsockNetLayer::s_isHost = false;
|
||||
bool WinsockNetLayer::s_connected = false;
|
||||
bool WinsockNetLayer::s_active = false;
|
||||
bool WinsockNetLayer::s_initialized = false;
|
||||
bool NetworkSocketLayer::s_isHost = false;
|
||||
bool NetworkSocketLayer::s_connected = false;
|
||||
bool NetworkSocketLayer::s_active = false;
|
||||
bool NetworkSocketLayer::s_initialized = false;
|
||||
|
||||
BYTE WinsockNetLayer::s_localSmallId = 0;
|
||||
BYTE WinsockNetLayer::s_hostSmallId = 0;
|
||||
BYTE WinsockNetLayer::s_nextSmallId = 1;
|
||||
BYTE NetworkSocketLayer::s_localSmallId = 0;
|
||||
BYTE NetworkSocketLayer::s_hostSmallId = 0;
|
||||
BYTE NetworkSocketLayer::s_nextSmallId = 1;
|
||||
|
||||
CRITICAL_SECTION WinsockNetLayer::s_sendLock;
|
||||
CRITICAL_SECTION WinsockNetLayer::s_connectionsLock;
|
||||
CRITICAL_SECTION NetworkSocketLayer::s_sendLock;
|
||||
CRITICAL_SECTION NetworkSocketLayer::s_connectionsLock;
|
||||
|
||||
std::vector<Win64RemoteConnection> WinsockNetLayer::s_connections;
|
||||
std::vector<RemoteConnection> NetworkSocketLayer::s_connections;
|
||||
|
||||
C4JThread* WinsockNetLayer::s_advertiseThread = NULL;
|
||||
volatile bool WinsockNetLayer::s_advertising = false;
|
||||
Win64LANBroadcast WinsockNetLayer::s_advertiseData = {};
|
||||
CRITICAL_SECTION WinsockNetLayer::s_advertiseLock;
|
||||
int WinsockNetLayer::s_hostGamePort = WIN64_NET_DEFAULT_PORT;
|
||||
C4JThread* NetworkSocketLayer::s_advertiseThread = NULL;
|
||||
volatile bool NetworkSocketLayer::s_advertising = false;
|
||||
LANBroadcast NetworkSocketLayer::s_advertiseData = {};
|
||||
CRITICAL_SECTION NetworkSocketLayer::s_advertiseLock;
|
||||
int NetworkSocketLayer::s_hostGamePort = NETWORK_LAN_DEFAULT_PORT;
|
||||
|
||||
C4JThread* WinsockNetLayer::s_discoveryThread = NULL;
|
||||
volatile bool WinsockNetLayer::s_discovering = false;
|
||||
CRITICAL_SECTION WinsockNetLayer::s_discoveryLock;
|
||||
std::vector<Win64LANSession> WinsockNetLayer::s_discoveredSessions;
|
||||
C4JThread* NetworkSocketLayer::s_discoveryThread = NULL;
|
||||
volatile bool NetworkSocketLayer::s_discovering = false;
|
||||
CRITICAL_SECTION NetworkSocketLayer::s_discoveryLock;
|
||||
std::vector<LANSession> NetworkSocketLayer::s_discoveredSessions;
|
||||
|
||||
CRITICAL_SECTION WinsockNetLayer::s_disconnectLock;
|
||||
std::vector<BYTE> WinsockNetLayer::s_disconnectedSmallIds;
|
||||
CRITICAL_SECTION NetworkSocketLayer::s_disconnectLock;
|
||||
std::vector<BYTE> NetworkSocketLayer::s_disconnectedSmallIds;
|
||||
|
||||
CRITICAL_SECTION WinsockNetLayer::s_freeSmallIdLock;
|
||||
std::vector<BYTE> WinsockNetLayer::s_freeSmallIds;
|
||||
CRITICAL_SECTION NetworkSocketLayer::s_freeSmallIdLock;
|
||||
std::vector<BYTE> NetworkSocketLayer::s_freeSmallIds;
|
||||
|
||||
bool g_Win64MultiplayerHost = false;
|
||||
bool g_Win64MultiplayerJoin = true;
|
||||
int g_Win64MultiplayerPort = WIN64_NET_DEFAULT_PORT;
|
||||
char g_Win64MultiplayerIP[256] = "127.0.0.1";
|
||||
bool g_MultiplayerHost = false;
|
||||
bool g_MultiplayerJoin = true;
|
||||
int g_MultiplayerPort = NETWORK_LAN_DEFAULT_PORT;
|
||||
char g_MultiplayerIP[256] = "127.0.0.1";
|
||||
|
||||
bool WinsockNetLayer::Initialize()
|
||||
bool NetworkSocketLayer::Initialize()
|
||||
{
|
||||
if (s_initialized) return true;
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
@@ -105,7 +105,7 @@ bool WinsockNetLayer::Initialize()
|
||||
return true;
|
||||
}
|
||||
|
||||
void WinsockNetLayer::Shutdown()
|
||||
void NetworkSocketLayer::Shutdown()
|
||||
{
|
||||
StopAdvertising();
|
||||
StopDiscovery();
|
||||
@@ -185,7 +185,7 @@ void WinsockNetLayer::Shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
bool WinsockNetLayer::HostGame(int port)
|
||||
bool NetworkSocketLayer::HostGame(int port)
|
||||
{
|
||||
if (!s_initialized && !Initialize()) return false;
|
||||
|
||||
@@ -322,7 +322,7 @@ bool WinsockNetLayer::HostGame(int port)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WinsockNetLayer::JoinGame(const char *ip, int port)
|
||||
bool NetworkSocketLayer::JoinGame(const char *ip, int port)
|
||||
{
|
||||
if (!s_initialized && !Initialize()) return false;
|
||||
|
||||
@@ -704,7 +704,7 @@ bool WinsockNetLayer::JoinGame(const char *ip, int port)
|
||||
}
|
||||
|
||||
|
||||
bool WinsockNetLayer::SendOnSocket(SOCKET sock, const void *data, int dataSize)
|
||||
bool NetworkSocketLayer::SendOnSocket(SOCKET sock, const void *data, int dataSize)
|
||||
{
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
if (sock == INVALID_SOCKET || dataSize <= 0) return false;
|
||||
@@ -758,7 +758,7 @@ bool WinsockNetLayer::SendOnSocket(SOCKET sock, const void *data, int dataSize)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WinsockNetLayer::SendToSmallId(BYTE targetSmallId, const void *data, int dataSize)
|
||||
bool NetworkSocketLayer::SendToSmallId(BYTE targetSmallId, const void *data, int dataSize)
|
||||
{
|
||||
if (!s_active) return false;
|
||||
|
||||
@@ -778,7 +778,7 @@ bool WinsockNetLayer::SendToSmallId(BYTE targetSmallId, const void *data, int da
|
||||
}
|
||||
}
|
||||
|
||||
SOCKET WinsockNetLayer::GetSocketForSmallId(BYTE smallId)
|
||||
SOCKET NetworkSocketLayer::GetSocketForSmallId(BYTE smallId)
|
||||
{
|
||||
EnterCriticalSection(&s_connectionsLock);
|
||||
for (size_t i = 0; i < s_connections.size(); i++)
|
||||
@@ -810,7 +810,7 @@ static bool RecvExact(SOCKET sock, BYTE *buf, int len)
|
||||
return true;
|
||||
}
|
||||
|
||||
void WinsockNetLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, unsigned char *data, unsigned int dataSize)
|
||||
void NetworkSocketLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, unsigned char *data, unsigned int dataSize)
|
||||
{
|
||||
INetworkPlayer *pPlayerFrom = g_NetworkManager.GetPlayerBySmallId(fromSmallId);
|
||||
INetworkPlayer *pPlayerTo = g_NetworkManager.GetPlayerBySmallId(toSmallId);
|
||||
@@ -831,7 +831,7 @@ void WinsockNetLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, unsig
|
||||
}
|
||||
}
|
||||
|
||||
int WinsockNetLayer::AcceptThreadProc(LPVOID param)
|
||||
int NetworkSocketLayer::AcceptThreadProc(LPVOID param)
|
||||
{
|
||||
while (s_active)
|
||||
{
|
||||
@@ -892,7 +892,7 @@ int WinsockNetLayer::AcceptThreadProc(LPVOID param)
|
||||
continue;
|
||||
}
|
||||
|
||||
Win64RemoteConnection conn;
|
||||
RemoteConnection conn;
|
||||
conn.tcpSocket = clientSocket;
|
||||
conn.smallId = assignedSmallId;
|
||||
conn.active = true;
|
||||
@@ -926,7 +926,7 @@ int WinsockNetLayer::AcceptThreadProc(LPVOID param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int WinsockNetLayer::RecvThreadProc(LPVOID param)
|
||||
int NetworkSocketLayer::RecvThreadProc(LPVOID param)
|
||||
{
|
||||
DWORD connIdx = *(DWORD *)param;
|
||||
delete (DWORD *)param;
|
||||
@@ -942,7 +942,7 @@ int WinsockNetLayer::RecvThreadProc(LPVOID param)
|
||||
LeaveCriticalSection(&s_connectionsLock);
|
||||
|
||||
std::vector<BYTE> recvBuf;
|
||||
recvBuf.resize(WIN64_NET_RECV_BUFFER_SIZE);
|
||||
recvBuf.resize(NETWORK_LAN_RECV_BUFFER_SIZE);
|
||||
|
||||
while (s_active)
|
||||
{
|
||||
@@ -959,12 +959,12 @@ int WinsockNetLayer::RecvThreadProc(LPVOID param)
|
||||
((uint32_t)header[2] << 8) |
|
||||
((uint32_t)header[3]);
|
||||
|
||||
if (packetSize <= 0 || packetSize > WIN64_NET_MAX_PACKET_SIZE)
|
||||
if (packetSize <= 0 || packetSize > NETWORK_LAN_MAX_PACKET_SIZE)
|
||||
{
|
||||
app.DebugPrintf("LAN: Invalid packet size %d from client smallId=%d (max=%d)\n",
|
||||
packetSize,
|
||||
clientSmallId,
|
||||
(int)WIN64_NET_MAX_PACKET_SIZE);
|
||||
(int)NETWORK_LAN_MAX_PACKET_SIZE);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1006,7 +1006,7 @@ int WinsockNetLayer::RecvThreadProc(LPVOID param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool WinsockNetLayer::PopDisconnectedSmallId(BYTE *outSmallId)
|
||||
bool NetworkSocketLayer::PopDisconnectedSmallId(BYTE *outSmallId)
|
||||
{
|
||||
bool found = false;
|
||||
EnterCriticalSection(&s_disconnectLock);
|
||||
@@ -1020,14 +1020,14 @@ bool WinsockNetLayer::PopDisconnectedSmallId(BYTE *outSmallId)
|
||||
return found;
|
||||
}
|
||||
|
||||
void WinsockNetLayer::PushFreeSmallId(BYTE smallId)
|
||||
void NetworkSocketLayer::PushFreeSmallId(BYTE smallId)
|
||||
{
|
||||
EnterCriticalSection(&s_freeSmallIdLock);
|
||||
s_freeSmallIds.push_back(smallId);
|
||||
LeaveCriticalSection(&s_freeSmallIdLock);
|
||||
}
|
||||
|
||||
void WinsockNetLayer::CloseConnectionBySmallId(BYTE smallId)
|
||||
void NetworkSocketLayer::CloseConnectionBySmallId(BYTE smallId)
|
||||
{
|
||||
EnterCriticalSection(&s_connectionsLock);
|
||||
for (size_t i = 0; i < s_connections.size(); i++)
|
||||
@@ -1043,10 +1043,10 @@ void WinsockNetLayer::CloseConnectionBySmallId(BYTE smallId)
|
||||
LeaveCriticalSection(&s_connectionsLock);
|
||||
}
|
||||
|
||||
int WinsockNetLayer::ClientRecvThreadProc(LPVOID param)
|
||||
int NetworkSocketLayer::ClientRecvThreadProc(LPVOID param)
|
||||
{
|
||||
std::vector<BYTE> recvBuf;
|
||||
recvBuf.resize(WIN64_NET_RECV_BUFFER_SIZE);
|
||||
recvBuf.resize(NETWORK_LAN_RECV_BUFFER_SIZE);
|
||||
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
while (s_active && s_hostConnectionSocket != INVALID_SOCKET)
|
||||
@@ -1063,7 +1063,7 @@ int WinsockNetLayer::ClientRecvThreadProc(LPVOID param)
|
||||
|
||||
int packetSize = (header[0] << 24) | (header[1] << 16) | (header[2] << 8) | header[3];
|
||||
|
||||
if (packetSize <= 0 || packetSize > WIN64_NET_MAX_PACKET_SIZE)
|
||||
if (packetSize <= 0 || packetSize > NETWORK_LAN_MAX_PACKET_SIZE)
|
||||
{
|
||||
app.DebugPrintf("LAN: Invalid packet size %d from host\n", packetSize);
|
||||
break;
|
||||
@@ -1088,14 +1088,14 @@ int WinsockNetLayer::ClientRecvThreadProc(LPVOID param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool WinsockNetLayer::StartAdvertising(int gamePort, const wchar_t *hostName, unsigned int gameSettings, unsigned int texPackId, unsigned char subTexId, unsigned short netVer)
|
||||
bool NetworkSocketLayer::StartAdvertising(int gamePort, const wchar_t *hostName, unsigned int gameSettings, unsigned int texPackId, unsigned char subTexId, unsigned short netVer)
|
||||
{
|
||||
if (s_advertising) return true;
|
||||
if (!s_initialized) return false;
|
||||
|
||||
EnterCriticalSection(&s_advertiseLock);
|
||||
memset(&s_advertiseData, 0, sizeof(s_advertiseData));
|
||||
s_advertiseData.magic = WIN64_LAN_BROADCAST_MAGIC;
|
||||
s_advertiseData.magic = NETWORK_LAN_BROADCAST_MAGIC;
|
||||
s_advertiseData.netVersion = netVer;
|
||||
s_advertiseData.gamePort = (WORD)gamePort;
|
||||
size_t converted = wcstombs(s_advertiseData.hostName, hostName, 32);
|
||||
@@ -1129,11 +1129,11 @@ bool WinsockNetLayer::StartAdvertising(int gamePort, const wchar_t *hostName, un
|
||||
s_advertising = true;
|
||||
s_advertiseThread = new C4JThread(AdvertiseThreadProc, NULL, "AdvertiseThreadProc");
|
||||
s_advertiseThread->Run();
|
||||
app.DebugPrintf("Win64 LAN: Started advertising on UDP port %d\n", WIN64_LAN_DISCOVERY_PORT);
|
||||
app.DebugPrintf("Win64 LAN: Started advertising on UDP port %d\n", NETWORK_LAN_DISCOVERY_PORT);
|
||||
return true;
|
||||
}
|
||||
|
||||
void WinsockNetLayer::StopAdvertising()
|
||||
void NetworkSocketLayer::StopAdvertising()
|
||||
{
|
||||
s_advertising = false;
|
||||
|
||||
@@ -1159,14 +1159,14 @@ void WinsockNetLayer::StopAdvertising()
|
||||
}
|
||||
}
|
||||
|
||||
void WinsockNetLayer::UpdateAdvertisePlayerCount(BYTE count)
|
||||
void NetworkSocketLayer::UpdateAdvertisePlayerCount(BYTE count)
|
||||
{
|
||||
EnterCriticalSection(&s_advertiseLock);
|
||||
s_advertiseData.playerCount = count;
|
||||
LeaveCriticalSection(&s_advertiseLock);
|
||||
}
|
||||
|
||||
void WinsockNetLayer::UpdateAdvertisePlayerNames(BYTE count, const char playerNames[][XUSER_NAME_SIZE])
|
||||
void NetworkSocketLayer::UpdateAdvertisePlayerNames(BYTE count, const char playerNames[][XUSER_NAME_SIZE])
|
||||
{
|
||||
EnterCriticalSection(&s_advertiseLock);
|
||||
memset(s_advertiseData.playerNames, 0, sizeof(s_advertiseData.playerNames));
|
||||
@@ -1178,25 +1178,25 @@ void WinsockNetLayer::UpdateAdvertisePlayerNames(BYTE count, const char playerNa
|
||||
LeaveCriticalSection(&s_advertiseLock);
|
||||
}
|
||||
|
||||
void WinsockNetLayer::UpdateAdvertiseJoinable(bool joinable)
|
||||
void NetworkSocketLayer::UpdateAdvertiseJoinable(bool joinable)
|
||||
{
|
||||
EnterCriticalSection(&s_advertiseLock);
|
||||
s_advertiseData.isJoinable = joinable ? 1 : 0;
|
||||
LeaveCriticalSection(&s_advertiseLock);
|
||||
}
|
||||
|
||||
int WinsockNetLayer::AdvertiseThreadProc(LPVOID param)
|
||||
int NetworkSocketLayer::AdvertiseThreadProc(LPVOID param)
|
||||
{
|
||||
struct sockaddr_in broadcastAddr;
|
||||
memset(&broadcastAddr, 0, sizeof(broadcastAddr));
|
||||
broadcastAddr.sin_family = AF_INET;
|
||||
broadcastAddr.sin_port = htons(WIN64_LAN_DISCOVERY_PORT);
|
||||
broadcastAddr.sin_port = htons(NETWORK_LAN_DISCOVERY_PORT);
|
||||
broadcastAddr.sin_addr.s_addr = INADDR_BROADCAST;
|
||||
|
||||
while (s_advertising)
|
||||
{
|
||||
EnterCriticalSection(&s_advertiseLock);
|
||||
Win64LANBroadcast data = s_advertiseData;
|
||||
LANBroadcast data = s_advertiseData;
|
||||
LeaveCriticalSection(&s_advertiseLock);
|
||||
|
||||
data.magic = htonl(data.magic);
|
||||
@@ -1226,7 +1226,7 @@ int WinsockNetLayer::AdvertiseThreadProc(LPVOID param)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool WinsockNetLayer::StartDiscovery()
|
||||
bool NetworkSocketLayer::StartDiscovery()
|
||||
{
|
||||
if (s_discovering) return true;
|
||||
if (!s_initialized) return false;
|
||||
@@ -1254,7 +1254,7 @@ bool WinsockNetLayer::StartDiscovery()
|
||||
struct sockaddr_in bindAddr;
|
||||
memset(&bindAddr, 0, sizeof(bindAddr));
|
||||
bindAddr.sin_family = AF_INET;
|
||||
bindAddr.sin_port = htons(WIN64_LAN_DISCOVERY_PORT);
|
||||
bindAddr.sin_port = htons(NETWORK_LAN_DISCOVERY_PORT);
|
||||
bindAddr.sin_addr.s_addr = INADDR_ANY;
|
||||
|
||||
#if defined _WINDOWS64 || defined _XBOX
|
||||
@@ -1285,11 +1285,11 @@ bool WinsockNetLayer::StartDiscovery()
|
||||
s_discoveryThread = new C4JThread(DiscoveryThreadProc, NULL, "DiscoveryThreadProc");
|
||||
s_discoveryThread->Run();
|
||||
|
||||
app.DebugPrintf("LAN: Listening for LAN games on UDP port %d\n", WIN64_LAN_DISCOVERY_PORT);
|
||||
app.DebugPrintf("LAN: Listening for LAN games on UDP port %d\n", NETWORK_LAN_DISCOVERY_PORT);
|
||||
return true;
|
||||
}
|
||||
|
||||
void WinsockNetLayer::StopDiscovery()
|
||||
void NetworkSocketLayer::StopDiscovery()
|
||||
{
|
||||
s_discovering = false;
|
||||
|
||||
@@ -1319,9 +1319,9 @@ void WinsockNetLayer::StopDiscovery()
|
||||
LeaveCriticalSection(&s_discoveryLock);
|
||||
}
|
||||
|
||||
std::vector<Win64LANSession> WinsockNetLayer::GetDiscoveredSessions()
|
||||
std::vector<LANSession> NetworkSocketLayer::GetDiscoveredSessions()
|
||||
{
|
||||
std::vector<Win64LANSession> result;
|
||||
std::vector<LANSession> result;
|
||||
if (TryEnterCriticalSection(&s_discoveryLock))
|
||||
{
|
||||
result = s_discoveredSessions;
|
||||
@@ -1330,7 +1330,7 @@ std::vector<Win64LANSession> WinsockNetLayer::GetDiscoveredSessions()
|
||||
return result;
|
||||
}
|
||||
|
||||
int WinsockNetLayer::DiscoveryThreadProc(LPVOID param)
|
||||
int NetworkSocketLayer::DiscoveryThreadProc(LPVOID param)
|
||||
{
|
||||
app.DebugPrintf("Discovery thread started\n");
|
||||
char recvBuf[1024];
|
||||
@@ -1359,10 +1359,10 @@ int WinsockNetLayer::DiscoveryThreadProc(LPVOID param)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (recvLen < (int)sizeof(Win64LANBroadcast))
|
||||
if (recvLen < (int)sizeof(LANBroadcast))
|
||||
continue;
|
||||
|
||||
Win64LANBroadcast *broadcast = (Win64LANBroadcast *)recvBuf;
|
||||
LANBroadcast *broadcast = (LANBroadcast *)recvBuf;
|
||||
|
||||
broadcast->magic = ntohl(broadcast->magic);
|
||||
broadcast->netVersion = ntohs(broadcast->netVersion);
|
||||
@@ -1370,7 +1370,7 @@ int WinsockNetLayer::DiscoveryThreadProc(LPVOID param)
|
||||
broadcast->gameHostSettings = ntohl(broadcast->gameHostSettings);
|
||||
broadcast->texturePackParentId = ntohl(broadcast->texturePackParentId);
|
||||
|
||||
if (broadcast->magic != WIN64_LAN_BROADCAST_MAGIC)
|
||||
if (broadcast->magic != NETWORK_LAN_BROADCAST_MAGIC)
|
||||
continue;
|
||||
|
||||
char senderIP[64];
|
||||
@@ -1415,7 +1415,7 @@ int WinsockNetLayer::DiscoveryThreadProc(LPVOID param)
|
||||
|
||||
if (!found)
|
||||
{
|
||||
Win64LANSession session;
|
||||
LANSession session;
|
||||
memset(&session, 0, sizeof(session));
|
||||
strncpy(session.hostIP, senderIP, sizeof(session.hostIP) - 1);
|
||||
session.hostIP[sizeof(session.hostIP) - 1] = '\0';
|
||||
+18
-18
@@ -30,12 +30,12 @@
|
||||
#pragma comment(lib, "Ws2_32.lib")
|
||||
#endif
|
||||
|
||||
#define WIN64_NET_DEFAULT_PORT 25565
|
||||
#define WIN64_NET_MAX_CLIENTS 7
|
||||
#define WIN64_NET_RECV_BUFFER_SIZE 65536
|
||||
#define WIN64_NET_MAX_PACKET_SIZE (4 * 1024 * 1024)
|
||||
#define WIN64_LAN_DISCOVERY_PORT 25566
|
||||
#define WIN64_LAN_BROADCAST_MAGIC 0x4D434C4E
|
||||
#define NETWORK_LAN_DEFAULT_PORT 25565
|
||||
#define NETWORK_LAN_MAX_CLIENTS 7
|
||||
#define NETWORK_LAN_RECV_BUFFER_SIZE 65536
|
||||
#define NETWORK_LAN_MAX_PACKET_SIZE (4 * 1024 * 1024)
|
||||
#define NETWORK_LAN_DISCOVERY_PORT 25566
|
||||
#define NETWORK_LAN_BROADCAST_MAGIC 0x4D434C4E
|
||||
|
||||
#if defined __PS3__ || defined __ORBIS__
|
||||
typedef int SOCKET;
|
||||
@@ -45,7 +45,7 @@ typedef int SOCKET;
|
||||
class Socket;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct Win64LANBroadcast
|
||||
struct LANBroadcast
|
||||
{
|
||||
DWORD magic;
|
||||
WORD netVersion;
|
||||
@@ -61,7 +61,7 @@ struct Win64LANBroadcast
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
struct Win64LANSession
|
||||
struct LANSession
|
||||
{
|
||||
char hostIP[64];
|
||||
int hostPort;
|
||||
@@ -77,7 +77,7 @@ struct Win64LANSession
|
||||
char playerNames[8][XUSER_NAME_SIZE];
|
||||
};
|
||||
|
||||
struct Win64RemoteConnection
|
||||
struct RemoteConnection
|
||||
{
|
||||
SOCKET tcpSocket;
|
||||
BYTE smallId;
|
||||
@@ -85,7 +85,7 @@ struct Win64RemoteConnection
|
||||
volatile bool active;
|
||||
};
|
||||
|
||||
class WinsockNetLayer
|
||||
class NetworkSocketLayer
|
||||
{
|
||||
public:
|
||||
static bool Initialize();
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
|
||||
static bool StartDiscovery();
|
||||
static void StopDiscovery();
|
||||
static vector<Win64LANSession> GetDiscoveredSessions();
|
||||
static vector<LANSession> GetDiscoveredSessions();
|
||||
|
||||
static int GetHostPort() { return s_hostGamePort; }
|
||||
|
||||
@@ -148,12 +148,12 @@ private:
|
||||
static CRITICAL_SECTION s_sendLock;
|
||||
static CRITICAL_SECTION s_connectionsLock;
|
||||
|
||||
static std::vector<Win64RemoteConnection> s_connections;
|
||||
static std::vector<RemoteConnection> s_connections;
|
||||
|
||||
static SOCKET s_advertiseSock;
|
||||
static C4JThread* s_advertiseThread;
|
||||
static volatile bool s_advertising;
|
||||
static Win64LANBroadcast s_advertiseData;
|
||||
static LANBroadcast s_advertiseData;
|
||||
static CRITICAL_SECTION s_advertiseLock;
|
||||
static int s_hostGamePort;
|
||||
|
||||
@@ -161,7 +161,7 @@ private:
|
||||
static C4JThread* s_discoveryThread;
|
||||
static volatile bool s_discovering;
|
||||
static CRITICAL_SECTION s_discoveryLock;
|
||||
static std::vector<Win64LANSession> s_discoveredSessions;
|
||||
static std::vector<LANSession> s_discoveredSessions;
|
||||
|
||||
static CRITICAL_SECTION s_disconnectLock;
|
||||
static std::vector<BYTE> s_disconnectedSmallIds;
|
||||
@@ -170,7 +170,7 @@ private:
|
||||
static std::vector<BYTE> s_freeSmallIds;
|
||||
};
|
||||
|
||||
extern bool g_Win64MultiplayerHost;
|
||||
extern bool g_Win64MultiplayerJoin;
|
||||
extern int g_Win64MultiplayerPort;
|
||||
extern char g_Win64MultiplayerIP[256];
|
||||
extern bool g_MultiplayerHost;
|
||||
extern bool g_MultiplayerJoin;
|
||||
extern int g_MultiplayerPort;
|
||||
extern char g_MultiplayerIP[256];
|
||||
+943
-943
File diff suppressed because it is too large
Load Diff
+171
-171
@@ -1,171 +1,171 @@
|
||||
#pragma once
|
||||
using namespace std;
|
||||
#include <vector>
|
||||
#include "..\..\..\Minecraft.World\C4JThread.h"
|
||||
#include "NetworkPlayerInterface.h"
|
||||
#include "PlatformNetworkManagerInterface.h"
|
||||
#include "SessionInfo.h"
|
||||
|
||||
class CPlatformNetworkManagerStub : public CPlatformNetworkManager
|
||||
{
|
||||
friend class CGameNetworkManager;
|
||||
public:
|
||||
virtual bool Initialise(CGameNetworkManager *pGameNetworkManager, int flagIndexSize);
|
||||
virtual void Terminate();
|
||||
virtual int GetJoiningReadyPercentage();
|
||||
virtual int CorrectErrorIDS(int IDS);
|
||||
|
||||
virtual void DoWork();
|
||||
virtual int GetPlayerCount();
|
||||
virtual int GetOnlinePlayerCount();
|
||||
virtual int GetLocalPlayerMask(int playerIndex);
|
||||
virtual bool AddLocalPlayerByUserIndex( int userIndex );
|
||||
virtual bool RemoveLocalPlayerByUserIndex( int userIndex );
|
||||
virtual INetworkPlayer *GetLocalPlayerByUserIndex( int userIndex );
|
||||
virtual INetworkPlayer *GetPlayerByIndex(int playerIndex);
|
||||
virtual INetworkPlayer * GetPlayerByXuid(PlayerUID xuid);
|
||||
virtual INetworkPlayer * GetPlayerBySmallId(unsigned char smallId);
|
||||
virtual bool ShouldMessageForFullSession();
|
||||
|
||||
virtual INetworkPlayer *GetHostPlayer();
|
||||
virtual bool IsHost();
|
||||
virtual bool JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo);
|
||||
virtual bool LeaveGame(bool bMigrateHost);
|
||||
|
||||
virtual bool IsInSession();
|
||||
virtual bool IsInGameplay();
|
||||
virtual bool IsReadyToPlayOrIdle();
|
||||
virtual bool IsInStatsEnabledSession();
|
||||
virtual bool SessionHasSpace(unsigned int spaceRequired = 1);
|
||||
virtual void SendInviteGUI(int quadrant);
|
||||
virtual bool IsAddingPlayer();
|
||||
|
||||
virtual void HostGame(int localUsersMask, bool bOnlineGame, bool bIsPrivate, unsigned char publicSlots = MINECRAFT_NET_MAX_PLAYERS, unsigned char privateSlots = 0);
|
||||
virtual int JoinGame(FriendSessionInfo *searchResult, int localUsersMask, int primaryUserIndex );
|
||||
virtual bool SetLocalGame(bool isLocal);
|
||||
virtual bool IsLocalGame() { return m_bIsOfflineGame; }
|
||||
virtual void SetPrivateGame(bool isPrivate);
|
||||
virtual bool IsPrivateGame() { return m_bIsPrivateGame; }
|
||||
virtual bool IsLeavingGame() { return m_bLeavingGame; }
|
||||
virtual void ResetLeavingGame() { m_bLeavingGame = false; }
|
||||
|
||||
virtual void RegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam);
|
||||
virtual void UnRegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam);
|
||||
|
||||
virtual void HandleSignInChange();
|
||||
|
||||
virtual bool _RunNetworkGame();
|
||||
|
||||
private:
|
||||
bool isSystemPrimaryPlayer(IQNetPlayer *pQNetPlayer);
|
||||
virtual bool _LeaveGame(bool bMigrateHost, bool bLeaveRoom);
|
||||
virtual void _HostGame(int dwUsersMask, unsigned char publicSlots = MINECRAFT_NET_MAX_PLAYERS, unsigned char privateSlots = 0);
|
||||
virtual bool _StartGame();
|
||||
|
||||
IQNet * m_pIQNet; // pointer to QNet interface
|
||||
|
||||
HANDLE m_notificationListener;
|
||||
|
||||
vector<IQNetPlayer *> m_machineQNetPrimaryPlayers; // collection of players that we deem to be the main one for that system
|
||||
|
||||
bool m_bLeavingGame;
|
||||
bool m_bLeaveGameOnTick;
|
||||
bool m_migrateHostOnLeave;
|
||||
bool m_bHostChanged;
|
||||
|
||||
bool m_bIsOfflineGame;
|
||||
bool m_bIsPrivateGame;
|
||||
int m_flagIndexSize;
|
||||
|
||||
// This is only maintained by the host, and is not valid on client machines
|
||||
GameSessionData m_hostGameSessionData;
|
||||
CGameNetworkManager *m_pGameNetworkManager;
|
||||
public:
|
||||
virtual void UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving = NULL);
|
||||
|
||||
private:
|
||||
// TODO 4J Stu - Do we need to be able to have more than one of these?
|
||||
void (*playerChangedCallback[XUSER_MAX_COUNT])(void *callbackParam, INetworkPlayer *pPlayer, bool leaving);
|
||||
void *playerChangedCallbackParam[XUSER_MAX_COUNT];
|
||||
|
||||
static int RemovePlayerOnSocketClosedThreadProc( void* lpParam );
|
||||
virtual bool RemoveLocalPlayer( INetworkPlayer *pNetworkPlayer );
|
||||
|
||||
// Things for handling per-system flags
|
||||
class PlayerFlags
|
||||
{
|
||||
public:
|
||||
INetworkPlayer *m_pNetworkPlayer;
|
||||
unsigned char *flags;
|
||||
unsigned int count;
|
||||
PlayerFlags(INetworkPlayer *pNetworkPlayer, unsigned int count);
|
||||
~PlayerFlags();
|
||||
};
|
||||
vector<PlayerFlags *> m_playerFlags;
|
||||
void SystemFlagAddPlayer(INetworkPlayer *pNetworkPlayer);
|
||||
void SystemFlagRemovePlayer(INetworkPlayer *pNetworkPlayer);
|
||||
void SystemFlagReset();
|
||||
public:
|
||||
virtual void SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index);
|
||||
virtual bool SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index);
|
||||
|
||||
// For telemetry
|
||||
private:
|
||||
float m_lastPlayerEventTimeStart;
|
||||
|
||||
public:
|
||||
wstring GatherStats();
|
||||
wstring GatherRTTStats();
|
||||
|
||||
private:
|
||||
vector<FriendSessionInfo *> friendsSessions[XUSER_MAX_COUNT];
|
||||
int m_searchResultsCount[XUSER_MAX_COUNT];
|
||||
int m_lastSearchStartTime[XUSER_MAX_COUNT];
|
||||
|
||||
// The results that will be filled in with the current search
|
||||
XSESSION_SEARCHRESULT_HEADER *m_pSearchResults[XUSER_MAX_COUNT];
|
||||
XNQOS *m_pQoSResult[XUSER_MAX_COUNT];
|
||||
|
||||
// The results from the previous search, which are currently displayed in the game
|
||||
XSESSION_SEARCHRESULT_HEADER *m_pCurrentSearchResults[XUSER_MAX_COUNT];
|
||||
XNQOS *m_pCurrentQoSResult[XUSER_MAX_COUNT];
|
||||
int m_currentSearchResultsCount[XUSER_MAX_COUNT];
|
||||
|
||||
int m_lastSearchPad;
|
||||
bool m_bSearchResultsReady;
|
||||
bool m_bSearchPending;
|
||||
LPVOID m_pSearchParam;
|
||||
void (*m_SessionsUpdatedCallback)(LPVOID pParam);
|
||||
|
||||
C4JThread* m_SearchingThread;
|
||||
|
||||
void TickSearch();
|
||||
void SearchForGames();
|
||||
static int SearchForGamesThreadProc( void* lpParameter );
|
||||
|
||||
void SetSearchResultsReady(int resultCount = 0);
|
||||
|
||||
vector<INetworkPlayer *>currentNetworkPlayers;
|
||||
INetworkPlayer *addNetworkPlayer(IQNetPlayer *pQNetPlayer);
|
||||
void removeNetworkPlayer(IQNetPlayer *pQNetPlayer);
|
||||
static INetworkPlayer *getNetworkPlayer(IQNetPlayer *pQNetPlayer);
|
||||
|
||||
virtual void SetSessionTexturePackParentId( int id );
|
||||
virtual void SetSessionSubTexturePackId( int id );
|
||||
virtual void Notify(int ID, ULONG_PTR Param);
|
||||
|
||||
public:
|
||||
virtual vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly);
|
||||
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession);
|
||||
virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam );
|
||||
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
||||
virtual void ForceFriendsSessionRefresh();
|
||||
|
||||
public:
|
||||
void NotifyPlayerJoined( IQNetPlayer *pQNetPlayer );
|
||||
void NotifyPlayerLeaving( IQNetPlayer *pQNetPlayer );
|
||||
|
||||
#ifndef _XBOX
|
||||
void FakeLocalPlayerJoined() { NotifyPlayerJoined(m_pIQNet->GetLocalPlayerByUserIndex(0)); }
|
||||
#endif
|
||||
};
|
||||
#pragma once
|
||||
using namespace std;
|
||||
#include <vector>
|
||||
#include "..\..\..\Minecraft.World\C4JThread.h"
|
||||
#include "NetworkPlayerInterface.h"
|
||||
#include "PlatformNetworkManagerInterface.h"
|
||||
#include "SessionInfo.h"
|
||||
|
||||
class CPlatformNetworkManagerStub : public CPlatformNetworkManager
|
||||
{
|
||||
friend class CGameNetworkManager;
|
||||
public:
|
||||
virtual bool Initialise(CGameNetworkManager *pGameNetworkManager, int flagIndexSize);
|
||||
virtual void Terminate();
|
||||
virtual int GetJoiningReadyPercentage();
|
||||
virtual int CorrectErrorIDS(int IDS);
|
||||
|
||||
virtual void DoWork();
|
||||
virtual int GetPlayerCount();
|
||||
virtual int GetOnlinePlayerCount();
|
||||
virtual int GetLocalPlayerMask(int playerIndex);
|
||||
virtual bool AddLocalPlayerByUserIndex( int userIndex );
|
||||
virtual bool RemoveLocalPlayerByUserIndex( int userIndex );
|
||||
virtual INetworkPlayer *GetLocalPlayerByUserIndex( int userIndex );
|
||||
virtual INetworkPlayer *GetPlayerByIndex(int playerIndex);
|
||||
virtual INetworkPlayer * GetPlayerByXuid(PlayerUID xuid);
|
||||
virtual INetworkPlayer * GetPlayerBySmallId(unsigned char smallId);
|
||||
virtual bool ShouldMessageForFullSession();
|
||||
|
||||
virtual INetworkPlayer *GetHostPlayer();
|
||||
virtual bool IsHost();
|
||||
virtual bool JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo);
|
||||
virtual bool LeaveGame(bool bMigrateHost);
|
||||
|
||||
virtual bool IsInSession();
|
||||
virtual bool IsInGameplay();
|
||||
virtual bool IsReadyToPlayOrIdle();
|
||||
virtual bool IsInStatsEnabledSession();
|
||||
virtual bool SessionHasSpace(unsigned int spaceRequired = 1);
|
||||
virtual void SendInviteGUI(int quadrant);
|
||||
virtual bool IsAddingPlayer();
|
||||
|
||||
virtual void HostGame(int localUsersMask, bool bOnlineGame, bool bIsPrivate, unsigned char publicSlots = MINECRAFT_NET_MAX_PLAYERS, unsigned char privateSlots = 0);
|
||||
virtual int JoinGame(FriendSessionInfo *searchResult, int localUsersMask, int primaryUserIndex );
|
||||
virtual bool SetLocalGame(bool isLocal);
|
||||
virtual bool IsLocalGame() { return m_bIsOfflineGame; }
|
||||
virtual void SetPrivateGame(bool isPrivate);
|
||||
virtual bool IsPrivateGame() { return m_bIsPrivateGame; }
|
||||
virtual bool IsLeavingGame() { return m_bLeavingGame; }
|
||||
virtual void ResetLeavingGame() { m_bLeavingGame = false; }
|
||||
|
||||
virtual void RegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam);
|
||||
virtual void UnRegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam);
|
||||
|
||||
virtual void HandleSignInChange();
|
||||
|
||||
virtual bool _RunNetworkGame();
|
||||
|
||||
private:
|
||||
bool isSystemPrimaryPlayer(IQNetPlayer *pQNetPlayer);
|
||||
virtual bool _LeaveGame(bool bMigrateHost, bool bLeaveRoom);
|
||||
virtual void _HostGame(int dwUsersMask, unsigned char publicSlots = MINECRAFT_NET_MAX_PLAYERS, unsigned char privateSlots = 0);
|
||||
virtual bool _StartGame();
|
||||
|
||||
IQNet * m_pIQNet; // pointer to QNet interface
|
||||
|
||||
HANDLE m_notificationListener;
|
||||
|
||||
vector<IQNetPlayer *> m_machineQNetPrimaryPlayers; // collection of players that we deem to be the main one for that system
|
||||
|
||||
bool m_bLeavingGame;
|
||||
bool m_bLeaveGameOnTick;
|
||||
bool m_migrateHostOnLeave;
|
||||
bool m_bHostChanged;
|
||||
|
||||
bool m_bIsOfflineGame;
|
||||
bool m_bIsPrivateGame;
|
||||
int m_flagIndexSize;
|
||||
|
||||
// This is only maintained by the host, and is not valid on client machines
|
||||
GameSessionData m_hostGameSessionData;
|
||||
CGameNetworkManager *m_pGameNetworkManager;
|
||||
public:
|
||||
virtual void UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving = NULL);
|
||||
|
||||
private:
|
||||
// TODO 4J Stu - Do we need to be able to have more than one of these?
|
||||
void (*playerChangedCallback[XUSER_MAX_COUNT])(void *callbackParam, INetworkPlayer *pPlayer, bool leaving);
|
||||
void *playerChangedCallbackParam[XUSER_MAX_COUNT];
|
||||
|
||||
static int RemovePlayerOnSocketClosedThreadProc( void* lpParam );
|
||||
virtual bool RemoveLocalPlayer( INetworkPlayer *pNetworkPlayer );
|
||||
|
||||
// Things for handling per-system flags
|
||||
class PlayerFlags
|
||||
{
|
||||
public:
|
||||
INetworkPlayer *m_pNetworkPlayer;
|
||||
unsigned char *flags;
|
||||
unsigned int count;
|
||||
PlayerFlags(INetworkPlayer *pNetworkPlayer, unsigned int count);
|
||||
~PlayerFlags();
|
||||
};
|
||||
vector<PlayerFlags *> m_playerFlags;
|
||||
void SystemFlagAddPlayer(INetworkPlayer *pNetworkPlayer);
|
||||
void SystemFlagRemovePlayer(INetworkPlayer *pNetworkPlayer);
|
||||
void SystemFlagReset();
|
||||
public:
|
||||
virtual void SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index);
|
||||
virtual bool SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index);
|
||||
|
||||
// For telemetry
|
||||
private:
|
||||
float m_lastPlayerEventTimeStart;
|
||||
|
||||
public:
|
||||
wstring GatherStats();
|
||||
wstring GatherRTTStats();
|
||||
|
||||
private:
|
||||
vector<FriendSessionInfo *> friendsSessions[XUSER_MAX_COUNT];
|
||||
int m_searchResultsCount[XUSER_MAX_COUNT];
|
||||
int m_lastSearchStartTime[XUSER_MAX_COUNT];
|
||||
|
||||
// The results that will be filled in with the current search
|
||||
XSESSION_SEARCHRESULT_HEADER *m_pSearchResults[XUSER_MAX_COUNT];
|
||||
XNQOS *m_pQoSResult[XUSER_MAX_COUNT];
|
||||
|
||||
// The results from the previous search, which are currently displayed in the game
|
||||
XSESSION_SEARCHRESULT_HEADER *m_pCurrentSearchResults[XUSER_MAX_COUNT];
|
||||
XNQOS *m_pCurrentQoSResult[XUSER_MAX_COUNT];
|
||||
int m_currentSearchResultsCount[XUSER_MAX_COUNT];
|
||||
|
||||
int m_lastSearchPad;
|
||||
bool m_bSearchResultsReady;
|
||||
bool m_bSearchPending;
|
||||
LPVOID m_pSearchParam;
|
||||
void (*m_SessionsUpdatedCallback)(LPVOID pParam);
|
||||
|
||||
C4JThread* m_SearchingThread;
|
||||
|
||||
void TickSearch();
|
||||
void SearchForGames();
|
||||
static int SearchForGamesThreadProc( void* lpParameter );
|
||||
|
||||
void SetSearchResultsReady(int resultCount = 0);
|
||||
|
||||
vector<INetworkPlayer *>currentNetworkPlayers;
|
||||
INetworkPlayer *addNetworkPlayer(IQNetPlayer *pQNetPlayer);
|
||||
void removeNetworkPlayer(IQNetPlayer *pQNetPlayer);
|
||||
static INetworkPlayer *getNetworkPlayer(IQNetPlayer *pQNetPlayer);
|
||||
|
||||
virtual void SetSessionTexturePackParentId( int id );
|
||||
virtual void SetSessionSubTexturePackId( int id );
|
||||
virtual void Notify(int ID, ULONG_PTR Param);
|
||||
|
||||
public:
|
||||
virtual vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly);
|
||||
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession);
|
||||
virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam );
|
||||
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
||||
virtual void ForceFriendsSessionRefresh();
|
||||
|
||||
public:
|
||||
void NotifyPlayerJoined( IQNetPlayer *pQNetPlayer );
|
||||
void NotifyPlayerLeaving( IQNetPlayer *pQNetPlayer );
|
||||
|
||||
#ifndef _XBOX
|
||||
void FakeLocalPlayerJoined() { NotifyPlayerJoined(m_pIQNet->GetLocalPlayerByUserIndex(0)); }
|
||||
#endif
|
||||
};
|
||||
@@ -127,7 +127,14 @@ if (-not (Test-Path $genGp4)) {
|
||||
Write-Host "Orbis Postbuild: '$pkgSrc' not found, skipping PKG creation."
|
||||
} else {
|
||||
Write-Host "Orbis Postbuild: Generating GP4..."
|
||||
& $genGp4 $pkgSrc
|
||||
$proc = Start-Process -FilePath $genGp4 -ArgumentList $pkgSrc `
|
||||
-WorkingDirectory (Split-Path $pkgSrc -Parent) `
|
||||
-NoNewWindow -Wait -PassThru
|
||||
|
||||
if ($proc.ExitCode -ne 0) {
|
||||
Write-Host "Orbis Postbuild ERROR: gengp4_app.exe failed with exit code $($proc.ExitCode)"
|
||||
return
|
||||
}
|
||||
|
||||
if (-not (Test-Path $gp4File)) {
|
||||
Write-Host "Orbis Postbuild ERROR: $gp4File was not created"
|
||||
|
||||
@@ -554,31 +554,33 @@ void UIController::loadSkins()
|
||||
#if ( defined(_WINDOWS64) || defined(_DURANGO) || defined(__ORBIS__) )
|
||||
|
||||
#if defined(_WINDOWS64)
|
||||
// 4J Stu - Load the 720/480 skins so that we have something to fallback on during development
|
||||
#ifndef _FINAL_BUILD
|
||||
m_iggyLibraries[eLibraryFallback_GraphicsDefault] = loadSkin(L"skinGraphics.swf", L"skinGraphics.swf");
|
||||
m_iggyLibraries[eLibraryFallback_GraphicsHUD] = loadSkin(L"skinGraphicsHud.swf", L"skinGraphicsHud.swf");
|
||||
m_iggyLibraries[eLibraryFallback_GraphicsInGame] = loadSkin(L"skinGraphicsInGame.swf", L"skinGraphicsInGame.swf");
|
||||
m_iggyLibraries[eLibraryFallback_GraphicsTooltips] = loadSkin(L"skinGraphicsTooltips.swf", L"skinGraphicsTooltips.swf");
|
||||
m_iggyLibraries[eLibraryFallback_GraphicsLabels] = loadSkin(L"skinGraphicsLabels.swf", L"skinGraphicsLabels.swf");
|
||||
m_iggyLibraries[eLibraryFallback_Labels] = loadSkin(L"skinLabels.swf", L"skinLabels.swf");
|
||||
m_iggyLibraries[eLibraryFallback_InGame] = loadSkin(L"skinInGame.swf", L"skinInGame.swf");
|
||||
m_iggyLibraries[eLibraryFallback_HUD] = loadSkin(L"skinHud.swf", L"skinHud.swf");
|
||||
m_iggyLibraries[eLibraryFallback_Tooltips] = loadSkin(L"skinTooltips.swf", L"skinTooltips.swf");
|
||||
m_iggyLibraries[eLibraryFallback_Default] = loadSkin(L"skin.swf", L"skin.swf");
|
||||
if (m_fScreenHeight <= 720.0f)
|
||||
{
|
||||
m_iggyLibraries[eLibrary_GraphicsDefault] = loadSkin(L"skinGraphics.swf", L"skinGraphics.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsHUD] = loadSkin(L"skinGraphicsHud.swf", L"skinGraphicsHud.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsInGame] = loadSkin(L"skinGraphicsInGame.swf", L"skinGraphicsInGame.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsTooltips] = loadSkin(L"skinGraphicsTooltips.swf", L"skinGraphicsTooltips.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsLabels] = loadSkin(L"skinGraphicsLabels.swf", L"skinGraphicsLabels.swf");
|
||||
m_iggyLibraries[eLibrary_Labels] = loadSkin(L"skinLabels.swf", L"skinLabels.swf");
|
||||
m_iggyLibraries[eLibrary_InGame] = loadSkin(L"skinInGame.swf", L"skinInGame.swf");
|
||||
m_iggyLibraries[eLibrary_HUD] = loadSkin(L"skinHud.swf", L"skinHud.swf");
|
||||
m_iggyLibraries[eLibrary_Tooltips] = loadSkin(L"skinTooltips.swf", L"skinTooltips.swf");
|
||||
m_iggyLibraries[eLibrary_Default] = loadSkin(L"skin.swf", L"skin.swf");
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
|
||||
m_iggyLibraries[eLibrary_GraphicsDefault] = loadSkin(L"skinHDGraphics.swf", L"skinHDGraphics.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsHUD] = loadSkin(L"skinHDGraphicsHud.swf", L"skinHDGraphicsHud.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsInGame] = loadSkin(L"skinHDGraphicsInGame.swf", L"skinHDGraphicsInGame.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsTooltips] = loadSkin(L"skinHDGraphicsTooltips.swf", L"skinHDGraphicsTooltips.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsLabels] = loadSkin(L"skinHDGraphicsLabels.swf", L"skinHDGraphicsLabels.swf");
|
||||
m_iggyLibraries[eLibrary_Labels] = loadSkin(L"skinHDLabels.swf", L"skinHDLabels.swf");
|
||||
m_iggyLibraries[eLibrary_InGame] = loadSkin(L"skinHDInGame.swf", L"skinHDInGame.swf");
|
||||
m_iggyLibraries[eLibrary_HUD] = loadSkin(L"skinHDHud.swf", L"skinHDHud.swf");
|
||||
m_iggyLibraries[eLibrary_Tooltips] = loadSkin(L"skinHDTooltips.swf", L"skinHDTooltips.swf");
|
||||
m_iggyLibraries[eLibrary_Default] = loadSkin(L"skinHD.swf", L"skinHD.swf");
|
||||
{
|
||||
m_iggyLibraries[eLibrary_GraphicsDefault] = loadSkin(L"skinHDGraphics.swf", L"skinHDGraphics.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsHUD] = loadSkin(L"skinHDGraphicsHud.swf", L"skinHDGraphicsHud.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsInGame] = loadSkin(L"skinHDGraphicsInGame.swf", L"skinHDGraphicsInGame.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsTooltips] = loadSkin(L"skinHDGraphicsTooltips.swf", L"skinHDGraphicsTooltips.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsLabels] = loadSkin(L"skinHDGraphicsLabels.swf", L"skinHDGraphicsLabels.swf");
|
||||
m_iggyLibraries[eLibrary_Labels] = loadSkin(L"skinHDLabels.swf", L"skinHDLabels.swf");
|
||||
m_iggyLibraries[eLibrary_InGame] = loadSkin(L"skinHDInGame.swf", L"skinHDInGame.swf");
|
||||
m_iggyLibraries[eLibrary_HUD] = loadSkin(L"skinHDHud.swf", L"skinHDHud.swf");
|
||||
m_iggyLibraries[eLibrary_Tooltips] = loadSkin(L"skinHDTooltips.swf", L"skinHDTooltips.swf");
|
||||
m_iggyLibraries[eLibrary_Default] = loadSkin(L"skinHD.swf", L"skinHD.swf");
|
||||
}
|
||||
#endif // HD platforms
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#ifdef __PS3__
|
||||
#include "PS3\Sentient\SentientManager.h"
|
||||
#include "Common\Network\WinsockNetLayer.h"
|
||||
#include "Common\Network\NetworkSocketLayer.h"
|
||||
#include "StatsCounter.h"
|
||||
#include "PS3\Social\SocialManager.h"
|
||||
#include <libsn.h>
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "Durango\DurangoExtras\xcompress.h"
|
||||
#elif defined _WINDOWS64
|
||||
#include "Windows64\Sentient\SentientManager.h"
|
||||
#include "Common\Network\WinsockNetLayer.h"
|
||||
#include "Common\Network\NetworkSocketLayer.h"
|
||||
#include "StatsCounter.h"
|
||||
#include "Windows64\Social\SocialManager.h"
|
||||
#include "Windows64\Sentient\DynamicConfigurations.h"
|
||||
@@ -43,7 +43,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
|
||||
#include "Common\Network\WinsockNetLayer.h"
|
||||
#include "Common\Network\NetworkSocketLayer.h"
|
||||
#endif
|
||||
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
@@ -425,9 +425,9 @@ void C_4JProfile::Initialise( DWORD dwTitleID,
|
||||
BYTE IQNetPlayer::GetSmallId() { return m_smallId; }
|
||||
void IQNetPlayer::SendData(IQNetPlayer *player, const void *pvData, DWORD dwDataSize, DWORD dwFlags)
|
||||
{
|
||||
if (WinsockNetLayer::IsActive())
|
||||
if (NetworkSocketLayer::IsActive())
|
||||
{
|
||||
WinsockNetLayer::SendToSmallId(player->m_smallId, pvData, dwDataSize);
|
||||
NetworkSocketLayer::SendToSmallId(player->m_smallId, pvData, dwDataSize);
|
||||
}
|
||||
}
|
||||
bool IQNetPlayer::IsSameSystem(IQNetPlayer *player) { return (this == player) || (!m_isRemote && !player->m_isRemote); }
|
||||
@@ -593,7 +593,7 @@ void C_4JProfile::GetXUID(int iPad, PlayerUID *pXuid,bool bOnlineXuid)
|
||||
if (IQNet::s_isHosting)
|
||||
*pXuid = 0xe000d45248242f2e;
|
||||
else
|
||||
*pXuid = 0xe000d45248242f2e + WinsockNetLayer::GetLocalSmallId();
|
||||
*pXuid = 0xe000d45248242f2e + NetworkSocketLayer::GetLocalSmallId();
|
||||
}
|
||||
BOOL C_4JProfile::AreXUIDSEqual(PlayerUID xuid1,PlayerUID xuid2) { return xuid1 == xuid2; }
|
||||
BOOL C_4JProfile::XUIDIsGuest(PlayerUID xuid) { return false; }
|
||||
|
||||
@@ -520,24 +520,32 @@
|
||||
<OutputFile>$(OutDir)default$(TargetExt)</OutputFile>
|
||||
<ImageXexOutput>$(OutDir)default.xex</ImageXexOutput>
|
||||
<IncludePath>$(ProjectDir)\Xbox\Sentient\Include;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)X360_$(Configuration)\</OutDir>
|
||||
<IntDir>X360_$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutputFile>$(OutDir)default$(TargetExt)</OutputFile>
|
||||
<ImageXexOutput>$(OutDir)default.xex</ImageXexOutput>
|
||||
<IncludePath>$(ProjectDir)\Xbox\Sentient\Include;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)X360_$(Configuration)\</OutDir>
|
||||
<IntDir>X360_$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Xbox 360'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutputFile>$(OutDir)default$(TargetExt)</OutputFile>
|
||||
<ImageXexOutput>$(OutDir)default.xex</ImageXexOutput>
|
||||
<IncludePath>$(ProjectDir)\Xbox\Sentient\Include;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)X360_$(Configuration)\</OutDir>
|
||||
<IntDir>X360_$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutputFile>$(OutDir)default$(TargetExt)</OutputFile>
|
||||
<ImageXexOutput>$(OutDir)default.xex</ImageXexOutput>
|
||||
<IncludePath>$(ProjectDir)\Xbox\Sentient\Include;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)X360_$(Configuration)\</OutDir>
|
||||
<IntDir>X360_$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ContentPackage|PS3'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
@@ -705,6 +713,9 @@
|
||||
<PostBuildEvent>
|
||||
<Message>Run Xbox postbuild script</Message>
|
||||
</PostBuildEvent>
|
||||
<Deploy>
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</Deploy>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">
|
||||
<ClCompile>
|
||||
@@ -2044,7 +2055,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<OptimizationLevel>Level2</OptimizationLevel>
|
||||
<AdditionalIncludeDirectories>Orbis\Iggy\include;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>SPLIT_SAVES;_LARGE_WORLDS;_EXTENDED_ACHIEVEMENTS;DEBUG_MENUS_ENABLED</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>SPLIT_SAVES;_LARGE_WORLDS;_EXTENDED_ACHIEVEMENTS;_DEBUG_MENUS_ENABLED</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\Minecraft.World\ORBIS_Release\Minecraft.World.a;Orbis\4JLibs\libs\4j_Render.a;Orbis\4JLibs\libs\4j_Input_r.a;Orbis\4JLibs\libs\4J_Storage_r.a;Orbis\4JLibs\libs\4J_Profile_r.a;Orbis\Iggy\lib\libiggy_orbis.a;Orbis\Miles\lib\mssorbis.a;Orbis\Miles\lib\binkaorbis.a;Common\Network\Sony\sceRemoteStorage\ps4\lib\sceRemoteStorage.a;-lSceGnmDriver_stub_weak;-lSceGnmx;-lSceGnm;-lSceGpuAddress;-lSceCes;-lSceVideoOut_stub_weak;-lScePad_stub_weak;-lScePngDec_stub_weak;-lScePngEnc_stub_weak;-lSceFios2_stub_weak;-lSceUlt_stub_weak;-lSceShaderBinary;-lSceUserService_stub_weak;-lSceSysmodule_stub_weak;-lSceImeDialog_stub_weak;-lScePosix_stub_weak;-lSceAudioOut_stub_weak;-lSceSaveData_stub_weak;-lSceRtc_stub_weak;-lSceSystemService_stub_weak;-lSceNetCtl_stub_weak;-lSceNpCommon_stub_weak;-lSceNpManager_stub_weak;-lSceNpToolkit;-lSceNpToolkitUtils;-lSceNpWebApi_stub_weak;-lSceNpAuth_stub_weak;-lSceNpTrophy_stub_weak;-lSceInvitationDialog_stub_weak;-lSceGameCustomDataDialog_stub_weak;-lSceNpCommerce_stub_weak;-lSceNet_stub_weak;-lSceHttp_stub_weak;-lSceSsl_stub_weak;-lSceNpMatching2_stub_weak;-lSceNpTus_stub_weak;-lSceNpUtility_stub_weak;-lSceNpScore_stub_weak;-lSceCommonDialog_stub_weak;-lSceNpSns_stub_weak;-lSceNpSnsFacebookDialog_stub_weak;-lSceRudp_stub_weak;-lSceAppContent_stub_weak;-lSceVoice_stub_weak;-lSceAudioIn_stub_weak;-lSceRemoteplay_stub_weak;-lSceSaveDataDialog_stub_weak;-lSceErrorDialog_stub_weak;-lSceMsgDialog_stub_weak;-lSceGameLiveStreaming_stub_weak;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
@@ -3829,7 +3840,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ClInclude Include="Common\Network\IQNet.h" />
|
||||
<ClInclude Include="Common\Network\NetworkPlayerInterface.h" />
|
||||
<ClInclude Include="Common\Network\PlatformNetworkManagerInterface.h" />
|
||||
<ClInclude Include="Common\Network\PlatformNetworkManagerStub.h">
|
||||
<ClInclude Include="Common\Network\PlatformNetworkManager.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
|
||||
@@ -4030,7 +4041,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ORBIS'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ORBIS'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\Network\WinsockNetLayer.h" />
|
||||
<ClInclude Include="Common\Network\NetworkSocketLayer.h" />
|
||||
<ClInclude Include="Common\Potion_Macros.h" />
|
||||
<ClInclude Include="Common\Telemetry\TelemetryManager.h" />
|
||||
<ClInclude Include="Common\Trial\TrialMode.h" />
|
||||
@@ -20918,7 +20929,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Common\Network\GameNetworkManager.cpp" />
|
||||
<ClCompile Include="Common\Network\PlatformNetworkManagerStub.cpp">
|
||||
<ClCompile Include="Common\Network\PlatformNetworkManager.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
|
||||
@@ -21120,7 +21131,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ORBIS'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ORBIS'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Common\Network\WinsockNetLayer.cpp" />
|
||||
<ClCompile Include="Common\Network\NetworkSocketLayer.cpp" />
|
||||
<ClCompile Include="Common\Telemetry\TelemetryManager.cpp" />
|
||||
<ClCompile Include="Common\Trial\TrialMode.cpp" />
|
||||
<ClCompile Include="Common\Tutorial\AreaConstraint.cpp" />
|
||||
|
||||
@@ -3110,9 +3110,6 @@
|
||||
<ClInclude Include="Xbox\Network\PlatformNetworkManagerXbox.h">
|
||||
<Filter>Xbox\Source Files\Network</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\Network\PlatformNetworkManagerStub.h">
|
||||
<Filter>Common\Source Files\Network</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Xbox\Network\NetworkPlayerXbox.h">
|
||||
<Filter>Xbox\Source Files\Network</Filter>
|
||||
</ClInclude>
|
||||
@@ -3779,10 +3776,13 @@
|
||||
<ClInclude Include="PSVita\OldSdk.h">
|
||||
<Filter>PSVita</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\Network\WinsockNetLayer.h">
|
||||
<ClInclude Include="Common\Network\IQNet.h">
|
||||
<Filter>Common\Source Files\Network</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\Network\IQNet.h">
|
||||
<ClInclude Include="Common\Network\NetworkSocketLayer.h">
|
||||
<Filter>Common\Source Files\Network</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\Network\PlatformNetworkManager.h">
|
||||
<Filter>Common\Source Files\Network</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
@@ -5335,9 +5335,6 @@
|
||||
<ClCompile Include="Xbox\Network\PlatformNetworkManagerXbox.cpp">
|
||||
<Filter>Xbox\Source Files\Network</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Common\Network\PlatformNetworkManagerStub.cpp">
|
||||
<Filter>Common\Source Files\Network</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Xbox\Network\NetworkPlayerXbox.cpp">
|
||||
<Filter>Xbox\Source Files\Network</Filter>
|
||||
</ClCompile>
|
||||
@@ -5929,7 +5926,10 @@
|
||||
<ClCompile Include="PSVita\OldSdk.cpp">
|
||||
<Filter>PSVita</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Common\Network\WinsockNetLayer.cpp">
|
||||
<ClCompile Include="Common\Network\NetworkSocketLayer.cpp">
|
||||
<Filter>Common\Source Files\Network</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Common\Network\PlatformNetworkManager.cpp">
|
||||
<Filter>Common\Source Files\Network</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "Network/Orbis_NPToolkit.h"
|
||||
#include "Orbis\Network\SonyVoiceChat_Orbis.h"
|
||||
#else
|
||||
#include "..\..\Minecraft.Client\Common\Network\WinsockNetLayer.h"
|
||||
#include "..\..\Minecraft.Client\Common\Network\NetworkSocketLayer.h"
|
||||
#endif
|
||||
|
||||
#define THEME_NAME "584111F70AAAAAAA"
|
||||
|
||||
@@ -24,7 +24,7 @@ SYS_PROCESS_PARAM(1001, 0x10000); // thread priority, and stack size
|
||||
#include <sysutil/sysutil_msgdialog.h>
|
||||
|
||||
#include "PS3/Network/SonyRemoteStorage_PS3.h"
|
||||
#include "..\..\Minecraft.Client\Common\Network\WinsockNetLayer.h"
|
||||
#include "..\..\Minecraft.Client\Common\Network\NetworkSocketLayer.h"
|
||||
|
||||
// define to use spurs (otherwise SPU threads or raw will be used)
|
||||
#define USE_SPURS
|
||||
@@ -1129,7 +1129,7 @@ int main()
|
||||
if(ShutdownManager::ShouldRun(ShutdownManager::eMainThread))
|
||||
{
|
||||
g_NetworkManager.Initialise();
|
||||
WinsockNetLayer::Initialize();
|
||||
NetworkSocketLayer::Initialize();
|
||||
g_NetworkManager.SetLocalGame(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "Resource.h"
|
||||
#include "..\..\Minecraft.World\compression.h"
|
||||
#include "..\..\Minecraft.World\OldChunkStorage.h"
|
||||
#include "..\..\Minecraft.Client\Common\Network\WinsockNetLayer.h"
|
||||
#include "..\..\Minecraft.Client\Common\Network\NetworkSocketLayer.h"
|
||||
|
||||
#include "Xbox/resource.h"
|
||||
|
||||
@@ -661,8 +661,8 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||
int n = 0;
|
||||
while (ipArg[n] && ipArg[n] != ' ' && n < 255) { ipBuf[n] = ipArg[n]; n++; }
|
||||
ipBuf[n] = 0;
|
||||
strncpy_s(g_Win64MultiplayerIP, 256, ipBuf, _TRUNCATE);
|
||||
g_Win64MultiplayerJoin = true;
|
||||
strncpy_s(g_MultiplayerIP, 256, ipBuf, _TRUNCATE);
|
||||
g_MultiplayerJoin = true;
|
||||
}
|
||||
|
||||
char *portArg = strstr(cmdLineA, "-port ");
|
||||
@@ -674,8 +674,8 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||
int n = 0;
|
||||
while (portArg[n] && portArg[n] != ' ' && n < 15) { portBuf[n] = portArg[n]; n++; }
|
||||
portBuf[n] = 0;
|
||||
g_Win64MultiplayerPort = atoi(portBuf);
|
||||
if (g_Win64MultiplayerPort <= 0) g_Win64MultiplayerPort = WIN64_NET_DEFAULT_PORT;
|
||||
g_MultiplayerPort = atoi(portBuf);
|
||||
if (g_MultiplayerPort <= 0) g_MultiplayerPort = NETWORK_LAN_DEFAULT_PORT;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -860,7 +860,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||
extern wchar_t g_Win64UsernameW[17];
|
||||
wcscpy_s(IQNet::m_player[0].m_gamertag, 32, g_Win64UsernameW);
|
||||
|
||||
WinsockNetLayer::Initialize();
|
||||
NetworkSocketLayer::Initialize();
|
||||
|
||||
// 4J-PB moved further down
|
||||
//app.InitGameSettings();
|
||||
|
||||
@@ -101,6 +101,7 @@ Global
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Release|Windows64.ActiveCfg = Release|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Release|Windows64.Build.0 = Release|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Release|Xbox 360.ActiveCfg = Release|Xbox 360
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.Release|Xbox 360.Build.0 = Release|Xbox 360
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|Durango.ActiveCfg = ReleaseForArt|x64
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|ORBIS.ActiveCfg = ReleaseForArt|ORBIS
|
||||
{F046C3CE-9749-4823-B32B-D9CC10B1A2C8}.ReleaseForArt|ORBIS.Build.0 = ReleaseForArt|ORBIS
|
||||
@@ -166,6 +167,7 @@ Global
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Release|Windows64.Build.0 = Release|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Release|Windows64.Deploy.0 = Release|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Release|Xbox 360.ActiveCfg = Release|Xbox 360
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.Release|Xbox 360.Build.0 = Release|Xbox 360
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|Durango.ActiveCfg = ReleaseForArt|x64
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|ORBIS.ActiveCfg = ReleaseForArt|ORBIS
|
||||
{1B9A8C38-DD48-448C-AA24-E1A35E0089A3}.ReleaseForArt|ORBIS.Build.0 = ReleaseForArt|ORBIS
|
||||
|
||||
Reference in New Issue
Block a user