Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1541c590d | ||
|
|
9e3077c3bc | ||
|
|
494235878e | ||
|
|
feeff55924 | ||
|
|
f404e4b4e4 | ||
|
|
67a8111974 | ||
|
|
6853eab85f | ||
|
|
125819419f | ||
|
|
ebbd54288b | ||
|
|
92891de261 | ||
|
|
6167e04f82 | ||
|
|
0443166b6a | ||
|
|
4b0520c938 | ||
|
|
2840b7620b | ||
|
|
5451249347 | ||
|
|
de8bf25fbe | ||
|
|
64e95393c8 | ||
|
|
ea3621971f | ||
|
|
ce3e83039d | ||
|
|
42f09f93e5 | ||
|
|
9f8dab8ebb | ||
|
|
5ebaab0ac9 | ||
|
|
92209cf909 | ||
|
|
94f1cefcf9 | ||
|
|
e254228cf5 | ||
|
|
b87d044cf0 | ||
|
|
01abe05b18 | ||
|
|
2170209e26 | ||
|
|
991369547a | ||
|
|
dbd90a75c9 |
@@ -38,5 +38,4 @@
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.v11.suo
|
||||
*.vcxproj.user
|
||||
*.aps
|
||||
*.vcxproj.user
|
||||
@@ -1,5 +0,0 @@
|
||||
[submodule "Minecraft.Client/Windows64/4JLibs"]
|
||||
path = Minecraft.Client/Windows64/4JLibs
|
||||
url = https://gitea.str1k3r.xyz/pieeebot/Cafeberry-4JLibs
|
||||
ignore = untracked
|
||||
branch = main
|
||||
@@ -402,6 +402,7 @@ void Chunk::rebuild()
|
||||
}
|
||||
|
||||
Tile *tile = Tile::tiles[tileId];
|
||||
if (!tile) continue;
|
||||
if (currentLayer == 0 && tile->isEntityTile())
|
||||
{
|
||||
shared_ptr<TileEntity> et = region->getTileEntity(x, y, z);
|
||||
@@ -739,9 +740,9 @@ void Chunk::rebuild_SPU()
|
||||
{
|
||||
// 4J - get tile from those copied into our local array in earlier optimisation
|
||||
unsigned char tileId = pOutData->getTile(x,y,z);
|
||||
if (tileId > 0)
|
||||
if (tileId > 0 && tileId != 0xff)
|
||||
{
|
||||
if (currentLayer == 0 && Tile::tiles[tileId]->isEntityTile())
|
||||
if (currentLayer == 0 && Tile::tiles[tileId] && Tile::tiles[tileId]->isEntityTile())
|
||||
{
|
||||
shared_ptr<TileEntity> et = region.getTileEntity(x, y, z);
|
||||
if (TileEntityRenderDispatcher::instance->hasRenderer(et))
|
||||
@@ -754,6 +755,7 @@ void Chunk::rebuild_SPU()
|
||||
{
|
||||
|
||||
Tile *tile = Tile::tiles[tileId];
|
||||
if (!tile) continue;
|
||||
int renderLayer = tile->getRenderLayer();
|
||||
|
||||
if (renderLayer != currentLayer)
|
||||
|
||||
@@ -50,11 +50,16 @@
|
||||
#else
|
||||
#include "Common\UI\UI.h"
|
||||
#endif
|
||||
#ifdef __PS3__
|
||||
#if defined __PS3__ && !defined DISABLE_PSN
|
||||
#include "PS3/Network/SonyVoiceChat.h"
|
||||
#endif
|
||||
#include "DLCTexturePack.h"
|
||||
|
||||
#if defined _WINDOWS64 || defined DISABLE_PSN || defined _DISABLE_XBLIVE
|
||||
#include "Xbox\Network\NetworkPlayerXbox.h"
|
||||
#include "Common\Network\PlatformNetworkManager.h"
|
||||
#endif
|
||||
|
||||
#ifdef _DURANGO
|
||||
#include "..\Minecraft.World\DurangoStats.h"
|
||||
#include "..\Minecraft.World\GenericStats.h"
|
||||
@@ -771,6 +776,7 @@ void ClientConnection::handleAddPlayer(shared_ptr<AddPlayerPacket> packet)
|
||||
player->yRotp = packet->yRot;
|
||||
player->yHeadRot = packet->yHeadRot * 360 / 256.0f;
|
||||
player->setXuid(packet->xuid);
|
||||
player->setOnlineXuid(packet->OnlineXuid);
|
||||
|
||||
#ifdef _DURANGO
|
||||
// On Durango request player display name from network manager
|
||||
@@ -781,6 +787,32 @@ void ClientConnection::handleAddPlayer(shared_ptr<AddPlayerPacket> packet)
|
||||
player->m_displayName = player->name;
|
||||
#endif
|
||||
|
||||
#if defined _WINDOWS64 || defined DISABLE_PSN || defined _DISABLE_XBLIVE
|
||||
{
|
||||
PlayerUID netXuid = packet->OnlineXuid;
|
||||
const PlayerUID WIN64_XUID_BASE = (PlayerUID)0xe000d45248242f2e;
|
||||
if (netXuid >= WIN64_XUID_BASE && netXuid < WIN64_XUID_BASE + MINECRAFT_NET_MAX_PLAYERS)
|
||||
{
|
||||
BYTE smallId = (BYTE)(netXuid - WIN64_XUID_BASE);
|
||||
INetworkPlayer *np = g_NetworkManager.GetPlayerBySmallId(smallId);
|
||||
if (np != NULL)
|
||||
{
|
||||
NetworkPlayerXbox *npx = (NetworkPlayerXbox *)np;
|
||||
IQNetPlayer *qp = npx->GetQNetPlayer();
|
||||
if (qp != NULL)
|
||||
{
|
||||
wcsncpy(qp->m_gamertag, packet->name.c_str(), 31);
|
||||
qp->m_gamertag[31] = L'\0';
|
||||
if (g_NetworkManager.IsHost())
|
||||
{
|
||||
g_NetworkManager.UpdateAndSetGameSessionData();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// printf("\t\t\t\t%d: Add player\n",packet->id,packet->yRot);
|
||||
|
||||
int item = packet->carriedItem;
|
||||
@@ -1004,6 +1036,7 @@ void ClientConnection::handleChunkVisibility(shared_ptr<ChunkVisibilityPacket> p
|
||||
void ClientConnection::handleChunkTilesUpdate(shared_ptr<ChunkTilesUpdatePacket> packet)
|
||||
{
|
||||
// 4J - changed to encode level in packet
|
||||
if (packet->levelIdx >= minecraft->levels.length) return;
|
||||
MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx];
|
||||
if( dimensionLevel )
|
||||
{
|
||||
@@ -1073,6 +1106,7 @@ void ClientConnection::handleChunkTilesUpdate(shared_ptr<ChunkTilesUpdatePacket>
|
||||
void ClientConnection::handleBlockRegionUpdate(shared_ptr<BlockRegionUpdatePacket> packet)
|
||||
{
|
||||
// 4J - changed to encode level in packet
|
||||
if (packet->levelIdx >= minecraft->levels.length) return;
|
||||
MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx];
|
||||
if( dimensionLevel )
|
||||
{
|
||||
@@ -1130,6 +1164,8 @@ void ClientConnection::handleTileUpdate(shared_ptr<TileUpdatePacket> packet)
|
||||
destroyTilePacket = true;
|
||||
}
|
||||
// 4J - changed to encode level in packet
|
||||
if (packet->levelIdx >= minecraft->levels.length) return;
|
||||
|
||||
MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx];
|
||||
if( dimensionLevel )
|
||||
{
|
||||
@@ -1769,6 +1805,7 @@ void ClientConnection::handleEntityActionAtPosition(shared_ptr<EntityActionAtPos
|
||||
|
||||
void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
||||
{
|
||||
app.DebugPrintf("ClientConnection::handlePreLogin ENTER (user %d)\n", m_userIndex);
|
||||
// printf("Client: handlePreLogin\n");
|
||||
#if 1
|
||||
// 4J - Check that we can play with all the players already in the game who have Friends-Only UGC set
|
||||
@@ -1791,6 +1828,7 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
||||
}
|
||||
|
||||
#ifdef _XBOX
|
||||
#if !defined(_DISABLE_XBLIVE)
|
||||
if(!g_NetworkManager.IsHost() && !app.GetGameHostOption(eGameHostOption_FriendsOfFriends))
|
||||
{
|
||||
if(m_userIndex == ProfileManager.GetPrimaryPad() )
|
||||
@@ -1934,6 +1972,16 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
// Offline/system-link games have no Xbox Live friend list, so grant all
|
||||
// pre-login permissions (the Xbox Live-only checks above would otherwise
|
||||
// fail and reject the client's own pre-login before Login is ever sent).
|
||||
canPlay = TRUE;
|
||||
canPlayLocal = TRUE;
|
||||
isAtLeastOneFriend = TRUE;
|
||||
isFriendsWithHost = TRUE;
|
||||
cantPlayContentRestricted = FALSE;
|
||||
#endif // _DISABLE_XBLIVE
|
||||
#else
|
||||
// TODO - handle this kind of things for non-360 platforms
|
||||
canPlay = TRUE;
|
||||
@@ -1941,7 +1989,7 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
||||
isAtLeastOneFriend = TRUE;
|
||||
cantPlayContentRestricted= FALSE;
|
||||
|
||||
#if ( defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
||||
#if !defined DISABLE_PSN && ( defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
||||
|
||||
if(!g_NetworkManager.IsHost() && !app.GetGameHostOption(eGameHostOption_FriendsOfFriends))
|
||||
{
|
||||
@@ -2223,7 +2271,8 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
||||
}
|
||||
BOOL allAllowed, friendsAllowed;
|
||||
ProfileManager.AllowedPlayerCreatedContent(m_userIndex,true,&allAllowed,&friendsAllowed);
|
||||
send( shared_ptr<LoginPacket>( new LoginPacket(minecraft->user->name, SharedConstants::NETWORK_PROTOCOL_VERSION, offlineXUID, onlineXUID, (allAllowed!=TRUE && friendsAllowed==TRUE),
|
||||
app.DebugPrintf("ClientConnection::handlePreLogin SENDING LoginPacket (user %d)\n", m_userIndex);
|
||||
send( shared_ptr<LoginPacket>( new LoginPacket(minecraft->user->name, SharedConstants::NETWORK_PROTOCOL_VERSION, offlineXUID, onlineXUID, (allAllowed!=TRUE && friendsAllowed==TRUE),
|
||||
packet->m_ugcPlayersVersion, app.GetPlayerSkinId(m_userIndex), app.GetPlayerCapeId(m_userIndex), ProfileManager.IsGuest( m_userIndex ))));
|
||||
|
||||
if(!g_NetworkManager.IsHost() )
|
||||
@@ -2273,6 +2322,7 @@ void ClientConnection::handleAddMob(shared_ptr<AddMobPacket> packet)
|
||||
float xRot = packet->xRot * 360 / 256.0f;
|
||||
|
||||
shared_ptr<LivingEntity> mob = dynamic_pointer_cast<LivingEntity>(EntityIO::newById(packet->type, level));
|
||||
if (mob == NULL) return;
|
||||
mob->xp = packet->x;
|
||||
mob->yp = packet->y;
|
||||
mob->zp = packet->z;
|
||||
@@ -3516,10 +3566,12 @@ void ClientConnection::handleCustomPayload(shared_ptr<CustomPayloadPacket> custo
|
||||
}
|
||||
#else
|
||||
UIScene *scene = ui.GetTopScene(m_userIndex, eUILayer_Scene);
|
||||
UIScene_TradingMenu *screen = (UIScene_TradingMenu *)scene;
|
||||
trader = screen->getMerchant();
|
||||
UIScene_TradingMenu *screen = dynamic_cast<UIScene_TradingMenu *>(scene);
|
||||
if (screen != NULL)
|
||||
trader = screen->getMerchant();
|
||||
#endif
|
||||
|
||||
if (trader == NULL) return;
|
||||
MerchantRecipeList *recipeList = MerchantRecipeList::createFromStream(&input);
|
||||
trader->overrideOffers(recipeList);
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ MOJANG_DATA;
|
||||
typedef struct
|
||||
{
|
||||
eDLCContentType eDLCType;
|
||||
#if defined( __PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && (defined( __PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
char chImageURL[256];//SCE_NP_COMMERCE2_URL_LEN
|
||||
#else
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ void SoundEngine::playMusicTick() {};
|
||||
#ifdef _WINDOWS64
|
||||
char SoundEngine::m_szSoundPath[]={"Windows64Media\\Sound\\"};
|
||||
char SoundEngine::m_szMusicPath[]={"music\\"};
|
||||
char SoundEngine::m_szRedistName[]={"Windows64\\redist64"}; //str1k3r - moved this to a the Windows64 dir so its out of plain view
|
||||
char SoundEngine::m_szRedistName[]={"redist64"};
|
||||
#elif defined _DURANGO
|
||||
char SoundEngine::m_szSoundPath[]={"Sound\\"};
|
||||
char SoundEngine::m_szMusicPath[]={"music\\"};
|
||||
@@ -791,9 +791,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
|
||||
char *SoundName = (char *)ConvertSoundPathToName(name);
|
||||
strcat((char *)szSoundName,SoundName);
|
||||
|
||||
#ifdef _DEBUG
|
||||
app.DebugPrintf(6,"PlaySound - %d - %s - %s (%f %f %f, vol %f, pitch %f)\n",iSound, SoundName, szSoundName,x,y,z,volume,pitch);
|
||||
#endif
|
||||
// app.DebugPrintf(6,"PlaySound - %d - %s - %s (%f %f %f, vol %f, pitch %f)\n",iSound, SoundName, szSoundName,x,y,z,volume,pitch);
|
||||
|
||||
AUDIO_INFO AudioInfo;
|
||||
AudioInfo.x=x;
|
||||
@@ -848,11 +846,9 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
|
||||
|
||||
char *SoundName = (char *)ConvertSoundPathToName(name);
|
||||
strcat((char *)szSoundName,SoundName);
|
||||
// app.DebugPrintf("UI: Playing %s, volume %f, pitch %f\n",SoundName,volume,pitch);
|
||||
|
||||
#ifdef _DEBUG
|
||||
app.DebugPrintf("UI: Playing %s, volume %f, pitch %f\n",SoundName,volume,pitch);
|
||||
app.DebugPrintf("PlaySound - %d - %s\n",iSound, SoundName);
|
||||
#endif
|
||||
//app.DebugPrintf("PlaySound - %d - %s\n",iSound, SoundName);
|
||||
|
||||
AUDIO_INFO AudioInfo;
|
||||
memset(&AudioInfo,0,sizeof(AUDIO_INFO));
|
||||
@@ -1140,12 +1136,10 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
|
||||
SoundEngine *soundEngine = (SoundEngine *)lpParameter;
|
||||
soundEngine->m_hStream = AIL_open_stream(soundEngine->m_hDriver,soundEngine->m_szStreamName,0);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if(soundEngine->m_hStream==0)
|
||||
{
|
||||
app.DebugPrintf("SoundEngine::OpenStreamThreadProc - Could not open - %s\n",soundEngine->m_szStreamName);
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
param(
|
||||
[string]$ProjectDir,
|
||||
[string]$Platform,
|
||||
[string]$Configuration
|
||||
)
|
||||
|
||||
if ($ProjectDir -match "Minecraft.World") {
|
||||
$BaseDir = "$ProjectDir..\Minecraft.Client\"
|
||||
} elseif ($ProjectDir -match "Minecraft.Client") {
|
||||
$BaseDir = $ProjectDir
|
||||
} else {
|
||||
Write-Host "4JLibs: Unknown project directory: '$ProjectDir'"
|
||||
exit 1
|
||||
}
|
||||
|
||||
switch ($Platform) {
|
||||
"x64" { $LibsDir = Join-Path $BaseDir "Windows64\4JLibs\"; $ExpectedCount = 4; $PlatformName = "Windows64" }
|
||||
"Durango" { $LibsDir = Join-Path $BaseDir "Durango\4JLibs\"; $ExpectedCount = 4; $PlatformName = "Durango" }
|
||||
"Xbox 360" { $LibsDir = Join-Path $BaseDir "Xbox\4JLibs\"; $ExpectedCount = 5; $PlatformName = "Xbox" }
|
||||
"PS3" { $LibsDir = Join-Path $BaseDir "PS3\4JLibs\"; $ExpectedCount = 4; $PlatformName = "PS3" }
|
||||
"Orbis" { $LibsDir = Join-Path $BaseDir "Orbis\4JLibs\"; $ExpectedCount = 4; $PlatformName = "Orbis" }
|
||||
"PSVita" { $LibsDir = Join-Path $BaseDir "PSVita\4JLibs\"; $ExpectedCount = 4; $PlatformName = "PSVita" }
|
||||
default { Write-Host "4JLibs: Unknown platform: '$Platform'"; exit 1 }
|
||||
}
|
||||
|
||||
if ($Configuration -match "ContentPackage" -or $Configuration -match "Release") {
|
||||
$BuildConfig = "Release"
|
||||
} elseif ($Configuration -match "Debug") {
|
||||
$BuildConfig = "Debug"
|
||||
} else {
|
||||
Write-Host "4JLibs: Configuration did not match any known patterns, defaulting to Debug"
|
||||
$BuildConfig = "Debug"
|
||||
}
|
||||
|
||||
if (-not (Test-Path $LibsDir)) {
|
||||
Write-Host "4JLibs: $PlatformName 4JLibs directory not found"
|
||||
exit 1
|
||||
} elseif (-not (Test-Path "$LibsDir\Headers\$PlatformName")) {
|
||||
Write-Host "4JLibs: $PlatformName 4JLibs Headers directory not found"
|
||||
exit 1
|
||||
} elseif (-not (Test-Path "$LibsDir\Headers")) {
|
||||
Write-Host "4JLibs: Headers directory not found"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$incPath = Join-Path $LibsDir "inc"
|
||||
$libsPath = Join-Path $LibsDir "libs"
|
||||
|
||||
$incCount = (Get-ChildItem -Path $incPath -Filter "*.h" -ErrorAction SilentlyContinue).Count
|
||||
|
||||
if ($BuildConfig -eq "Release") {
|
||||
$libCount = (Get-ChildItem -Path $libsPath -Filter "*_r.lib" -ErrorAction SilentlyContinue).Count
|
||||
} else {
|
||||
$libCount = (Get-ChildItem -Path $libsPath -Filter "*_d.lib" -ErrorAction SilentlyContinue).Count
|
||||
}
|
||||
|
||||
if ($incCount -lt $ExpectedCount) {
|
||||
Write-Host "4JLibs: Copying header files for $PlatformName"
|
||||
xcopy "$LibsDir\Headers\$PlatformName\*" "$incPath" /E /I /Y
|
||||
} else {
|
||||
Write-Host "4JLibs: inc files already present, skipping copy."
|
||||
}
|
||||
|
||||
if ($libCount -lt $ExpectedCount) {
|
||||
Write-Host "4JLibs: Building 4JLibs for $PlatformName in $BuildConfig"
|
||||
|
||||
& "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" `
|
||||
(Join-Path $LibsDir "4JLibs.sln") `
|
||||
/p:Configuration=$BuildConfig `
|
||||
/p:Platform=$PlatformName `
|
||||
/v:minimal `
|
||||
/m
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "4JLibs: Build failed with exit code: $LASTEXITCODE"
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
} else {
|
||||
Write-Host "4JLibs: libs already present, skipping build."
|
||||
}
|
||||
@@ -4419,7 +4419,7 @@ int CMinecraftApp::EthernetDisconnectReturned(void *pParam,int iPad,const C4JSto
|
||||
// 4J-PB - turn off the PSN store icon just in case this happened when we were in one of the DLC menus
|
||||
#ifdef __ORBIS__
|
||||
sceNpCommerceHidePsStoreIcon();
|
||||
#elif defined __PSVITA__
|
||||
#elif defined(__PSVITA__) && !defined(DISABLE_PSN)
|
||||
app.GetCommerce()->HidePsStoreIcon();
|
||||
#endif
|
||||
app.SetAction(iPad,eAppAction_EthernetDisconnectedReturned_Menus);
|
||||
@@ -4889,11 +4889,13 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange
|
||||
// 4J Stu - On PS4 we can also cause to exit players if they are signed out here, but we shouldn't do that if
|
||||
// we are going to switch to an offline game as it will likely crash due to incompatible parallel processes
|
||||
bool switchToOffline = false;
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
// If it's an online game, and the primary profile is no longer signed into LIVE then we act as if disconnected
|
||||
if( !ProfileManager.IsSignedInLive( ProfileManager.GetLockedProfile() ) && !g_NetworkManager.IsLocalGame() )
|
||||
{
|
||||
switchToOffline = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
//printf("Old: %x, New: %x, Changed: %x\n", m_ulLastSignInData, ulSignInData, changedPlayers);
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
|
||||
@@ -4958,6 +4960,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange
|
||||
|
||||
g_NetworkManager.HandleSignInChange();
|
||||
}
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
// Some menus require the player to be signed in to live, so if this callback happens and the primary player is
|
||||
// no longer signed in then nav back
|
||||
else if ( pApp->GetLiveLinkRequired() && !ProfileManager.IsSignedInLive( ProfileManager.GetLockedProfile() ) )
|
||||
@@ -4969,6 +4972,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange
|
||||
pApp->SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ )
|
||||
// 4J-JEV: Need to kick of loading of profile data for sub-sign in players.
|
||||
@@ -5094,6 +5098,9 @@ void CMinecraftApp::NotificationsCallback(LPVOID pParam,DWORD dwNotification, un
|
||||
#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__
|
||||
int CMinecraftApp::MustSignInFullVersionPurchaseReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
#ifdef DISABLE_PSN
|
||||
return 0;
|
||||
#else
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
#ifdef __PS3__
|
||||
@@ -5106,11 +5113,15 @@ int CMinecraftApp::MustSignInFullVersionPurchaseReturned(void *pParam,int iPad,C
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__
|
||||
int CMinecraftApp::MustSignInFullVersionPurchaseReturnedExitTrial(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
#ifdef DISABLE_PSN
|
||||
return 0;
|
||||
#else
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
#ifdef __PS3__
|
||||
@@ -5126,6 +5137,7 @@ int CMinecraftApp::MustSignInFullVersionPurchaseReturnedExitTrial(void *pParam,i
|
||||
app.SetAction(iPad,eAppAction_ExitWorldTrial);
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -6761,7 +6773,7 @@ wstring CMinecraftApp::GetIconReplacement(unsigned int uiIcon)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
unordered_map<PlayerUID, MOJANG_DATA *, PlayerUID::Hash> CMinecraftApp::MojangData;
|
||||
unordered_map<int, char * > CMinecraftApp::DLCTextures_PackID;
|
||||
unordered_map<string, DLC_INFO * > CMinecraftApp::DLCInfo;
|
||||
@@ -6772,6 +6784,12 @@ unordered_map<int, wstring > CMinecraftApp::DLCTextures_PackID; // for mash-up
|
||||
//unordered_map<ULONGLONG,DLC_INFO * > CMinecraftApp::DLCInfo_Trial; // full offerid, dlc_info
|
||||
unordered_map<wstring,DLC_INFO * > CMinecraftApp::DLCInfo_Full; // full offerid, dlc_info
|
||||
unordered_map<wstring, wstring > CMinecraftApp::DLCInfo_SkinName; // skin name, full offer id
|
||||
#elif defined(DISABLE_PSN)
|
||||
unordered_map<PlayerUID, MOJANG_DATA *, PlayerUID::Hash> CMinecraftApp::MojangData;
|
||||
unordered_map<int, ULONGLONG > CMinecraftApp::DLCTextures_PackID;
|
||||
unordered_map<ULONGLONG, DLC_INFO * > CMinecraftApp::DLCInfo_Trial;
|
||||
unordered_map<ULONGLONG, DLC_INFO * > CMinecraftApp::DLCInfo_Full;
|
||||
unordered_map<wstring, ULONGLONG > CMinecraftApp::DLCInfo_SkinName;
|
||||
#else
|
||||
unordered_map<PlayerUID, MOJANG_DATA *> CMinecraftApp::MojangData;
|
||||
unordered_map<int, ULONGLONG > CMinecraftApp::DLCTextures_PackID;
|
||||
@@ -6854,7 +6872,7 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue)
|
||||
return hr;
|
||||
}
|
||||
|
||||
#if (defined _XBOX || defined _WINDOWS64)
|
||||
#if (defined _XBOX || defined _WINDOWS64 || defined DISABLE_PSN)
|
||||
HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGender, __uint64 ullOfferID_Full, __uint64 ullOfferID_Trial, WCHAR *pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR *pDataFile)
|
||||
{
|
||||
HRESULT hr=S_OK;
|
||||
@@ -6871,12 +6889,20 @@ HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGe
|
||||
// ignore the names if we don't recognize them
|
||||
if(pBannerName!=L"")
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
wcsncpy_s( pDLCData->wchBanner, MAX_BANNERNAME_SIZE, pBannerName, MAX_BANNERNAME_SIZE);
|
||||
#else
|
||||
wcsncpy_s( pDLCData->wchBanner, pBannerName, MAX_BANNERNAME_SIZE);
|
||||
#endif
|
||||
}
|
||||
|
||||
if(pDataFile[0]!=0)
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
wcsncpy_s( pDLCData->wchDataFile, MAX_BANNERNAME_SIZE, pDataFile, MAX_BANNERNAME_SIZE);
|
||||
#else
|
||||
wcsncpy_s( pDLCData->wchDataFile, pDataFile, MAX_BANNERNAME_SIZE);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -7046,7 +7072,7 @@ HRESULT CMinecraftApp::RegisterDLCData(char *pchDLCName, unsigned int uiSortInde
|
||||
|
||||
|
||||
|
||||
#if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && (defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__))
|
||||
bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal)
|
||||
{
|
||||
AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin));
|
||||
@@ -7314,7 +7340,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForProductName(WCHAR *pwchProductName)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#elif defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
#elif !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
#else
|
||||
|
||||
DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full)
|
||||
@@ -9425,7 +9451,7 @@ byteArray CMinecraftApp::getArchiveFile(const wstring &filename)
|
||||
|
||||
// DLC
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
int CMinecraftApp::GetDLCInfoCount()
|
||||
{
|
||||
return (int)DLCInfo.size();
|
||||
@@ -10034,11 +10060,11 @@ enum ETitleUpdateTexturePacks
|
||||
#ifdef _WINDOWS64
|
||||
wstring titleUpdateTexturePackRoot = L"Windows64\\DLC\\";
|
||||
#elif defined(__ORBIS__)
|
||||
wstring titleUpdateTexturePackRoot = L"app0/Orbis/DLC/";
|
||||
wstring titleUpdateTexturePackRoot = L"/app0/orbis/CU/DLC/";
|
||||
#elif defined(__PSVITA__)
|
||||
wstring titleUpdateTexturePackRoot = L"PSVita/DLC/";
|
||||
wstring titleUpdateTexturePackRoot = L"PSVita/CU/DLC/";
|
||||
#elif defined(__PS3__)
|
||||
wstring titleUpdateTexturePackRoot = L"PS3/DLC/";
|
||||
wstring titleUpdateTexturePackRoot = L"PS3/CU/DLC/";
|
||||
#else
|
||||
wstring titleUpdateTexturePackRoot = L"CU\\DLC\\";
|
||||
#endif
|
||||
|
||||
@@ -594,7 +594,7 @@ public:
|
||||
MOJANG_DATA *GetMojangDataForXuid(PlayerUID xuid);
|
||||
static HRESULT RegisterConfigValues(WCHAR *pType, int iValue);
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__))
|
||||
HRESULT RegisterDLCData(char *pchDLCName, unsigned int uiSortIndex, char *pchImageURL);
|
||||
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal);
|
||||
DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial);
|
||||
@@ -631,7 +631,7 @@ private:
|
||||
|
||||
std::vector <SCreditTextItemDef *> vDLCCredits;
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
|
||||
static unordered_map<int, char * > DLCTextures_PackID; // for mash-up packs & texture packs
|
||||
static unordered_map<string,DLC_INFO * > DLCInfo;
|
||||
@@ -642,6 +642,12 @@ private:
|
||||
//static unordered_map<wstring,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info
|
||||
static unordered_map<wstring,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info
|
||||
static unordered_map<wstring, wstring > DLCInfo_SkinName; // skin name, full offer id
|
||||
#elif defined(DISABLE_PSN)
|
||||
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
|
||||
static unordered_map<int, ULONGLONG > DLCTextures_PackID; // for mash-up packs & texture packs
|
||||
static unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info
|
||||
static unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info
|
||||
static unordered_map<wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id
|
||||
#else
|
||||
static unordered_map<PlayerUID,MOJANG_DATA * > MojangData;
|
||||
static unordered_map<int, ULONGLONG > DLCTextures_PackID; // for mash-up packs & texture packs
|
||||
@@ -772,7 +778,7 @@ public:
|
||||
void ClearTMSPPFilesRetrieved();
|
||||
unsigned int AddTMSPPFileTypeRequest(eDLCContentType eType, bool bPromote=false);
|
||||
int GetDLCInfoTexturesOffersCount();
|
||||
#if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && (defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__))
|
||||
DLC_INFO *GetDLCInfo(int iIndex);
|
||||
DLC_INFO *GetDLCInfo(char *);
|
||||
DLC_INFO *GetDLCInfoFromTPackID(int iTPID);
|
||||
|
||||
@@ -406,12 +406,6 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
||||
unsigned int uiVersion=*(unsigned int *)pbData;
|
||||
uiCurrentByte+=sizeof(int);
|
||||
|
||||
if(uiVersion > CURRENT_DLC_VERSION_NUM)
|
||||
{
|
||||
if(pbData!=NULL) delete [] pbData;
|
||||
app.DebugPrintf("DLC version of %d is newer than this build can read (%d)\n", uiVersion, CURRENT_DLC_VERSION_NUM);
|
||||
return false;
|
||||
}
|
||||
if(uiVersion < CURRENT_DLC_VERSION_NUM)
|
||||
{
|
||||
if(pbData!=NULL) delete [] pbData;
|
||||
@@ -619,11 +613,6 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
|
||||
unsigned int uiVersion=*(unsigned int *)pbData;
|
||||
uiCurrentByte+=sizeof(int);
|
||||
|
||||
if(uiVersion > CURRENT_DLC_VERSION_NUM)
|
||||
{
|
||||
app.DebugPrintf("DLC version of %d is newer than this build can read (%d)\n", uiVersion, CURRENT_DLC_VERSION_NUM);
|
||||
return 0;
|
||||
}
|
||||
if(uiVersion < CURRENT_DLC_VERSION_NUM)
|
||||
{
|
||||
app.DebugPrintf("DLC version of %d is too old to be read\n", uiVersion);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
base64.cpp and base64.h
|
||||
|
||||
Copyright (C) 2004-2008 René Nyffenegger
|
||||
Copyright (C) 2004-2008 René Nyffenegger
|
||||
|
||||
This source code is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the author be held liable for any damages
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
|
||||
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
|
||||
|
||||
*/
|
||||
|
||||
@@ -41,7 +41,7 @@ static inline bool is_base64(unsigned char c) {
|
||||
}
|
||||
|
||||
// 4J ADDED,
|
||||
std::string base64_encode(std::string str)
|
||||
std::string base64_encode(const std::string& str)
|
||||
{
|
||||
return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() );
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
std::string base64_encode(std::string str);
|
||||
std::string base64_encode(const std::string& str);
|
||||
std::string base64_encode(unsigned char const* , unsigned int len);
|
||||
std::string base64_decode(std::string const& s);
|
||||
@@ -66,9 +66,9 @@ 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 __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
#elif !defined(DISABLE_PSN) && (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
||||
s_pPlatformNetworkManager = new CPlatformNetworkManagerSony();
|
||||
#elif defined _DURANGO
|
||||
s_pPlatformNetworkManager = new CPlatformNetworkManagerDurango();
|
||||
@@ -100,12 +100,14 @@ void CGameNetworkManager::DoWork()
|
||||
{
|
||||
case XN_LIVE_LINK_STATE_CHANGED:
|
||||
{
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
int iPrimaryPlayer = g_NetworkManager.GetPrimaryPad();
|
||||
bool bConnected = (pNotification->uiParam!=0)?true:false;
|
||||
if((g_NetworkManager.GetLockedProfile()!=-1) && iPrimaryPlayer!=-1 && bConnected == false && g_NetworkManager.IsInSession() )
|
||||
{
|
||||
app.SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case XN_LIVE_INVITE_ACCEPTED:
|
||||
@@ -167,6 +169,11 @@ bool CGameNetworkManager::_RunNetworkGame(LPVOID lpParameter)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Client needs QNET_STATE_GAME_PLAY so that IsInGameplay() returns true
|
||||
s_pPlatformNetworkManager->SetGamePlayState();
|
||||
}
|
||||
|
||||
if( g_NetworkManager.IsLeavingGame() ) return false;
|
||||
|
||||
@@ -336,10 +343,12 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
|
||||
// 4J Stu - Wait a while to make sure that DLC is loaded. This is the last point before the network communication starts
|
||||
// so the latest we can check this
|
||||
#ifndef DISABLE_PSN
|
||||
while( !app.DLCInstallProcessCompleted() && app.DLCInstallPending() && !g_NetworkManager.IsLeavingGame() )
|
||||
{
|
||||
Sleep( 10 );
|
||||
}
|
||||
#endif
|
||||
if( g_NetworkManager.IsLeavingGame() )
|
||||
{
|
||||
MinecraftServer::HaltServer();
|
||||
@@ -496,7 +505,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
// The connections should tick at 20 per second
|
||||
Sleep(50);
|
||||
app.DebugPrintf("<***> %d %d %d %d %d\n",IsInSession(), !connection->isStarted(),!connection->isClosed(),ProfileManager.IsSignedIn(idx),!g_NetworkManager.IsLeavingGame());
|
||||
#if defined _XBOX || __PS3__
|
||||
#if defined _XBOX || defined __PS3__ && !defined DISABLE_PSN
|
||||
} while (IsInSession() && !connection->isStarted() && !connection->isClosed() && ProfileManager.IsSignedIn(idx) && !g_NetworkManager.IsLeavingGame() );
|
||||
#else
|
||||
// TODO - This SHOULD be something just like the code above but temporarily changing here so that we don't have to depend on the profilemanager behaviour
|
||||
@@ -775,7 +784,11 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
|
||||
|
||||
app.DebugPrintf("JoinFromInvite_SignInReturned, iPad %d\n",iPad);
|
||||
// It's possible that the player has not signed in - they can back out
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
if(ProfileManager.IsSignedIn(iPad) && ProfileManager.IsSignedInLive(iPad) )
|
||||
#else
|
||||
if(ProfileManager.IsSignedIn(iPad))
|
||||
#endif
|
||||
{
|
||||
app.DebugPrintf("JoinFromInvite_SignInReturned, passed sign-in tests\n");
|
||||
int localUsersMask = 0;
|
||||
@@ -787,14 +800,16 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
|
||||
if(ProfileManager.IsSignedIn(index) )
|
||||
{
|
||||
++joiningUsers;
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
#endif
|
||||
localUsersMask |= GetLocalPlayerMask( index );
|
||||
}
|
||||
}
|
||||
|
||||
// Check if user-created content is allowed, as we cannot play multiplayer if it's not
|
||||
bool noUGC = false;
|
||||
#if defined(__PS3__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__PSVITA__))
|
||||
ProfileManager.GetChatAndContentRestrictions(iPad,false,&noUGC,NULL,NULL);
|
||||
#elif defined(__ORBIS__)
|
||||
ProfileManager.GetChatAndContentRestrictions(iPad,false,NULL,&noUGC,NULL);
|
||||
@@ -883,6 +898,12 @@ bool CGameNetworkManager::IsNetworkThreadRunning()
|
||||
|
||||
int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
|
||||
{
|
||||
if( g_NetworkManager.m_bNetworkThreadRunning )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
g_NetworkManager.m_bNetworkThreadRunning = true;
|
||||
|
||||
// Share AABB & Vec3 pools with default (main thread) - should be ok as long as we don't tick the main thread whilst this thread is running
|
||||
AABB::UseDefaultThreadStorage();
|
||||
Vec3::UseDefaultThreadStorage();
|
||||
@@ -890,7 +911,6 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
|
||||
Tile::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
|
||||
g_NetworkManager.m_bNetworkThreadRunning = true;
|
||||
bool success = g_NetworkManager._RunNetworkGame(lpParameter);
|
||||
g_NetworkManager.m_bNetworkThreadRunning = false;
|
||||
if( !success)
|
||||
@@ -898,7 +918,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
|
||||
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
|
||||
while ( tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()) )
|
||||
{
|
||||
Sleep(1);
|
||||
Sleep(0);
|
||||
}
|
||||
ui.CleanUpSkinReload();
|
||||
if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None)
|
||||
@@ -935,7 +955,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter )
|
||||
{
|
||||
while((Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()))
|
||||
{
|
||||
Sleep(1);
|
||||
Sleep(0);
|
||||
}
|
||||
param->levelGen->loadBaseSaveData();
|
||||
}
|
||||
@@ -977,7 +997,7 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc( void* lpParam )
|
||||
|
||||
while( g_NetworkManager.IsInSession() )
|
||||
{
|
||||
Sleep(1);
|
||||
Sleep(0);
|
||||
}
|
||||
|
||||
// Xbox should always be online when receiving invites - on PS3 we need to check & ask the user to sign in
|
||||
@@ -1007,6 +1027,9 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc( void* lpParam )
|
||||
// The pair of methods MustSignInReturned_0 & PSNSignInReturned_0 handle this
|
||||
int CGameNetworkManager::MustSignInReturned_0(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
#ifdef DISABLE_PSN
|
||||
return 0;
|
||||
#else
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
#ifdef __PS3__
|
||||
@@ -1025,10 +1048,14 @@ int CGameNetworkManager::MustSignInReturned_0(void *pParam,int iPad,C4JStorage::
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int CGameNetworkManager::PSNSignInReturned_0(void* pParam, bool bContinue, int iPad)
|
||||
{
|
||||
#ifdef DISABLE_PSN
|
||||
return 0;
|
||||
#else
|
||||
JoinFromInviteData *inviteData = (JoinFromInviteData *)pParam;
|
||||
|
||||
// If the invite data isn't set up yet (indicated by it being all zeroes, easiest detected via the net version), then try and get it again... this can happen if we got
|
||||
@@ -1061,12 +1088,16 @@ int CGameNetworkManager::PSNSignInReturned_0(void* pParam, bool bContinue, int i
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// This case happens when we were in the main menus when we got an invite, and weren't signed in... now can proceed with the normal flow of code for this situation
|
||||
// The pair of methods MustSignInReturned_1 & PSNSignInReturned_1 handle this
|
||||
int CGameNetworkManager::MustSignInReturned_1(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
#ifdef DISABLE_PSN
|
||||
return 0;
|
||||
#else
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
#ifdef __PS3__
|
||||
@@ -1078,10 +1109,14 @@ int CGameNetworkManager::MustSignInReturned_1(void *pParam,int iPad,C4JStorage::
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int CGameNetworkManager::PSNSignInReturned_1(void* pParam, bool bContinue, int iPad)
|
||||
{
|
||||
#ifdef DISABLE_PSN
|
||||
return 0;
|
||||
#else
|
||||
INVITE_INFO *inviteInfo = (INVITE_INFO *)pParam;
|
||||
|
||||
// If the invite data isn't set up yet (indicated by it being all zeroes, easiest detected via the net version), then try and get it again... this can happen if we got
|
||||
@@ -1109,6 +1144,7 @@ int CGameNetworkManager::PSNSignInReturned_1(void* pParam, bool bContinue, int i
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1237,7 +1273,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
// wait for the current session to end
|
||||
while( g_NetworkManager.IsInSession() )
|
||||
{
|
||||
Sleep(1);
|
||||
Sleep(0);
|
||||
}
|
||||
|
||||
// Reset this flag as the we don't need to know that we only lost the room only from this point onwards, the behaviour is exactly the same
|
||||
@@ -1446,7 +1482,7 @@ void CGameNetworkManager::StateChange_AnyToEnding(bool bStateWasPlaying)
|
||||
if(pNetworkPlayer != NULL && ProfileManager.IsSignedIn( i ) )
|
||||
{
|
||||
app.DebugPrintf("Stats save for an offline game for the player at index %d\n", i );
|
||||
Minecraft::GetInstance()->forceStatsSave(pNetworkPlayer->GetUserIndex());
|
||||
//Minecraft::GetInstance()->forceStatsSave(pNetworkPlayer->GetUserIndex());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1479,7 +1515,10 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
Socket *socket = NULL;
|
||||
shared_ptr<MultiplayerLocalPlayer> mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()];
|
||||
shared_ptr<MultiplayerLocalPlayer> mpPlayer = nullptr;
|
||||
int userIdx = pNetworkPlayer->GetUserIndex();
|
||||
if (userIdx >= 0 && userIdx < XUSER_MAX_COUNT)
|
||||
mpPlayer = pMinecraft->localplayers[userIdx];
|
||||
if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL)
|
||||
{
|
||||
// If we already have a MultiplayerLocalPlayer here then we are doing a session type change
|
||||
@@ -1639,6 +1678,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
{
|
||||
if (ProfileManager.IsSignedIn(i) && (i == ProfileManager.GetPrimaryPad() || isLocalMultiplayerAvailable))
|
||||
{
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
if (isSignedInLive && !ProfileManager.IsSignedInLive(i))
|
||||
{
|
||||
// Record the first non signed in live pad
|
||||
@@ -1646,6 +1686,9 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
}
|
||||
|
||||
isSignedInLive = isSignedInLive && ProfileManager.IsSignedInLive(i);
|
||||
#else
|
||||
isSignedInLive = true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1717,7 +1760,9 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
if(index==userIndex || pMinecraft->localplayers[index]!=NULL )
|
||||
{
|
||||
++joiningUsers;
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
#endif
|
||||
localUsersMask |= GetLocalPlayerMask( index );
|
||||
}
|
||||
}
|
||||
@@ -1789,7 +1834,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
#endif
|
||||
if( !g_NetworkManager.IsInSession() )
|
||||
{
|
||||
#if defined (__PS3__) || defined (__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && (defined (__PS3__) || defined (__PSVITA__))
|
||||
// PS3 is more complicated here - we need to make sure that the player is online. If they are then we can do the same as the xbox, if not we need to try and get them online and then, if they do sign in, go down the same path
|
||||
|
||||
// Determine why they're not "signed in live"
|
||||
@@ -1821,7 +1866,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
// joinData->pInviteInfo = pInviteInfo;
|
||||
|
||||
// tell the app to process this
|
||||
#ifdef __PSVITA__
|
||||
#if !defined(DISABLE_PSN) && defined(__PSVITA__)
|
||||
if(((CPlatformNetworkManagerSony*)s_pPlatformNetworkManager)->checkValidInviteData(pInviteInfo))
|
||||
#endif
|
||||
{
|
||||
@@ -1872,6 +1917,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
||||
if(!app.IsLocalMultiplayerAvailable())
|
||||
#endif
|
||||
{
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
bool noPrivileges=!ProfileManager.AllowedToPlayMultiplayer(userIndex);
|
||||
|
||||
if(noPrivileges)
|
||||
@@ -1882,6 +1928,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
ProfileManager.SetLockedProfile(userIndex);
|
||||
ProfileManager.SetPrimaryPad(userIndex);
|
||||
|
||||
@@ -1904,7 +1951,9 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
||||
{
|
||||
app.DebugPrintf( "Failed joining game from invite\n" );
|
||||
}
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1939,7 +1988,7 @@ void CGameNetworkManager::HandleDisconnect(bool bLostRoomOnly)
|
||||
if((g_NetworkManager.GetLockedProfile()!=-1) && iPrimaryPlayer!=-1 && g_NetworkManager.IsInSession() )
|
||||
{
|
||||
m_bLastDisconnectWasLostRoomOnly = bLostRoomOnly;
|
||||
#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__
|
||||
#if !defined(DISABLE_PSN) && (defined __PS3__ || defined __PSVITA__ || defined __ORBIS__)
|
||||
m_bSignedOutofPSN=bPSNSignout;
|
||||
#endif
|
||||
app.SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected);
|
||||
@@ -2064,7 +2113,7 @@ void CGameNetworkManager::FakeLocalPlayerJoined()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if !defined(DISABLE_PSN) && defined(__PSVITA__)
|
||||
bool CGameNetworkManager::usingAdhocMode()
|
||||
{
|
||||
return ((CPlatformNetworkManagerSony*)s_pPlatformNetworkManager)->usingAdhocMode();
|
||||
@@ -2079,5 +2128,17 @@ void CGameNetworkManager::startAdhocMatching()
|
||||
{
|
||||
((CPlatformNetworkManagerSony*)s_pPlatformNetworkManager)->startAdhocMatching();
|
||||
}
|
||||
#elif defined(__PSVITA__)
|
||||
bool CGameNetworkManager::usingAdhocMode()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CGameNetworkManager::setAdhocMode(bool bAdhoc)
|
||||
{
|
||||
}
|
||||
|
||||
void CGameNetworkManager::startAdhocMatching()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
#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 __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
#elif !defined DISABLE_PSN && (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
||||
#include "..\..\Common\Network\Sony\PlatformNetworkManagerSony.h"
|
||||
#elif defined _DURANGO
|
||||
#include "..\..\Durango\Network\PlatformNetworkManagerDurango.h"
|
||||
#else
|
||||
#include "PlatformNetworkManagerStub.h"
|
||||
#include "PlatformNetworkManager.h"
|
||||
#endif
|
||||
#include "SessionInfo.h"
|
||||
|
||||
@@ -30,9 +32,9 @@ const int NON_QNET_SENDDATA_ACK_REQUIRED = 1;
|
||||
|
||||
class CGameNetworkManager
|
||||
{
|
||||
#ifdef _XBOX
|
||||
#if defined _XBOX && !defined _DISABLE_XBLIVE
|
||||
friend class CPlatformNetworkManagerXbox;
|
||||
#elif defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
#elif !defined DISABLE_PSN && (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
||||
friend class CPlatformNetworkManagerSony;
|
||||
#elif defined _DURANGO
|
||||
friend class CPlatformNetworkManagerDurango;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
@@ -0,0 +1,243 @@
|
||||
#pragma once
|
||||
|
||||
#if defined _WINDOWS64
|
||||
#include <WinSock2.h>
|
||||
#include <WS2tcpip.h>
|
||||
#elif defined _XBOX
|
||||
#include <stdint.h>
|
||||
#include <winsockx.h>
|
||||
#include <xtl.h>
|
||||
#elif defined __PS3__ || defined __ORBIS__
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/select.h>
|
||||
#elif defined __PSVITA__
|
||||
#include <net.h>
|
||||
#endif
|
||||
|
||||
#ifdef __PS3__
|
||||
#include <netex/net.h>
|
||||
#include <netex/errno.h>
|
||||
#endif
|
||||
|
||||
#include <vector>
|
||||
#include "..\..\Common\Network\NetworkPlayerInterface.h"
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
#pragma comment(lib, "Ws2_32.lib")
|
||||
#endif
|
||||
|
||||
#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 (3 * 1024 * 1024)
|
||||
#define NETWORK_LAN_DISCOVERY_PORT 25566
|
||||
#define NETWORK_LAN_BROADCAST_MAGIC 0x4D434C4E
|
||||
#define NETWORK_LAN_BROADCAST_PLAYERS 8
|
||||
|
||||
#ifdef __PS3__
|
||||
typedef int SOCKET;
|
||||
#define INVALID_SOCKET -1
|
||||
#define closesocket socketclose
|
||||
#elif defined(__ORBIS__)
|
||||
typedef int SOCKET;
|
||||
#define INVALID_SOCKET -1
|
||||
#define SO_NBIO SCE_NET_SO_NBIO
|
||||
#define sys_net_errno errno
|
||||
#define SYS_NET_EINPROGRESS EINPROGRESS
|
||||
#define socketselect select
|
||||
#define closesocket sceNetSocketClose
|
||||
#define socketclose sceNetSocketClose
|
||||
#elif defined(__PSVITA__)
|
||||
typedef SceNetId SOCKET;
|
||||
typedef SceNetSockaddr sockaddr;
|
||||
typedef SceNetSocklen_t socklen_t;
|
||||
|
||||
#define getsockopt sceNetGetsockopt
|
||||
#define setsockopt sceNetSetsockopt
|
||||
#define recv sceNetRecv
|
||||
#define send sceNetSend
|
||||
#define bind sceNetBind
|
||||
#define sendto sceNetSendto
|
||||
#define recvfrom sceNetRecvfrom
|
||||
#define listen sceNetListen
|
||||
#define connect sceNetConnect
|
||||
#define accept sceNetAccept
|
||||
#define closesocket sceNetSocketClose
|
||||
#define socketclose sceNetSocketClose
|
||||
#define inet_ntop sceNetInetNtop
|
||||
|
||||
#define SOL_SOCKET SCE_NET_SOL_SOCKET
|
||||
#define AF_INET SCE_NET_AF_INET
|
||||
#define SOCK_STREAM SCE_NET_SOCK_STREAM
|
||||
#define sys_net_errno sce_net_errno
|
||||
#define SYS_NET_EINPROGRESS SCE_NET_EINPROGRESS
|
||||
|
||||
#define htonl sceNetHtonl
|
||||
#define htons sceNetHtons
|
||||
#define ntohl sceNetNtohl
|
||||
#define ntohs sceNetNtohs
|
||||
|
||||
#define SO_BROADCAST SCE_NET_SO_BROADCAST
|
||||
#define SO_ERROR SCE_NET_SO_ERROR
|
||||
#define SO_RCVTIMEO SCE_NET_SO_RCVTIMEO
|
||||
#define SO_REUSEADDR SCE_NET_SO_REUSEADDR
|
||||
#define SO_NBIO SCE_NET_SO_NBIO
|
||||
#define SOCK_DGRAM SCE_NET_SOCK_DGRAM
|
||||
|
||||
#define INADDR_ANY SCE_NET_INADDR_ANY
|
||||
#define IPPROTO_TCP SCE_NET_IPPROTO_TCP
|
||||
#define IPPROTO_UDP SCE_NET_IPPROTO_UDP
|
||||
#define TCP_NODELAY SCE_NET_TCP_NODELAY
|
||||
#define INADDR_BROADCAST SCE_NET_INADDR_BROADCAST
|
||||
|
||||
#define INVALID_SOCKET -1
|
||||
#endif
|
||||
|
||||
class Socket;
|
||||
|
||||
#define NETWORK_LAN_PLAYER_NAME_SIZE 32
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct LANBroadcast
|
||||
{
|
||||
DWORD magic;
|
||||
WORD netVersion;
|
||||
WORD gamePort;
|
||||
char hostName[32];
|
||||
BYTE playerCount;
|
||||
BYTE maxPlayers;
|
||||
DWORD gameHostSettings;
|
||||
DWORD texturePackParentId;
|
||||
BYTE subTexturePackId;
|
||||
BYTE isJoinable;
|
||||
char playerNames[NETWORK_LAN_BROADCAST_PLAYERS][NETWORK_LAN_PLAYER_NAME_SIZE];
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
struct LANSession
|
||||
{
|
||||
char hostIP[64];
|
||||
int hostPort;
|
||||
wchar_t hostName[32];
|
||||
unsigned short netVersion;
|
||||
unsigned char playerCount;
|
||||
unsigned char maxPlayers;
|
||||
unsigned int gameHostSettings;
|
||||
unsigned int texturePackParentId;
|
||||
unsigned char subTexturePackId;
|
||||
bool isJoinable;
|
||||
DWORD lastSeenTick;
|
||||
char playerNames[NETWORK_LAN_BROADCAST_PLAYERS][NETWORK_LAN_PLAYER_NAME_SIZE];
|
||||
};
|
||||
|
||||
struct RemoteConnection
|
||||
{
|
||||
SOCKET tcpSocket;
|
||||
BYTE smallId;
|
||||
C4JThread* recvThread;
|
||||
volatile bool active;
|
||||
CRITICAL_SECTION sendLock;
|
||||
};
|
||||
|
||||
class NetworkSocketLayer
|
||||
{
|
||||
public:
|
||||
static bool Initialize();
|
||||
static void Shutdown();
|
||||
|
||||
static bool HostGame(int port);
|
||||
static bool JoinGame(const char *ip, int port);
|
||||
|
||||
static bool SendToSmallId(BYTE targetSmallId, const void *data, int dataSize);
|
||||
static bool SendOnSocket(SOCKET sock, const void *data, int dataSize);
|
||||
|
||||
static bool IsHosting() { return s_isHost; }
|
||||
static bool IsConnected() { return s_connected; }
|
||||
static bool IsActive() { return s_active; }
|
||||
|
||||
static BYTE GetLocalSmallId() { return s_localSmallId; }
|
||||
static BYTE GetHostSmallId() { return s_hostSmallId; }
|
||||
|
||||
static SOCKET GetSocketForSmallId(BYTE smallId);
|
||||
|
||||
static void HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, unsigned char *data, unsigned int dataSize);
|
||||
|
||||
static bool PopDisconnectedSmallId(BYTE *outSmallId);
|
||||
static void PushFreeSmallId(BYTE smallId);
|
||||
static void CloseConnectionBySmallId(BYTE smallId);
|
||||
|
||||
static bool PopPendingJoinSmallId(BYTE *outSmallId);
|
||||
|
||||
static bool IsSmallIdConnected(BYTE smallId);
|
||||
|
||||
static bool StartAdvertising(int gamePort, const wchar_t *hostName, unsigned int gameSettings, unsigned int texPackId, unsigned char subTexId, unsigned short netVer);
|
||||
static void StopAdvertising();
|
||||
static void UpdateAdvertisePlayerCount(BYTE count);
|
||||
static void UpdateAdvertiseJoinable(bool joinable);
|
||||
static void UpdateAdvertisePlayerNames(BYTE count, const char playerNames[][XUSER_NAME_SIZE]);
|
||||
|
||||
static bool StartDiscovery();
|
||||
static void StopDiscovery();
|
||||
static vector<LANSession> GetDiscoveredSessions();
|
||||
|
||||
static int GetHostPort() { return s_hostGamePort; }
|
||||
|
||||
private:
|
||||
static int AcceptThreadProc(void* param);
|
||||
static int RecvThreadProc(void* param);
|
||||
static int ClientRecvThreadProc(void* param);
|
||||
static int AdvertiseThreadProc(void* param);
|
||||
static int DiscoveryThreadProc(void* param);
|
||||
|
||||
static SOCKET s_listenSocket;
|
||||
static SOCKET s_hostConnectionSocket;
|
||||
static C4JThread* s_acceptThread;
|
||||
static C4JThread* s_clientRecvThread;
|
||||
|
||||
static bool s_isHost;
|
||||
static bool s_connected;
|
||||
static bool s_active;
|
||||
static bool s_initialized;
|
||||
|
||||
static BYTE s_localSmallId;
|
||||
static BYTE s_hostSmallId;
|
||||
static BYTE s_nextSmallId;
|
||||
|
||||
static CRITICAL_SECTION s_sendLock;
|
||||
static CRITICAL_SECTION s_connectionsLock;
|
||||
|
||||
static RemoteConnection s_connections[NETWORK_LAN_MAX_CLIENTS + 1];
|
||||
|
||||
static SOCKET s_advertiseSock;
|
||||
static C4JThread* s_advertiseThread;
|
||||
static volatile bool s_advertising;
|
||||
static LANBroadcast s_advertiseData;
|
||||
static CRITICAL_SECTION s_advertiseLock;
|
||||
static int s_hostGamePort;
|
||||
|
||||
static SOCKET s_discoverySock;
|
||||
static C4JThread* s_discoveryThread;
|
||||
static volatile bool s_discovering;
|
||||
static CRITICAL_SECTION s_discoveryLock;
|
||||
static std::vector<LANSession> s_discoveredSessions;
|
||||
|
||||
static CRITICAL_SECTION s_disconnectLock;
|
||||
static std::vector<BYTE> s_disconnectedSmallIds;
|
||||
|
||||
static CRITICAL_SECTION s_pendingJoinLock;
|
||||
static std::vector<BYTE> s_pendingJoinSmallIds;
|
||||
|
||||
static CRITICAL_SECTION s_freeSmallIdLock;
|
||||
static std::vector<BYTE> s_freeSmallIds;
|
||||
};
|
||||
|
||||
extern bool g_MultiplayerHost;
|
||||
extern bool g_MultiplayerJoin;
|
||||
extern int g_MultiplayerPort;
|
||||
extern char g_MultiplayerIP[256];
|
||||
@@ -1,14 +1,20 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "..\..\..\Minecraft.World\Socket.h"
|
||||
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
||||
#include "PlatformNetworkManagerStub.h"
|
||||
#include "PlatformNetworkManager.h"
|
||||
#include "..\..\Xbox\Network\NetworkPlayerXbox.h" // TODO - stub version of this?
|
||||
#include "..\..\Minecraft.h"
|
||||
#include "..\..\User.h"
|
||||
#include "..\..\Common\Network\NetworkSocketLayer.h"
|
||||
|
||||
CPlatformNetworkManagerStub *g_pPlatformNetworkManager;
|
||||
|
||||
|
||||
void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer *pQNetPlayer )
|
||||
{
|
||||
if (getNetworkPlayer(pQNetPlayer) != NULL)
|
||||
return;
|
||||
|
||||
const char * pszDescription;
|
||||
|
||||
// 4J Stu - We create a fake socket for every where that we need an INBOUND queue of game data. Outbound
|
||||
@@ -89,7 +95,7 @@ void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer *pQNetPlayer )
|
||||
if( m_pIQNet->IsHost() )
|
||||
{
|
||||
// 4J-PB - only the host should do this
|
||||
// g_NetworkManager.UpdateAndSetGameSessionData();
|
||||
g_NetworkManager.UpdateAndSetGameSessionData();
|
||||
SystemFlagAddPlayer( networkPlayer );
|
||||
}
|
||||
|
||||
@@ -114,16 +120,55 @@ void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer *pQNetPlayer )
|
||||
}
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::NotifyPlayerLeaving(IQNetPlayer *pQNetPlayer)
|
||||
{
|
||||
app.DebugPrintf("Player 0x%p \"%ls\" leaving.\n", pQNetPlayer, pQNetPlayer->GetGamertag());
|
||||
|
||||
INetworkPlayer *networkPlayer = getNetworkPlayer(pQNetPlayer);
|
||||
if (networkPlayer == NULL)
|
||||
return;
|
||||
|
||||
Socket *socket = networkPlayer->GetSocket();
|
||||
if (socket != NULL)
|
||||
{
|
||||
if (m_pIQNet->IsHost())
|
||||
g_NetworkManager.CloseConnection(networkPlayer);
|
||||
}
|
||||
|
||||
if (m_pIQNet->IsHost())
|
||||
{
|
||||
SystemFlagRemovePlayer(networkPlayer);
|
||||
}
|
||||
|
||||
g_NetworkManager.PlayerLeaving(networkPlayer);
|
||||
|
||||
if (m_pIQNet->IsHost())
|
||||
{
|
||||
g_NetworkManager.UpdateAndSetGameSessionData(networkPlayer);
|
||||
}
|
||||
|
||||
for (int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
if (playerChangedCallback[idx] != NULL)
|
||||
playerChangedCallback[idx](playerChangedCallbackParam[idx], networkPlayer, true);
|
||||
}
|
||||
|
||||
removeNetworkPlayer(pQNetPlayer);
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::Initialise(CGameNetworkManager *pGameNetworkManager, int flagIndexSize)
|
||||
{
|
||||
m_pGameNetworkManager = pGameNetworkManager;
|
||||
m_flagIndexSize = flagIndexSize;
|
||||
m_pIQNet = new IQNet();
|
||||
g_pPlatformNetworkManager = this;
|
||||
for( int i = 0; i < XUSER_MAX_COUNT; i++ )
|
||||
{
|
||||
playerChangedCallback[ i ] = NULL;
|
||||
}
|
||||
|
||||
NetworkSocketLayer::Initialize();
|
||||
|
||||
m_bLeavingGame = false;
|
||||
m_bLeaveGameOnTick = false;
|
||||
m_bHostChanged = false;
|
||||
@@ -174,6 +219,69 @@ bool CPlatformNetworkManagerStub::isSystemPrimaryPlayer(IQNetPlayer *pQNetPlayer
|
||||
// We call this twice a frame, either side of the render call so is a good place to "tick" things
|
||||
void CPlatformNetworkManagerStub::DoWork()
|
||||
{
|
||||
extern QNET_STATE _iQNetStubState;
|
||||
if (_iQNetStubState == QNET_STATE_SESSION_STARTING && app.GetGameStarted())
|
||||
{
|
||||
_iQNetStubState = QNET_STATE_GAME_PLAY;
|
||||
if (m_pIQNet->IsHost())
|
||||
NetworkSocketLayer::UpdateAdvertiseJoinable(true);
|
||||
}
|
||||
if (_iQNetStubState == QNET_STATE_IDLE)
|
||||
TickSearch();
|
||||
if (_iQNetStubState == QNET_STATE_GAME_PLAY && m_pIQNet->IsHost())
|
||||
{
|
||||
BYTE disconnectedSmallId;
|
||||
while (NetworkSocketLayer::PopDisconnectedSmallId(&disconnectedSmallId))
|
||||
{
|
||||
if (disconnectedSmallId == 0) continue;
|
||||
if (NetworkSocketLayer::IsSmallIdConnected(disconnectedSmallId)) continue;
|
||||
IQNetPlayer *qnetPlayer = m_pIQNet->GetPlayerBySmallId(disconnectedSmallId);
|
||||
if (qnetPlayer != NULL && qnetPlayer->m_smallId == disconnectedSmallId)
|
||||
{
|
||||
NotifyPlayerLeaving(qnetPlayer);
|
||||
qnetPlayer->m_smallId = 0;
|
||||
qnetPlayer->m_isRemote = false;
|
||||
qnetPlayer->m_isHostPlayer = false;
|
||||
qnetPlayer->m_gamertag[0] = 0;
|
||||
qnetPlayer->SetCustomDataValue(0);
|
||||
NetworkSocketLayer::PushFreeSmallId(disconnectedSmallId);
|
||||
if (IQNet::s_playerCount > 1)
|
||||
IQNet::s_playerCount--;
|
||||
}
|
||||
}
|
||||
|
||||
BYTE joinedSmallId;
|
||||
while (NetworkSocketLayer::PopPendingJoinSmallId(&joinedSmallId))
|
||||
{
|
||||
IQNetPlayer *qnetPlayer = m_pIQNet->GetPlayerBySmallId(joinedSmallId);
|
||||
if (qnetPlayer != NULL && qnetPlayer->m_smallId == joinedSmallId)
|
||||
{
|
||||
NotifyPlayerJoined(qnetPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 1; i < MINECRAFT_NET_MAX_PLAYERS; i++)
|
||||
{
|
||||
IQNetPlayer *qp = &IQNet::m_player[i];
|
||||
if (qp->GetCustomDataValue() == 0)
|
||||
continue;
|
||||
INetworkPlayer *np = (INetworkPlayer *)qp->GetCustomDataValue();
|
||||
Socket *sock = np->GetSocket();
|
||||
if (sock != NULL && sock->isClosing())
|
||||
{
|
||||
NetworkSocketLayer::CloseConnectionBySmallId((BYTE)i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_iQNetStubState == QNET_STATE_GAME_PLAY && !m_pIQNet->IsHost())
|
||||
{
|
||||
if (!NetworkSocketLayer::IsConnected() && !g_NetworkManager.IsLeavingGame())
|
||||
{
|
||||
if (app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None)
|
||||
app.SetDisconnectReason(DisconnectPacket::eDisconnect_Quitting);
|
||||
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ExitWorld, (void *)TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int CPlatformNetworkManagerStub::GetPlayerCount()
|
||||
@@ -198,12 +306,27 @@ int CPlatformNetworkManagerStub::GetLocalPlayerMask(int playerIndex)
|
||||
|
||||
bool CPlatformNetworkManagerStub::AddLocalPlayerByUserIndex( int userIndex )
|
||||
{
|
||||
if (m_pIQNet->AddLocalPlayerByUserIndex(userIndex) != S_OK) return false;
|
||||
NotifyPlayerJoined(m_pIQNet->GetLocalPlayerByUserIndex(userIndex));
|
||||
return ( m_pIQNet->AddLocalPlayerByUserIndex(userIndex) == S_OK );
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::RemoveLocalPlayerByUserIndex( int userIndex )
|
||||
{
|
||||
if (userIndex > 0 && userIndex < XUSER_MAX_COUNT)
|
||||
{
|
||||
IQNetPlayer *qnetPlayer = m_pIQNet->GetLocalPlayerByUserIndex(userIndex);
|
||||
if (qnetPlayer != NULL)
|
||||
{
|
||||
NotifyPlayerLeaving(qnetPlayer);
|
||||
qnetPlayer->m_isRemote = true;
|
||||
qnetPlayer->m_isHostPlayer = false;
|
||||
qnetPlayer->m_gamertag[0] = 0;
|
||||
qnetPlayer->SetCustomDataValue(0);
|
||||
if (IQNet::s_playerCount > 1)
|
||||
IQNet::s_playerCount--;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -231,6 +354,7 @@ bool CPlatformNetworkManagerStub::LeaveGame(bool bMigrateHost)
|
||||
if( m_bLeavingGame ) return true;
|
||||
|
||||
m_bLeavingGame = true;
|
||||
NetworkSocketLayer::StopAdvertising();
|
||||
|
||||
// If we are the host wait for the game server to end
|
||||
if(m_pIQNet->IsHost() && g_NetworkManager.ServerStoppedValid())
|
||||
@@ -239,6 +363,20 @@ bool CPlatformNetworkManagerStub::LeaveGame(bool bMigrateHost)
|
||||
g_NetworkManager.ServerStoppedWait();
|
||||
g_NetworkManager.ServerStoppedDestroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pIQNet->EndGame();
|
||||
}
|
||||
|
||||
for (AUTO_VAR(it, currentNetworkPlayers.begin()); it != currentNetworkPlayers.end(); it++)
|
||||
delete *it;
|
||||
currentNetworkPlayers.clear();
|
||||
m_machineQNetPrimaryPlayers.clear();
|
||||
SystemFlagReset();
|
||||
|
||||
NetworkSocketLayer::Shutdown();
|
||||
NetworkSocketLayer::Initialize();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -262,7 +400,27 @@ void CPlatformNetworkManagerStub::HostGame(int localUsersMask, bool bOnlineGame,
|
||||
|
||||
m_pIQNet->HostGame();
|
||||
|
||||
IQNet::m_player[0].m_smallId = 0;
|
||||
IQNet::m_player[0].m_isRemote = false;
|
||||
IQNet::m_player[0].m_isHostPlayer = true;
|
||||
#ifdef _WINDOWS64
|
||||
extern wchar_t g_Win64UsernameW[17];
|
||||
wcscpy_s(IQNet::m_player[0].m_gamertag, 32, g_Win64UsernameW);
|
||||
IQNet::s_playerCount = 1;
|
||||
#endif
|
||||
|
||||
if (getNetworkPlayer(&IQNet::m_player[0]) == NULL)
|
||||
NotifyPlayerJoined(&IQNet::m_player[0]);
|
||||
|
||||
_HostGame( localUsersMask, publicSlots, privateSlots );
|
||||
|
||||
int port = NETWORK_LAN_DEFAULT_PORT;
|
||||
if (!NetworkSocketLayer::IsActive())
|
||||
NetworkSocketLayer::HostGame(port);
|
||||
|
||||
const wchar_t *hostName = IQNet::m_player[0].m_gamertag;
|
||||
unsigned int settings = app.GetGameHostOption(eGameHostOption_All);
|
||||
NetworkSocketLayer::StartAdvertising(port, hostName, settings, 0, 0, MINECRAFT_NET_VERSION);
|
||||
//#endif
|
||||
}
|
||||
|
||||
@@ -277,6 +435,46 @@ bool CPlatformNetworkManagerStub::_StartGame()
|
||||
|
||||
int CPlatformNetworkManagerStub::JoinGame(FriendSessionInfo *searchResult, int localUsersMask, int primaryUserIndex)
|
||||
{
|
||||
if (searchResult == NULL)
|
||||
return CGameNetworkManager::JOINGAME_FAIL_GENERAL;
|
||||
|
||||
const char *hostIP = searchResult->data.hostIP;
|
||||
int hostPort = searchResult->data.hostPort;
|
||||
|
||||
if (hostPort <= 0 || hostIP[0] == 0)
|
||||
return CGameNetworkManager::JOINGAME_FAIL_GENERAL;
|
||||
|
||||
m_bLeavingGame = false;
|
||||
IQNet::s_isHosting = false;
|
||||
m_pIQNet->ClientJoinGame();
|
||||
|
||||
IQNet::m_player[0].m_smallId = 0;
|
||||
IQNet::m_player[0].m_isRemote = true;
|
||||
IQNet::m_player[0].m_isHostPlayer = true;
|
||||
wcsncpy(IQNet::m_player[0].m_gamertag, searchResult->data.hostName, 31);
|
||||
IQNet::m_player[0].m_gamertag[31] = L'\0';
|
||||
|
||||
NetworkSocketLayer::StopDiscovery();
|
||||
|
||||
if (!NetworkSocketLayer::JoinGame(hostIP, hostPort))
|
||||
{
|
||||
app.DebugPrintf("Win64 LAN: Failed to connect to %s:%d\n", hostIP, hostPort);
|
||||
return CGameNetworkManager::JOINGAME_FAIL_GENERAL;
|
||||
}
|
||||
|
||||
BYTE localSmallId = NetworkSocketLayer::GetLocalSmallId();
|
||||
|
||||
IQNet::m_player[localSmallId].m_smallId = localSmallId;
|
||||
IQNet::m_player[localSmallId].m_isRemote = false;
|
||||
IQNet::m_player[localSmallId].m_isHostPlayer = false;
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
wcsncpy(IQNet::m_player[localSmallId].m_gamertag, pMinecraft->user->name.c_str(), 32);
|
||||
IQNet::s_playerCount = localSmallId + 1;
|
||||
|
||||
NotifyPlayerJoined(&IQNet::m_player[0]);
|
||||
NotifyPlayerJoined(&IQNet::m_player[localSmallId]);
|
||||
|
||||
return CGameNetworkManager::JOINGAME_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -315,49 +513,82 @@ void CPlatformNetworkManagerStub::HandleSignInChange()
|
||||
|
||||
bool CPlatformNetworkManagerStub::_RunNetworkGame()
|
||||
{
|
||||
extern QNET_STATE _iQNetStubState;
|
||||
_iQNetStubState = QNET_STATE_GAME_PLAY;
|
||||
if (m_pIQNet->IsHost())
|
||||
NetworkSocketLayer::UpdateAdvertiseJoinable(true);
|
||||
|
||||
for (DWORD i = 0; i < IQNet::s_playerCount; i++)
|
||||
{
|
||||
if (IQNet::m_player[i].m_isRemote)
|
||||
{
|
||||
INetworkPlayer *pNetworkPlayer = getNetworkPlayer(&IQNet::m_player[i]);
|
||||
if (pNetworkPlayer != NULL && pNetworkPlayer->GetSocket() != NULL)
|
||||
{
|
||||
Socket::addIncomingSocket(pNetworkPlayer->GetSocket());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SetGamePlayState()
|
||||
{
|
||||
extern QNET_STATE _iQNetStubState;
|
||||
|
||||
_iQNetStubState = QNET_STATE_GAME_PLAY;
|
||||
|
||||
if (m_pIQNet->IsHost())
|
||||
{
|
||||
NetworkSocketLayer::UpdateAdvertiseJoinable(true);
|
||||
}
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/)
|
||||
{
|
||||
// DWORD playerCount = m_pIQNet->GetPlayerCount();
|
||||
//
|
||||
// if( this->m_bLeavingGame )
|
||||
// return;
|
||||
//
|
||||
// if( GetHostPlayer() == NULL )
|
||||
// return;
|
||||
//
|
||||
// for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i)
|
||||
// {
|
||||
// if( i < playerCount )
|
||||
// {
|
||||
// INetworkPlayer *pNetworkPlayer = GetPlayerByIndex(i);
|
||||
//
|
||||
// // We can call this from NotifyPlayerLeaving but at that point the player is still considered in the session
|
||||
// if( pNetworkPlayer != pNetworkPlayerLeaving )
|
||||
// {
|
||||
// m_hostGameSessionData.players[i] = ((NetworkPlayerXbox *)pNetworkPlayer)->GetUID();
|
||||
//
|
||||
// char *temp;
|
||||
// temp = (char *)wstringtofilename( pNetworkPlayer->GetOnlineName() );
|
||||
// memcpy(m_hostGameSessionData.szPlayers[i],temp,XUSER_NAME_SIZE);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// m_hostGameSessionData.players[i] = NULL;
|
||||
// memset(m_hostGameSessionData.szPlayers[i],0,XUSER_NAME_SIZE);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// m_hostGameSessionData.players[i] = NULL;
|
||||
// memset(m_hostGameSessionData.szPlayers[i],0,XUSER_NAME_SIZE);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// m_hostGameSessionData.hostPlayerUID = ((NetworkPlayerXbox *)GetHostPlayer())->GetQNetPlayer()->GetXuid();
|
||||
// m_hostGameSessionData.m_uiGameHostSettings = app.GetGameHostOption(eGameHostOption_All);
|
||||
if (this->m_bLeavingGame)
|
||||
return;
|
||||
|
||||
if (!m_pIQNet->IsHost())
|
||||
return;
|
||||
|
||||
DWORD playerCount = m_pIQNet->GetPlayerCount();
|
||||
|
||||
m_hostGameSessionData.m_uiGameHostSettings = app.GetGameHostOption(eGameHostOption_All);
|
||||
m_hostGameSessionData.playerCount = (unsigned char)playerCount;
|
||||
|
||||
for (unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i)
|
||||
{
|
||||
if (i < playerCount)
|
||||
{
|
||||
INetworkPlayer *pNetworkPlayer = GetPlayerByIndex(i);
|
||||
|
||||
if (pNetworkPlayer != NULL && pNetworkPlayer != pNetworkPlayerLeaving)
|
||||
{
|
||||
m_hostGameSessionData.players[i] = (GameSessionUID)(i + 1);
|
||||
|
||||
const wchar_t *name = pNetworkPlayer->GetOnlineName();
|
||||
char nameBuf[XUSER_NAME_SIZE];
|
||||
memset(nameBuf, 0, sizeof(nameBuf));
|
||||
wcstombs(nameBuf, name, XUSER_NAME_SIZE - 1);
|
||||
memcpy(m_hostGameSessionData.szPlayers[i], nameBuf, XUSER_NAME_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_hostGameSessionData.players[i] = 0;
|
||||
memset(m_hostGameSessionData.szPlayers[i], 0, XUSER_NAME_SIZE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_hostGameSessionData.players[i] = 0;
|
||||
memset(m_hostGameSessionData.szPlayers[i], 0, XUSER_NAME_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
// update the LAN advertiser with current player names and count
|
||||
NetworkSocketLayer::UpdateAdvertisePlayerNames(m_hostGameSessionData.playerCount, m_hostGameSessionData.szPlayers);
|
||||
}
|
||||
|
||||
int CPlatformNetworkManagerStub::RemovePlayerOnSocketClosedThreadProc( void* lpParam )
|
||||
@@ -503,10 +734,106 @@ wstring CPlatformNetworkManagerStub::GatherRTTStats()
|
||||
|
||||
void CPlatformNetworkManagerStub::TickSearch()
|
||||
{
|
||||
if (m_SessionsUpdatedCallback == NULL)
|
||||
return;
|
||||
|
||||
static DWORD lastSearchTime = 0;
|
||||
DWORD now = GetTickCount();
|
||||
if (now - lastSearchTime < 2000)
|
||||
return;
|
||||
lastSearchTime = now;
|
||||
|
||||
SearchForGames();
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SearchForGames()
|
||||
{
|
||||
std::vector<LANSession> lanSessions = NetworkSocketLayer::GetDiscoveredSessions();
|
||||
|
||||
if (g_MultiplayerJoin && g_MultiplayerIP[0] != '\0')
|
||||
{
|
||||
bool alreadyPresent = false;
|
||||
for (size_t i = 0; i < lanSessions.size(); i++)
|
||||
{
|
||||
if (strcmp(lanSessions[i].hostIP, g_MultiplayerIP) == 0 &&
|
||||
lanSessions[i].hostPort == g_MultiplayerPort)
|
||||
{
|
||||
alreadyPresent = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!alreadyPresent)
|
||||
{
|
||||
LANSession manual;
|
||||
memset(&manual, 0, sizeof(manual));
|
||||
strncpy(manual.hostIP, g_MultiplayerIP, sizeof(manual.hostIP) - 1);
|
||||
manual.hostIP[sizeof(manual.hostIP) - 1] = '\0';
|
||||
|
||||
manual.hostPort = g_MultiplayerPort;
|
||||
|
||||
swprintf(manual.hostName, 32, L"%hs:%d", g_MultiplayerIP, g_MultiplayerPort);
|
||||
manual.hostName[31] = L'\0';
|
||||
manual.playerCount = 0;
|
||||
manual.maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
manual.isJoinable = true;
|
||||
manual.lastSeenTick = GetTickCount();
|
||||
lanSessions.push_back(manual);
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < friendsSessions[0].size(); i++)
|
||||
delete friendsSessions[0][i];
|
||||
friendsSessions[0].clear();
|
||||
|
||||
for (size_t i = 0; i < lanSessions.size(); i++)
|
||||
{
|
||||
FriendSessionInfo *info = new FriendSessionInfo();
|
||||
size_t nameLen = wcslen(lanSessions[i].hostName);
|
||||
info->displayLabel = new wchar_t[nameLen + 1];
|
||||
wcsncpy(info->displayLabel, lanSessions[i].hostName, nameLen);
|
||||
info->displayLabel[nameLen] = L'\0';
|
||||
info->displayLabelLength = (unsigned char)nameLen;
|
||||
info->displayLabelViewableStartIndex = 0;
|
||||
|
||||
info->data.netVersion = lanSessions[i].netVersion;
|
||||
info->data.m_uiGameHostSettings = lanSessions[i].gameHostSettings;
|
||||
info->data.texturePackParentId = lanSessions[i].texturePackParentId;
|
||||
info->data.subTexturePackId = lanSessions[i].subTexturePackId;
|
||||
info->data.isReadyToJoin = lanSessions[i].isJoinable;
|
||||
info->data.isJoinable = lanSessions[i].isJoinable;
|
||||
strncpy(info->data.hostIP, lanSessions[i].hostIP, sizeof(info->data.hostIP) - 1);
|
||||
info->data.hostIP[sizeof(info->data.hostIP) - 1] = '\0';
|
||||
info->data.hostPort = lanSessions[i].hostPort;
|
||||
wcsncpy(info->data.hostName, lanSessions[i].hostName, XUSER_NAME_SIZE - 1);
|
||||
info->data.hostName[XUSER_NAME_SIZE - 1] = L'\0';
|
||||
info->data.playerCount = lanSessions[i].playerCount;
|
||||
info->data.maxPlayers = lanSessions[i].maxPlayers;
|
||||
|
||||
memset(info->data.players, 0, sizeof(info->data.players));
|
||||
memset(info->data.szPlayers, 0, sizeof(info->data.szPlayers));
|
||||
for (int p = 0; p < NETWORK_LAN_BROADCAST_PLAYERS && p < lanSessions[i].playerCount; p++)
|
||||
{
|
||||
if (lanSessions[i].playerNames[p][0] != 0)
|
||||
{
|
||||
info->data.players[p] = (GameSessionUID)(p + 1);
|
||||
memcpy(info->data.szPlayers[p], lanSessions[i].playerNames[p], XUSER_NAME_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__ORBIS__) || defined(__PSVITA__)
|
||||
SceNetInAddr ip_addr = {};
|
||||
sceNetInetPton(SCE_NET_AF_INET, lanSessions[i].hostIP, &ip_addr);
|
||||
info->sessionId = (ULONGLONG)((uint64_t)ip_addr.s_addr | ((uint64_t)lanSessions[i].hostPort << 32));
|
||||
#else
|
||||
info->sessionId = (ULONGLONG)((unsigned __int64)inet_addr(lanSessions[i].hostIP) | ((unsigned __int64)lanSessions[i].hostPort << 32));
|
||||
#endif
|
||||
friendsSessions[0].push_back(info);
|
||||
}
|
||||
|
||||
m_searchResultsCount[0] = (int)friendsSessions[0].size();
|
||||
|
||||
if (m_SessionsUpdatedCallback != NULL)
|
||||
m_SessionsUpdatedCallback(m_pSearchParam);
|
||||
}
|
||||
|
||||
int CPlatformNetworkManagerStub::SearchForGamesThreadProc( void* lpParameter )
|
||||
@@ -522,12 +849,42 @@ void CPlatformNetworkManagerStub::SetSearchResultsReady(int resultCount)
|
||||
|
||||
vector<FriendSessionInfo *> *CPlatformNetworkManagerStub::GetSessionList(int iPad, int localPlayers, bool partyOnly)
|
||||
{
|
||||
vector<FriendSessionInfo *> *filteredList = new vector<FriendSessionInfo *>();;
|
||||
vector<FriendSessionInfo *> *filteredList = new vector<FriendSessionInfo *>();
|
||||
for (size_t i = 0; i < friendsSessions[0].size(); i++)
|
||||
{
|
||||
FriendSessionInfo *src = friendsSessions[0][i];
|
||||
FriendSessionInfo *copy = new FriendSessionInfo();
|
||||
*copy = *src;
|
||||
if (src->displayLabel != NULL)
|
||||
{
|
||||
copy->displayLabel = new wchar_t[(size_t)src->displayLabelLength + 1];
|
||||
wcsncpy(copy->displayLabel, src->displayLabel, src->displayLabelLength);
|
||||
copy->displayLabel[src->displayLabelLength] = L'\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
copy->displayLabel = NULL;
|
||||
}
|
||||
filteredList->push_back(copy);
|
||||
}
|
||||
return filteredList;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::GetGameSessionInfo(int iPad, SessionID sessionId, FriendSessionInfo *foundSessionInfo)
|
||||
{
|
||||
for (size_t i = 0; i < friendsSessions[0].size(); i++)
|
||||
{
|
||||
if (friendsSessions[0][i]->sessionId == sessionId)
|
||||
{
|
||||
if (foundSessionInfo != NULL)
|
||||
{
|
||||
foundSessionInfo->sessionId = friendsSessions[0][i]->sessionId;
|
||||
foundSessionInfo->data = friendsSessions[0][i]->data;
|
||||
foundSessionInfo->hasPartyMember = friendsSessions[0][i]->hasPartyMember;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -570,9 +927,11 @@ void CPlatformNetworkManagerStub::removeNetworkPlayer(IQNetPlayer *pQNetPlayer)
|
||||
if( *it == pNetworkPlayer )
|
||||
{
|
||||
currentNetworkPlayers.erase(it);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pQNetPlayer->SetCustomDataValue(0);
|
||||
}
|
||||
|
||||
INetworkPlayer *CPlatformNetworkManagerStub::getNetworkPlayer(IQNetPlayer *pQNetPlayer)
|
||||
@@ -598,7 +957,19 @@ INetworkPlayer * CPlatformNetworkManagerStub::GetPlayerByXuid(PlayerUID xuid)
|
||||
|
||||
INetworkPlayer * CPlatformNetworkManagerStub::GetPlayerBySmallId(unsigned char smallId)
|
||||
{
|
||||
return getNetworkPlayer(m_pIQNet->GetPlayerBySmallId(smallId));
|
||||
IQNetPlayer *qnetPlayer = m_pIQNet->GetPlayerBySmallId(smallId);
|
||||
if (qnetPlayer == NULL)
|
||||
return NULL;
|
||||
|
||||
INetworkPlayer *networkPlayer = getNetworkPlayer(qnetPlayer);
|
||||
if (networkPlayer == NULL && smallId != 0 && !m_pIQNet->IsHost())
|
||||
{
|
||||
qnetPlayer->m_isRemote = true;
|
||||
qnetPlayer->m_isHostPlayer = false;
|
||||
NotifyPlayerJoined(qnetPlayer);
|
||||
networkPlayer = getNetworkPlayer(qnetPlayer);
|
||||
}
|
||||
return networkPlayer;
|
||||
}
|
||||
|
||||
INetworkPlayer *CPlatformNetworkManagerStub::GetHostPlayer()
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
using namespace std;
|
||||
#include <vector>
|
||||
#include "..\..\..\Minecraft.World\C4JThread.h"
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
|
||||
virtual void HandleSignInChange();
|
||||
|
||||
virtual void SetGamePlayState();
|
||||
virtual bool _RunNetworkGame();
|
||||
|
||||
private:
|
||||
@@ -161,8 +162,9 @@ public:
|
||||
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
||||
virtual void ForceFriendsSessionRefresh();
|
||||
|
||||
private:
|
||||
public:
|
||||
void NotifyPlayerJoined( IQNetPlayer *pQNetPlayer );
|
||||
void NotifyPlayerLeaving( IQNetPlayer *pQNetPlayer );
|
||||
|
||||
#ifndef _XBOX
|
||||
void FakeLocalPlayerJoined() { NotifyPlayerJoined(m_pIQNet->GetLocalPlayerByUserIndex(0)); }
|
||||
@@ -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"
|
||||
@@ -84,7 +88,7 @@ public:
|
||||
virtual void HandleSignInChange() = 0;
|
||||
|
||||
virtual bool _RunNetworkGame() = 0;
|
||||
|
||||
virtual void SetGamePlayState() {}
|
||||
private:
|
||||
virtual bool _LeaveGame(bool bMigrateHost, bool bLeaveRoom) = 0;
|
||||
virtual void _HostGame(int usersMask, unsigned char publicSlots = MINECRAFT_NET_MAX_PLAYERS, unsigned char privateSlots = 0) = 0;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__)
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__))
|
||||
#include "..\..\Common\Network\Sony\SQRNetworkManager.h"
|
||||
#endif
|
||||
|
||||
|
||||
// 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
|
||||
@@ -32,7 +32,7 @@ typedef struct _GameSessionData
|
||||
subTexturePackId = 0;
|
||||
}
|
||||
} GameSessionData;
|
||||
#elif defined __PS3__ || defined __ORBIS__ || defined(__PSVITA__)
|
||||
#elif !defined DISABLE_PSN && (defined __PS3__ || defined __ORBIS__ || defined(__PSVITA__))
|
||||
typedef struct _GameSessionData
|
||||
{
|
||||
unsigned short netVersion; // 2 bytes
|
||||
@@ -47,6 +47,11 @@ typedef struct _GameSessionData
|
||||
unsigned char playerCount; // 1 byte
|
||||
bool isReadyToJoin; // 1 byte
|
||||
|
||||
char hostIP[64]; // 64 bytes
|
||||
int hostPort; // 4 bytes
|
||||
wchar_t hostName[XUSER_NAME_SIZE]; // 64 bytes ( 32*2 )
|
||||
unsigned char maxPlayers; // 1 byte
|
||||
|
||||
_GameSessionData()
|
||||
{
|
||||
netVersion = 0;
|
||||
@@ -57,7 +62,11 @@ typedef struct _GameSessionData
|
||||
subTexturePackId = 0;
|
||||
playerCount = 0;
|
||||
isReadyToJoin = false;
|
||||
|
||||
memset(hostIP, 0, sizeof(hostIP));
|
||||
hostPort = 0;
|
||||
memset(hostName, 0, sizeof(hostName));
|
||||
playerCount = 0;
|
||||
maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
}
|
||||
} GameSessionData;
|
||||
#else
|
||||
@@ -69,6 +78,16 @@ typedef struct _GameSessionData
|
||||
unsigned char subTexturePackId; // 1 byte
|
||||
|
||||
bool isReadyToJoin; // 1 byte
|
||||
bool isJoinable; // 1 byte
|
||||
|
||||
char hostIP[64]; // 64 bytes
|
||||
int hostPort; // 4 bytes
|
||||
wchar_t hostName[XUSER_NAME_SIZE]; // 64 bytes ( 32*2 )
|
||||
unsigned char playerCount; // 1 byte
|
||||
unsigned char maxPlayers; // 1 byte
|
||||
|
||||
GameSessionUID players[MINECRAFT_NET_MAX_PLAYERS];
|
||||
char szPlayers[MINECRAFT_NET_MAX_PLAYERS][XUSER_NAME_SIZE];
|
||||
|
||||
_GameSessionData()
|
||||
{
|
||||
@@ -76,6 +95,15 @@ typedef struct _GameSessionData
|
||||
m_uiGameHostSettings = 0;
|
||||
texturePackParentId = 0;
|
||||
subTexturePackId = 0;
|
||||
isReadyToJoin = false;
|
||||
isJoinable = true;
|
||||
memset(hostIP, 0, sizeof(hostIP));
|
||||
hostPort = 0;
|
||||
memset(hostName, 0, sizeof(hostName));
|
||||
playerCount = 0;
|
||||
maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
memset(players, 0, sizeof(players));
|
||||
memset(szPlayers, 0, sizeof(szPlayers));
|
||||
}
|
||||
} GameSessionData;
|
||||
#endif
|
||||
@@ -86,7 +114,7 @@ public:
|
||||
SessionID sessionId;
|
||||
#ifdef _XBOX
|
||||
XSESSION_SEARCHRESULT searchResult;
|
||||
#elif defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
#elif !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
SQRNetworkManager::SessionSearchResult searchResult;
|
||||
#elif defined(_DURANGO)
|
||||
DQRNetworkManager::SessionSearchResult searchResult;
|
||||
@@ -108,6 +136,6 @@ public:
|
||||
~FriendSessionInfo()
|
||||
{
|
||||
if(displayLabel!=NULL)
|
||||
delete displayLabel;
|
||||
delete[] displayLabel;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "NetworkPlayerSony.h"
|
||||
#ifndef DISABLE_PSN
|
||||
|
||||
NetworkPlayerSony::NetworkPlayerSony(SQRNetworkPlayer *qnetPlayer)
|
||||
{
|
||||
@@ -135,3 +136,4 @@ int NetworkPlayerSony::GetTimeSinceLastChunkPacket_ms()
|
||||
__int64 currentTime = System::currentTimeMillis();
|
||||
return (int)( currentTime - m_lastChunkPacketTime );
|
||||
}
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef _DISABLE_PSN
|
||||
#include "..\..\Common\Network\NetworkPlayerInterface.h"
|
||||
#include "SQRNetworkPlayer.h"
|
||||
|
||||
@@ -41,3 +41,4 @@ private:
|
||||
Socket *m_pSocket;
|
||||
__int64 m_lastChunkPacketTime;
|
||||
};
|
||||
#endif
|
||||
@@ -56,7 +56,7 @@ void CPlatformNetworkManagerSony::HandleStateChange(SQRNetworkManager::eSQRNetwo
|
||||
// 4J Stu - We may be accepting an invite from the DLC menu, so hide the icon
|
||||
#ifdef __ORBIS__
|
||||
sceNpCommerceHidePsStoreIcon();
|
||||
#elif defined __PSVITA__
|
||||
#elif defined(__PSVITA__) && !defined(DISABLE_PSN)
|
||||
app.GetCommerce()->HidePsStoreIcon();
|
||||
#endif
|
||||
m_bLeavingGame = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#ifndef DISABLE_PSN
|
||||
#include "SQRNetworkManager.h"
|
||||
|
||||
bool SQRNetworkManager::s_safeToRespondToGameBootInvite = false;
|
||||
@@ -80,4 +80,5 @@ void SQRNetworkManager::TickWriteAcks()
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&m_csAckQueue);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -80,7 +80,6 @@ public:
|
||||
bool inviteOnly;
|
||||
};
|
||||
|
||||
|
||||
// Externally exposed state. All internal states are mapped to one of these broader states.
|
||||
typedef enum
|
||||
{
|
||||
@@ -324,4 +323,4 @@ public:
|
||||
virtual void HandleAddLocalPlayerFailed(int idx) = 0;
|
||||
virtual void HandleDisconnect(bool bLostRoomOnly,bool bPSNSignOut=false) = 0;
|
||||
virtual void HandleInviteReceived( int userIndex, const SQRNetworkManager::PresenceSyncInfo *pInviteInfo) = 0;
|
||||
};
|
||||
};
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#ifndef DISABLE_PSN
|
||||
#include "SQRNetworkPlayer.h"
|
||||
|
||||
#ifdef __PS3__
|
||||
@@ -609,3 +610,4 @@ bool SQRNetworkPlayer::IsMutedByLocalUser(int userIndex)
|
||||
return SonyVoiceChat::isMutedPlayer(pMan->m_roomSyncData.players[userIndex].m_roomMemberId);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@@ -124,7 +124,7 @@ class SQRNetworkPlayer
|
||||
int GetTotalSendQueueMessages();
|
||||
|
||||
|
||||
#ifdef __PSVITA__
|
||||
#if !defined(DISABLE_PSN) && defined(__PSVITA__)
|
||||
void SendInternal_VitaAdhoc(const void *data, unsigned int dataSize, EAdhocDataTag tag = e_dataTag_Normal);
|
||||
void SendMoreInternal_VitaAdhoc();
|
||||
#endif
|
||||
|
||||
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 196 KiB After Width: | Height: | Size: 196 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 196 KiB After Width: | Height: | Size: 196 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 189 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 196 KiB After Width: | Height: | Size: 196 KiB |
|
Before Width: | Height: | Size: 308 KiB After Width: | Height: | Size: 308 KiB |
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 252 KiB After Width: | Height: | Size: 252 KiB |
|
Before Width: | Height: | Size: 252 KiB After Width: | Height: | Size: 252 KiB |
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 253 KiB After Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 255 KiB |
|
Before Width: | Height: | Size: 253 KiB After Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 255 KiB |
|
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 255 KiB |
|
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 260 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 253 KiB After Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 252 KiB After Width: | Height: | Size: 252 KiB |
|
Before Width: | Height: | Size: 253 KiB After Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 252 KiB After Width: | Height: | Size: 252 KiB |
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 252 KiB After Width: | Height: | Size: 252 KiB |
|
Before Width: | Height: | Size: 250 KiB After Width: | Height: | Size: 250 KiB |
|
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 251 KiB After Width: | Height: | Size: 251 KiB |
|
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 2.0 MiB After Width: | Height: | Size: 2.0 MiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |