Compare commits
22
Commits
networking
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f6de1c60e | ||
|
|
bb46fd6242 | ||
|
|
babe3fdc65 | ||
|
|
192c70a61b | ||
|
|
de1dacafcb | ||
|
|
a4326aec9a | ||
|
|
2e0e676e8f | ||
|
|
9ce6b16546 | ||
|
|
59fd8f0cdc | ||
|
|
5725fd715f | ||
|
|
987e77c817 | ||
|
|
a18c98fcdc | ||
|
|
8970406c7f | ||
|
|
886c0c8e29 | ||
|
|
fb793310a6 | ||
|
|
67021802dc | ||
|
|
addac20a35 | ||
|
|
8163eb6f9a | ||
|
|
0fda67f73e | ||
|
|
44b2eab134 | ||
|
|
e2b838272b | ||
|
|
afbd3fef00 |
@@ -0,0 +1 @@
|
||||
*.sfo binary
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
steps:
|
||||
- name: Validate version format
|
||||
run: |
|
||||
if (-not ("${{ inputs.version }}" -match '^v\d+\.\d+\.\d+[a-zA-Z0-9.-]*$')) {
|
||||
if (-not ("${{ inputs.version }}" -match '^[vb]\d+\.\d+\.\d+[a-zA-Z0-9.-]*$')) {
|
||||
Write-Error "Version '${{ inputs.version }}' doesn't match expected format (e.g. v1.0.0)"
|
||||
exit 1
|
||||
}
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
needs: validate
|
||||
strategy:
|
||||
matrix:
|
||||
configuration: [Release]
|
||||
configuration: [ContentPackage]
|
||||
platform: [Windows64, Xbox360, Orbis, PSVita, PS3]
|
||||
include:
|
||||
- platform: Windows64
|
||||
|
||||
+2
-11
@@ -6,24 +6,15 @@
|
||||
/*Release*
|
||||
/*ContentPackage*
|
||||
|
||||
# Minecraft.Server
|
||||
/Minecraft.Server/x64
|
||||
/Minecraft.Server/x64_*
|
||||
/Minecraft.Server/*Debug
|
||||
/Minecraft.Server/*Release*
|
||||
/Minecraft.Server/*Server*
|
||||
/Minecraft.Server/*ContentPackage*
|
||||
|
||||
# Minecraft.Client
|
||||
/Minecraft.Client/x64
|
||||
/Minecraft.Client/x64_*
|
||||
/Minecraft.Client/*Debug
|
||||
/Minecraft.Client/*Release*
|
||||
/Minecraft.Client/*Server*
|
||||
/Minecraft.Client/*ContentPackage*
|
||||
/Minecraft.Client/Windows64/GameHDD
|
||||
|
||||
# Minecraft.World
|
||||
# Minecraft.world
|
||||
/Minecraft.World/x64
|
||||
/Minecraft.World/x64_*
|
||||
/Minecraft.World/*Debug
|
||||
@@ -52,4 +43,4 @@ Minecraft.Client/Common/Media/XURs
|
||||
*.opensdf
|
||||
*.v11.suo
|
||||
*.vcxproj.user
|
||||
*.aps
|
||||
*.aps
|
||||
@@ -93,14 +93,13 @@ BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=f
|
||||
|
||||
if(bTitleUpdateTexture)
|
||||
{
|
||||
// Make the content package point to to the UPDATE: drive is needed
|
||||
wDrive= wstr + L"\\Common\\res\\TitleUpdate\\";
|
||||
}
|
||||
else
|
||||
{
|
||||
wDrive= wstr + L"/Common/";
|
||||
}
|
||||
#elif __PSVITA__
|
||||
//#elif __PSVITA__
|
||||
|
||||
/*char *pchUsrDir=getUsrDirPath();
|
||||
|
||||
@@ -115,20 +114,9 @@ BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=f
|
||||
{
|
||||
wDrive= wstr + L"/Common/";
|
||||
}*/
|
||||
|
||||
if(bTitleUpdateTexture)
|
||||
{
|
||||
// Make the content package point to to the UPDATE: drive is needed
|
||||
wDrive= L"Common\\res\\TitleUpdate\\";
|
||||
}
|
||||
else
|
||||
{
|
||||
wDrive= L"Common/";
|
||||
}
|
||||
#else
|
||||
if(bTitleUpdateTexture)
|
||||
{
|
||||
// Make the content package point to to the UPDATE: drive is needed
|
||||
wDrive= L"Common\\res\\TitleUpdate\\";
|
||||
}
|
||||
else
|
||||
|
||||
@@ -402,7 +402,6 @@ 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);
|
||||
@@ -740,9 +739,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 && tileId != 0xff)
|
||||
if (tileId > 0)
|
||||
{
|
||||
if (currentLayer == 0 && Tile::tiles[tileId] && Tile::tiles[tileId]->isEntityTile())
|
||||
if (currentLayer == 0 && Tile::tiles[tileId]->isEntityTile())
|
||||
{
|
||||
shared_ptr<TileEntity> et = region.getTileEntity(x, y, z);
|
||||
if (TileEntityRenderDispatcher::instance->hasRenderer(et))
|
||||
@@ -755,7 +754,6 @@ void Chunk::rebuild_SPU()
|
||||
{
|
||||
|
||||
Tile *tile = Tile::tiles[tileId];
|
||||
if (!tile) continue;
|
||||
int renderLayer = tile->getRenderLayer();
|
||||
|
||||
if (renderLayer != currentLayer)
|
||||
|
||||
@@ -50,16 +50,11 @@
|
||||
#else
|
||||
#include "Common\UI\UI.h"
|
||||
#endif
|
||||
#if defined __PS3__ && !defined DISABLE_PSN
|
||||
#ifdef __PS3__
|
||||
#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"
|
||||
@@ -303,10 +298,6 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> packet)
|
||||
level->isClientSide = true;
|
||||
minecraft->setLevel(level);
|
||||
}
|
||||
else
|
||||
{
|
||||
level = (MultiPlayerLevel *)dimensionLevel;
|
||||
}
|
||||
|
||||
minecraft->player->setPlayerIndex( packet->m_playerIndex );
|
||||
minecraft->player->setCustomSkin( app.GetPlayerSkinId(m_userIndex) );
|
||||
@@ -780,7 +771,6 @@ 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
|
||||
@@ -791,32 +781,6 @@ 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;
|
||||
@@ -1040,7 +1004,6 @@ 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 )
|
||||
{
|
||||
@@ -1110,7 +1073,6 @@ 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 )
|
||||
{
|
||||
@@ -1168,8 +1130,6 @@ 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 )
|
||||
{
|
||||
@@ -1405,7 +1365,7 @@ void ClientConnection::handleChat(shared_ptr<ChatPacket> packet)
|
||||
break;
|
||||
case ChatPacket::e_ChatCannotPlaceLava:
|
||||
displayOnGui = false;
|
||||
app.SetGlobalXuiAction(eAppAction_DisplayLavaMessage);
|
||||
app.SetGlobalUIAction(eAppAction_DisplayLavaMessage);
|
||||
break;
|
||||
case ChatPacket::e_ChatDeathInFire:
|
||||
message=app.GetString(IDS_DEATH_INFIRE);
|
||||
@@ -1809,7 +1769,6 @@ 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
|
||||
@@ -1835,7 +1794,6 @@ 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() )
|
||||
@@ -1979,16 +1937,6 @@ 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;
|
||||
@@ -1996,7 +1944,7 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
||||
isAtLeastOneFriend = TRUE;
|
||||
cantPlayContentRestricted= FALSE;
|
||||
|
||||
#if !defined DISABLE_PSN && ( defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
||||
#if ( defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
||||
|
||||
if(!g_NetworkManager.IsHost() && !app.GetGameHostOption(eGameHostOption_FriendsOfFriends))
|
||||
{
|
||||
@@ -2278,8 +2226,7 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
||||
}
|
||||
BOOL allAllowed, friendsAllowed;
|
||||
ProfileManager.AllowedPlayerCreatedContent(m_userIndex,true,&allAllowed,&friendsAllowed);
|
||||
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),
|
||||
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() )
|
||||
@@ -2329,7 +2276,6 @@ 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;
|
||||
@@ -3573,12 +3519,10 @@ void ClientConnection::handleCustomPayload(shared_ptr<CustomPayloadPacket> custo
|
||||
}
|
||||
#else
|
||||
UIScene *scene = ui.GetTopScene(m_userIndex, eUILayer_Scene);
|
||||
UIScene_TradingMenu *screen = dynamic_cast<UIScene_TradingMenu *>(scene);
|
||||
if (screen != NULL)
|
||||
trader = screen->getMerchant();
|
||||
UIScene_TradingMenu *screen = (UIScene_TradingMenu *)scene;
|
||||
trader = screen->getMerchant();
|
||||
#endif
|
||||
|
||||
if (trader == NULL) return;
|
||||
MerchantRecipeList *recipeList = MerchantRecipeList::createFromStream(&input);
|
||||
trader->overrideOffers(recipeList);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ enum eFont
|
||||
eFont_None, // to fallback to nothing
|
||||
};
|
||||
|
||||
enum eXuiAction
|
||||
enum eUIAction
|
||||
{
|
||||
eAppAction_Idle=0,
|
||||
eAppAction_SaveGame,
|
||||
@@ -112,21 +112,21 @@ enum eTMSAction
|
||||
|
||||
// The server runs on its own thread, so we need to call its actions there rather than where all other Xui actions are performed
|
||||
// In general these are debugging options
|
||||
enum eXuiServerAction
|
||||
enum eUIServerAction
|
||||
{
|
||||
eXuiServerAction_Idle=0,
|
||||
eXuiServerAction_DropItem, // Debug
|
||||
eXuiServerAction_SaveGame,
|
||||
eXuiServerAction_AutoSaveGame,
|
||||
eXuiServerAction_SpawnMob, // Debug
|
||||
eXuiServerAction_PauseServer,
|
||||
eXuiServerAction_ToggleRain, // Debug
|
||||
eXuiServerAction_ToggleThunder, // Debug
|
||||
eXuiServerAction_ServerSettingChanged_Gamertags,
|
||||
eXuiServerAction_ServerSettingChanged_Difficulty,
|
||||
eXuiServerAction_ExportSchematic, //Debug
|
||||
eXuiServerAction_ServerSettingChanged_BedrockFog,
|
||||
eXuiServerAction_SetCameraLocation, //Debug
|
||||
eUIServerAction_Idle=0,
|
||||
eUIServerAction_DropItem, // Debug
|
||||
eUIServerAction_SaveGame,
|
||||
eUIServerAction_AutoSaveGame,
|
||||
eUIServerAction_SpawnMob, // Debug
|
||||
eUIServerAction_PauseServer,
|
||||
eUIServerAction_ToggleRain, // Debug
|
||||
eUIServerAction_ToggleThunder, // Debug
|
||||
eUIServerAction_ServerSettingChanged_Gamertags,
|
||||
eUIServerAction_ServerSettingChanged_Difficulty,
|
||||
eUIServerAction_ExportSchematic, //Debug
|
||||
eUIServerAction_ServerSettingChanged_BedrockFog,
|
||||
eUIServerAction_SetCameraLocation, //Debug
|
||||
};
|
||||
|
||||
enum eGameSetting
|
||||
@@ -835,7 +835,7 @@ enum EControllerActions
|
||||
ACTION_MENU_GTC_RESUME,
|
||||
#endif
|
||||
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
ACTION_MENU_TOUCHPAD_PRESS,
|
||||
#endif
|
||||
|
||||
|
||||
@@ -138,9 +138,9 @@ typedef std::vector <PBANNEDLISTDATA> VBANNEDLIST;
|
||||
typedef struct
|
||||
{
|
||||
int iPad;
|
||||
eXuiAction action;
|
||||
eUIAction action;
|
||||
}
|
||||
XuiActionParam;
|
||||
UIActionParam;
|
||||
|
||||
// tips
|
||||
typedef struct
|
||||
@@ -162,7 +162,7 @@ MOJANG_DATA;
|
||||
typedef struct
|
||||
{
|
||||
eDLCContentType eDLCType;
|
||||
#if !defined(DISABLE_PSN) && (defined( __PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
#if defined( __PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
char chImageURL[256];//SCE_NP_COMMERCE2_URL_LEN
|
||||
#else
|
||||
|
||||
|
||||
@@ -1100,7 +1100,7 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
|
||||
{
|
||||
#ifdef __DISABLE_MILES__
|
||||
return 0;
|
||||
#endif
|
||||
#else
|
||||
SoundEngine *soundEngine = (SoundEngine *)lpParameter;
|
||||
soundEngine->m_hStream = AIL_open_stream(soundEngine->m_hDriver,soundEngine->m_szStreamName,0);
|
||||
|
||||
@@ -1111,6 +1111,7 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
@@ -1120,8 +1121,7 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
|
||||
/////////////////////////////////////////////
|
||||
void SoundEngine::playMusicTick()
|
||||
{
|
||||
// AP - vita will update the music during the mixer callback
|
||||
#ifndef __PSVITA__
|
||||
#ifndef __PSVITA__ // AP - vita will update the music during the mixer callback
|
||||
playMusicUpdate();
|
||||
#endif
|
||||
}
|
||||
@@ -1156,10 +1156,6 @@ void SoundEngine::playMusicUpdate()
|
||||
if(m_musicID!=-1)
|
||||
{
|
||||
// start playing it
|
||||
|
||||
|
||||
#if ( defined __PS3__ || defined __PSVITA__ || defined __ORBIS__ )
|
||||
|
||||
#ifdef __PS3__
|
||||
// 4J-PB - Need to check if we are a patched BD build
|
||||
if(app.GetBootedFromDiscPatch())
|
||||
@@ -1171,13 +1167,12 @@ void SoundEngine::playMusicUpdate()
|
||||
{
|
||||
sprintf(m_szStreamName,"%s/%s",getUsrDirPath(), m_szMusicPath );
|
||||
}
|
||||
#else
|
||||
#elif (defined __PSVITA__ || __ORBIS__)
|
||||
sprintf(m_szStreamName,"%s/%s",getUsrDirPath(), m_szMusicPath );
|
||||
#endif
|
||||
|
||||
#else
|
||||
strcpy((char *)m_szStreamName,m_szMusicPath);
|
||||
#endif
|
||||
|
||||
// are we using a mash-up pack?
|
||||
//if(pMinecraft && !pMinecraft->skins->isUsingDefaultSkin() && pMinecraft->skins->getSelected()->hasAudio())
|
||||
if(Minecraft::GetInstance()->skins->getSelected()->hasAudio())
|
||||
@@ -1249,32 +1244,11 @@ void SoundEngine::playMusicUpdate()
|
||||
SetIsPlayingStreamingCDMusic(false);
|
||||
m_MusicType=eMusicType_Game;
|
||||
m_StreamingAudioInfo.bIs3D=false;
|
||||
}
|
||||
}
|
||||
else if(m_musicID<m_iStream_CD_1)
|
||||
{
|
||||
SetIsPlayingStreamingGameMusic(true);
|
||||
SetIsPlayingStreamingCDMusic(false);
|
||||
m_MusicType=eMusicType_Game;
|
||||
m_StreamingAudioInfo.bIs3D=false;
|
||||
// build the name
|
||||
strcat((char *)m_szStreamName,"music/");
|
||||
strcat((char *)m_szStreamName,m_szStreamFileA[m_musicID]);
|
||||
strcat((char *)m_szStreamName,".binka");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
SetIsPlayingStreamingGameMusic(false);
|
||||
SetIsPlayingStreamingCDMusic(true);
|
||||
m_MusicType=eMusicType_CD;
|
||||
m_StreamingAudioInfo.bIs3D=true;
|
||||
// build the name
|
||||
strcat((char *)m_szStreamName,"cds/");
|
||||
strcat((char *)m_szStreamName,m_szStreamFileA[m_musicID]);
|
||||
strcat((char *)m_szStreamName,".binka");
|
||||
}
|
||||
#else
|
||||
#else
|
||||
if(m_musicID<m_iStream_CD_1)
|
||||
#endif
|
||||
{
|
||||
SetIsPlayingStreamingGameMusic(true);
|
||||
SetIsPlayingStreamingCDMusic(false);
|
||||
@@ -1294,8 +1268,6 @@ void SoundEngine::playMusicUpdate()
|
||||
}
|
||||
strcat((char *)m_szStreamName,m_szStreamFileA[m_musicID]);
|
||||
strcat((char *)m_szStreamName,".binka");
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
// wstring name = m_szStreamFileA[m_musicID];
|
||||
|
||||
@@ -62,7 +62,9 @@ foreach ($copy in $fileCopies) {
|
||||
}
|
||||
|
||||
$deleteDirs = @(
|
||||
"Common\Media\font\RU"
|
||||
"Common\Media\font\RU",
|
||||
"Common\res\TitleUpdate\DLC",
|
||||
"Common\res\TitleUpdate\Audio"
|
||||
)
|
||||
|
||||
foreach ($dir in $deleteDirs) {
|
||||
@@ -74,13 +76,14 @@ foreach ($dir in $deleteDirs) {
|
||||
|
||||
$delDirs = @(
|
||||
"Common\Media\font",
|
||||
"Common\Media\font\*"
|
||||
"Common\Media\font\*",
|
||||
"Common\res\TitleUpdate\GameRules"
|
||||
)
|
||||
|
||||
foreach ($dir in $delDirs) {
|
||||
$path = Join-Path $OutDir $dir
|
||||
if (Test-Path $path) {
|
||||
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "DF-DotDotGothic16.ttf", "DFTT_R5.TTC", "candadite2.ttf" -File |
|
||||
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, *.mcs, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "DF-DotDotGothic16.ttf", "DFTT_R5.TTC", "candadite2.ttf" -File |
|
||||
Remove-Item -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,9 @@ if (Test-Path $builtFile) {
|
||||
}
|
||||
|
||||
$deleteDirs = @(
|
||||
"PS4_GAME\Common\Media\font\RU"
|
||||
"PS4_GAME\Common\Media\font\RU",
|
||||
"PS4_GAME\Common\res\TitleUpdate\DLC",
|
||||
"PS4_GAME\Common\res\TitleUpdate\Audio"
|
||||
)
|
||||
|
||||
foreach ($dir in $deleteDirs) {
|
||||
@@ -88,13 +90,14 @@ foreach ($dir in $deleteDirs) {
|
||||
|
||||
$delDirs = @(
|
||||
"PS4_GAME\Common\Media\font",
|
||||
"PS4_GAME\Common\Media\font\*"
|
||||
"PS4_GAME\Common\Media\font\*",
|
||||
"PS4_GAME\Common\res\TitleUpdate\GameRules"
|
||||
)
|
||||
|
||||
foreach ($dir in $delDirs) {
|
||||
$path = Join-Path $OutDir $dir
|
||||
if (Test-Path $path) {
|
||||
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "MSYH.ttf" -File |
|
||||
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, *.mcs, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "MSYH.ttf" -File |
|
||||
Remove-Item -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,9 @@ if (Test-Path $builtFile) {
|
||||
}
|
||||
|
||||
$deleteDirs = @(
|
||||
"PS3_GAME\USRDIR\Common\Media\font\RU"
|
||||
"PS3_GAME\USRDIR\Common\Media\font\RU",
|
||||
"PS3_GAME\USRDIR\Common\res\TitleUpdate\DLC",
|
||||
"PS3_GAME\USRDIR\Common\res\TitleUpdate\Audio"
|
||||
)
|
||||
|
||||
foreach ($dir in $deleteDirs) {
|
||||
@@ -97,13 +99,14 @@ foreach ($dir in $deleteDirs) {
|
||||
|
||||
$delDirs = @(
|
||||
"PS3_GAME\USRDIR\Common\Media\font",
|
||||
"PS3_GAME\USRDIR\Common\Media\font\*"
|
||||
"PS3_GAME\USRDIR\Common\Media\font\*",
|
||||
"PS3_GAME\USRDIR\Common\res\TitleUpdate\GameRules"
|
||||
)
|
||||
|
||||
foreach ($dir in $delDirs) {
|
||||
$path = Join-Path $OutDir $dir
|
||||
if (Test-Path $path) {
|
||||
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "MSYH.ttf" -File |
|
||||
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, *.mcs, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "MSYH.ttf" -File |
|
||||
Remove-Item -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,7 @@ $directories = @(
|
||||
"PSVITA_GAME\Common\res",
|
||||
"PSVITA_GAME\Common\Media",
|
||||
"PSVITA_GAME\PSVita\Sound",
|
||||
"PSVITA_GAME\PSVita\Tutorial",
|
||||
"PSVITA_GAME\savedata"
|
||||
"PSVITA_GAME\PSVita\Tutorial"
|
||||
)
|
||||
|
||||
foreach ($dir in $directories) {
|
||||
@@ -74,7 +73,9 @@ if (Test-Path $builtFile) {
|
||||
}
|
||||
|
||||
$deleteDirs = @(
|
||||
"PSVITA_GAME\Common\Media\font\RU"
|
||||
"PSVITA_GAME\Common\Media\font\RU",
|
||||
"PSVITA_GAME\Common\res\TitleUpdate\DLC",
|
||||
"PSVITA_GAME\Common\res\TitleUpdate\Audio"
|
||||
)
|
||||
|
||||
foreach ($dir in $deleteDirs) {
|
||||
@@ -86,13 +87,14 @@ foreach ($dir in $deleteDirs) {
|
||||
|
||||
$delDirs = @(
|
||||
"PSVITA_GAME\Common\Media\font",
|
||||
"PSVITA_GAME\Common\Media\font\*"
|
||||
"PSVITA_GAME\Common\Media\font\*",
|
||||
"PSVITA_GAME\Common\res\TitleUpdate\GameRules"
|
||||
)
|
||||
|
||||
foreach ($dir in $delDirs) {
|
||||
$path = Join-Path $OutDir $dir
|
||||
if (Test-Path $path) {
|
||||
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "MSYH.ttf" -File |
|
||||
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, *.mcs, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "MSYH.ttf" -File |
|
||||
Remove-Item -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
param(
|
||||
[string]$OutDir,
|
||||
[string]$ProjectDir
|
||||
)
|
||||
|
||||
Write-Host "Server Postbuild: script started. Output Directory: $OutDir, Project Directory: $ProjectDir"
|
||||
|
||||
$directories = @(
|
||||
"Windows64\GameHDD",
|
||||
"Common\Media",
|
||||
"Common\res",
|
||||
"redist64"
|
||||
)
|
||||
|
||||
foreach ($dir in $directories) {
|
||||
New-Item -ItemType Directory -Path (Join-Path $OutDir $dir) -Force | Out-Null
|
||||
}
|
||||
|
||||
$folderCopies = @(
|
||||
@{ Source = "Common\Media"; Dest = "Common\Media" },
|
||||
@{ Source = "Common\res"; Dest = "Common\res" },
|
||||
@{ Source = "Common\Postbuilds\Contents\Windows64\redist64"; Dest = "redist64" }
|
||||
)
|
||||
|
||||
foreach ($copy in $folderCopies) {
|
||||
$src = Join-Path "$ProjectDir\..\Minecraft.Client" $copy.Source
|
||||
$dst = Join-Path $OutDir $copy.Dest
|
||||
|
||||
if (Test-Path $src) {
|
||||
xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null
|
||||
}
|
||||
}
|
||||
|
||||
$fileCopies = @(
|
||||
@{ Source = Join-Path "$ProjectDir\..\Minecraft.Client" "Windows64\4JLibs\4J_Input\Windows64\vendor\SDL\lib\x64\SDL3.dll"; Dest = "SDL3.dll" },
|
||||
@{ Source = "Common\Media\MediaWindows64.arc"; Dest = "Common\Media\MediaWindows64.arc" },
|
||||
@{ Source = Join-Path $PSScriptRoot "Contents\Windows64\mss64.dll"; Dest = "mss64.dll" },
|
||||
@{ Source = "Windows64\Iggy\lib\redist64\iggy_w64.dll"; Dest = "iggy_w64.dll" }
|
||||
)
|
||||
|
||||
foreach ($copy in $fileCopies) {
|
||||
$src = $copy.Source
|
||||
$dst = Join-Path $OutDir $copy.Dest
|
||||
if (Test-Path $src) {
|
||||
Copy-Item -Path $src -Destination $dst -Force
|
||||
} else {
|
||||
Write-Host "Server Postbuild: File not found, skipping: $src"
|
||||
}
|
||||
}
|
||||
|
||||
$deleteDirs = @(
|
||||
"Common\Media\Sound",
|
||||
"Common\Media\Graphics",
|
||||
"Common\Media\de-DE",
|
||||
"Common\Media\es-ES",
|
||||
"Common\Media\fr-FR",
|
||||
"Common\Media\it-IT",
|
||||
"Common\Media\ja-JP",
|
||||
"Common\Media\ko-KR",
|
||||
"Common\Media\pt-BR",
|
||||
"Common\Media\pt-PT",
|
||||
"Common\Media\zh-CHT"
|
||||
)
|
||||
|
||||
foreach ($dir in $deleteDirs) {
|
||||
$path = Join-Path $OutDir $dir
|
||||
if (Test-Path $path) {
|
||||
Remove-Item $path -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
$delDirs = @(
|
||||
"Common\Media",
|
||||
"Common\Media\font"
|
||||
)
|
||||
|
||||
foreach ($dir in $delDirs) {
|
||||
if ($delDirs -contains $dir) {
|
||||
$path = Join-Path $OutDir $dir
|
||||
if (Test-Path $path) {
|
||||
Get-ChildItem -Path $path -Recurse -Include *.swf, *.txt, *.resx, *.xml, *.loc, *.lang, *.col, *.h, *.xui, *.abc, "Mojang Font_7.ttf", "Mojang Font_11.ttf", MediaDurango.arc, MediaOrbis.arc, MediaPS3.arc, MediaPSVita.arc -File |
|
||||
Remove-Item -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ $folderCopies = @(
|
||||
@{ Source = "Common\Media\Font"; Dest = "Common\Media\Font" },
|
||||
@{ Source = "Windows64Media\DLC"; Dest = "Windows64Media\DLC" },
|
||||
@{ Source = "Windows64Media\Sound"; Dest = "Windows64Media\Sound" },
|
||||
#@{ Source = "PSVita\Tutorial"; Dest = "Windows64Media\Tutorial" }, # str1k3r - doesnt even work bru
|
||||
@{ Source = "Windows64Media\Tutorial"; Dest = "Windows64Media\Tutorial" },
|
||||
@{ Source = "Windows64\Miles\lib\redist64"; Dest = "Windows64\redist64" }
|
||||
)
|
||||
|
||||
@@ -60,7 +60,9 @@ foreach ($copy in $fileCopies) {
|
||||
}
|
||||
|
||||
$deleteDirs = @(
|
||||
"Common\Media\font\RU" #str1k3r - russian font?
|
||||
"Common\Media\font\RU", #str1k3r - russian font?
|
||||
"Common\res\TitleUpdate\DLC",
|
||||
"Common\res\TitleUpdate\Audio"
|
||||
)
|
||||
|
||||
foreach ($dir in $deleteDirs) {
|
||||
@@ -72,13 +74,14 @@ foreach ($dir in $deleteDirs) {
|
||||
|
||||
$delDirs = @(
|
||||
"Common\Media\font",
|
||||
"Common\Media\font\*"
|
||||
"Common\Media\font\*",
|
||||
"Common\res\TitleUpdate\GameRules"
|
||||
)
|
||||
|
||||
foreach ($dir in $delDirs) {
|
||||
$path = Join-Path $OutDir $dir
|
||||
if (Test-Path $path) {
|
||||
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "DF-DotDotGothic16.ttf", "DFTT_R5.TTC", "candadite2.ttf" -File |
|
||||
Get-ChildItem -Path $path -Recurse -Include *.txt, *.abc, *.mcs, "Mojang Font_7.ttf", "Mojang Font_11.ttf", "DF-DotDotGothic16.ttf", "DFTT_R5.TTC", "candadite2.ttf" -File |
|
||||
Remove-Item -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,18 @@ $fileCopies = @(
|
||||
@{ Source = "Common\Tutorial\Tutorial"; Dest = "Tutorial\Tutorial" }
|
||||
)
|
||||
|
||||
$delDirs = @(
|
||||
"Common\res\TitleUpdate\GameRules"
|
||||
)
|
||||
|
||||
foreach ($dir in $delDirs) {
|
||||
$path = Join-Path $OutDir $dir
|
||||
if (Test-Path $path) {
|
||||
Get-ChildItem -Path $path -Recurse -Include *.mcs -File |
|
||||
Remove-Item -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($copy in $fileCopies) {
|
||||
$src = Join-Path $ProjectDir $copy.Source
|
||||
$dst = Join-Path $OutDir $copy.Dest
|
||||
|
||||
@@ -1,27 +1,15 @@
|
||||
#include "stdafx.h"
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#include "../../Minecraft.Server/ServerLogManager.h"
|
||||
#endif
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Name: DebugSpewV()
|
||||
// Desc: Internal helper function
|
||||
//--------------------------------------------------------------------------------------
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
static VOID DebugSpewV( const CHAR* strFormat, va_list pArgList )
|
||||
static VOID DebugSpewV( const CHAR* strFormat, const va_list pArgList )
|
||||
{
|
||||
#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
assert(0);
|
||||
#else
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Dedicated server routes legacy debug spew through ServerLogger to preserve CLI prompt handling.
|
||||
if (ServerRuntime::ServerLogManager::ShouldForwardClientDebugLogs())
|
||||
{
|
||||
ServerRuntime::ServerLogManager::ForwardClientDebugSpewLogV(strFormat, pArgList);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
CHAR str[2048];
|
||||
// Use the secure CRT to avoid buffer overruns. Specify a count of
|
||||
// _TRUNCATE so that too long strings will be silently truncated
|
||||
|
||||
@@ -30,9 +30,6 @@
|
||||
#include "GameRules\ConsoleGameRules.h"
|
||||
#include "GameRules\ConsoleSchematicFile.h"
|
||||
#include "..\User.h"
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#include "..\..\Minecraft.Server\ServerLogManager.h"
|
||||
#endif
|
||||
#include "..\\EntityRenderDispatcher.h"
|
||||
#include "..\TexturePackRepository.h"
|
||||
#include "..\DLCTexturePack.h"
|
||||
@@ -92,8 +89,8 @@ CMinecraftApp::CMinecraftApp()
|
||||
for(int i=0;i<XUSER_MAX_COUNT;i++)
|
||||
{
|
||||
m_eTMSAction[i]=eTMSAction_Idle;
|
||||
m_eXuiAction[i]=eAppAction_Idle;
|
||||
m_eXuiActionParam[i] = NULL;
|
||||
m_eUIAction[i]=eAppAction_Idle;
|
||||
m_eUIActionParam[i] = NULL;
|
||||
//m_dwAdditionalModelParts[i] = 0;
|
||||
|
||||
if(FAILED(XUserGetSigninInfo(i,XUSER_GET_SIGNIN_INFO_OFFLINE_XUID_ONLY ,&m_currentSigninInfo[i])))
|
||||
@@ -109,8 +106,8 @@ CMinecraftApp::CMinecraftApp()
|
||||
m_uiOpacityCountDown[i]=0;
|
||||
|
||||
}
|
||||
m_eGlobalXuiAction=eAppAction_Idle;
|
||||
m_eGlobalXuiServerAction=eXuiServerAction_Idle;
|
||||
m_eGlobalUIAction=eAppAction_Idle;
|
||||
m_eGlobalUIServerAction=eUIServerAction_Idle;
|
||||
|
||||
m_bResourcesLoaded=false;
|
||||
m_bGameStarted=false;
|
||||
@@ -202,13 +199,13 @@ CMinecraftApp::CMinecraftApp()
|
||||
// m_uiTransferSlotC=5;
|
||||
#endif
|
||||
|
||||
#if (defined _CONTENT_PACAKGE) || (defined _XBOX)
|
||||
#if (defined _CONTENT_PACAKGE || _XBOX)
|
||||
m_bUseDPadForDebug = false;
|
||||
#else
|
||||
m_bUseDPadForDebug = true;
|
||||
#endif
|
||||
|
||||
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
|
||||
#if !(defined _WINDOWS64 || _XBOX)
|
||||
for(int i=0;i<XUSER_MAX_COUNT;i++)
|
||||
{
|
||||
m_eOptionsStatusA[i]=C4JStorage::eOptions_Callback_Idle;
|
||||
@@ -233,21 +230,12 @@ void CMinecraftApp::DebugPrintf(const char *szFormat, ...)
|
||||
{
|
||||
|
||||
#ifndef _FINAL_BUILD
|
||||
va_list ap;
|
||||
va_start(ap, szFormat);
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Dedicated server routes client debug spew through ServerLogger so CLI output stays prompt-safe.
|
||||
if (ServerRuntime::ServerLogManager::ShouldForwardClientDebugLogs())
|
||||
{
|
||||
ServerRuntime::ServerLogManager::ForwardClientAppDebugLogV(szFormat, ap);
|
||||
va_end(ap);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
char buf[1024];
|
||||
vsnprintf(buf, sizeof(buf), szFormat, ap);
|
||||
va_end(ap);
|
||||
OutputDebugStringA(buf);
|
||||
char buf[1024];
|
||||
va_list ap;
|
||||
va_start(ap, szFormat);
|
||||
vsnprintf(buf, sizeof(buf), szFormat, ap);
|
||||
va_end(ap);
|
||||
OutputDebugStringA(buf);
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -255,22 +243,13 @@ void CMinecraftApp::DebugPrintf(const char *szFormat, ...)
|
||||
void CMinecraftApp::DebugPrintf(int user, const char *szFormat, ...)
|
||||
{
|
||||
#ifndef _FINAL_BUILD
|
||||
if(user == USER_NONE)
|
||||
return;
|
||||
va_list ap;
|
||||
va_start(ap, szFormat);
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Dedicated server routes client debug spew through ServerLogger so CLI output stays prompt-safe.
|
||||
if (ServerRuntime::ServerLogManager::ShouldForwardClientDebugLogs())
|
||||
{
|
||||
ServerRuntime::ServerLogManager::ForwardClientUserDebugLogV(user, szFormat, ap);
|
||||
va_end(ap);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
char buf[1024];
|
||||
vsnprintf(buf, sizeof(buf), szFormat, ap);
|
||||
va_end(ap);
|
||||
if(user == USER_NONE)
|
||||
return;
|
||||
char buf[1024];
|
||||
va_list ap;
|
||||
va_start(ap, szFormat);
|
||||
vsnprintf(buf, sizeof(buf), szFormat, ap);
|
||||
va_end(ap);
|
||||
#ifdef __PS3__
|
||||
unsigned int writelen;
|
||||
sys_tty_write(SYS_TTYP_USER1 + ( user - 1 ), buf, strlen(buf), &writelen );
|
||||
@@ -322,25 +301,25 @@ LPCWSTR CMinecraftApp::GetString(int iID)
|
||||
return app.m_stringTable->getString(iID);
|
||||
}
|
||||
|
||||
void CMinecraftApp::SetAction(int iPad, eXuiAction action, LPVOID param)
|
||||
void CMinecraftApp::SetAction(int iPad, eUIAction action, LPVOID param)
|
||||
{
|
||||
if( ( m_eXuiAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_EthernetDisconnected ) )
|
||||
if( ( m_eUIAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_EthernetDisconnected ) )
|
||||
{
|
||||
app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eXuiAction[iPad], action);
|
||||
app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eUIAction[iPad], action);
|
||||
}
|
||||
else if( ( m_eXuiAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_ExitWorld ) )
|
||||
else if( ( m_eUIAction[iPad] == eAppAction_ReloadTexturePack ) && ( action == eAppAction_ExitWorld ) )
|
||||
{
|
||||
app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eXuiAction[iPad], action);
|
||||
app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eUIAction[iPad], action);
|
||||
}
|
||||
else if(m_eXuiAction[iPad] == eAppAction_ExitWorldCapturedThumbnail && action != eAppAction_Idle)
|
||||
else if(m_eUIAction[iPad] == eAppAction_ExitWorldCapturedThumbnail && action != eAppAction_Idle)
|
||||
{
|
||||
app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eXuiAction[iPad], action);
|
||||
app.DebugPrintf("Invalid change of App action for pad %d from %d to %d, ignoring\n", iPad, m_eUIAction[iPad], action);
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Changing App action for pad %d from %d to %d\n", iPad, m_eXuiAction[iPad], action);
|
||||
m_eXuiAction[iPad]=action;
|
||||
m_eXuiActionParam[iPad] = param;
|
||||
app.DebugPrintf("Changing App action for pad %d from %d to %d\n", iPad, m_eUIAction[iPad], action);
|
||||
m_eUIAction[iPad]=action;
|
||||
m_eUIActionParam[iPad] = param;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,30 +344,6 @@ void CMinecraftApp::SetAppPaused(bool val)
|
||||
m_bIsAppPaused = val;
|
||||
}
|
||||
|
||||
void CMinecraftApp::HandleButtonPresses()
|
||||
{
|
||||
for(int i=0;i<4;i++)
|
||||
{
|
||||
HandleButtonPresses(i);
|
||||
}
|
||||
}
|
||||
|
||||
void CMinecraftApp::HandleButtonPresses(int iPad)
|
||||
{
|
||||
|
||||
// // test an update of the profile data
|
||||
// void *pData=ProfileManager.GetGameDefinedProfileData(iPad);
|
||||
//
|
||||
// unsigned char *pchData= (unsigned char *)pData;
|
||||
// int iCount=0;
|
||||
// for(int i=0;i<GAME_DEFINED_PROFILE_DATA_BYTES;i++)
|
||||
// {
|
||||
// pchData[i]=0xBC;
|
||||
// //if(iCount==255) iCount = 0;
|
||||
// }
|
||||
// ProfileManager.WriteToProfile(iPad,true);
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadInventoryMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack)
|
||||
{
|
||||
bool success = true;
|
||||
@@ -774,7 +729,7 @@ void CMinecraftApp::InitGameSettings()
|
||||
{
|
||||
for(int i=0;i<XUSER_MAX_COUNT;i++)
|
||||
{
|
||||
#if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
|
||||
#if !(defined _WINDOWS64 || _XBOX)
|
||||
GameSettingsA[i]=(GAME_SETTINGS *)StorageManager.GetGameDefinedProfileData(i);
|
||||
#else
|
||||
GameSettingsA[i]=(GAME_SETTINGS *)ProfileManager.GetGameDefinedProfileData(i);
|
||||
@@ -785,21 +740,20 @@ void CMinecraftApp::InitGameSettings()
|
||||
//SetDefaultGameSettings(i); - done on a callback from the profile manager
|
||||
|
||||
// 4J-PB - adding in for Windows & PS3 to set the defaults for the joypad
|
||||
#if defined _WINDOWS64
|
||||
#ifdef _WINDOWS64
|
||||
C_4JProfile::PROFILESETTINGS *pProfileSettings=ProfileManager.GetDashboardProfileSettings(i);
|
||||
SetDefaultOptions(pProfileSettings,i);
|
||||
ProfileManager.LoadSettings(GameSettingsA[i], sizeof(GAME_SETTINGS));
|
||||
ApplyGameSettingsChanged(i);
|
||||
#elif defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__
|
||||
#elif !defined(_XBOX)
|
||||
C4JStorage::PROFILESETTINGS *pProfileSettings=StorageManager.GetDashboardProfileSettings(i);
|
||||
// 4J-PB - don't cause an options write to happen here
|
||||
SetDefaultOptions(pProfileSettings,i,false);
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
|
||||
#if !(defined _WINDOWS64 || _XBOX)
|
||||
int CMinecraftApp::SetDefaultOptions(C4JStorage::PROFILESETTINGS *pSettings,const int iPad,bool bWriteProfile)
|
||||
#else
|
||||
int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,const int iPad)
|
||||
@@ -892,7 +846,7 @@ int CMinecraftApp::SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,con
|
||||
|
||||
//#endif
|
||||
|
||||
#if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
|
||||
#if !(defined _WINDOWS64 || _XBOX)
|
||||
GameSettingsA[iPad]->bSettingsChanged=bWriteProfile;
|
||||
#endif
|
||||
|
||||
@@ -920,8 +874,7 @@ int CMinecraftApp::DefaultOptionsCallback(LPVOID pParam,C_4JProfile::PROFILESETT
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
|
||||
|
||||
#if !(defined _WINDOWS64 || _XBOX)
|
||||
wstring CMinecraftApp::toStringOptionsStatus(const C4JStorage::eOptionsCallback &eStatus)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
@@ -1248,9 +1201,6 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat
|
||||
{
|
||||
// This might be from a version during testing of new profile updates
|
||||
app.DebugPrintf("Don't know what to do with this profile version!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
// __debugbreak();
|
||||
#endif
|
||||
|
||||
GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData;
|
||||
pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu
|
||||
@@ -1373,7 +1323,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
|
||||
// Game Host only (and for now we can't change the diff while in game, so this shouldn't happen)
|
||||
if(bInGame && g_NetworkManager.IsHost() && (iPad==ProfileManager.GetPrimaryPad()))
|
||||
{
|
||||
app.SetXuiServerAction(iPad,eXuiServerAction_ServerSettingChanged_Difficulty);
|
||||
app.SetUIServerAction(iPad,eUIServerAction_ServerSettingChanged_Difficulty);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1439,7 +1389,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
|
||||
{
|
||||
// Update the Game Host setting if you are the host and you are in-game
|
||||
app.SetGameHostOption(eGameHostOption_Gamertags,((GameSettingsA[iPad]->usBitmaskValues&0x0008)!=0)?1:0);
|
||||
app.SetXuiServerAction(iPad,eXuiServerAction_ServerSettingChanged_Gamertags);
|
||||
app.SetUIServerAction(iPad,eUIServerAction_ServerSettingChanged_Gamertags);
|
||||
|
||||
PlayerList *players = MinecraftServer::getInstance()->getPlayerList();
|
||||
for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3)
|
||||
@@ -1515,7 +1465,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
|
||||
{
|
||||
// Update the Game Host setting if you are the host and you are in-game
|
||||
app.SetGameHostOption(eGameHostOption_BedrockFog,GetGameSettings(iPad,eGameSetting_BedrockFog)?1:0);
|
||||
app.SetXuiServerAction(iPad,eXuiServerAction_ServerSettingChanged_BedrockFog);
|
||||
app.SetUIServerAction(iPad,eUIServerAction_ServerSettingChanged_BedrockFog);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2609,21 +2559,21 @@ int CMinecraftApp::DisplaySavingMessage(void *pParam, C4JStorage::ESavingMessage
|
||||
|
||||
void CMinecraftApp::SetActionConfirmed(LPVOID param)
|
||||
{
|
||||
XuiActionParam *actionInfo = (XuiActionParam *)param;
|
||||
UIActionParam *actionInfo = (UIActionParam *)param;
|
||||
app.SetAction(actionInfo->iPad, actionInfo->action);
|
||||
}
|
||||
|
||||
|
||||
void CMinecraftApp::HandleXuiActions(void)
|
||||
void CMinecraftApp::HandleUIActions(void)
|
||||
{
|
||||
eXuiAction eAction;
|
||||
eUIAction eAction;
|
||||
eTMSAction eTMS;
|
||||
LPVOID param;
|
||||
Minecraft *pMinecraft=Minecraft::GetInstance();
|
||||
shared_ptr<MultiplayerLocalPlayer> player;
|
||||
|
||||
// are there any global actions to deal with?
|
||||
eAction = app.GetGlobalXuiAction();
|
||||
eAction = app.GetGlobalUIAction();
|
||||
if(eAction!=eAppAction_Idle)
|
||||
{
|
||||
switch(eAction)
|
||||
@@ -2634,7 +2584,7 @@ void CMinecraftApp::HandleXuiActions(void)
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
C4JStorage::EMessageResult result = ui.RequestErrorMessage( IDS_CANT_PLACE_NEAR_SPAWN_TITLE, IDS_CANT_PLACE_NEAR_SPAWN_TEXT, uiIDA,1,XUSER_INDEX_ANY);
|
||||
if(result != C4JStorage::EMessage_Busy) SetGlobalXuiAction(eAppAction_Idle);
|
||||
if(result != C4JStorage::EMessage_Busy) SetGlobalUIAction(eAppAction_Idle);
|
||||
|
||||
}
|
||||
break;
|
||||
@@ -2646,8 +2596,8 @@ void CMinecraftApp::HandleXuiActions(void)
|
||||
// are there any app actions to deal with?
|
||||
for(int i=0;i<XUSER_MAX_COUNT;i++)
|
||||
{
|
||||
eAction = app.GetXuiAction(i);
|
||||
param = m_eXuiActionParam[i];
|
||||
eAction = app.GetUIAction(i);
|
||||
param = m_eUIActionParam[i];
|
||||
|
||||
if(eAction!=eAppAction_Idle)
|
||||
{
|
||||
@@ -2682,7 +2632,7 @@ void CMinecraftApp::HandleXuiActions(void)
|
||||
bool bKeepHiding = false;
|
||||
for(int j=0; j < XUSER_MAX_COUNT;++j)
|
||||
{
|
||||
if(app.GetXuiAction(j) == eAppAction_SocialPostScreenshot)
|
||||
if(app.GetUIAction(j) == eAppAction_SocialPostScreenshot)
|
||||
{
|
||||
bKeepHiding = true;
|
||||
break;
|
||||
@@ -2804,7 +2754,7 @@ void CMinecraftApp::HandleXuiActions(void)
|
||||
SetAction(i,eAppAction_Idle);
|
||||
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_AutoSaveGame);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_AutoSaveGame);
|
||||
|
||||
if(app.GetGameHostOption(eGameHostOption_DisableSaving)) StorageManager.SetSaveDisabled(true);
|
||||
#else
|
||||
@@ -3286,7 +3236,7 @@ void CMinecraftApp::HandleXuiActions(void)
|
||||
pMinecraft->localplayers[i]->respawn();
|
||||
|
||||
// If the respawn requires a dimension change then the action will have changed
|
||||
//if(app.GetXuiAction(i) == eAppAction_Respawn)
|
||||
//if(app.GetUIAction(i) == eAppAction_Respawn)
|
||||
//{
|
||||
// SetAction(i,eAppAction_Idle);
|
||||
// CloseXuiScenes(i);
|
||||
@@ -4910,13 +4860,11 @@ 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)
|
||||
@@ -4981,7 +4929,6 @@ 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() ) )
|
||||
@@ -4993,7 +4940,6 @@ 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.
|
||||
@@ -5119,9 +5065,6 @@ 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__
|
||||
@@ -5134,15 +5077,11 @@ 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__
|
||||
@@ -5158,7 +5097,6 @@ int CMinecraftApp::MustSignInFullVersionPurchaseReturnedExitTrial(void *pParam,i
|
||||
app.SetAction(iPad,eAppAction_ExitWorldTrial);
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -6492,7 +6430,7 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado
|
||||
text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_DOWN*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_DOWN ) );
|
||||
text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_RIGHT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_RIGHT ) );
|
||||
text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_LEFT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_LEFT ) );
|
||||
#if !(defined __ORBIS__ || __PS3__)
|
||||
#if !(defined __ORBIS__ || __PS3__ || _XBOX)
|
||||
text = replaceAll(text, L"{*CONTROLLER_VK_START*}", GetVKReplacement(VK_PAD_START ) );
|
||||
text = replaceAll(text, L"{*CONTROLLER_VK_BACK*}", GetVKReplacement(VK_PAD_BACK ) );
|
||||
#endif
|
||||
@@ -6810,7 +6748,7 @@ wstring CMinecraftApp::GetIconReplacement(unsigned int uiIcon)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
#if 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;
|
||||
@@ -6821,12 +6759,6 @@ 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;
|
||||
@@ -6909,7 +6841,7 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue)
|
||||
return hr;
|
||||
}
|
||||
|
||||
#if (defined _XBOX || defined _WINDOWS64 || defined DISABLE_PSN)
|
||||
#if (defined _XBOX || defined _WINDOWS64)
|
||||
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;
|
||||
@@ -6926,20 +6858,12 @@ 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
|
||||
|
||||
@@ -7109,7 +7033,7 @@ HRESULT CMinecraftApp::RegisterDLCData(char *pchDLCName, unsigned int uiSortInde
|
||||
|
||||
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__))
|
||||
#if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal)
|
||||
{
|
||||
AUTO_VAR(it, DLCInfo_SkinName.find(FirstSkin));
|
||||
@@ -7377,7 +7301,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForProductName(WCHAR *pwchProductName)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#elif !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
#elif defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
#else
|
||||
|
||||
DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full)
|
||||
@@ -7412,7 +7336,7 @@ void CMinecraftApp::EnterSaveNotificationSection()
|
||||
|
||||
if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 )
|
||||
{
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)TRUE);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7430,7 +7354,7 @@ void CMinecraftApp::LeaveSaveNotificationSection()
|
||||
|
||||
if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 )
|
||||
{
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7459,14 +7383,14 @@ int CMinecraftApp::RemoteSaveThreadProc( void* lpParameter )
|
||||
pMinecraft->progressRenderer->progressStage( -1 );
|
||||
pMinecraft->progressRenderer->progressStagePercentage(0);
|
||||
|
||||
while( !app.GetGameStarted() && app.GetXuiAction( ProfileManager.GetPrimaryPad() ) == eAppAction_WaitRemoteServerSaveComplete )
|
||||
while( !app.GetGameStarted() && app.GetUIAction( ProfileManager.GetPrimaryPad() ) == eAppAction_WaitRemoteServerSaveComplete )
|
||||
{
|
||||
// Tick all the games connections
|
||||
pMinecraft->tickAllConnections();
|
||||
Sleep( 100 );
|
||||
}
|
||||
|
||||
if( app.GetXuiAction( ProfileManager.GetPrimaryPad() ) != eAppAction_WaitRemoteServerSaveComplete )
|
||||
if( app.GetUIAction( ProfileManager.GetPrimaryPad() ) != eAppAction_WaitRemoteServerSaveComplete )
|
||||
{
|
||||
// Something cancelled us?
|
||||
return ERROR_CANCELLED;
|
||||
@@ -9488,7 +9412,7 @@ byteArray CMinecraftApp::getArchiveFile(const wstring &filename)
|
||||
|
||||
// DLC
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
int CMinecraftApp::GetDLCInfoCount()
|
||||
{
|
||||
return (int)DLCInfo.size();
|
||||
|
||||
@@ -114,7 +114,6 @@ public:
|
||||
static const int USER_SR = 6;
|
||||
static const int USER_UI = 7; // 4J Stu - This also makes it appear on the UI console
|
||||
|
||||
void HandleButtonPresses();
|
||||
bool IntroRunning() { return m_bIntroRunning;}
|
||||
void SetIntroRunning(bool bSet) {m_bIntroRunning=bSet;}
|
||||
#ifdef _CONTENT_PACKAGE
|
||||
@@ -160,17 +159,17 @@ public:
|
||||
eGameMode GetGameMode() { return m_eGameMode;}
|
||||
void SetGameMode(eGameMode eMode) { m_eGameMode=eMode;}
|
||||
|
||||
eXuiAction GetGlobalXuiAction() {return m_eGlobalXuiAction;}
|
||||
void SetGlobalXuiAction(eXuiAction action) {m_eGlobalXuiAction=action;}
|
||||
eXuiAction GetXuiAction(int iPad) {return m_eXuiAction[iPad];}
|
||||
void SetAction(int iPad, eXuiAction action, LPVOID param = NULL);
|
||||
eUIAction GetGlobalUIAction() {return m_eGlobalUIAction;}
|
||||
void SetGlobalUIAction(eUIAction action) {m_eGlobalUIAction=action;}
|
||||
eUIAction GetUIAction(int iPad) {return m_eUIAction[iPad];}
|
||||
void SetAction(int iPad, eUIAction action, LPVOID param = NULL);
|
||||
void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; }
|
||||
eTMSAction GetTMSAction(int iPad) {return m_eTMSAction[iPad];}
|
||||
eXuiServerAction GetXuiServerAction(int iPad) {return m_eXuiServerAction[iPad];}
|
||||
LPVOID GetXuiServerActionParam(int iPad) {return m_eXuiServerActionParam[iPad];}
|
||||
void SetXuiServerAction(int iPad, eXuiServerAction action, LPVOID param = NULL) {m_eXuiServerAction[iPad]=action; m_eXuiServerActionParam[iPad] = param;}
|
||||
eXuiServerAction GetGlobalXuiServerAction() {return m_eGlobalXuiServerAction;}
|
||||
void SetGlobalXuiServerAction(eXuiServerAction action) {m_eGlobalXuiServerAction=action;}
|
||||
eUIServerAction GetUIServerAction(int iPad) {return m_eUIServerAction[iPad];}
|
||||
LPVOID GetUIServerActionParam(int iPad) {return m_eUIServerActionParam[iPad];}
|
||||
void SetUIServerAction(int iPad, eUIServerAction action, LPVOID param = NULL) {m_eUIServerAction[iPad]=action; m_eUIServerActionParam[iPad] = param;}
|
||||
eUIServerAction GetGlobalUIServerAction() {return m_eGlobalUIServerAction;}
|
||||
void SetGlobalUIServerAction(eUIServerAction action) {m_eGlobalUIServerAction=action;}
|
||||
|
||||
DisconnectPacket::eDisconnectReason GetDisconnectReason() { return m_disconnectReason; }
|
||||
void SetDisconnectReason(DisconnectPacket::eDisconnectReason bVal) { m_disconnectReason = bVal; }
|
||||
@@ -184,7 +183,7 @@ public:
|
||||
|
||||
// 4J Stu - Added so that we can call this when a confirmation box is selected
|
||||
static void SetActionConfirmed(LPVOID param);
|
||||
void HandleXuiActions(void);
|
||||
void HandleUIActions(void);
|
||||
|
||||
// 4J Stu - Functions used for Minecon and other promo work
|
||||
bool GetLoadSavesFromFolderEnabled() { return m_bLoadSavesFromFolderEnabled; }
|
||||
@@ -446,8 +445,6 @@ private:
|
||||
|
||||
VBANNEDLIST *m_vBannedListA[XUSER_MAX_COUNT];
|
||||
|
||||
void HandleButtonPresses(int iPad);
|
||||
|
||||
bool m_bResourcesLoaded;
|
||||
|
||||
// Global string table for this application.
|
||||
@@ -514,13 +511,13 @@ private:
|
||||
|
||||
// To avoid problems with threads being kicked off from xuis that alter things that may be in progress within the run_middle,
|
||||
// we'll action these at the end of the game loop
|
||||
eXuiAction m_eXuiAction[XUSER_MAX_COUNT];
|
||||
eUIAction m_eUIAction[XUSER_MAX_COUNT];
|
||||
eTMSAction m_eTMSAction[XUSER_MAX_COUNT];
|
||||
LPVOID m_eXuiActionParam[XUSER_MAX_COUNT];
|
||||
eXuiAction m_eGlobalXuiAction;
|
||||
eXuiServerAction m_eXuiServerAction[XUSER_MAX_COUNT];
|
||||
LPVOID m_eXuiServerActionParam[XUSER_MAX_COUNT];
|
||||
eXuiServerAction m_eGlobalXuiServerAction;
|
||||
LPVOID m_eUIActionParam[XUSER_MAX_COUNT];
|
||||
eUIAction m_eGlobalUIAction;
|
||||
eUIServerAction m_eUIServerAction[XUSER_MAX_COUNT];
|
||||
LPVOID m_eUIServerActionParam[XUSER_MAX_COUNT];
|
||||
eUIServerAction m_eGlobalUIServerAction;
|
||||
|
||||
bool m_bLiveLinkRequired;
|
||||
|
||||
@@ -594,7 +591,7 @@ public:
|
||||
MOJANG_DATA *GetMojangDataForXuid(PlayerUID xuid);
|
||||
static HRESULT RegisterConfigValues(WCHAR *pType, int iValue);
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__))
|
||||
#if 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 +628,7 @@ private:
|
||||
|
||||
std::vector <SCreditTextItemDef *> vDLCCredits;
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
#if 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,12 +639,6 @@ 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
|
||||
@@ -778,7 +769,7 @@ public:
|
||||
void ClearTMSPPFilesRetrieved();
|
||||
unsigned int AddTMSPPFileTypeRequest(eDLCContentType eType, bool bPromote=false);
|
||||
int GetDLCInfoTexturesOffersCount();
|
||||
#if !defined(DISABLE_PSN) && (defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__))
|
||||
#if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
DLC_INFO *GetDLCInfo(int iIndex);
|
||||
DLC_INFO *GetDLCInfo(char *);
|
||||
DLC_INFO *GetDLCInfoFromTPackID(int iTPID);
|
||||
|
||||
@@ -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(const std::string& str)
|
||||
std::string base64_encode(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(const std::string& str);
|
||||
std::string base64_encode(std::string str);
|
||||
std::string base64_encode(unsigned char const* , unsigned int len);
|
||||
std::string base64_decode(std::string const& s);
|
||||
Binary file not shown.
@@ -70,9 +70,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
|
||||
#if !defined(_DISABLE_XBLIVE) && defined _XBOX
|
||||
#ifdef _XBOX
|
||||
s_pPlatformNetworkManager = new CPlatformNetworkManagerXbox();
|
||||
#elif !defined(DISABLE_PSN) && (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
||||
#elif defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
s_pPlatformNetworkManager = new CPlatformNetworkManagerSony();
|
||||
#elif defined _DURANGO
|
||||
s_pPlatformNetworkManager = new CPlatformNetworkManagerDurango();
|
||||
@@ -104,14 +104,12 @@ 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:
|
||||
@@ -173,11 +171,6 @@ 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;
|
||||
|
||||
@@ -347,12 +340,10 @@ 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();
|
||||
@@ -362,24 +353,12 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
// PRIMARY PLAYER
|
||||
|
||||
vector<ClientConnection *> createdConnections;
|
||||
ClientConnection *connection = NULL;
|
||||
ClientConnection *connection;
|
||||
|
||||
if( g_NetworkManager.IsHost() )
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
{
|
||||
app.DebugPrintf("Dedicated server mode: skipping local host client connection\n");
|
||||
|
||||
// Keep telemetry behavior consistent with the host path.
|
||||
INT multiplayerInstanceId = TelemetryManager->GenerateMultiplayerInstanceId();
|
||||
TelemetryManager->SetMultiplayerInstanceId(multiplayerInstanceId);
|
||||
|
||||
app.SetGameMode( eMode_Multiplayer );
|
||||
}
|
||||
#else
|
||||
{
|
||||
connection = new ClientConnection(minecraft, NULL);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
INetworkPlayer *pNetworkPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(ProfileManager.GetLockedProfile());
|
||||
@@ -405,159 +384,155 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
connection = new ClientConnection(minecraft, socket);
|
||||
}
|
||||
|
||||
if (connection != NULL)
|
||||
if( !connection->createdOk )
|
||||
{
|
||||
if( !connection->createdOk )
|
||||
{
|
||||
assert(false);
|
||||
delete connection;
|
||||
connection = NULL;
|
||||
MinecraftServer::HaltServer();
|
||||
return false;
|
||||
}
|
||||
assert(false);
|
||||
delete connection;
|
||||
connection = NULL;
|
||||
MinecraftServer::HaltServer();
|
||||
return false;
|
||||
}
|
||||
|
||||
connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket(minecraft->user->name) ) );
|
||||
connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket(minecraft->user->name) ) );
|
||||
|
||||
// Tick connection until we're ready to go. The stages involved in this are:
|
||||
// (1) Creating the ClientConnection sends a prelogin packet to the server
|
||||
// (2) the server sends a prelogin back, which is handled by the clientConnection, and returns a login packet
|
||||
// (3) the server sends a login back, which is handled by the client connection to start the game
|
||||
if( !g_NetworkManager.IsHost() )
|
||||
// Tick connection until we're ready to go. The stages involved in this are:
|
||||
// (1) Creating the ClientConnection sends a prelogin packet to the server
|
||||
// (2) the server sends a prelogin back, which is handled by the clientConnection, and returns a login packet
|
||||
// (3) the server sends a login back, which is handled by the client connection to start the game
|
||||
if( !g_NetworkManager.IsHost() )
|
||||
{
|
||||
Minecraft::GetInstance()->progressRenderer->progressStart(IDS_PROGRESS_CONNECTING);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 4J Stu - Host needs to generate a unique multiplayer id for sentient telemetry reporting
|
||||
INT multiplayerInstanceId = TelemetryManager->GenerateMultiplayerInstanceId();
|
||||
TelemetryManager->SetMultiplayerInstanceId(multiplayerInstanceId);
|
||||
}
|
||||
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
|
||||
do
|
||||
{
|
||||
app.DebugPrintf("ticking connection A\n");
|
||||
connection->tick();
|
||||
|
||||
// 4J Stu - We were ticking this way too fast which could cause the connection to time out
|
||||
// The connections should tick at 20 per second
|
||||
Sleep(50);
|
||||
} while ( (IsInSession() && !connection->isStarted() && !connection->isClosed() && !g_NetworkManager.IsLeavingGame()) || tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkins()) );
|
||||
ui.CleanUpSkinsReload();
|
||||
|
||||
// 4J Stu - Fix for #11279 - CRASH: TCR 001: BAS Game Stability: Signing out of game will cause title to crash
|
||||
// We need to break out of the above loop if m_bLeavingGame is set, and close the connection
|
||||
if( g_NetworkManager.IsLeavingGame() || !IsInSession() )
|
||||
{
|
||||
connection->close();
|
||||
}
|
||||
|
||||
if( connection->isStarted() && !connection->isClosed() )
|
||||
{
|
||||
createdConnections.push_back( connection );
|
||||
|
||||
int primaryPad = ProfileManager.GetPrimaryPad();
|
||||
app.SetRichPresenceContext(primaryPad,CONTEXT_GAME_STATE_BLANK);
|
||||
if (GetPlayerCount() > 1) // Are we offline or online, and how many players are there
|
||||
{
|
||||
Minecraft::GetInstance()->progressRenderer->progressStart(IDS_PROGRESS_CONNECTING);
|
||||
if (IsLocalGame()) ProfileManager.SetCurrentGameActivity(primaryPad,CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,false);
|
||||
else ProfileManager.SetCurrentGameActivity(primaryPad,CONTEXT_PRESENCE_MULTIPLAYER,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 4J Stu - Host needs to generate a unique multiplayer id for sentient telemetry reporting
|
||||
INT multiplayerInstanceId = TelemetryManager->GenerateMultiplayerInstanceId();
|
||||
TelemetryManager->SetMultiplayerInstanceId(multiplayerInstanceId);
|
||||
}
|
||||
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
|
||||
do
|
||||
{
|
||||
app.DebugPrintf("ticking connection A\n");
|
||||
connection->tick();
|
||||
|
||||
// 4J Stu - We were ticking this way too fast which could cause the connection to time out
|
||||
// The connections should tick at 20 per second
|
||||
Sleep(50);
|
||||
} while ( (IsInSession() && !connection->isStarted() && !connection->isClosed() && !g_NetworkManager.IsLeavingGame()) || tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkins()) );
|
||||
ui.CleanUpSkinsReload();
|
||||
|
||||
// 4J Stu - Fix for #11279 - CRASH: TCR 001: BAS Game Stability: Signing out of game will cause title to crash
|
||||
// We need to break out of the above loop if m_bLeavingGame is set, and close the connection
|
||||
if( g_NetworkManager.IsLeavingGame() || !IsInSession() )
|
||||
{
|
||||
connection->close();
|
||||
if(IsLocalGame()) ProfileManager.SetCurrentGameActivity(primaryPad,CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,false);
|
||||
else ProfileManager.SetCurrentGameActivity(primaryPad,CONTEXT_PRESENCE_MULTIPLAYER_1P,false);
|
||||
}
|
||||
|
||||
if( connection->isStarted() && !connection->isClosed() )
|
||||
|
||||
// ALL OTHER LOCAL PLAYERS
|
||||
for(int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
// Already have setup the primary pad
|
||||
if(idx == ProfileManager.GetPrimaryPad() ) continue;
|
||||
|
||||
if( GetLocalPlayerByUserIndex(idx) != NULL && !ProfileManager.IsSignedIn(idx) )
|
||||
{
|
||||
INetworkPlayer *pNetworkPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(idx);
|
||||
Socket *socket = pNetworkPlayer->GetSocket();
|
||||
app.DebugPrintf("Closing socket due to player %d not being signed in any more\n");
|
||||
if( !socket->close(false) ) socket->close(true);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// By default when we host we only have the local player, but currently allow multiple local players to join
|
||||
// when joining any other way, so just because they are signed in doesn't mean they are in the session
|
||||
// 4J Stu - If they are in the session, then we should add them to the game. Otherwise we won't be able to add them later
|
||||
INetworkPlayer *pNetworkPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(idx);
|
||||
if( pNetworkPlayer == NULL )
|
||||
continue;
|
||||
|
||||
ClientConnection *connection;
|
||||
|
||||
Socket *socket = pNetworkPlayer->GetSocket();
|
||||
connection = new ClientConnection(minecraft, socket, idx);
|
||||
|
||||
minecraft->addPendingLocalConnection(idx, connection);
|
||||
//minecraft->createExtraLocalPlayer(idx, (convStringToWstring( ProfileManager.GetGamertag(idx) )).c_str(), idx, connection);
|
||||
|
||||
// Open the socket on the server end to accept incoming data
|
||||
Socket::addIncomingSocket(socket);
|
||||
|
||||
connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket(convStringToWstring( ProfileManager.GetGamertag(idx) )) ) );
|
||||
|
||||
createdConnections.push_back( connection );
|
||||
|
||||
int primaryPad = ProfileManager.GetPrimaryPad();
|
||||
app.SetRichPresenceContext(primaryPad,CONTEXT_GAME_STATE_BLANK);
|
||||
if (GetPlayerCount() > 1) // Are we offline or online, and how many players are there
|
||||
// Tick connection until we're ready to go. The stages involved in this are:
|
||||
// (1) Creating the ClientConnection sends a prelogin packet to the server
|
||||
// (2) the server sends a prelogin back, which is handled by the clientConnection, and returns a login packet
|
||||
// (3) the server sends a login back, which is handled by the client connection to start the game
|
||||
do
|
||||
{
|
||||
if (IsLocalGame()) ProfileManager.SetCurrentGameActivity(primaryPad,CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,false);
|
||||
else ProfileManager.SetCurrentGameActivity(primaryPad,CONTEXT_PRESENCE_MULTIPLAYER,false);
|
||||
// We need to keep ticking the connections for players that already logged in
|
||||
for(AUTO_VAR(it, createdConnections.begin()); it < createdConnections.end(); ++it)
|
||||
{
|
||||
(*it)->tick();
|
||||
}
|
||||
|
||||
// 4J Stu - We were ticking this way too fast which could cause the connection to time out
|
||||
// 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__
|
||||
} 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
|
||||
} while (IsInSession() && !connection->isStarted() && !connection->isClosed() && !g_NetworkManager.IsLeavingGame() );
|
||||
#endif
|
||||
|
||||
// 4J Stu - Fix for #11279 - CRASH: TCR 001: BAS Game Stability: Signing out of game will cause title to crash
|
||||
// We need to break out of the above loop if m_bLeavingGame is set, and stop creating new connections
|
||||
// The connections in the createdConnections vector get closed at the end of the thread
|
||||
if( g_NetworkManager.IsLeavingGame() || !IsInSession() ) break;
|
||||
|
||||
if( ProfileManager.IsSignedIn(idx) && !connection->isClosed() )
|
||||
{
|
||||
app.SetRichPresenceContext(idx,CONTEXT_GAME_STATE_BLANK);
|
||||
if (IsLocalGame()) ProfileManager.SetCurrentGameActivity(idx,CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,false);
|
||||
else ProfileManager.SetCurrentGameActivity(idx,CONTEXT_PRESENCE_MULTIPLAYER,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(IsLocalGame()) ProfileManager.SetCurrentGameActivity(primaryPad,CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,false);
|
||||
else ProfileManager.SetCurrentGameActivity(primaryPad,CONTEXT_PRESENCE_MULTIPLAYER_1P,false);
|
||||
connection->close();
|
||||
AUTO_VAR(it, find( createdConnections.begin(), createdConnections.end(), connection ));
|
||||
if(it != createdConnections.end() ) createdConnections.erase( it );
|
||||
}
|
||||
|
||||
|
||||
// ALL OTHER LOCAL PLAYERS
|
||||
for(int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
// Already have setup the primary pad
|
||||
if(idx == ProfileManager.GetPrimaryPad() ) continue;
|
||||
|
||||
if( GetLocalPlayerByUserIndex(idx) != NULL && !ProfileManager.IsSignedIn(idx) )
|
||||
{
|
||||
INetworkPlayer *pNetworkPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(idx);
|
||||
Socket *socket = pNetworkPlayer->GetSocket();
|
||||
app.DebugPrintf("Closing socket due to player %d not being signed in any more\n");
|
||||
if( !socket->close(false) ) socket->close(true);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// By default when we host we only have the local player, but currently allow multiple local players to join
|
||||
// when joining any other way, so just because they are signed in doesn't mean they are in the session
|
||||
// 4J Stu - If they are in the session, then we should add them to the game. Otherwise we won't be able to add them later
|
||||
INetworkPlayer *pNetworkPlayer = g_NetworkManager.GetLocalPlayerByUserIndex(idx);
|
||||
if( pNetworkPlayer == NULL )
|
||||
continue;
|
||||
|
||||
ClientConnection *connection;
|
||||
|
||||
Socket *socket = pNetworkPlayer->GetSocket();
|
||||
connection = new ClientConnection(minecraft, socket, idx);
|
||||
|
||||
minecraft->addPendingLocalConnection(idx, connection);
|
||||
//minecraft->createExtraLocalPlayer(idx, (convStringToWstring( ProfileManager.GetGamertag(idx) )).c_str(), idx, connection);
|
||||
|
||||
// Open the socket on the server end to accept incoming data
|
||||
Socket::addIncomingSocket(socket);
|
||||
|
||||
connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket(convStringToWstring( ProfileManager.GetGamertag(idx) )) ) );
|
||||
|
||||
createdConnections.push_back( connection );
|
||||
|
||||
// Tick connection until we're ready to go. The stages involved in this are:
|
||||
// (1) Creating the ClientConnection sends a prelogin packet to the server
|
||||
// (2) the server sends a prelogin back, which is handled by the clientConnection, and returns a login packet
|
||||
// (3) the server sends a login back, which is handled by the client connection to start the game
|
||||
do
|
||||
{
|
||||
// We need to keep ticking the connections for players that already logged in
|
||||
for(AUTO_VAR(it, createdConnections.begin()); it < createdConnections.end(); ++it)
|
||||
{
|
||||
(*it)->tick();
|
||||
}
|
||||
|
||||
// 4J Stu - We were ticking this way too fast which could cause the connection to time out
|
||||
// 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 || 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
|
||||
} while (IsInSession() && !connection->isStarted() && !connection->isClosed() && !g_NetworkManager.IsLeavingGame() );
|
||||
#endif
|
||||
|
||||
// 4J Stu - Fix for #11279 - CRASH: TCR 001: BAS Game Stability: Signing out of game will cause title to crash
|
||||
// We need to break out of the above loop if m_bLeavingGame is set, and stop creating new connections
|
||||
// The connections in the createdConnections vector get closed at the end of the thread
|
||||
if( g_NetworkManager.IsLeavingGame() || !IsInSession() ) break;
|
||||
|
||||
if( ProfileManager.IsSignedIn(idx) && !connection->isClosed() )
|
||||
{
|
||||
app.SetRichPresenceContext(idx,CONTEXT_GAME_STATE_BLANK);
|
||||
if (IsLocalGame()) ProfileManager.SetCurrentGameActivity(idx,CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,false);
|
||||
else ProfileManager.SetCurrentGameActivity(idx,CONTEXT_PRESENCE_MULTIPLAYER,false);
|
||||
}
|
||||
else
|
||||
{
|
||||
connection->close();
|
||||
AUTO_VAR(it, find( createdConnections.begin(), createdConnections.end(), connection ));
|
||||
if(it != createdConnections.end() ) createdConnections.erase( it );
|
||||
}
|
||||
}
|
||||
|
||||
app.SetGameMode( eMode_Multiplayer );
|
||||
}
|
||||
else if ( connection->isClosed() || !IsInSession())
|
||||
{
|
||||
// assert(false);
|
||||
|
||||
MinecraftServer::HaltServer();
|
||||
return false;
|
||||
}
|
||||
app.SetGameMode( eMode_Multiplayer );
|
||||
}
|
||||
else if ( connection->isClosed() || !IsInSession())
|
||||
{
|
||||
// assert(false);
|
||||
MinecraftServer::HaltServer();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -567,7 +542,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
{
|
||||
(*it)->close();
|
||||
}
|
||||
//assert(false);
|
||||
// assert(false);
|
||||
MinecraftServer::HaltServer();
|
||||
return false;
|
||||
}
|
||||
@@ -804,11 +779,7 @@ 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;
|
||||
@@ -820,16 +791,14 @@ 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(DISABLE_PSN) && (defined(__PS3__) || defined(__PSVITA__))
|
||||
#if defined(__PS3__) || defined(__PSVITA__)
|
||||
ProfileManager.GetChatAndContentRestrictions(iPad,false,&noUGC,NULL,NULL);
|
||||
#elif defined(__ORBIS__)
|
||||
ProfileManager.GetChatAndContentRestrictions(iPad,false,NULL,&noUGC,NULL);
|
||||
@@ -918,12 +887,6 @@ 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();
|
||||
@@ -931,6 +894,7 @@ 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)
|
||||
@@ -938,7 +902,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
|
||||
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
|
||||
while ( tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkins()) )
|
||||
{
|
||||
Sleep(0);
|
||||
Sleep(1);
|
||||
}
|
||||
ui.CleanUpSkinsReload();
|
||||
if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None)
|
||||
@@ -975,7 +939,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter )
|
||||
{
|
||||
while((Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkins()))
|
||||
{
|
||||
Sleep(0);
|
||||
Sleep(1);
|
||||
}
|
||||
param->levelGen->loadBaseSaveData();
|
||||
}
|
||||
@@ -1017,7 +981,7 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc( void* lpParam )
|
||||
|
||||
while( g_NetworkManager.IsInSession() )
|
||||
{
|
||||
Sleep(0);
|
||||
Sleep(1);
|
||||
}
|
||||
|
||||
// Xbox should always be online when receiving invites - on PS3 we need to check & ask the user to sign in
|
||||
@@ -1047,9 +1011,6 @@ 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__
|
||||
@@ -1068,14 +1029,10 @@ 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
|
||||
@@ -1108,16 +1065,12 @@ 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__
|
||||
@@ -1129,14 +1082,10 @@ 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
|
||||
@@ -1164,7 +1113,6 @@ int CGameNetworkManager::PSNSignInReturned_1(void* pParam, bool bContinue, int i
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1225,11 +1173,11 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
pMinecraft->progressRenderer->progressStage( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME );
|
||||
#endif
|
||||
|
||||
while( app.GetXuiServerAction(ProfileManager.GetPrimaryPad() ) != eXuiServerAction_Idle && !MinecraftServer::serverHalted() )
|
||||
while( app.GetUIServerAction(ProfileManager.GetPrimaryPad() ) != eUIServerAction_Idle && !MinecraftServer::serverHalted() )
|
||||
{
|
||||
Sleep(10);
|
||||
}
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)TRUE);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)TRUE);
|
||||
|
||||
// wait for the server to be in a non-ticking state
|
||||
pServer->m_serverPausedEvent->WaitForSignal(INFINITE);
|
||||
@@ -1293,7 +1241,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
// wait for the current session to end
|
||||
while( g_NetworkManager.IsInSession() )
|
||||
{
|
||||
Sleep(0);
|
||||
Sleep(1);
|
||||
}
|
||||
|
||||
// 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
|
||||
@@ -1385,7 +1333,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
|
||||
// Start the game again
|
||||
app.SetGameStarted(true);
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE);
|
||||
app.SetChangingSessionType(false);
|
||||
app.SetReallyChangingSessionType(false);
|
||||
|
||||
@@ -1502,7 +1450,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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1535,10 +1483,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
Socket *socket = NULL;
|
||||
shared_ptr<MultiplayerLocalPlayer> mpPlayer = nullptr;
|
||||
int userIdx = pNetworkPlayer->GetUserIndex();
|
||||
if (userIdx >= 0 && userIdx < XUSER_MAX_COUNT)
|
||||
mpPlayer = pMinecraft->localplayers[userIdx];
|
||||
shared_ptr<MultiplayerLocalPlayer> mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()];
|
||||
if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL)
|
||||
{
|
||||
// If we already have a MultiplayerLocalPlayer here then we are doing a session type change
|
||||
@@ -1698,7 +1643,6 @@ 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
|
||||
@@ -1706,9 +1650,6 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
}
|
||||
|
||||
isSignedInLive = isSignedInLive && ProfileManager.IsSignedInLive(i);
|
||||
#else
|
||||
isSignedInLive = true;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1780,9 +1721,7 @@ 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 );
|
||||
}
|
||||
}
|
||||
@@ -1854,7 +1793,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
#endif
|
||||
if( !g_NetworkManager.IsInSession() )
|
||||
{
|
||||
#if !defined(DISABLE_PSN) && (defined (__PS3__) || defined (__PSVITA__))
|
||||
#if 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"
|
||||
@@ -1886,7 +1825,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
||||
// joinData->pInviteInfo = pInviteInfo;
|
||||
|
||||
// tell the app to process this
|
||||
#if !defined(DISABLE_PSN) && defined(__PSVITA__)
|
||||
#ifdef __PSVITA__
|
||||
if(((CPlatformNetworkManagerSony*)s_pPlatformNetworkManager)->checkValidInviteData(pInviteInfo))
|
||||
#endif
|
||||
{
|
||||
@@ -1937,7 +1876,6 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
||||
if(!app.IsLocalMultiplayerAvailable())
|
||||
#endif
|
||||
{
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
bool noPrivileges=!ProfileManager.AllowedToPlayMultiplayer(userIndex);
|
||||
|
||||
if(noPrivileges)
|
||||
@@ -1948,7 +1886,6 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
ProfileManager.SetLockedProfile(userIndex);
|
||||
ProfileManager.SetPrimaryPad(userIndex);
|
||||
|
||||
@@ -1971,9 +1908,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
||||
{
|
||||
app.DebugPrintf( "Failed joining game from invite\n" );
|
||||
}
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2008,7 +1943,7 @@ void CGameNetworkManager::HandleDisconnect(bool bLostRoomOnly)
|
||||
if((g_NetworkManager.GetLockedProfile()!=-1) && iPrimaryPlayer!=-1 && g_NetworkManager.IsInSession() )
|
||||
{
|
||||
m_bLastDisconnectWasLostRoomOnly = bLostRoomOnly;
|
||||
#if !defined(DISABLE_PSN) && (defined __PS3__ || defined __PSVITA__ || defined __ORBIS__)
|
||||
#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__
|
||||
m_bSignedOutofPSN=bPSNSignout;
|
||||
#endif
|
||||
app.SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected);
|
||||
@@ -2133,12 +2068,7 @@ void CGameNetworkManager::FakeLocalPlayerJoined()
|
||||
}
|
||||
#endif
|
||||
|
||||
void CGameNetworkManager::AddServer(const wchar_t *ip, int port, const wchar_t *name)
|
||||
{
|
||||
((CPlatformNetworkManagerStub *)s_pPlatformNetworkManager)->AddServer(ip, port, name);
|
||||
}
|
||||
|
||||
#if !defined(DISABLE_PSN) && defined(__PSVITA__)
|
||||
#ifdef __PSVITA__
|
||||
bool CGameNetworkManager::usingAdhocMode()
|
||||
{
|
||||
return ((CPlatformNetworkManagerSony*)s_pPlatformNetworkManager)->usingAdhocMode();
|
||||
@@ -2153,17 +2083,5 @@ 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,19 +1,17 @@
|
||||
#pragma once
|
||||
using namespace std;
|
||||
#include <vector>
|
||||
#ifndef _DISABLE_XBLIVE
|
||||
#include <qnet.h>
|
||||
#endif
|
||||
#include "..\..\..\Minecraft.World\C4JThread.h"
|
||||
#include "NetworkPlayerInterface.h"
|
||||
#if defined _XBOX && !defined _DISABLE_XBLIVE
|
||||
#ifdef _XBOX
|
||||
#include "..\..\Xbox\Network\PlatformNetworkManagerXbox.h"
|
||||
#elif !defined DISABLE_PSN && (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
||||
#elif defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
#include "..\..\Common\Network\Sony\PlatformNetworkManagerSony.h"
|
||||
#elif defined _DURANGO
|
||||
#include "..\..\Durango\Network\PlatformNetworkManagerDurango.h"
|
||||
#else
|
||||
#include "PlatformNetworkManager.h"
|
||||
#include "PlatformNetworkManagerStub.h"
|
||||
#endif
|
||||
#include "SessionInfo.h"
|
||||
|
||||
@@ -32,9 +30,9 @@ const int NON_QNET_SENDDATA_ACK_REQUIRED = 1;
|
||||
|
||||
class CGameNetworkManager
|
||||
{
|
||||
#if defined _XBOX && !defined _DISABLE_XBLIVE
|
||||
#ifdef _XBOX
|
||||
friend class CPlatformNetworkManagerXbox;
|
||||
#elif !defined DISABLE_PSN && (defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
|
||||
#elif defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
friend class CPlatformNetworkManagerSony;
|
||||
#elif defined _DURANGO
|
||||
friend class CPlatformNetworkManagerDurango;
|
||||
@@ -229,7 +227,6 @@ public:
|
||||
#ifndef _XBOX
|
||||
void FakeLocalPlayerJoined(); // Temporary method whilst we don't have real networking to make this happen
|
||||
#endif
|
||||
static void AddServer(const wchar_t *ip, int port, const wchar_t *name);
|
||||
};
|
||||
|
||||
extern CGameNetworkManager g_NetworkManager;
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
|
||||
#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;
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,248 +0,0 @@
|
||||
#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 "SocketManagers\NetworkSocketManager.h"
|
||||
|
||||
#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_SMALLID_REJECT 0xFF
|
||||
#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 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 NetworkSocketManager *s_pPlatformSocketManager;
|
||||
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_freeSmallIdLock;
|
||||
static std::vector<BYTE> s_freeSmallIds;
|
||||
};
|
||||
|
||||
extern bool g_MultiplayerHost;
|
||||
extern bool g_MultiplayerJoin;
|
||||
extern int g_MultiplayerPort;
|
||||
extern char g_MultiplayerIP[256];
|
||||
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
extern int g_DedicatedServerPort;
|
||||
extern char g_DedicatedServerBindIP[256];
|
||||
extern bool g_DedicatedServerLanAdvertise;
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,7 @@
|
||||
#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"
|
||||
@@ -88,7 +84,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;
|
||||
|
||||
@@ -0,0 +1,646 @@
|
||||
#include "stdafx.h"
|
||||
#include "..\..\..\Minecraft.World\Socket.h"
|
||||
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
||||
#include "PlatformNetworkManagerStub.h"
|
||||
#include "..\..\Xbox\Network\NetworkPlayerXbox.h" // TODO - stub version of this?
|
||||
|
||||
CPlatformNetworkManagerStub *g_pPlatformNetworkManager;
|
||||
|
||||
|
||||
void CPlatformNetworkManagerStub::NotifyPlayerJoined(IQNetPlayer *pQNetPlayer )
|
||||
{
|
||||
const char * pszDescription;
|
||||
|
||||
// 4J Stu - We create a fake socket for every where that we need an INBOUND queue of game data. Outbound
|
||||
// is all handled by QNet so we don't need that. Therefore each client player has one, and the host has one
|
||||
// for each client player.
|
||||
bool createFakeSocket = false;
|
||||
bool localPlayer = false;
|
||||
|
||||
NetworkPlayerXbox *networkPlayer = (NetworkPlayerXbox *)addNetworkPlayer(pQNetPlayer);
|
||||
|
||||
if( pQNetPlayer->IsLocal() )
|
||||
{
|
||||
localPlayer = true;
|
||||
if( pQNetPlayer->IsHost() )
|
||||
{
|
||||
pszDescription = "local host";
|
||||
// 4J Stu - No socket for the localhost as it uses a special loopback queue
|
||||
|
||||
m_machineQNetPrimaryPlayers.push_back( pQNetPlayer );
|
||||
}
|
||||
else
|
||||
{
|
||||
pszDescription = "local";
|
||||
|
||||
// We need an inbound queue on all local players to receive data from the host
|
||||
createFakeSocket = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( pQNetPlayer->IsHost() )
|
||||
{
|
||||
pszDescription = "remote host";
|
||||
}
|
||||
else
|
||||
{
|
||||
pszDescription = "remote";
|
||||
|
||||
// If we are the host, then create a fake socket for every remote player
|
||||
if( m_pIQNet->IsHost() )
|
||||
{
|
||||
createFakeSocket = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( m_pIQNet->IsHost() && !m_bHostChanged )
|
||||
{
|
||||
// Do we already have a primary player for this system?
|
||||
bool systemHasPrimaryPlayer = false;
|
||||
for(AUTO_VAR(it, m_machineQNetPrimaryPlayers.begin()); it < m_machineQNetPrimaryPlayers.end(); ++it)
|
||||
{
|
||||
IQNetPlayer *pQNetPrimaryPlayer = *it;
|
||||
if( pQNetPlayer->IsSameSystem(pQNetPrimaryPlayer) )
|
||||
{
|
||||
systemHasPrimaryPlayer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( !systemHasPrimaryPlayer )
|
||||
m_machineQNetPrimaryPlayers.push_back( pQNetPlayer );
|
||||
}
|
||||
}
|
||||
g_NetworkManager.PlayerJoining( networkPlayer );
|
||||
|
||||
if( createFakeSocket == true && !m_bHostChanged )
|
||||
{
|
||||
g_NetworkManager.CreateSocket( networkPlayer, localPlayer );
|
||||
}
|
||||
|
||||
app.DebugPrintf( "Player 0x%p \"%ls\" joined; %s; voice %i; camera %i.\n",
|
||||
pQNetPlayer,
|
||||
pQNetPlayer->GetGamertag(),
|
||||
pszDescription,
|
||||
(int) pQNetPlayer->HasVoice(),
|
||||
(int) pQNetPlayer->HasCamera() );
|
||||
|
||||
|
||||
if( m_pIQNet->IsHost() )
|
||||
{
|
||||
// 4J-PB - only the host should do this
|
||||
// g_NetworkManager.UpdateAndSetGameSessionData();
|
||||
SystemFlagAddPlayer( networkPlayer );
|
||||
}
|
||||
|
||||
for( int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
if(playerChangedCallback[idx] != NULL)
|
||||
playerChangedCallback[idx]( playerChangedCallbackParam[idx], networkPlayer, false );
|
||||
}
|
||||
|
||||
if(m_pIQNet->GetState() == QNET_STATE_GAME_PLAY)
|
||||
{
|
||||
int localPlayerCount = 0;
|
||||
for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
{
|
||||
if( m_pIQNet->GetLocalPlayerByUserIndex(idx) != NULL ) ++localPlayerCount;
|
||||
}
|
||||
|
||||
float appTime = app.getAppTime();
|
||||
|
||||
// Only record stats for the primary player here
|
||||
m_lastPlayerEventTimeStart = appTime;
|
||||
}
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::Initialise(CGameNetworkManager *pGameNetworkManager, int flagIndexSize)
|
||||
{
|
||||
m_pGameNetworkManager = pGameNetworkManager;
|
||||
m_flagIndexSize = flagIndexSize;
|
||||
g_pPlatformNetworkManager = this;
|
||||
for( int i = 0; i < XUSER_MAX_COUNT; i++ )
|
||||
{
|
||||
playerChangedCallback[ i ] = NULL;
|
||||
}
|
||||
|
||||
m_bLeavingGame = false;
|
||||
m_bLeaveGameOnTick = false;
|
||||
m_bHostChanged = false;
|
||||
|
||||
m_bSearchResultsReady = false;
|
||||
m_bSearchPending = false;
|
||||
|
||||
m_bIsOfflineGame = false;
|
||||
m_pSearchParam = NULL;
|
||||
m_SessionsUpdatedCallback = NULL;
|
||||
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
|
||||
{
|
||||
m_searchResultsCount[i] = 0;
|
||||
m_lastSearchStartTime[i] = 0;
|
||||
|
||||
// The results that will be filled in with the current search
|
||||
m_pSearchResults[i] = NULL;
|
||||
m_pQoSResult[i] = NULL;
|
||||
m_pCurrentSearchResults[i] = NULL;
|
||||
m_pCurrentQoSResult[i] = NULL;
|
||||
m_currentSearchResultsCount[i] = 0;
|
||||
}
|
||||
|
||||
// Success!
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::Terminate()
|
||||
{
|
||||
}
|
||||
|
||||
int CPlatformNetworkManagerStub::GetJoiningReadyPercentage()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
int CPlatformNetworkManagerStub::CorrectErrorIDS(int IDS)
|
||||
{
|
||||
return IDS;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::isSystemPrimaryPlayer(IQNetPlayer *pQNetPlayer)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// We call this twice a frame, either side of the render call so is a good place to "tick" things
|
||||
void CPlatformNetworkManagerStub::DoWork()
|
||||
{
|
||||
}
|
||||
|
||||
int CPlatformNetworkManagerStub::GetPlayerCount()
|
||||
{
|
||||
return m_pIQNet->GetPlayerCount();
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::ShouldMessageForFullSession()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int CPlatformNetworkManagerStub::GetOnlinePlayerCount()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int CPlatformNetworkManagerStub::GetLocalPlayerMask(int playerIndex)
|
||||
{
|
||||
return 1 << playerIndex;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::AddLocalPlayerByUserIndex( int userIndex )
|
||||
{
|
||||
NotifyPlayerJoined(m_pIQNet->GetLocalPlayerByUserIndex(userIndex));
|
||||
return ( m_pIQNet->AddLocalPlayerByUserIndex(userIndex) == S_OK );
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::RemoveLocalPlayerByUserIndex( int userIndex )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::IsInStatsEnabledSession()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::SessionHasSpace(unsigned int spaceRequired /*= 1*/)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SendInviteGUI(int quadrant)
|
||||
{
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::IsAddingPlayer()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::LeaveGame(bool bMigrateHost)
|
||||
{
|
||||
if( m_bLeavingGame ) return true;
|
||||
|
||||
m_bLeavingGame = true;
|
||||
|
||||
// If we are the host wait for the game server to end
|
||||
if(m_pIQNet->IsHost() && g_NetworkManager.ServerStoppedValid())
|
||||
{
|
||||
m_pIQNet->EndGame();
|
||||
g_NetworkManager.ServerStoppedWait();
|
||||
g_NetworkManager.ServerStoppedDestroy();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::_LeaveGame(bool bMigrateHost, bool bLeaveRoom)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::HostGame(int localUsersMask, bool bOnlineGame, bool bIsPrivate, unsigned char publicSlots /*= MINECRAFT_NET_MAX_PLAYERS*/, unsigned char privateSlots /*= 0*/)
|
||||
{
|
||||
// #ifdef _XBOX
|
||||
// 4J Stu - We probably did this earlier as well, but just to be sure!
|
||||
SetLocalGame( !bOnlineGame );
|
||||
SetPrivateGame( bIsPrivate );
|
||||
SystemFlagReset();
|
||||
|
||||
// Make sure that the Primary Pad is in by default
|
||||
localUsersMask |= GetLocalPlayerMask( g_NetworkManager.GetPrimaryPad() );
|
||||
|
||||
m_bLeavingGame = false;
|
||||
|
||||
m_pIQNet->HostGame();
|
||||
|
||||
_HostGame( localUsersMask, publicSlots, privateSlots );
|
||||
//#endif
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::_HostGame(int usersMask, unsigned char publicSlots /*= MINECRAFT_NET_MAX_PLAYERS*/, unsigned char privateSlots /*= 0*/)
|
||||
{
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::_StartGame()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int CPlatformNetworkManagerStub::JoinGame(FriendSessionInfo *searchResult, int localUsersMask, int primaryUserIndex)
|
||||
{
|
||||
return CGameNetworkManager::JOINGAME_SUCCESS;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::SetLocalGame(bool isLocal)
|
||||
{
|
||||
m_bIsOfflineGame = isLocal;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SetPrivateGame(bool isPrivate)
|
||||
{
|
||||
app.DebugPrintf("Setting as private game: %s\n", isPrivate ? "yes" : "no" );
|
||||
m_bIsPrivateGame = isPrivate;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::RegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam)
|
||||
{
|
||||
playerChangedCallback[iPad] = callback;
|
||||
playerChangedCallbackParam[iPad] = callbackParam;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::UnRegisterPlayerChangedCallback(int iPad, void (*callback)(void *callbackParam, INetworkPlayer *pPlayer, bool leaving), void *callbackParam)
|
||||
{
|
||||
if(playerChangedCallbackParam[iPad] == callbackParam)
|
||||
{
|
||||
playerChangedCallback[iPad] = NULL;
|
||||
playerChangedCallbackParam[iPad] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::HandleSignInChange()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::_RunNetworkGame()
|
||||
{
|
||||
return 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);
|
||||
}
|
||||
|
||||
int CPlatformNetworkManagerStub::RemovePlayerOnSocketClosedThreadProc( void* lpParam )
|
||||
{
|
||||
INetworkPlayer *pNetworkPlayer = (INetworkPlayer *)lpParam;
|
||||
|
||||
Socket *socket = pNetworkPlayer->GetSocket();
|
||||
|
||||
if( socket != NULL )
|
||||
{
|
||||
//printf("Waiting for socket closed event\n");
|
||||
socket->m_socketClosedEvent->WaitForSignal(INFINITE);
|
||||
|
||||
//printf("Socket closed event has fired\n");
|
||||
// 4J Stu - Clear our reference to this socket
|
||||
pNetworkPlayer->SetSocket( NULL );
|
||||
delete socket;
|
||||
}
|
||||
|
||||
return g_pPlatformNetworkManager->RemoveLocalPlayer( pNetworkPlayer );
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::RemoveLocalPlayer( INetworkPlayer *pNetworkPlayer )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CPlatformNetworkManagerStub::PlayerFlags::PlayerFlags(INetworkPlayer *pNetworkPlayer, unsigned int count)
|
||||
{
|
||||
// 4J Stu - Don't assert, just make it a multiple of 8! This count is calculated from a load of separate values,
|
||||
// and makes tweaking world/render sizes a pain if we hit an assert here
|
||||
count = (count + 8 - 1) & ~(8 - 1);
|
||||
//assert( ( count % 8 ) == 0 );
|
||||
this->m_pNetworkPlayer = pNetworkPlayer;
|
||||
this->flags = new unsigned char [ count / 8 ];
|
||||
memset( this->flags, 0, count / 8 );
|
||||
this->count = count;
|
||||
}
|
||||
CPlatformNetworkManagerStub::PlayerFlags::~PlayerFlags()
|
||||
{
|
||||
delete [] flags;
|
||||
}
|
||||
|
||||
// Add a player to the per system flag storage - if we've already got a player from that system, copy its flags over
|
||||
void CPlatformNetworkManagerStub::SystemFlagAddPlayer(INetworkPlayer *pNetworkPlayer)
|
||||
{
|
||||
PlayerFlags *newPlayerFlags = new PlayerFlags( pNetworkPlayer, m_flagIndexSize);
|
||||
// If any of our existing players are on the same system, then copy over flags from that one
|
||||
for( unsigned int i = 0; i < m_playerFlags.size(); i++ )
|
||||
{
|
||||
if( pNetworkPlayer->IsSameSystem(m_playerFlags[i]->m_pNetworkPlayer) )
|
||||
{
|
||||
memcpy( newPlayerFlags->flags, m_playerFlags[i]->flags, m_playerFlags[i]->count / 8 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_playerFlags.push_back(newPlayerFlags);
|
||||
}
|
||||
|
||||
// Remove a player from the per system flag storage - just maintains the m_playerFlags vector without any gaps in it
|
||||
void CPlatformNetworkManagerStub::SystemFlagRemovePlayer(INetworkPlayer *pNetworkPlayer)
|
||||
{
|
||||
for( unsigned int i = 0; i < m_playerFlags.size(); i++ )
|
||||
{
|
||||
if( m_playerFlags[i]->m_pNetworkPlayer == pNetworkPlayer )
|
||||
{
|
||||
delete m_playerFlags[i];
|
||||
m_playerFlags[i] = m_playerFlags.back();
|
||||
m_playerFlags.pop_back();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SystemFlagReset()
|
||||
{
|
||||
for( unsigned int i = 0; i < m_playerFlags.size(); i++ )
|
||||
{
|
||||
delete m_playerFlags[i];
|
||||
}
|
||||
m_playerFlags.clear();
|
||||
}
|
||||
|
||||
// Set a per system flag - this is done by setting the flag on every player that shares that system
|
||||
void CPlatformNetworkManagerStub::SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index)
|
||||
{
|
||||
if( ( index < 0 ) || ( index >= m_flagIndexSize ) ) return;
|
||||
if( pNetworkPlayer == NULL ) return;
|
||||
|
||||
for( unsigned int i = 0; i < m_playerFlags.size(); i++ )
|
||||
{
|
||||
if( pNetworkPlayer->IsSameSystem(m_playerFlags[i]->m_pNetworkPlayer) )
|
||||
{
|
||||
m_playerFlags[i]->flags[ index / 8 ] |= ( 128 >> ( index % 8 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get value of a per system flag - can be read from the flags of the passed in player as anything else sent to that
|
||||
// system should also have been duplicated here
|
||||
bool CPlatformNetworkManagerStub::SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index)
|
||||
{
|
||||
if( ( index < 0 ) || ( index >= m_flagIndexSize ) ) return false;
|
||||
if( pNetworkPlayer == NULL )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for( unsigned int i = 0; i < m_playerFlags.size(); i++ )
|
||||
{
|
||||
if( m_playerFlags[i]->m_pNetworkPlayer == pNetworkPlayer )
|
||||
{
|
||||
return ( ( m_playerFlags[i]->flags[ index / 8 ] & ( 128 >> ( index % 8 ) ) ) != 0 );
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
wstring CPlatformNetworkManagerStub::GatherStats()
|
||||
{
|
||||
return L"";
|
||||
}
|
||||
|
||||
wstring CPlatformNetworkManagerStub::GatherRTTStats()
|
||||
{
|
||||
wstring stats(L"Rtt: ");
|
||||
|
||||
wchar_t stat[32];
|
||||
|
||||
for(unsigned int i = 0; i < GetPlayerCount(); ++i)
|
||||
{
|
||||
IQNetPlayer *pQNetPlayer = ((NetworkPlayerXbox *)GetPlayerByIndex( i ))->GetQNetPlayer();
|
||||
|
||||
if(!pQNetPlayer->IsLocal())
|
||||
{
|
||||
ZeroMemory(stat,32*sizeof(WCHAR));
|
||||
swprintf(stat, 32, L"%d: %d/", i, pQNetPlayer->GetCurrentRtt() );
|
||||
stats.append(stat);
|
||||
}
|
||||
}
|
||||
return stats;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::TickSearch()
|
||||
{
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SearchForGames()
|
||||
{
|
||||
}
|
||||
|
||||
int CPlatformNetworkManagerStub::SearchForGamesThreadProc( void* lpParameter )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SetSearchResultsReady(int resultCount)
|
||||
{
|
||||
m_bSearchResultsReady = true;
|
||||
m_searchResultsCount[m_lastSearchPad] = resultCount;
|
||||
}
|
||||
|
||||
vector<FriendSessionInfo *> *CPlatformNetworkManagerStub::GetSessionList(int iPad, int localPlayers, bool partyOnly)
|
||||
{
|
||||
vector<FriendSessionInfo *> *filteredList = new vector<FriendSessionInfo *>();;
|
||||
return filteredList;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::GetGameSessionInfo(int iPad, SessionID sessionId, FriendSessionInfo *foundSessionInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam )
|
||||
{
|
||||
m_SessionsUpdatedCallback = SessionsUpdatedCallback; m_pSearchParam = pSearchParam;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam )
|
||||
{
|
||||
FriendSessionUpdatedFn(true, pParam);
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::ForceFriendsSessionRefresh()
|
||||
{
|
||||
app.DebugPrintf("Resetting friends session search data\n");
|
||||
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
|
||||
{
|
||||
m_searchResultsCount[i] = 0;
|
||||
m_lastSearchStartTime[i] = 0;
|
||||
delete m_pSearchResults[i];
|
||||
m_pSearchResults[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
INetworkPlayer *CPlatformNetworkManagerStub::addNetworkPlayer(IQNetPlayer *pQNetPlayer)
|
||||
{
|
||||
NetworkPlayerXbox *pNetworkPlayer = new NetworkPlayerXbox(pQNetPlayer);
|
||||
pQNetPlayer->SetCustomDataValue((ULONG_PTR)pNetworkPlayer);
|
||||
currentNetworkPlayers.push_back( pNetworkPlayer );
|
||||
return pNetworkPlayer;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::removeNetworkPlayer(IQNetPlayer *pQNetPlayer)
|
||||
{
|
||||
INetworkPlayer *pNetworkPlayer = getNetworkPlayer(pQNetPlayer);
|
||||
for( AUTO_VAR(it, currentNetworkPlayers.begin()); it != currentNetworkPlayers.end(); it++ )
|
||||
{
|
||||
if( *it == pNetworkPlayer )
|
||||
{
|
||||
currentNetworkPlayers.erase(it);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INetworkPlayer *CPlatformNetworkManagerStub::getNetworkPlayer(IQNetPlayer *pQNetPlayer)
|
||||
{
|
||||
return pQNetPlayer ? (INetworkPlayer *)(pQNetPlayer->GetCustomDataValue()) : NULL;
|
||||
}
|
||||
|
||||
|
||||
INetworkPlayer *CPlatformNetworkManagerStub::GetLocalPlayerByUserIndex(int userIndex )
|
||||
{
|
||||
return getNetworkPlayer(m_pIQNet->GetLocalPlayerByUserIndex(userIndex));
|
||||
}
|
||||
|
||||
INetworkPlayer *CPlatformNetworkManagerStub::GetPlayerByIndex(int playerIndex)
|
||||
{
|
||||
return getNetworkPlayer(m_pIQNet->GetPlayerByIndex(playerIndex));
|
||||
}
|
||||
|
||||
INetworkPlayer * CPlatformNetworkManagerStub::GetPlayerByXuid(PlayerUID xuid)
|
||||
{
|
||||
return getNetworkPlayer( m_pIQNet->GetPlayerByXuid(xuid)) ;
|
||||
}
|
||||
|
||||
INetworkPlayer * CPlatformNetworkManagerStub::GetPlayerBySmallId(unsigned char smallId)
|
||||
{
|
||||
return getNetworkPlayer(m_pIQNet->GetPlayerBySmallId(smallId));
|
||||
}
|
||||
|
||||
INetworkPlayer *CPlatformNetworkManagerStub::GetHostPlayer()
|
||||
{
|
||||
return getNetworkPlayer(m_pIQNet->GetHostPlayer());
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::IsHost()
|
||||
{
|
||||
return m_pIQNet->IsHost() && !m_bHostChanged;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo)
|
||||
{
|
||||
return ( m_pIQNet->JoinGameFromInviteInfo( userIndex, userMask, pInviteInfo ) == S_OK);
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SetSessionTexturePackParentId( int id )
|
||||
{
|
||||
m_hostGameSessionData.texturePackParentId = id;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::SetSessionSubTexturePackId( int id )
|
||||
{
|
||||
m_hostGameSessionData.subTexturePackId = id;
|
||||
}
|
||||
|
||||
void CPlatformNetworkManagerStub::Notify(int ID, ULONG_PTR Param)
|
||||
{
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::IsInSession()
|
||||
{
|
||||
return m_pIQNet->GetState() != QNET_STATE_IDLE;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::IsInGameplay()
|
||||
{
|
||||
return m_pIQNet->GetState() == QNET_STATE_GAME_PLAY;
|
||||
}
|
||||
|
||||
bool CPlatformNetworkManagerStub::IsReadyToPlayOrIdle()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
+2
-8
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
using namespace std;
|
||||
#include <vector>
|
||||
#include "..\..\..\Minecraft.World\C4JThread.h"
|
||||
@@ -54,7 +54,6 @@ public:
|
||||
|
||||
virtual void HandleSignInChange();
|
||||
|
||||
virtual void SetGamePlayState();
|
||||
virtual bool _RunNetworkGame();
|
||||
|
||||
private:
|
||||
@@ -99,14 +98,12 @@ private:
|
||||
INetworkPlayer *m_pNetworkPlayer;
|
||||
unsigned char *flags;
|
||||
unsigned int count;
|
||||
int m_smallId;
|
||||
PlayerFlags(INetworkPlayer *pNetworkPlayer, unsigned int count);
|
||||
~PlayerFlags();
|
||||
};
|
||||
vector<PlayerFlags *> m_playerFlags;
|
||||
void SystemFlagAddPlayer(INetworkPlayer *pNetworkPlayer);
|
||||
void SystemFlagRemovePlayer(INetworkPlayer *pNetworkPlayer);
|
||||
void SystemFlagRemoveBySmallId(int smallId);
|
||||
void SystemFlagReset();
|
||||
public:
|
||||
virtual void SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index);
|
||||
@@ -164,11 +161,8 @@ public:
|
||||
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
||||
virtual void ForceFriendsSessionRefresh();
|
||||
|
||||
public:
|
||||
private:
|
||||
void NotifyPlayerJoined( IQNetPlayer *pQNetPlayer );
|
||||
void NotifyPlayerLeaving( IQNetPlayer *pQNetPlayer );
|
||||
|
||||
void AddServer(const wchar_t *ip, int port, const wchar_t *name);
|
||||
|
||||
#ifndef _XBOX
|
||||
void FakeLocalPlayerJoined() { NotifyPlayerJoined(m_pIQNet->GetLocalPlayerByUserIndex(0)); }
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__))
|
||||
#if 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.
|
||||
#if defined _XBOX && !defined _DISABLE_XBLIVE
|
||||
#ifdef _XBOX
|
||||
typedef struct _GameSessionData
|
||||
{
|
||||
unsigned short netVersion; // 2 bytes
|
||||
@@ -32,7 +32,7 @@ typedef struct _GameSessionData
|
||||
subTexturePackId = 0;
|
||||
}
|
||||
} GameSessionData;
|
||||
#elif !defined DISABLE_PSN && (defined __PS3__ || defined __ORBIS__ || defined(__PSVITA__))
|
||||
#elif defined __PS3__ || defined __ORBIS__ || defined(__PSVITA__)
|
||||
typedef struct _GameSessionData
|
||||
{
|
||||
unsigned short netVersion; // 2 bytes
|
||||
@@ -47,11 +47,6 @@ 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;
|
||||
@@ -62,11 +57,7 @@ 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
|
||||
@@ -78,16 +69,6 @@ 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()
|
||||
{
|
||||
@@ -95,15 +76,6 @@ 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
|
||||
@@ -114,7 +86,7 @@ public:
|
||||
SessionID sessionId;
|
||||
#ifdef _XBOX
|
||||
XSESSION_SEARCHRESULT searchResult;
|
||||
#elif !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
#elif defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
SQRNetworkManager::SessionSearchResult searchResult;
|
||||
#elif defined(_DURANGO)
|
||||
DQRNetworkManager::SessionSearchResult searchResult;
|
||||
@@ -136,6 +108,6 @@ public:
|
||||
~FriendSessionInfo()
|
||||
{
|
||||
if(displayLabel!=NULL)
|
||||
delete[] displayLabel;
|
||||
delete displayLabel;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "NetworkSocketManager.h"
|
||||
|
||||
#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>
|
||||
#include <netex/net.h>
|
||||
#include <netex/errno.h>
|
||||
|
||||
// PIEBOT: Adding this because Sony systems uses BSD apis
|
||||
// which uses socketclose instead of closesocket.
|
||||
int NetworkSocketManager::CloseSocket(SOCKET sock)
|
||||
{
|
||||
return socketclose(sock);
|
||||
}
|
||||
|
||||
int NetworkSocketManager::getSocketError(SOCKET socket)
|
||||
{
|
||||
return socket;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::IsSocketValid(SOCKET sock)
|
||||
{
|
||||
return sock >= 0;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::IsSentValid(int sent)
|
||||
{
|
||||
return sent >= 0;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::InitNetwork()
|
||||
{
|
||||
int result = sys_net_initialize_network();
|
||||
if (result != 0) {
|
||||
app.DebugPrintf("sys_net_initialize_network failed: %d\n", result);
|
||||
return false;
|
||||
}
|
||||
|
||||
result = cellNetCtlInit();
|
||||
if (result < 0) {
|
||||
app.DebugPrintf("cellNetCtlInit failed: %d\n", result);
|
||||
sys_net_finalize_network();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SOCKET NetworkSocketManager::MakeHostSocket(int port)
|
||||
{
|
||||
SOCKET s_listenSocket;
|
||||
|
||||
struct sockaddr_in addr = {};
|
||||
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
addr.sin_port = htons((uint16_t)port);
|
||||
|
||||
s_listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (s_listenSocket < 0)
|
||||
{
|
||||
app.DebugPrintf("socket() failed: %d\n", s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
// PIEBOT: time for part 2, binding and listening.
|
||||
int opt = 1;
|
||||
setsockopt(s_listenSocket, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof(opt));
|
||||
|
||||
int iResult = ::bind(s_listenSocket, (struct sockaddr*)&addr, sizeof(addr));
|
||||
|
||||
if (iResult < 0)
|
||||
{
|
||||
app.DebugPrintf("bind() failed: %d\n", iResult);
|
||||
CloseSocket(s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
iResult = listen(s_listenSocket, 5);
|
||||
if (iResult < 0)
|
||||
{
|
||||
app.DebugPrintf("listen() failed: %d\n", iResult);
|
||||
CloseSocket(s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
return s_listenSocket;
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "NetworkSocketManager.h"
|
||||
|
||||
#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>
|
||||
|
||||
// PIEBOT: Adding this because Sony systems uses BSD apis
|
||||
// which uses socketclose instead of closesocket.
|
||||
int NetworkSocketManager::CloseSocket(SOCKET sock)
|
||||
{
|
||||
return socketclose(sock);
|
||||
}
|
||||
|
||||
int NetworkSocketManager::getSocketError(SOCKET socket)
|
||||
{
|
||||
return socket;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::IsSocketValid(SOCKET sock)
|
||||
{
|
||||
return sock >= 0;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::IsSentValid(int sent)
|
||||
{
|
||||
return sent >= 0;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::InitNetwork()
|
||||
{
|
||||
WSADATA wsaData;
|
||||
int result = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
if (result != 0)
|
||||
{
|
||||
app.DebugPrintf("WSAStartup failed: %d\n", result);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SOCKET NetworkSocketManager::MakeHostSocket(int port)
|
||||
{
|
||||
SOCKET s_listenSocket = NULL;
|
||||
|
||||
struct sockaddr_in addr = {};
|
||||
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
addr.sin_port = htons((uint16_t)port);
|
||||
|
||||
s_listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (s_listenSocket < 0)
|
||||
{
|
||||
app.DebugPrintf("socket() failed: %d\n", s_listenSocket);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// PIEBOT: time for part 2, binding and listening.
|
||||
int opt = 1;
|
||||
setsockopt(s_listenSocket, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof(opt));
|
||||
|
||||
int iResult = ::bind(s_listenSocket, (struct sockaddr*)&addr, sizeof(addr));
|
||||
|
||||
if (iResult < 0)
|
||||
{
|
||||
app.DebugPrintf("bind() failed: %d\n", iResult);
|
||||
closesocket(s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
iResult = listen(s_listenSocket, 5);
|
||||
if (iResult < 0)
|
||||
{
|
||||
app.DebugPrintf("listen() failed: %d\n", iResult);
|
||||
closesocket(s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
return s_listenSocket;
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "NetworkSocketManager.h"
|
||||
|
||||
#include <net.h>
|
||||
|
||||
// PIEBOT: Adding this because Sony systems uses BSD apis
|
||||
// which uses socketclose instead of closesocket.
|
||||
int NetworkSocketManager::CloseSocket(SOCKET sock)
|
||||
{
|
||||
return socketclose(sock);
|
||||
}
|
||||
|
||||
int NetworkSocketManager::getSocketError(SOCKET socket)
|
||||
{
|
||||
return socket;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::IsSocketValid(SOCKET sock)
|
||||
{
|
||||
return sock >= 0;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::IsSentValid(int sent)
|
||||
{
|
||||
return sent >= 0;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::InitNetwork()
|
||||
{
|
||||
SceNetInitParam param;
|
||||
static char memory[16 * 1024];
|
||||
|
||||
param.memory = memory;
|
||||
param.size = sizeof(memory);
|
||||
param.flags = 0;
|
||||
|
||||
int result = sceNetInit(¶m);
|
||||
// libnet is brought up before us by the platform layer, which reports EBUSY here.
|
||||
if (result < 0 && result != SCE_NET_ERROR_EBUSY) {
|
||||
app.DebugPrintf("sceNetInit failed: 0x%08x\n", result);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SOCKET NetworkSocketManager::MakeHostSocket(int port)
|
||||
{
|
||||
SOCKET s_listenSocket = NULL;
|
||||
|
||||
SceNetSockaddrIn addr = {};
|
||||
addr.sin_len = sizeof(addr);
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
addr.sin_port = htons((uint16_t)port);
|
||||
|
||||
s_listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (s_listenSocket < 0)
|
||||
{
|
||||
app.DebugPrintf("socket() failed: %d\n", s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
// PIEBOT: time for part 2, binding and listening.
|
||||
int opt = 1;
|
||||
setsockopt(s_listenSocket, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof(opt));
|
||||
|
||||
int iResult = ::bind(s_listenSocket, (const sockaddr*)&addr, sizeof(addr));
|
||||
|
||||
if (iResult < 0)
|
||||
{
|
||||
app.DebugPrintf("bind() failed: %d\n", iResult);
|
||||
closesocket(s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
iResult = listen(s_listenSocket, 5);
|
||||
if (iResult < 0)
|
||||
{
|
||||
app.DebugPrintf("listen() failed: %d\n", iResult);
|
||||
closesocket(s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
return s_listenSocket;
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "NetworkSocketManager.h"
|
||||
|
||||
#include <WinSock2.h>
|
||||
#include <WS2tcpip.h>
|
||||
|
||||
// PIEBOT: Adding this because Sony systems uses BSD apis
|
||||
// which uses socketclose instead of closesocket.
|
||||
int NetworkSocketManager::CloseSocket(SOCKET sock)
|
||||
{
|
||||
return closesocket(sock);
|
||||
}
|
||||
|
||||
int NetworkSocketManager::getSocketError(SOCKET socket)
|
||||
{
|
||||
return WSAGetLastError();
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::IsSocketValid(SOCKET sock)
|
||||
{
|
||||
return sock != INVALID_SOCKET;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::IsSentValid(int sent)
|
||||
{
|
||||
return sent != SOCKET_ERROR;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::InitNetwork()
|
||||
{
|
||||
WSADATA wsaData;
|
||||
int result = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
if (result != 0)
|
||||
{
|
||||
app.DebugPrintf("WSAStartup failed: %d\n", result);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SOCKET NetworkSocketManager::MakeHostSocket(int port)
|
||||
{
|
||||
SOCKET s_listenSocket = NULL;
|
||||
struct addrinfo hints = {};
|
||||
struct addrinfo *result = NULL;
|
||||
|
||||
hints.ai_family = AF_INET;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_protocol = IPPROTO_TCP;
|
||||
hints.ai_flags = AI_PASSIVE;
|
||||
|
||||
char portStr[16];
|
||||
sprintf_s(portStr, "%d", port);
|
||||
|
||||
int iResult = getaddrinfo(NULL, portStr, &hints, &result);
|
||||
if (iResult != 0)
|
||||
{
|
||||
app.DebugPrintf("getaddrinfo failed: %d\n", iResult);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
s_listenSocket = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
|
||||
if (s_listenSocket == INVALID_SOCKET)
|
||||
{
|
||||
app.DebugPrintf("socket() failed: %d\n", WSAGetLastError());
|
||||
freeaddrinfo(result);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
// PIEBOT: time for part 2, binding and listening.
|
||||
int opt = 1;
|
||||
setsockopt(s_listenSocket, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof(opt));
|
||||
|
||||
iResult = ::bind(s_listenSocket, result->ai_addr, (int)result->ai_addrlen);
|
||||
freeaddrinfo(result);
|
||||
if (iResult == SOCKET_ERROR)
|
||||
{
|
||||
app.DebugPrintf("bind() failed: %d\n", WSAGetLastError());
|
||||
closesocket(s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
iResult = listen(s_listenSocket, SOMAXCONN);
|
||||
if (iResult == SOCKET_ERROR)
|
||||
{
|
||||
app.DebugPrintf("listen() failed: %d\n", WSAGetLastError());
|
||||
closesocket(s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
return s_listenSocket;
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "NetworkSocketManager.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <winsockx.h>
|
||||
#include <xtl.h>
|
||||
|
||||
// PIEBOT: Adding this because Sony systems uses BSD apis
|
||||
// which uses socketclose instead of closesocket.
|
||||
int NetworkSocketManager::CloseSocket(SOCKET sock)
|
||||
{
|
||||
return closesocket(sock);
|
||||
}
|
||||
|
||||
int NetworkSocketManager::getSocketError(SOCKET socket)
|
||||
{
|
||||
return WSAGetLastError();
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::IsSocketValid(SOCKET sock)
|
||||
{
|
||||
return sock != INVALID_SOCKET;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::IsSentValid(int sent)
|
||||
{
|
||||
return sent != SOCKET_ERROR;
|
||||
}
|
||||
|
||||
bool NetworkSocketManager::InitNetwork()
|
||||
{
|
||||
WSADATA wsaData;
|
||||
int result = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
if (result != 0)
|
||||
{
|
||||
app.DebugPrintf("WSAStartup failed: %d\n", result);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SOCKET NetworkSocketManager::MakeListenSocket(int port)
|
||||
{
|
||||
SOCKET s_listenSocket = NULL;
|
||||
struct sockaddr_in addr = {};
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
addr.sin_port = htons((WORD)port);
|
||||
|
||||
s_listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (s_listenSocket == INVALID_SOCKET)
|
||||
{
|
||||
app.DebugPrintf("socket() failed: %d\n", WSAGetLastError());
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
// PIEBOT: time for part 2, binding and listening.
|
||||
int opt = 1;
|
||||
setsockopt(s_listenSocket, SOL_SOCKET, SO_REUSEADDR, (const char *)&opt, sizeof(opt));
|
||||
|
||||
iResult = ::bind(s_listenSocket, (struct sockaddr*)&addr, sizeof(addr));
|
||||
if (iResult == SOCKET_ERROR)
|
||||
{
|
||||
app.DebugPrintf("bind() failed: %d\n", WSAGetLastError());
|
||||
closesocket(s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
iResult = listen(s_listenSocket, SOMAXCONN);
|
||||
if (iResult == SOCKET_ERROR)
|
||||
{
|
||||
app.DebugPrintf("listen() failed: %d\n", WSAGetLastError());
|
||||
closesocket(s_listenSocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
return s_listenSocket;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
#include <WinSock2.h>
|
||||
#elif defined _XBOX
|
||||
#include <winsockx.h>
|
||||
#else
|
||||
typedef int SOCKET;
|
||||
#define INVALID_SOCKET -1
|
||||
#endif
|
||||
|
||||
class NetworkSocketManager {
|
||||
public:
|
||||
bool IsSocketValid(SOCKET sock);
|
||||
bool IsSentValid(int sent);
|
||||
int getSocketError(SOCKET sock);
|
||||
int CloseSocket(SOCKET sock);
|
||||
int TCPaddrinfo(PCSTR ip, int port);
|
||||
bool InitNetwork();
|
||||
SOCKET MakeHostSocket(int port);
|
||||
};
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#include "NetworkPlayerSony.h"
|
||||
#ifndef DISABLE_PSN
|
||||
|
||||
NetworkPlayerSony::NetworkPlayerSony(SQRNetworkPlayer *qnetPlayer)
|
||||
{
|
||||
@@ -136,4 +135,3 @@ 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,4 +41,3 @@ private:
|
||||
Socket *m_pSocket;
|
||||
__int64 m_lastChunkPacketTime;
|
||||
};
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "stdafx.h"
|
||||
#ifndef DISABLE_PSN
|
||||
|
||||
#include "SQRNetworkManager.h"
|
||||
|
||||
bool SQRNetworkManager::s_safeToRespondToGameBootInvite = false;
|
||||
@@ -80,5 +80,4 @@ void SQRNetworkManager::TickWriteAcks()
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection(&m_csAckQueue);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -80,6 +80,7 @@ public:
|
||||
bool inviteOnly;
|
||||
};
|
||||
|
||||
|
||||
// Externally exposed state. All internal states are mapped to one of these broader states.
|
||||
typedef enum
|
||||
{
|
||||
@@ -323,4 +324,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,5 +1,4 @@
|
||||
#include "stdafx.h"
|
||||
#ifndef DISABLE_PSN
|
||||
#include "SQRNetworkPlayer.h"
|
||||
|
||||
#ifdef __PS3__
|
||||
@@ -610,4 +609,3 @@ 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();
|
||||
|
||||
|
||||
#if !defined(DISABLE_PSN) && defined(__PSVITA__)
|
||||
#ifdef __PSVITA__
|
||||
void SendInternal_VitaAdhoc(const void *data, unsigned int dataSize, EAdhocDataTag tag = e_dataTag_Normal);
|
||||
void SendMoreInternal_VitaAdhoc();
|
||||
#endif
|
||||
|
||||
@@ -1309,7 +1309,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
||||
break;
|
||||
#endif
|
||||
case ACTION_MENU_A:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
if(!bRepeat)
|
||||
|
||||
@@ -192,7 +192,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
bHandled = true;
|
||||
break;
|
||||
case ACTION_MENU_A:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
// Do some crafting!
|
||||
|
||||
@@ -170,7 +170,7 @@ void IUIScene_HUD::updateFrameTick()
|
||||
}
|
||||
SetOpacity(fVal);
|
||||
|
||||
bool bDisplayGui=app.GetGameStarted() && !ui.GetMenuDisplayed(iPad) && !(app.GetXuiAction(iPad)==eAppAction_AutosaveSaveGameCapturedThumbnail) && app.GetGameSettings(iPad,eGameSetting_DisplayHUD)!=0;
|
||||
bool bDisplayGui=app.GetGameStarted() && !ui.GetMenuDisplayed(iPad) && !(app.GetUIAction(iPad)==eAppAction_AutosaveSaveGameCapturedThumbnail) && app.GetGameSettings(iPad,eGameSetting_DisplayHUD)!=0;
|
||||
if(bDisplayGui && pMinecraft->localplayers[iPad] != NULL)
|
||||
{
|
||||
SetVisible(true);
|
||||
|
||||
@@ -354,11 +354,11 @@ int IUIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter )
|
||||
bool bAutosave=(bool)lpParameter;
|
||||
if(bAutosave)
|
||||
{
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_AutoSaveGame);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_AutoSaveGame);
|
||||
}
|
||||
else
|
||||
{
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_SaveGame);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_SaveGame);
|
||||
}
|
||||
|
||||
// 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
|
||||
@@ -374,7 +374,7 @@ int IUIScene_PauseMenu::SaveWorldThreadProc( LPVOID lpParameter )
|
||||
{
|
||||
app.SetGameStarted(false);
|
||||
|
||||
while( app.GetXuiServerAction(ProfileManager.GetPrimaryPad() ) != eXuiServerAction_Idle && !MinecraftServer::serverHalted() )
|
||||
while( app.GetUIServerAction(ProfileManager.GetPrimaryPad() ) != eUIServerAction_Idle && !MinecraftServer::serverHalted() )
|
||||
{
|
||||
Sleep(10);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ void IUIScene_StartGame::HandleDLCMountingComplete()
|
||||
for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i)
|
||||
{
|
||||
bTexturePackAlreadyListed=false;
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__))
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
char *pchName=app.GetDLCInfoTextures(i);
|
||||
pDLCInfo=app.GetDLCInfo(pchName);
|
||||
#elif defined _XBOX_ONE
|
||||
|
||||
@@ -59,7 +59,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
handled = true;
|
||||
break;
|
||||
case ACTION_MENU_A:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
if(!m_activeOffers.empty())
|
||||
|
||||
@@ -64,16 +64,19 @@ F64 UIComponent_Tooltips::getSafeZoneHalfWidth()
|
||||
float safeWidth = 0.0f;
|
||||
|
||||
#ifndef __PSVITA__
|
||||
// 85% safezone for tooltips in either SD mode
|
||||
if( !RenderManager.IsHiDef() )
|
||||
if (!(width >= 960.0f && width < 1280.0f))
|
||||
{
|
||||
// 85% safezone
|
||||
safeWidth = m_movieWidth * (0.15f / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 90% safezone
|
||||
safeWidth = width * (0.1f / 2);
|
||||
// 85% safezone for tooltips in either SD mode
|
||||
if( !RenderManager.IsHiDef() )
|
||||
{
|
||||
// 85% safezone
|
||||
safeWidth = m_movieWidth * (0.15f / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 90% safezone
|
||||
safeWidth = width * (0.1f / 2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return safeWidth;
|
||||
|
||||
@@ -35,15 +35,16 @@
|
||||
#ifdef __ORBIS__
|
||||
#include "Orbis\Iggy\include\iggyperfmon.h"
|
||||
#include "Orbis\Iggy\include\iggyperfmon_orbis.h"
|
||||
#elif defined _DURANGO
|
||||
#elif _DURANGO
|
||||
#include "Durango\Iggy\include\iggyperfmon.h"
|
||||
#elif defined __PS3__
|
||||
#elif __PS3__
|
||||
#include "PS3\Iggy\include\iggyperfmon.h"
|
||||
#include "PS3\Iggy\include\iggyperfmon_ps3.h"
|
||||
#elif defined __PSVITA__
|
||||
#elif __PSVITA__
|
||||
#include "PSVita\Iggy\include\iggyperfmon.h"
|
||||
#include "PSVita\Iggy\include\iggyperfmon_psp2.h"
|
||||
#elif defined __WINDOWS64
|
||||
#elif _WINDOWS64
|
||||
//str1k3r - IggyPerfmon is broken on windows64 as we dont have the DLL
|
||||
#include "Windows64\Iggy\include\iggyperfmon.h"
|
||||
#endif
|
||||
|
||||
@@ -184,17 +185,6 @@ UIController::UIController()
|
||||
InitializeCriticalSection(&m_Allocatorlock);
|
||||
#endif
|
||||
|
||||
// 4J Stu - This is a bit of a hack until we change the Minecraft initialisation to store the proper screen size for other platforms
|
||||
#if defined _DURANGO || defined __ORBIS__
|
||||
m_fScreenWidth = 1920.0f;
|
||||
m_fScreenHeight = 1080.0f;
|
||||
m_bScreenWidthSetup = true;
|
||||
#else
|
||||
m_fScreenWidth = 1280.0f;
|
||||
m_fScreenHeight = 720.0f;
|
||||
m_bScreenWidthSetup = false;
|
||||
#endif
|
||||
|
||||
for(unsigned int i = 0; i < eLibrary_Count; ++i)
|
||||
{
|
||||
m_iggyLibraries[i] = IGGY_INVALID_LIBRARY;
|
||||
@@ -257,6 +247,7 @@ void UIController::SetSystemUIShowing(LPVOID lpParam,bool bVal)
|
||||
// SETUP
|
||||
void UIController::preInit(S32 width, S32 height)
|
||||
{
|
||||
//str1k3r - 4J previously hardcoded this in UIController(), this is already set per platform so just use this :3
|
||||
m_fScreenWidth = width;
|
||||
m_fScreenHeight = height;
|
||||
m_bScreenWidthSetup = true;
|
||||
@@ -500,14 +491,14 @@ void UIController::tick()
|
||||
}
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
GetControllerType();
|
||||
GetControllerSwf();
|
||||
#endif
|
||||
}
|
||||
|
||||
//str1k3r - PS3 & PS4 icons are broken in some spots, therefore they wont be included yet
|
||||
#ifdef _WINDOWS64
|
||||
//str1k3r - this is what actually does all the autoswitching
|
||||
void UIController::GetControllerType()
|
||||
void UIController::GetControllerSwf()
|
||||
{
|
||||
EControllerType ControllerType = InputManager.GetControllerType(0);
|
||||
wstring controlTooltipsPath = L"";
|
||||
@@ -521,7 +512,6 @@ void UIController::GetControllerType()
|
||||
case EControllerType_Xbox360:
|
||||
controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\XboxHDControls.swf" : L"ControlTooltips\\XboxControls.swf";
|
||||
break;
|
||||
case EControllerType_Default:
|
||||
case EControllerType_XboxOne:
|
||||
controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\DurangoHDControls.swf" : L"ControlTooltips\\DurangoControls.swf";
|
||||
break;
|
||||
@@ -539,6 +529,9 @@ void UIController::GetControllerType()
|
||||
controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\SwitchHDControls.swf" : L"ControlTooltips\\SwitchControls.swf";
|
||||
break;
|
||||
*/
|
||||
case EControllerType_Default: //str1k3r - this is going to get a custom swf soon
|
||||
controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\DurangoHDControls.swf" : L"ControlTooltips\\DurangoControls.swf";
|
||||
break;
|
||||
default:
|
||||
controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\Windows64HDControls.swf" : L"ControlTooltips\\Windows64Controls.swf";
|
||||
break;
|
||||
@@ -569,7 +562,6 @@ wstring UIController::GetTooltipSkinPath()
|
||||
{
|
||||
case EControllerType_Xbox360:
|
||||
return ui.getScreenWidth() >= 1920 ? L"ControlTooltips\\HD\\XboxHDControls.swf" : L"ControlTooltips\\XboxControls.swf";
|
||||
case EControllerType_Default:
|
||||
case EControllerType_XboxOne:
|
||||
return ui.getScreenWidth() >= 1920 ? L"ControlTooltips\\HD\\DurangoHDControls.swf" : L"ControlTooltips\\DurangoControls.swf";
|
||||
/*
|
||||
@@ -582,6 +574,8 @@ wstring UIController::GetTooltipSkinPath()
|
||||
case EControllerType_Switch:
|
||||
return ui.getScreenWidth() >= 1920 ? L"ControlTooltips\\HD\\SwitchHDControls.swf" : L"ControlTooltips\\SwitchControls.swf";
|
||||
*/
|
||||
case EControllerType_Default:
|
||||
return ui.getScreenWidth() >= 1920 ? L"ControlTooltips\\HD\\DurangoHDControls.swf" : L"ControlTooltips\\DurangoControls.swf";
|
||||
default:
|
||||
return ui.getScreenWidth() >= 1920 ? L"ControlTooltips\\HD\\Windows64HDControls.swf" : L"ControlTooltips\\Windows64Controls.swf";
|
||||
break;
|
||||
@@ -601,12 +595,12 @@ void UIController::loadSkins()
|
||||
#elif defined __PSVITA__
|
||||
platformSkinPath = L"skinVita.swf";
|
||||
#elif defined _WINDOWS64
|
||||
if(m_fScreenWidth >= 1920.0f)
|
||||
if(ui.getScreenWidth() >= 1920.0f)
|
||||
{
|
||||
tooltipsSkinPath = GetTooltipSkinPath();
|
||||
platformSkinPath = L"skinHDWin.swf";
|
||||
}
|
||||
else if (m_fScreenWidth >= 960.0f && m_fScreenWidth < 1280.0f) //str1k3r - we need to check this to make sure we dont load the vita skin on 720p
|
||||
else if (ui.getScreenWidth() >= 960.0f && ui.getScreenWidth() < 1280.0f) //str1k3r - we need to check this to make sure we dont load the vita skin on 720p
|
||||
{
|
||||
tooltipsSkinPath = GetTooltipSkinPath();
|
||||
platformSkinPath = L"skinWinVita.swf";
|
||||
@@ -639,7 +633,7 @@ void UIController::loadSkins()
|
||||
|
||||
// str1k3r - Fixes 720p/480p Crashes on Windows64, also allows this to be used on 1080p consoles instead of just Windows64
|
||||
// This also cleans up some 4J code and turns 3 if statements into 1.
|
||||
if (m_fScreenWidth >= 1920.0f)
|
||||
if (ui.getScreenWidth() >= 1920.0f)
|
||||
{
|
||||
m_iggyLibraries[eLibrary_Platform] = loadSkin(platformSkinPath, L"platformskinHD.swf");
|
||||
m_iggyLibraries[eLibrary_GraphicsDefault] = loadSkin(L"skinHDGraphics.swf", L"skinHDGraphics.swf");
|
||||
@@ -929,7 +923,8 @@ void UIController::handleInput()
|
||||
|
||||
if(ProfileManager.GetLockedProfile() >= 0 && !InputManager.IsPadLocked( ProfileManager.GetLockedProfile() ) && firstUnfocussedUnhandledPad >= 0)
|
||||
{
|
||||
ProfileManager.RequestSignInUI(false, false, false, false, true, NULL, NULL, firstUnfocussedUnhandledPad );
|
||||
//ProfileManager.RequestSignInUI(false, false, false, false, true, NULL, NULL, firstUnfocussedUnhandledPad );
|
||||
ProfileManager.RequestSignInUI(false, false, false, false, true, static_cast<int (*)(LPVOID, const bool, const int)>(NULL), NULL, firstUnfocussedUnhandledPad );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -2624,7 +2619,7 @@ void UIController::ClearPressStart()
|
||||
|
||||
C4JStorage::EMessageResult UIController::RequestAlertMessage(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, WCHAR *pwchFormatString)
|
||||
{
|
||||
#ifndef __ORBIS__
|
||||
#if !(defined __ORBIS__ || _XBOX_ONE)
|
||||
return RequestMessageBox(uiTitle, uiText, uiOptionA, uiOptionC, dwPad, Func, lpParam, pwchFormatString, 0, false);
|
||||
#else
|
||||
return RequestMessageBox(uiTitle, uiText, uiOptionA, uiOptionC, dwPad, Func, lpParam, NULL, pwchFormatString, 0, false);
|
||||
@@ -2633,14 +2628,14 @@ C4JStorage::EMessageResult UIController::RequestAlertMessage(UINT uiTitle, UINT
|
||||
|
||||
C4JStorage::EMessageResult UIController::RequestErrorMessage(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, WCHAR *pwchFormatString)
|
||||
{
|
||||
#ifndef __ORBIS__
|
||||
#if !(defined __ORBIS__ || _XBOX_ONE)
|
||||
return RequestMessageBox(uiTitle, uiText, uiOptionA, uiOptionC, dwPad, Func, lpParam, pwchFormatString, 0, true);
|
||||
#else
|
||||
return RequestMessageBox(uiTitle, uiText, uiOptionA, uiOptionC, dwPad, Func, lpParam, NULL, pwchFormatString, 0, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef __ORBIS__
|
||||
#if !(defined __ORBIS__ || _XBOX_ONE)
|
||||
C4JStorage::EMessageResult UIController::RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad,
|
||||
int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, WCHAR *pwchFormatString,DWORD dwFocusButton, bool bIsError)
|
||||
#else
|
||||
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
virtual void tick();
|
||||
|
||||
private:
|
||||
void GetControllerType();
|
||||
void GetControllerSwf();
|
||||
wstring GetTooltipSkinPath();
|
||||
void loadSkins();
|
||||
IggyLibrary loadSkin(const wstring &skinPath, const wstring &skinName);
|
||||
@@ -236,6 +236,8 @@ public:
|
||||
// RENDERING
|
||||
float getScreenWidth() { return m_fScreenWidth; }
|
||||
float getScreenHeight() { return m_fScreenHeight; }
|
||||
void setScreenWidth(float w) { m_fScreenWidth = w; }
|
||||
void setScreenHeight(float h) { m_fScreenHeight = h; }
|
||||
|
||||
virtual void render() = 0;
|
||||
void getRenderDimensions(C4JRender::eViewportType viewport, S32 &width, S32 &height);
|
||||
@@ -363,7 +365,7 @@ public:
|
||||
|
||||
virtual C4JStorage::EMessageResult RequestAlertMessage(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, WCHAR *pwchFormatString=NULL);
|
||||
virtual C4JStorage::EMessageResult RequestErrorMessage(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY, int( *Func)(LPVOID,int,const C4JStorage::EMessageResult)=NULL,LPVOID lpParam=NULL, WCHAR *pwchFormatString=NULL);
|
||||
#ifndef __ORBIS__
|
||||
#if !(defined __ORBIS__ || _XBOX_ONE)
|
||||
private:
|
||||
virtual C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad,
|
||||
int( *Func)(LPVOID,int,const C4JStorage::EMessageResult),LPVOID lpParam, WCHAR *pwchFormatString,DWORD dwFocusButton, bool bIsError);
|
||||
|
||||
@@ -125,15 +125,18 @@ F64 UIScene::getSafeZoneHalfHeight()
|
||||
float safeHeight = 0.0f;
|
||||
|
||||
#ifndef __PSVITA__
|
||||
if( !RenderManager.IsHiDef() && RenderManager.IsWidescreen() )
|
||||
if (!(height >= 544.0f && height < 720.0f))
|
||||
{
|
||||
// 90% safezone
|
||||
safeHeight = height * (0.15f / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 90% safezone
|
||||
safeHeight = height * (0.1f / 2);
|
||||
if( !RenderManager.IsHiDef() && RenderManager.IsWidescreen() )
|
||||
{
|
||||
// 90% safezone
|
||||
safeHeight = height * (0.15f / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 90% safezone
|
||||
safeHeight = height * (0.1f / 2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return safeHeight;
|
||||
@@ -145,15 +148,18 @@ F64 UIScene::getSafeZoneHalfWidth()
|
||||
|
||||
float safeWidth = 0.0f;
|
||||
#ifndef __PSVITA__
|
||||
if( !RenderManager.IsHiDef() && RenderManager.IsWidescreen() )
|
||||
if (!(width >= 960.0f && width < 1280.0f))
|
||||
{
|
||||
// 85% safezone
|
||||
safeWidth = width * (0.15f / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 90% safezone
|
||||
safeWidth = width * (0.1f / 2);
|
||||
if( !RenderManager.IsHiDef() && RenderManager.IsWidescreen() )
|
||||
{
|
||||
// 85% safezone
|
||||
safeWidth = width * (0.15f / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 90% safezone
|
||||
safeWidth = width * (0.1f / 2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return safeWidth;
|
||||
@@ -329,20 +335,20 @@ void UIScene::loadMovie()
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
#else
|
||||
app.DebugPrintf("WARNING: Could not find iggy movie %ls, falling back on 480\n", moviePath.c_str());
|
||||
app.DebugPrintf("WARNING: Could not find iggy movie %ls, falling back on Vita\n", moviePath.c_str());
|
||||
|
||||
moviePath = getMoviePath();
|
||||
moviePath.append(L"480.swf");
|
||||
m_loadedResolution = eSceneResolution_480;
|
||||
moviePath.append(L"Vita.swf");
|
||||
m_loadedResolution = eSceneResolution_544;
|
||||
|
||||
//str1k3r - while 480 & Vita share basically all the same skins its just a extra fallback :D
|
||||
if(!app.hasArchiveFile(moviePath))
|
||||
{
|
||||
app.DebugPrintf("WARNING: Could not find iggy movie %ls, falling back on Vita\n", moviePath.c_str());
|
||||
app.DebugPrintf("WARNING: Could not find iggy movie %ls, falling back on 480\n", moviePath.c_str());
|
||||
|
||||
moviePath = getMoviePath();
|
||||
moviePath.append(L"Vita.swf");
|
||||
m_loadedResolution = eSceneResolution_544;
|
||||
moviePath.append(L"480.swf");
|
||||
m_loadedResolution = eSceneResolution_480;
|
||||
|
||||
if(!app.hasArchiveFile(moviePath))
|
||||
{
|
||||
@@ -940,7 +946,7 @@ int UIScene::convertGameActionToIggyKeycode(int action)
|
||||
int keycode = -1;
|
||||
switch(action)
|
||||
{
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
case ACTION_MENU_A:
|
||||
|
||||
@@ -12,7 +12,7 @@ UIScene_AbstractContainerMenu::UIScene_AbstractContainerMenu(int iPad, UILayer *
|
||||
// in this scene, we override the press sound with our own for crafting success or fail
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_A,true);
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_OK,true);
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_TOUCHPAD_PRESS,true);
|
||||
#endif
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_X,true);
|
||||
@@ -51,7 +51,7 @@ void UIScene_AbstractContainerMenu::handleDestroy()
|
||||
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_A,false);
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_OK,false);
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_TOUCHPAD_PRESS,false);
|
||||
#endif
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_X,false);
|
||||
|
||||
@@ -224,7 +224,7 @@ void UIScene_ConnectingProgress::handleInput(int iPad, int key, bool repeat, boo
|
||||
// }
|
||||
// break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
if(pressed)
|
||||
|
||||
@@ -159,7 +159,7 @@ void UIScene_ControlsMenu::handleInput(int iPad, int key, bool repeat, bool pres
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
if( pressed )
|
||||
|
||||
@@ -163,7 +163,7 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p
|
||||
// in this scene, we override the press sound with our own for crafting success or fail
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_A,true);
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_OK,true);
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_TOUCHPAD_PRESS,true);
|
||||
#endif
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_LEFT_SCROLL,true);
|
||||
@@ -204,7 +204,7 @@ void UIScene_CraftingMenu::handleDestroy()
|
||||
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_A,false);
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_OK,false);
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_TOUCHPAD_PRESS,false);
|
||||
#endif
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_LEFT_SCROLL,false);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "..\..\..\Minecraft.World\LevelType.h"
|
||||
#include "..\..\DLCTexturePack.h"
|
||||
|
||||
#if !defined(DISABLE_PSN) && defined(__PSVITA__)
|
||||
#ifdef __PSVITA__
|
||||
#include "PSVita\Network\SQRNetworkManager_AdHoc_Vita.h"
|
||||
#endif
|
||||
|
||||
@@ -367,7 +367,7 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat, bool p
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
|
||||
@@ -959,19 +959,11 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
|
||||
else
|
||||
{
|
||||
//ProfileManager.RequestSignInUI(false, false, false, true, false,&CScene_MultiGameCreate::StartGame_SignInReturned, this,ProfileManager.GetPrimaryPad());
|
||||
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
|
||||
SignInInfo info;
|
||||
info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned;
|
||||
info.lpParam = this;
|
||||
info.requireOnline = m_MoreOptionsParams.bOnlineGame;
|
||||
UIScene_CreateWorldMenu::StartGame_SignInReturned(this, true, ProfileManager.GetPrimaryPad());
|
||||
#else
|
||||
SignInInfo info;
|
||||
info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned;
|
||||
info.lpParam = this;
|
||||
info.requireOnline = m_MoreOptionsParams.bOnlineGame;
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1052,7 +1044,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
|
||||
#endif
|
||||
|
||||
bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame;
|
||||
#if !defined DISABLE_PSN && defined __PSVITA__
|
||||
#ifdef __PSVITA__
|
||||
if(CGameNetworkManager::usingAdhocMode())
|
||||
{
|
||||
if(SQRNetworkManager_AdHoc_Vita::GetAdhocStatus())// && pClass->m_MoreOptionsParams.bOnlineGame)
|
||||
@@ -1350,16 +1342,12 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor
|
||||
|
||||
if(isClientSide && app.IsLocalMultiplayerAvailable())
|
||||
{
|
||||
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
|
||||
UIScene_CreateWorldMenu::StartGame_SignInReturned(pClass, true, ProfileManager.GetPrimaryPad());
|
||||
#else
|
||||
//ProfileManager.RequestSignInUI(false, false, false, true, false,&UIScene_CreateWorldMenu::StartGame_SignInReturned, pClass,ProfileManager.GetPrimaryPad());
|
||||
SignInInfo info;
|
||||
info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned;
|
||||
info.lpParam = pClass;
|
||||
info.requireOnline = pClass->m_MoreOptionsParams.bOnlineGame;
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1404,21 +1392,17 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__ORBIS__)
|
||||
#ifdef __ORBIS__
|
||||
int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu *)pParam;
|
||||
pClass->m_bIgnoreInput = false;
|
||||
#ifdef DISABLE_PSN
|
||||
UIScene_CreateWorldMenu::StartGame_SignInReturned(pClass, true, iPad);
|
||||
#else
|
||||
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_CreateWorldMenu::StartGame_SignInReturned, pClass, false, iPad);
|
||||
}
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -648,7 +648,7 @@ void UIScene_Credits::handleInput(int iPad, int key, bool repeat, bool pressed,
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
case ACTION_MENU_UP:
|
||||
|
||||
@@ -103,7 +103,7 @@ void UIScene_DLCMainMenu::handleInput(int iPad, int key, bool repeat, bool press
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
@@ -195,7 +195,7 @@ void UIScene_DLCMainMenu::tick()
|
||||
{
|
||||
UIScene::tick();
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
if((m_bCategoriesShown==false) && (app.GetCommerceCategoriesRetrieved()))
|
||||
{
|
||||
// disable the timer display on this menu
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "Common\Network\Sony\SonyHttp.h"
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_PSN) && defined(__PSVITA__)
|
||||
#ifdef __PSVITA__
|
||||
#include "PSVita\Network\SonyCommerce_Vita.h"
|
||||
#endif
|
||||
|
||||
@@ -149,7 +149,7 @@ void UIScene_DLCOffersMenu::handleInput(int iPad, int key, bool repeat, bool pre
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
@@ -191,13 +191,13 @@ void UIScene_DLCOffersMenu::handleInput(int iPad, int key, bool repeat, bool pre
|
||||
switch(iTextC)
|
||||
{
|
||||
case 0:
|
||||
m_labelHTMLSellText.init("Voici un fantastique mini-pack de 24 apparences pour personnaliser votre personnage Minecraft et vous mettre dans l'ambiance des f�tes de fin d'ann�e.<br><br>1-4 joueurs<br>2-8 joueurs en r�seau<br><br> Cet article fait l�objet d�une licence ou d�une sous-licence de Sony Computer Entertainment America, et est soumis aux conditions g�n�rales du service du r�seau, au contrat d�utilisateur, aux restrictions d�utilisation de cet article et aux autres conditions applicables, disponibles sur le site www.us.playstation.com/support/useragreements. Si vous ne souhaitez pas accepter ces conditions, ne t�l�chargez pas ce produit. Cet article peut �tre utilis� avec un maximum de deux syst�mes PlayStation�3 activ�s associ�s � ce compte Sony Entertainment Network.�<br><br>'Minecraft' est une marque commerciale de Notch Development AB.");
|
||||
m_labelHTMLSellText.init("Voici un fantastique mini-pack de 24 apparences pour personnaliser votre personnage Minecraft et vous mettre dans l'ambiance des fêtes de fin d'année.<br><br>1-4 joueurs<br>2-8 joueurs en réseau<br><br> Cet article fait l’objet d’une licence ou d’une sous-licence de Sony Computer Entertainment America, et est soumis aux conditions générales du service du réseau, au contrat d’utilisateur, aux restrictions d’utilisation de cet article et aux autres conditions applicables, disponibles sur le site www.us.playstation.com/support/useragreements. Si vous ne souhaitez pas accepter ces conditions, ne téléchargez pas ce produit. Cet article peut être utilisé avec un maximum de deux systèmes PlayStation®3 activés associés à ce compte Sony Entertainment Network. <br><br>'Minecraft' est une marque commerciale de Notch Development AB.");
|
||||
break;
|
||||
case 1:
|
||||
m_labelHTMLSellText.init("Un fabuloso minipack de 24 aspectos para personalizar tu personaje de Minecraft y ponerte a tono con las fiestas.<br><br>1-4 jugadores<br>2-8 jugadores en red<br><br> Sony Computer Entertainment America le concede la licencia o sublicencia de este art�culo, que est� sujeto a los t�rminos de servicio y al acuerdo de usuario de la red. Las restricciones de uso de este art�culo, as� como otros t�rminos aplicables, se encuentran en www.us.playstation.com/support/useragreements. Si no desea aceptar todos estos t�rminos, no descargue este art�culo. Este art�culo puede usarse en hasta dos sistemas PlayStation�3 activados asociados con esta cuenta de Sony Entertainment Network.�<br><br>'Minecraft' es una marca comercial de Notch Development AB.");
|
||||
m_labelHTMLSellText.init("Un fabuloso minipack de 24 aspectos para personalizar tu personaje de Minecraft y ponerte a tono con las fiestas.<br><br>1-4 jugadores<br>2-8 jugadores en red<br><br> Sony Computer Entertainment America le concede la licencia o sublicencia de este artículo, que está sujeto a los términos de servicio y al acuerdo de usuario de la red. Las restricciones de uso de este artículo, así como otros términos aplicables, se encuentran en www.us.playstation.com/support/useragreements. Si no desea aceptar todos estos términos, no descargue este artículo. Este artículo puede usarse en hasta dos sistemas PlayStation®3 activados asociados con esta cuenta de Sony Entertainment Network. <br><br>'Minecraft' es una marca comercial de Notch Development AB.");
|
||||
break;
|
||||
case 2:
|
||||
m_labelHTMLSellText.init("Este � um incr�vel pacote com 24 capas para personalizar seu personagem no Minecraft e entrar no clima de final de ano.<br><br>1-4 Jogadores<br>Jogadores em rede 2-8<br><br> Este item est� sendo licenciado ou sublicenciado para voc� pela Sony Computer Entertainment America e est� sujeito aos Termos de Servi�o da Rede e Acordo do Usu�rio, as restri��es de uso deste item e outros termos aplic�veis est�o localizados em www.us.playstation.com/support/useragreements. Caso n�o queira aceitar todos esses termos, n�o baixe este item. Este item pode ser usado com at� 2 sistemas PlayStation�3 ativados associados a esta Conta de Rede Sony Entertainment.�<br><br>'Minecraft' � uma marca registrada da Notch Development AB");
|
||||
m_labelHTMLSellText.init("Este é um incrível pacote com 24 capas para personalizar seu personagem no Minecraft e entrar no clima de final de ano.<br><br>1-4 Jogadores<br>Jogadores em rede 2-8<br><br> Este item está sendo licenciado ou sublicenciado para você pela Sony Computer Entertainment America e está sujeito aos Termos de Serviço da Rede e Acordo do Usuário, as restrições de uso deste item e outros termos aplicáveis estão localizados em www.us.playstation.com/support/useragreements. Caso não queira aceitar todos esses termos, não baixe este item. Este item pode ser usado com até 2 sistemas PlayStation®3 ativados associados a esta Conta de Rede Sony Entertainment. <br><br>'Minecraft' é uma marca registrada da Notch Development AB");
|
||||
break;
|
||||
}
|
||||
iTextC++;
|
||||
@@ -333,7 +333,7 @@ void UIScene_DLCOffersMenu::tick()
|
||||
{
|
||||
UIScene::tick();
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__))
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
|
||||
if(m_bAddAllDLCButtons)
|
||||
{
|
||||
@@ -504,7 +504,7 @@ void UIScene_DLCOffersMenu::tick()
|
||||
}
|
||||
else
|
||||
{
|
||||
#if !defined(DISABLE_PSN) && defined(__PSVITA__)
|
||||
#ifdef __PSVITA__
|
||||
// MGH - fixes bug 5768 on Vita - should be extended properly to work for other platforms
|
||||
if((SonyCommerce_Vita::getPurchasabilityUpdated()) && app.GetCommerceProductListRetrieved()&& app.GetCommerceProductListInfoRetrieved() && m_iTotalDLC > 0)
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ void UIScene_DeathMenu::handleInput(int iPad, int key, bool repeat, bool pressed
|
||||
handled = true;
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
case ACTION_MENU_UP:
|
||||
|
||||
@@ -100,7 +100,7 @@ void UIScene_DebugCreateSchematic::handlePress(F64 controlId, F64 childId)
|
||||
else if(m_data->endZ < 0 && m_data->endZ%2 ==0)
|
||||
m_data->endZ+=1;
|
||||
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(), eXuiServerAction_ExportSchematic, (void *)m_data);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(), eUIServerAction_ExportSchematic, (void *)m_data);
|
||||
|
||||
navigateBack();
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId)
|
||||
{
|
||||
app.DebugPrintf("UIScene_DebugOverlay::handlePress for itemsList: %f\n", childId);
|
||||
int id = childId;
|
||||
//app.SetXuiServerAction(m_iPad, eXuiServerAction_DropItem, (void *)m_itemIds[id]);
|
||||
//app.SetUIServerAction(m_iPad, eUIServerAction_DropItem, (void *)m_itemIds[id]);
|
||||
ClientConnection *conn = Minecraft::GetInstance()->getConnection(ProfileManager.GetPrimaryPad());
|
||||
conn->send( GiveItemCommand::preparePacket(dynamic_pointer_cast<Player>(Minecraft::GetInstance()->localplayers[ProfileManager.GetPrimaryPad()]), m_itemIds[id]) );
|
||||
}
|
||||
@@ -177,7 +177,7 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId)
|
||||
int id = childId;
|
||||
if(id<m_mobFactories.size())
|
||||
{
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_SpawnMob,(void *)m_mobFactories[id]);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_SpawnMob,(void *)m_mobFactories[id]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -204,13 +204,13 @@ void UIScene_DebugOverlay::handlePress(F64 controlId, F64 childId)
|
||||
break;
|
||||
case eControl_Rain:
|
||||
{
|
||||
//app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_ToggleRain);
|
||||
//app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_ToggleRain);
|
||||
ClientConnection *conn = Minecraft::GetInstance()->getConnection(ProfileManager.GetPrimaryPad());
|
||||
conn->send( ToggleDownfallCommand::preparePacket() );
|
||||
}
|
||||
break;
|
||||
case eControl_Thunder:
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_ToggleThunder);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_ToggleThunder);
|
||||
break;
|
||||
case eControl_ResetTutorial:
|
||||
Tutorial::debugResetPlayerSavedProgress( ProfileManager.GetPrimaryPad() );
|
||||
|
||||
@@ -91,8 +91,8 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
|
||||
switch((int)controlId)
|
||||
{
|
||||
case eControl_Teleport:
|
||||
app.SetXuiServerAction( ProfileManager.GetPrimaryPad(),
|
||||
eXuiServerAction_SetCameraLocation,
|
||||
app.SetUIServerAction( ProfileManager.GetPrimaryPad(),
|
||||
eUIServerAction_SetCameraLocation,
|
||||
(void *)currentPosition);
|
||||
break;
|
||||
case eControl_CamX:
|
||||
|
||||
@@ -106,7 +106,7 @@ void UIScene_EULA::handleInput(int iPad, int key, bool repeat, bool pressed, boo
|
||||
{
|
||||
if(m_bIgnoreInput) return;
|
||||
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
// ignore all players except player 0 - it's their profile that is currently being used
|
||||
if(iPad!=0) return;
|
||||
#endif
|
||||
|
||||
@@ -276,7 +276,7 @@ void UIScene_FullscreenProgress::handleInput(int iPad, int key, bool repeat, boo
|
||||
switch(key)
|
||||
{
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
if(pressed)
|
||||
|
||||
@@ -189,7 +189,7 @@ void UIScene_HelpAndOptionsMenu::handleInput(int iPad, int key, bool repeat, boo
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
//CD - Added for audio
|
||||
|
||||
@@ -210,7 +210,7 @@ void UIScene_HowToPlay::handleInput(int iPad, int key, bool repeat, bool pressed
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_A:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
if(pressed)
|
||||
|
||||
@@ -175,7 +175,7 @@ void UIScene_HowToPlayMenu::handleInput(int iPad, int key, bool repeat, bool pre
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
@@ -136,7 +136,7 @@ void UIScene_InGameHostOptionsMenu::handleInput(int iPad, int key, bool repeat,
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
@@ -253,7 +253,7 @@ void UIScene_InGameInfoMenu::handleInput(int iPad, int key, bool repeat, bool pr
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_Y:
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__))
|
||||
#if defined(__PS3__) || defined(__ORBIS__)
|
||||
if(pressed && iPad == ProfileManager.GetPrimaryPad())
|
||||
{
|
||||
#ifdef __PS3__
|
||||
@@ -290,7 +290,7 @@ void UIScene_InGameInfoMenu::handleInput(int iPad, int key, bool repeat, bool pr
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
PSVITA_STUBBED;
|
||||
#elif !defined(DISABLE_PSN)
|
||||
#else
|
||||
ProfileManager.ShowProfileCard(iPad,uid);
|
||||
#endif
|
||||
}
|
||||
@@ -313,7 +313,7 @@ void UIScene_InGameInfoMenu::handleInput(int iPad, int key, bool repeat, bool pr
|
||||
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
case ACTION_MENU_UP:
|
||||
@@ -502,9 +502,6 @@ UIScene_InGameInfoMenu::PlayerInfo *UIScene_InGameInfoMenu::BuildPlayerInfo(INet
|
||||
#if defined __PS3__ || defined __PSVITA__
|
||||
int UIScene_InGameInfoMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
#ifdef DISABLE_PSN
|
||||
return 0;
|
||||
#else
|
||||
UIScene_InGameInfoMenu* pClass = (UIScene_InGameInfoMenu*)pParam;
|
||||
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
@@ -517,7 +514,6 @@ int UIScene_InGameInfoMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStora
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int UIScene_InGameInfoMenu::ViewInvites_SignInReturned(void *pParam,bool bContinue, int iPad)
|
||||
@@ -532,7 +528,7 @@ int UIScene_InGameInfoMenu::ViewInvites_SignInReturned(void *pParam,bool bContin
|
||||
#elif defined(__PS3__)
|
||||
int ret = sceNpBasicRecvMessageCustom(SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE, SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE, SYS_MEMORY_CONTAINER_ID_INVALID);
|
||||
app.DebugPrintf("sceNpBasicRecvMessageCustom return %d ( %08x )\n", ret, ret);
|
||||
#elif !defined(DISABLE_PSN) // __PSVITA__
|
||||
#else // __PSVITA__
|
||||
SQRNetworkManager_Vita::RecvInviteGUI();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ void UIScene_InGamePlayerOptionsMenu::handleInput(int iPad, int key, bool repeat
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
@@ -12,27 +12,27 @@ UIScene_Intro::UIScene_Intro(int iPad, void *initData, UILayer *parentLayer) : U
|
||||
|
||||
bool bSkipESRB = false;
|
||||
bool bChina = false;
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
bSkipESRB = app.GetProductSKU() != e_sku_SCEA;
|
||||
#elif defined(_XBOX) || defined(_DURANGO)
|
||||
#if (defined __PS3__ || __ORBIS__ || __PSVITA__)
|
||||
bSkipESRB = !app.IsAmericanSKU();
|
||||
#else
|
||||
bSkipESRB = !ProfileManager.LocaleIsUSorCanada();
|
||||
#endif
|
||||
|
||||
#ifdef _DURANGO
|
||||
#if (defined _DURANGO || _WINDOWS64)
|
||||
bChina = ProfileManager.LocaleIsChina();
|
||||
#endif
|
||||
// 4J Stu - These map to values in the Actionscript
|
||||
#ifdef _WINDOWS64
|
||||
int platformIdx = 0;
|
||||
#elif defined(_XBOX)
|
||||
#elif _XBOX
|
||||
int platformIdx = 1;
|
||||
#elif defined(_DURANGO)
|
||||
#elif _DURANGO
|
||||
int platformIdx = 2;
|
||||
#elif defined(__PS3__)
|
||||
#elif __PS3__
|
||||
int platformIdx = 3;
|
||||
#elif defined(__ORBIS__)
|
||||
#elif __ORBIS__
|
||||
int platformIdx = 4;
|
||||
#elif defined(__PSVITA__)
|
||||
#elif __PSVITA__
|
||||
int platformIdx = 5;
|
||||
#endif
|
||||
|
||||
@@ -67,7 +67,7 @@ void UIScene_Intro::handleInput(int iPad, int key, bool repeat, bool pressed, bo
|
||||
switch(key)
|
||||
{
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
if(!m_bIgnoreNavigate)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "..\..\MinecraftServer.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.level.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.h"
|
||||
#include "..\..\Common\Network\NetworkSocketLayer.h"
|
||||
|
||||
#define UPDATE_PLAYERS_TIMER_ID 0
|
||||
#define UPDATE_PLAYERS_TIMER_TIME 30000
|
||||
@@ -51,6 +50,7 @@ void UIScene_JoinMenu::tick()
|
||||
g_NetworkManager.GetFullFriendSessionInfo(m_selectedSession, &friendSessionUpdated, this);
|
||||
m_friendInfoRequestIssued = true;
|
||||
}
|
||||
|
||||
if( m_friendInfoUpdatedOK )
|
||||
{
|
||||
m_friendInfoUpdatedOK = false;
|
||||
@@ -59,7 +59,7 @@ void UIScene_JoinMenu::tick()
|
||||
|
||||
m_buttonListPlayers.init(eControl_GamePlayers);
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__)
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
|
||||
for( int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; i++ )
|
||||
{
|
||||
if( m_selectedSession->data.players[i] != NULL )
|
||||
@@ -105,21 +105,6 @@ void UIScene_JoinMenu::tick()
|
||||
break;
|
||||
}
|
||||
}
|
||||
#elif defined(_WINDOWS64) || defined(DISABLE_PSN)
|
||||
for( int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; i++ )
|
||||
{
|
||||
if( m_selectedSession->data.players[i] != 0 && m_selectedSession->data.szPlayers[i][0] != 0 )
|
||||
{
|
||||
string playerName(m_selectedSession->data.szPlayers[i], XUSER_NAME_SIZE);
|
||||
size_t end = playerName.find('\0');
|
||||
if (end != string::npos) playerName.resize(end);
|
||||
m_buttonListPlayers.addItem(playerName);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
m_labelLabels[eLabel_Difficulty].init(app.GetString(IDS_LABEL_DIFFICULTY));
|
||||
@@ -301,7 +286,7 @@ void UIScene_JoinMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
|
||||
}
|
||||
handled = true;
|
||||
break;
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
case ACTION_MENU_UP:
|
||||
@@ -368,15 +353,6 @@ void UIScene_JoinMenu::checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege,
|
||||
|
||||
void UIScene_JoinMenu::StartSharedLaunchFlow()
|
||||
{
|
||||
const bool bManualJoin = (g_MultiplayerJoin == true);
|
||||
if (bManualJoin)
|
||||
{
|
||||
JoinGame(this);
|
||||
return;
|
||||
}
|
||||
#if defined DISABLE_PSN
|
||||
JoinGame(this);
|
||||
#else
|
||||
if(!app.IsLocalMultiplayerAvailable())
|
||||
{
|
||||
JoinGame(this);
|
||||
@@ -395,17 +371,12 @@ void UIScene_JoinMenu::StartSharedLaunchFlow()
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int UIScene_JoinMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int iPad)
|
||||
{
|
||||
UIScene_JoinMenu* pClass = (UIScene_JoinMenu*)ui.GetSceneFromCallbackId((size_t)pParam);
|
||||
|
||||
#if defined DISABLE_PSN
|
||||
JoinGame(pClass);
|
||||
return 0;
|
||||
#else
|
||||
if(pClass)
|
||||
{
|
||||
if(bContinue==true)
|
||||
@@ -426,18 +397,11 @@ int UIScene_JoinMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Shared function to join the game that is the same whether we used the sign-in UI or not
|
||||
void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
|
||||
{
|
||||
if (pClass == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
const bool bManualJoin = (g_MultiplayerJoin == true);
|
||||
|
||||
DWORD dwSignedInUsers = 0;
|
||||
bool noPrivileges = false;
|
||||
DWORD dwLocalUsersMask = 0;
|
||||
@@ -445,14 +409,10 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
|
||||
int iPadNotSignedInLive = -1;
|
||||
|
||||
ProfileManager.SetLockedProfile(0); // TEMP!
|
||||
if (bManualJoin)
|
||||
{
|
||||
isSignedInLive = true;
|
||||
}
|
||||
|
||||
// If we're in SD mode, then only the primary player gets to play
|
||||
if (app.IsLocalMultiplayerAvailable())
|
||||
{
|
||||
{
|
||||
for(unsigned int index = 0; index < XUSER_MAX_COUNT; ++index)
|
||||
{
|
||||
if(ProfileManager.IsSignedIn(index))
|
||||
@@ -463,7 +423,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
|
||||
iPadNotSignedInLive = index;
|
||||
}
|
||||
|
||||
if( !bManualJoin && !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true;
|
||||
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(index);
|
||||
isSignedInLive = isSignedInLive && ProfileManager.IsSignedInLive(index);
|
||||
}
|
||||
@@ -473,13 +433,11 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
|
||||
{
|
||||
if(ProfileManager.IsSignedIn(ProfileManager.GetPrimaryPad()))
|
||||
{
|
||||
if( !bManualJoin && !ProfileManager.AllowedToPlayMultiplayer(ProfileManager.GetPrimaryPad()) ) noPrivileges = true;
|
||||
if( !ProfileManager.AllowedToPlayMultiplayer(ProfileManager.GetPrimaryPad()) ) noPrivileges = true;
|
||||
dwLocalUsersMask |= CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad());
|
||||
|
||||
#ifndef DISABLE_PSN
|
||||
isSignedInLive = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad());
|
||||
#endif
|
||||
#if !defined DISABLE_PSN && defined __PSVITA__
|
||||
#ifdef __PSVITA__
|
||||
if(CGameNetworkManager::usingAdhocMode() && SQRNetworkManager_AdHoc_Vita::GetAdhocStatus())
|
||||
isSignedInLive = true;
|
||||
#endif
|
||||
@@ -488,7 +446,7 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
|
||||
}
|
||||
|
||||
// If this is an online game but not all players are signed in to Live, stop!
|
||||
if (!bManualJoin && !isSignedInLive)
|
||||
if (!isSignedInLive)
|
||||
{
|
||||
#ifdef __ORBIS__
|
||||
// Check if PSN is unavailable because of age restriction
|
||||
@@ -517,23 +475,15 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
|
||||
BOOL pccAllowed = TRUE;
|
||||
BOOL pccFriendsAllowed = TRUE;
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__PSVITA__))
|
||||
if(!bManualJoin && isSignedInLive)
|
||||
#if defined(__PS3__) || defined(__PSVITA__)
|
||||
if(isSignedInLive)
|
||||
{
|
||||
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&noUGC,NULL,NULL);
|
||||
}
|
||||
#else
|
||||
if(!bManualJoin)
|
||||
{
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
}
|
||||
ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed);
|
||||
if(!pccAllowed && !pccFriendsAllowed) noUGC = true;
|
||||
#endif
|
||||
if (bManualJoin)
|
||||
{
|
||||
noUGC = false;
|
||||
noPrivileges = false;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __PSVITA__
|
||||
@@ -563,16 +513,13 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
|
||||
ui.RequestErrorMessage( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad());
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
#if defined(__ORBIS__) || defined(__PSVITA__)
|
||||
if(!bManualJoin)
|
||||
bool chatRestricted = false;
|
||||
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,NULL,NULL);
|
||||
if(chatRestricted)
|
||||
{
|
||||
bool chatRestricted = false;
|
||||
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,NULL,NULL);
|
||||
if(chatRestricted)
|
||||
{
|
||||
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, ProfileManager.GetPrimaryPad() );
|
||||
}
|
||||
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, ProfileManager.GetPrimaryPad() );
|
||||
}
|
||||
#endif
|
||||
CGameNetworkManager::eJoinGameResult result = g_NetworkManager.JoinGame( pClass->m_selectedSession, dwLocalUsersMask );
|
||||
@@ -582,7 +529,6 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
|
||||
|
||||
if( result != CGameNetworkManager::JOINGAME_SUCCESS )
|
||||
{
|
||||
pClass->m_bIgnoreInput = false;
|
||||
int exitReasonStringId = -1;
|
||||
switch(result)
|
||||
{
|
||||
@@ -605,21 +551,6 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
|
||||
ui.NavigateToHomeMenu();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadingInputParams *loadingParams = new LoadingInputParams();
|
||||
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
|
||||
loadingParams->lpParam = NULL;
|
||||
|
||||
UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData();
|
||||
completionData->bShowBackground = TRUE;
|
||||
completionData->bShowLogo = TRUE;
|
||||
completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes;
|
||||
completionData->iPad = DEFAULT_XUI_MENU_USER;
|
||||
loadingParams->completionData = completionData;
|
||||
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_FullscreenProgress, loadingParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -664,31 +595,7 @@ void UIScene_JoinMenu::handleTimerComplete(int id)
|
||||
playersList.SetCurSel(selectedIndex);
|
||||
}
|
||||
#endif
|
||||
#if defined(_WINDOWS64) || defined(DISABLE_PSN)
|
||||
{
|
||||
bool success = g_NetworkManager.GetGameSessionInfo(m_iPad, m_selectedSession->sessionId, m_selectedSession);
|
||||
if (success)
|
||||
{
|
||||
m_buttonListPlayers.clearList();
|
||||
for (unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i)
|
||||
{
|
||||
if (m_selectedSession->data.players[i] != 0 && m_selectedSession->data.szPlayers[i][0] != 0)
|
||||
{
|
||||
string playerName(m_selectedSession->data.szPlayers[i], XUSER_NAME_SIZE);
|
||||
size_t end = playerName.find('\0');
|
||||
if (end != string::npos) playerName.resize(end);
|
||||
m_buttonListPlayers.addItem(playerName);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
addTimer(UPDATE_PLAYERS_TIMER_ID, UPDATE_PLAYERS_TIMER_TIME);
|
||||
}
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ void UIScene_LanguageSelector::handleInput(int iPad, int key, bool repeat, bool
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
@@ -271,7 +271,7 @@ void UIScene_LaunchMoreOptionsMenu::handleInput(int iPad, int key, bool repeat,
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
// 4J-JEV: Inform user why their game must be offline.
|
||||
|
||||
@@ -731,7 +731,7 @@ void UIScene_LeaderboardsMenu::CopyLeaderboardEntry(LeaderboardManager::ReadScor
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(DISABLE_PSN) && defined(__PS3__)
|
||||
#ifdef __PS3__
|
||||
// m_name can be unicode characters somehow for Japan - should use m_onlineID
|
||||
wstring wstr=convStringToWstring(statsRow->m_uid.getOnlineID());
|
||||
swprintf(leaderboardEntry->m_gamerTag, XUSER_NAME_SIZE, L"%ls",wstr.c_str());
|
||||
|
||||
@@ -642,7 +642,7 @@ void UIScene_LoadMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
|
||||
@@ -879,7 +879,6 @@ void UIScene_LoadMenu::StartSharedLaunchFlow()
|
||||
app.SetGameHostOption(eGameHostOption_DisableSaving, m_MoreOptionsParams.bDisableSaving?1:0);
|
||||
StorageManager.SetSaveDisabled(m_MoreOptionsParams.bDisableSaving);
|
||||
|
||||
#ifdef _LARGE_WORLDS
|
||||
int newWorldSize = 0;
|
||||
int newHellScale = 0;
|
||||
switch(m_MoreOptionsParams.newWorldSize)
|
||||
@@ -912,7 +911,6 @@ void UIScene_LoadMenu::StartSharedLaunchFlow()
|
||||
app.SetGameNewWorldSize(newWorldSize, bUseMoat);
|
||||
app.SetGameNewHellScale(newHellScale);
|
||||
app.SetGameHostOption(eGameHostOption_WorldSize, m_MoreOptionsParams.newWorldSize);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1449,12 +1447,7 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
|
||||
#ifndef _WINDOWS64
|
||||
else
|
||||
{
|
||||
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
|
||||
DWORD dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad());
|
||||
StartGameFromSave(pClass, dwLocalUsersMask);
|
||||
#else
|
||||
pClass->m_bRequestQuadrantSignin = true;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1561,7 +1554,7 @@ void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocal
|
||||
}
|
||||
|
||||
bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame;
|
||||
#if !defined DISABLE_PSN && defined __PSVITA__
|
||||
#ifdef __PSVITA__
|
||||
if(CGameNetworkManager::usingAdhocMode())
|
||||
{
|
||||
if(SQRNetworkManager_AdHoc_Vita::GetAdhocStatus())// && pClass->m_MoreOptionsParams.bOnlineGame)
|
||||
@@ -1795,20 +1788,17 @@ void UIScene_LoadMenu::handleGainFocus(bool navBack)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined __ORBIS__
|
||||
#ifdef __ORBIS__
|
||||
int UIScene_LoadMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
UIScene_LoadMenu* pClass = (UIScene_LoadMenu *)pParam;
|
||||
pClass->m_bIgnoreInput = false;
|
||||
|
||||
#ifdef DISABLE_PSN
|
||||
UIScene_LoadMenu::StartGame_SignInReturned(pParam, true, iPad);
|
||||
#else
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_LoadMenu::StartGame_SignInReturned, pClass, false, iPad);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "..\..\TexturePackRepository.h"
|
||||
#include "..\..\TexturePack.h"
|
||||
#include "..\Network\SessionInfo.h"
|
||||
#include "..\..\Common\Network\NetworkSocketLayer.h"
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#include "Common\Network\Sony\SonyHttp.h"
|
||||
#include "Common\Network\Sony\SonyRemoteStorage.h"
|
||||
@@ -116,7 +115,10 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer
|
||||
|
||||
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
m_spaceIndicatorSaves.init(L"",eControl_SpaceIndicator,0, (4LL *1024LL * 1024LL * 1024LL) );
|
||||
if(ui.getScreenWidth() >= 1920)
|
||||
{
|
||||
m_spaceIndicatorSaves.init(L"",eControl_SpaceIndicator,0, (4LL *1024LL * 1024LL * 1024LL) );
|
||||
}
|
||||
#endif
|
||||
m_bUpdateSaveSize = false;
|
||||
|
||||
@@ -162,7 +164,7 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) || defined(_DURANGO)
|
||||
#if (defined __PS3__ || __ORBIS__ || __PSVITA__ || _DURANGO || _WINDOWS64)
|
||||
// Always clear the saves when we enter this menu
|
||||
StorageManager.ClearSavesInfo();
|
||||
#endif
|
||||
@@ -183,7 +185,7 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer
|
||||
|
||||
Initialise();
|
||||
|
||||
#if !defined DISABLE_PSN && defined __PSVITA__
|
||||
#ifdef __PSVITA__
|
||||
if(CGameNetworkManager::usingAdhocMode() && SQRNetworkManager_AdHoc_Vita::GetAdhocStatus())
|
||||
{
|
||||
g_NetworkManager.startAdhocMatching(); // create the client matching context and clear out the friends list
|
||||
@@ -292,7 +294,13 @@ UIScene_LoadOrJoinMenu::~UIScene_LoadOrJoinMenu()
|
||||
g_NetworkManager.SetSessionsUpdatedCallback( NULL, NULL );
|
||||
app.SetLiveLinkRequired( false );
|
||||
|
||||
delete m_currentSessions;
|
||||
if(m_currentSessions)
|
||||
{
|
||||
for(AUTO_VAR(it, m_currentSessions->begin()); it < m_currentSessions->end(); ++it)
|
||||
{
|
||||
delete (*it);
|
||||
}
|
||||
}
|
||||
|
||||
#if TO_BE_IMPLEMENTED
|
||||
// Reset the background downloading, in case we changed it by attempting to download a texture pack
|
||||
@@ -413,8 +421,6 @@ void UIScene_LoadOrJoinMenu::Initialise()
|
||||
m_iDefaultButtonsC = 0;
|
||||
m_iMashUpButtonsC=0;
|
||||
|
||||
m_iServerDefaultButtonsC = 0;
|
||||
|
||||
// Check if we're in the trial version
|
||||
if(ProfileManager.IsFullVersion()==false)
|
||||
{
|
||||
@@ -582,7 +588,7 @@ void UIScene_LoadOrJoinMenu::tick()
|
||||
m_bSaveTransferRunning = false;
|
||||
#endif
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
if(m_bUpdateSaveSize)
|
||||
if(m_bUpdateSaveSize && ui.getScreenWidth() >= 1920)
|
||||
{
|
||||
if((m_iDefaultButtonsC > 0) && (m_iSaveListIndex >= m_iDefaultButtonsC))
|
||||
{
|
||||
@@ -603,7 +609,10 @@ void UIScene_LoadOrJoinMenu::tick()
|
||||
{
|
||||
//CD - Fix - Adding define for ORBIS/XBOXONE
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
m_spaceIndicatorSaves.reset();
|
||||
if(ui.getScreenWidth() >= 1920)
|
||||
{
|
||||
m_spaceIndicatorSaves.reset();
|
||||
}
|
||||
#endif
|
||||
|
||||
AddDefaultButtons();
|
||||
@@ -631,25 +640,28 @@ void UIScene_LoadOrJoinMenu::tick()
|
||||
#elif defined(__ORBIS__)
|
||||
m_spaceIndicatorSaves.addSave(m_pSaveDetails->SaveInfoA[i].blocksUsed * (32 * 1024) );
|
||||
#elif defined(_WINDOWS64)
|
||||
ZeroMemory(m_saveDetails[i].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH);
|
||||
memcpy(m_saveDetails[i].UTF8SaveFilename, m_pSaveDetails->SaveInfoA[i].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1);
|
||||
wstring folderPath = wstring(L"Windows64\\GameHDD\\") + app.UTF8ToWide(m_saveDetails[i].UTF8SaveFilename) + L"\\*";
|
||||
if(ui.getScreenWidth() >= 1920)
|
||||
{
|
||||
ZeroMemory(m_saveDetails[i].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH);
|
||||
memcpy(m_saveDetails[i].UTF8SaveFilename, m_pSaveDetails->SaveInfoA[i].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1);
|
||||
wstring folderPath = wstring(L"Windows64\\GameHDD\\") + app.UTF8ToWide(m_saveDetails[i].UTF8SaveFilename) + L"\\*";
|
||||
|
||||
DWORD fileSize = 0;
|
||||
WIN32_FIND_DATAW findData;
|
||||
HANDLE hFile = FindFirstFileW(folderPath.c_str(), &findData);
|
||||
DWORD fileSize = 0;
|
||||
WIN32_FIND_DATAW findData;
|
||||
HANDLE hFile = FindFirstFileW(folderPath.c_str(), &findData);
|
||||
|
||||
if (hFile != INVALID_HANDLE_VALUE) {
|
||||
do {
|
||||
if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
fileSize = findData.nFileSizeLow;
|
||||
break;
|
||||
}
|
||||
} while (FindNextFileW(hFile, &findData));
|
||||
FindClose(hFile);
|
||||
}
|
||||
m_spaceIndicatorSaves.addSave(fileSize);
|
||||
if (hFile != INVALID_HANDLE_VALUE) {
|
||||
do {
|
||||
if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
fileSize = findData.nFileSizeLow;
|
||||
break;
|
||||
}
|
||||
} while (FindNextFileW(hFile, &findData));
|
||||
FindClose(hFile);
|
||||
}
|
||||
m_spaceIndicatorSaves.addSave(fileSize);
|
||||
}
|
||||
#endif
|
||||
#ifdef _DURANGO
|
||||
m_buttonListSaves.addItem(m_pSaveDetails->SaveInfoA[i].UTF16SaveTitle, L"");
|
||||
@@ -937,13 +949,8 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons()
|
||||
m_iMashUpButtonsC=0;
|
||||
m_generators.clear();
|
||||
|
||||
m_iServerDefaultButtonsC = 0;
|
||||
m_buttonListSaves.addItem(app.GetString(IDS_CREATE_NEW_WORLD));
|
||||
|
||||
// hard-coded FOR NOW!
|
||||
m_buttonListGames.addItem(L"Add Server");
|
||||
m_iDefaultButtonsC++;
|
||||
m_iServerDefaultButtonsC++;
|
||||
|
||||
int i = 0;
|
||||
|
||||
@@ -1042,7 +1049,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr
|
||||
#endif
|
||||
break;
|
||||
case ACTION_MENU_Y:
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__PSVITA__) || defined(__ORBIS__))
|
||||
#if defined(__PS3__) || defined(__PSVITA__) || defined(__ORBIS__)
|
||||
m_eAction = eAction_ViewInvites;
|
||||
if(pressed && iPad == ProfileManager.GetPrimaryPad())
|
||||
{
|
||||
@@ -1202,7 +1209,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr
|
||||
break;
|
||||
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
case ACTION_MENU_UP:
|
||||
@@ -1398,60 +1405,36 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId)
|
||||
//CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
int nIndex = (int)childId;
|
||||
if(nIndex == ADD_SERVER_BUTTON_INDEX)
|
||||
{
|
||||
InputManager.RequestKeyboard(app.GetString(IDS_SIGN_TITLE),L"192.168.",(DWORD)m_iPad,15,&UIScene_LoadOrJoinMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_IP_Address);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_iGameListIndex = nIndex - m_iServerDefaultButtonsC;
|
||||
CheckAndJoinGame(nIndex - m_iServerDefaultButtonsC);
|
||||
int nIndex = (int)childId;
|
||||
m_iGameListIndex = nIndex;
|
||||
CheckAndJoinGame(nIndex);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
|
||||
{
|
||||
// 4J HEG - No reason to set value if keyboard was cancelled
|
||||
UIScene_LoadOrJoinMenu *pClass=(UIScene_LoadOrJoinMenu *)lpParam;
|
||||
pClass->m_bIgnoreInput = false;
|
||||
if (bRes)
|
||||
{
|
||||
uint16_t pchText[128];
|
||||
ZeroMemory(pchText, 128 * sizeof(uint16_t) );
|
||||
InputManager.GetText(pchText);
|
||||
|
||||
CGameNetworkManager::AddServer((const wchar_t *)pchText, NETWORK_LAN_DEFAULT_PORT, (const wchar_t *)pchText);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
|
||||
{
|
||||
if( m_buttonListGames.getItemCount() > 0 && gameIndex < m_currentSessions->size() )
|
||||
{
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
const bool bManualJoin = (g_MultiplayerJoin == true);
|
||||
// 4J-PB - is the player allowed to join games?
|
||||
bool noUGC=false;
|
||||
bool bContentRestricted=false;
|
||||
|
||||
// A direct LAN join should probnot use PSN matchmaking or account privileges (nansess)
|
||||
if(!bManualJoin)
|
||||
{
|
||||
ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&noUGC,&bContentRestricted,NULL);
|
||||
}
|
||||
// we're online, since we are joining a game
|
||||
ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&noUGC,&bContentRestricted,NULL);
|
||||
|
||||
#ifdef __ORBIS__
|
||||
// 4J Stu - On PS4 we don't restrict playing multiplayer based on chat restriction, so remove this check
|
||||
noUGC = false;
|
||||
|
||||
bool bPlayStationPlus=true;
|
||||
int iPadWithNoPlaystationPlus=-1;
|
||||
bool isSignedInLive = true;
|
||||
int iPadWithNoPlaystationPlus=0;
|
||||
bool isSignedInLive = true;
|
||||
int iPadNotSignedInLive = -1;
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
|
||||
{
|
||||
@@ -1467,7 +1450,6 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
|
||||
if(ProfileManager.HasPlayStationPlus(i)==false)
|
||||
{
|
||||
bPlayStationPlus=false;
|
||||
iPadWithNoPlaystationPlus = (int)i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1481,7 +1463,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
|
||||
}
|
||||
#endif
|
||||
|
||||
if(!bManualJoin && noUGC)
|
||||
if(noUGC)
|
||||
{
|
||||
// not allowed to join
|
||||
#ifndef __PSVITA__
|
||||
@@ -1497,7 +1479,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
|
||||
m_bIgnoreInput=false;
|
||||
return;
|
||||
}
|
||||
else if(!bManualJoin && bContentRestricted)
|
||||
else if(bContentRestricted)
|
||||
{
|
||||
ui.RequestContentRestrictedMessageBox();
|
||||
|
||||
@@ -1506,7 +1488,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
|
||||
}
|
||||
#ifdef __ORBIS__
|
||||
// If this is an online game but not all players are signed in to Live, stop!
|
||||
else if (!bManualJoin && !isSignedInLive)
|
||||
else if (!isSignedInLive)
|
||||
{
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_CONFIRM_OK;
|
||||
@@ -1525,7 +1507,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if(!bManualJoin && bPlayStationPlus==false)
|
||||
else if(bPlayStationPlus==false)
|
||||
{
|
||||
|
||||
if(ProfileManager.RequestingPlaystationPlus(iPadWithNoPlaystationPlus))
|
||||
@@ -1534,7 +1516,6 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_OK;
|
||||
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL);
|
||||
m_bIgnoreInput=false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1607,7 +1588,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex)
|
||||
return;
|
||||
}
|
||||
|
||||
#if !defined DISABLE_PSN && defined __PSVITA__
|
||||
#ifdef __PSVITA__
|
||||
if(CGameNetworkManager::usingAdhocMode() && !SQRNetworkManager_AdHoc_Vita::GetAdhocStatus())
|
||||
{
|
||||
// not connected to adhoc anymore, must have connected back to PSN to buy texture pack so sign in again
|
||||
@@ -1645,7 +1626,7 @@ void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions *levelGen)
|
||||
bool isClientSide = false;
|
||||
bool isPrivate = false;
|
||||
// TODO int maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
int maxPlayers = MINECRAFT_NET_MAX_PLAYERS;
|
||||
int maxPlayers = 8;
|
||||
|
||||
if( app.GetTutorialMode() )
|
||||
{
|
||||
@@ -1713,14 +1694,10 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
|
||||
|
||||
|
||||
FriendSessionInfo *pSelectedSession = NULL;
|
||||
unsigned int nIndex = 0;
|
||||
if(DoesGamesListHaveFocus() && (m_buttonListGames.getItemCount() - m_iServerDefaultButtonsC) > 0)
|
||||
if(DoesGamesListHaveFocus() && m_buttonListGames.getItemCount() > 0)
|
||||
{
|
||||
nIndex = m_buttonListGames.getCurrentSelection();
|
||||
if (nIndex >= m_iServerDefaultButtonsC)
|
||||
{
|
||||
pSelectedSession = m_currentSessions->at( nIndex - m_iServerDefaultButtonsC );
|
||||
}
|
||||
unsigned int nIndex = m_buttonListGames.getCurrentSelection();
|
||||
pSelectedSession = m_currentSessions->at( nIndex );
|
||||
}
|
||||
|
||||
SessionID selectedSessionId;
|
||||
@@ -1745,7 +1722,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
|
||||
|
||||
BOOL gamesListHasFocus = DoesGamesListHaveFocus();
|
||||
|
||||
if(filteredListSize > 0 || m_iServerDefaultButtonsC > 0)
|
||||
if(filteredListSize > 0)
|
||||
{
|
||||
#if TO_BE_IMPLEMENTED
|
||||
if( !m_pGamesList->IsEnabled() )
|
||||
@@ -1773,24 +1750,11 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
|
||||
// clear out the games list and re-fill
|
||||
m_buttonListGames.clearList();
|
||||
|
||||
m_iServerDefaultButtonsC = 0;
|
||||
m_buttonListGames.addItem(app.GetString(IDS_ACTION_BAN_LEVEL_TITLE));
|
||||
m_iServerDefaultButtonsC++;
|
||||
|
||||
if( filteredListSize > 0 )
|
||||
if( filteredListSize > 0 )
|
||||
{
|
||||
// Reset the focus to the selected session if it still exists
|
||||
unsigned int sessionIndex = 0;
|
||||
|
||||
if (DoesGamesListHaveFocus())
|
||||
{
|
||||
m_buttonListGames.setCurrentSelection( 0 );
|
||||
|
||||
if (nIndex >= m_iServerDefaultButtonsC)
|
||||
{
|
||||
m_buttonListGames.setCurrentSelection( nIndex );
|
||||
}
|
||||
}
|
||||
m_buttonListGames.setCurrentSelection(0);
|
||||
|
||||
for( AUTO_VAR(it, m_currentSessions->begin()); it < m_currentSessions->end(); ++it)
|
||||
{
|
||||
@@ -1851,9 +1815,9 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList()
|
||||
|
||||
m_buttonListGames.addItem( sessionInfo->displayLabel, textureName );
|
||||
|
||||
if(memcmp( &selectedSessionId, &sessionInfo->sessionId, sizeof(SessionID) ) == 0 && DoesGamesListHaveFocus())
|
||||
if(memcmp( &selectedSessionId, &sessionInfo->sessionId, sizeof(SessionID) ) == 0)
|
||||
{
|
||||
m_buttonListGames.setCurrentSelection(sessionIndex + m_iServerDefaultButtonsC);
|
||||
m_buttonListGames.setCurrentSelection(sessionIndex);
|
||||
break;
|
||||
}
|
||||
++sessionIndex;
|
||||
@@ -2297,9 +2261,6 @@ int UIScene_LoadOrJoinMenu::MustSignInTexturePack(void *pParam,int iPad,C4JStora
|
||||
{
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
|
||||
|
||||
#ifdef DISABLE_PSN
|
||||
UIScene_LoadOrJoinMenu::MustSignInReturnedTexturePack(pClass, true, iPad);
|
||||
#else
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
SQRNetworkManager_Vita::AttemptPSNSignIn(&UIScene_LoadOrJoinMenu::MustSignInReturnedTexturePack, pClass);
|
||||
@@ -2309,7 +2270,6 @@ int UIScene_LoadOrJoinMenu::MustSignInTexturePack(void *pParam,int iPad,C4JStora
|
||||
pClass->m_bIgnoreInput = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2455,9 +2415,6 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS
|
||||
#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__
|
||||
int UIScene_LoadOrJoinMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
#ifdef DISABLE_PSN
|
||||
return 0;
|
||||
#else
|
||||
UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam;
|
||||
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
@@ -2476,7 +2433,6 @@ int UIScene_LoadOrJoinMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStora
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int UIScene_LoadOrJoinMenu::PSN_SignInReturned(void *pParam,bool bContinue, int iPad)
|
||||
@@ -2490,7 +2446,6 @@ int UIScene_LoadOrJoinMenu::PSN_SignInReturned(void *pParam,bool bContinue, int
|
||||
// Check if we're signed in to LIVE
|
||||
if(ProfileManager.IsSignedInLive(iPad))
|
||||
{
|
||||
#ifndef DISABLE_PSN
|
||||
#if defined(__PS3__)
|
||||
int ret = sceNpBasicRecvMessageCustom(SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE, SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE, SYS_MEMORY_CONTAINER_ID_INVALID);
|
||||
app.DebugPrintf("sceNpBasicRecvMessageCustom return %d ( %08x )\n", ret, ret);
|
||||
@@ -2498,7 +2453,6 @@ int UIScene_LoadOrJoinMenu::PSN_SignInReturned(void *pParam,bool bContinue, int
|
||||
SQRNetworkManager_Vita::RecvInviteGUI();
|
||||
#else
|
||||
SQRNetworkManager_Orbis::RecvInviteGUI();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -43,7 +43,6 @@ private:
|
||||
eActions m_eAction;
|
||||
|
||||
static const int JOIN_LOAD_CREATE_BUTTON_INDEX = 0;
|
||||
static const int ADD_SERVER_BUTTON_INDEX = 0;
|
||||
|
||||
SaveListDetails *m_saveDetails;
|
||||
int m_iSaveDetailsCount;
|
||||
@@ -74,7 +73,6 @@ private:
|
||||
#endif
|
||||
UI_END_MAP_ELEMENTS_AND_NAMES()
|
||||
|
||||
int m_iServerDefaultButtonsC;
|
||||
int m_iDefaultButtonsC;
|
||||
int m_iMashUpButtonsC;
|
||||
int m_iState;
|
||||
@@ -169,7 +167,6 @@ protected:
|
||||
void LoadSaveFromCloud();
|
||||
#endif
|
||||
public:
|
||||
static int KeyboardCompleteCallback(LPVOID lpParam,bool bRes);
|
||||
virtual void HandleDLCMountingComplete();
|
||||
|
||||
#ifdef __ORBIS__
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include "UIScene_MainMenu.h"
|
||||
#ifdef __ORBIS__
|
||||
#include <error_dialog.h>
|
||||
#include "..\..\Common\Network\NetworkSocketLayer.h"
|
||||
#endif
|
||||
|
||||
Random *UIScene_MainMenu::random = new Random();
|
||||
@@ -238,8 +237,7 @@ void UIScene_MainMenu::handleReload()
|
||||
removeControl( &m_buttons[(int)eControl_Exit], false );
|
||||
// We don't have a way to display trophies/achievements, so remove the button
|
||||
removeControl( &m_buttons[(int)eControl_Achievements], false );
|
||||
#endif
|
||||
#ifdef _DURANGO
|
||||
#elif _DURANGO
|
||||
// Allowed to not have achievements in the menu
|
||||
removeControl( &m_buttons[(int)eControl_Achievements], false );
|
||||
#endif
|
||||
@@ -251,7 +249,7 @@ void UIScene_MainMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
|
||||
|
||||
if ( m_bIgnorePress || (eNavigateWhenReady >= 0) ) return;
|
||||
|
||||
#if defined (__ORBIS__) || defined (__PSVITA__)
|
||||
#if (defined __ORBIS__ || __PSVITA__ || _WINDOWS64)
|
||||
// ignore all players except player 0 - it's their profile that is currently being used
|
||||
if(iPad!=0) return;
|
||||
#endif
|
||||
@@ -261,7 +259,7 @@ void UIScene_MainMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
|
||||
switch(key)
|
||||
{
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
if(pressed)
|
||||
@@ -279,8 +277,7 @@ void UIScene_MainMenu::handleInput(int iPad, int key, bool repeat, bool pressed,
|
||||
ProfileManager.RequestSignInUI(false, false, false, false, false, ChooseUser_SignInReturned, this, iPad);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef __PSVITA__
|
||||
#elif __PSVITA__
|
||||
case ACTION_MENU_X:
|
||||
if(pressed && ProfileManager.IsFullVersion())
|
||||
{
|
||||
@@ -319,16 +316,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
|
||||
//CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
if(g_MultiplayerJoin)
|
||||
{
|
||||
// request only completes after the platform network timeout.
|
||||
// this needs to be done before hand or else the PS4 crashes ill need to look more into this
|
||||
CreateLoad_SignInReturned(this, true, primaryPad);
|
||||
}
|
||||
else
|
||||
{
|
||||
ProfileManager.RefreshChatAndContentRestrictions(RefreshChatAndContentRestrictionsReturned_PlayGame, this);
|
||||
}
|
||||
ProfileManager.RefreshChatAndContentRestrictions(RefreshChatAndContentRestrictionsReturned_PlayGame, this);
|
||||
}
|
||||
#else
|
||||
m_eAction=eAction_RunGame;
|
||||
@@ -383,10 +371,6 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
|
||||
ui.NavigateToScene(primaryPad,eUIScene_TrialExitUpsell);
|
||||
}
|
||||
break;
|
||||
#elif defined _WINDOWS64
|
||||
case eControl_Exit:
|
||||
app.ExitGame();
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef _DURANGO
|
||||
@@ -561,7 +545,6 @@ int UIScene_MainMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EM
|
||||
{
|
||||
UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam;
|
||||
|
||||
#ifndef DISABLE_PSN
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
#ifdef __PS3__
|
||||
@@ -578,7 +561,7 @@ int UIScene_MainMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EM
|
||||
SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_MainMenu::UnlockFullGame_SignInReturned, pClass);
|
||||
break;
|
||||
}
|
||||
#elif defined __PSVITA__
|
||||
#elif __PSVITA__
|
||||
switch(pClass->m_eAction)
|
||||
{
|
||||
case eAction_RunLeaderboardsPSN:
|
||||
@@ -641,9 +624,6 @@ int UIScene_MainMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EM
|
||||
pClass->m_bIgnorePress=false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
CreateLoad_SignInReturned(pClass, true, 0);
|
||||
pClass->m_bIgnorePress=false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -751,7 +731,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in
|
||||
if(ProfileManager.IsFullVersion())
|
||||
{
|
||||
bool bSignedInLive = ProfileManager.IsSignedInLive(iPad);
|
||||
#if !defined DISABLE_PSN && defined __PSVITA__
|
||||
#ifdef __PSVITA__
|
||||
if(CGameNetworkManager::usingAdhocMode())
|
||||
{
|
||||
if(SQRNetworkManager_AdHoc_Vita::GetAdhocStatus())
|
||||
@@ -1107,12 +1087,6 @@ void UIScene_MainMenu::RefreshChatAndContentRestrictionsReturned_PlayGame(void *
|
||||
int primaryPad = ProfileManager.GetPrimaryPad();
|
||||
|
||||
UIScene_MainMenu* pClass = (UIScene_MainMenu*)pParam;
|
||||
const bool bManualJoin = (g_MultiplayerJoin == true);
|
||||
if (bManualJoin)
|
||||
{
|
||||
CreateLoad_SignInReturned(pClass, true, primaryPad);
|
||||
return;
|
||||
}
|
||||
|
||||
int (*signInReturnedFunc) (LPVOID,const bool, const int iPad) = NULL;
|
||||
|
||||
@@ -1342,7 +1316,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad)
|
||||
{
|
||||
// are we offline?
|
||||
bool bSignedInLive = ProfileManager.IsSignedInLive(iPad);
|
||||
#if !defined DISABLE_PSN && defined __PSVITA__
|
||||
#ifdef __PSVITA__
|
||||
if(app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_PSVita_NetworkModeAdhoc) == true)
|
||||
{
|
||||
CGameNetworkManager::setAdhocMode(true);
|
||||
|
||||
@@ -104,7 +104,7 @@ void UIScene_MessageBox::handleInput(int iPad, int key, bool repeat, bool presse
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
@@ -83,7 +83,7 @@ void UIScene_NewUpdateMessage::handleInput(int iPad, int key, bool repeat, bool
|
||||
ui.NavigateBack(m_iPad);
|
||||
}
|
||||
break;
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
case ACTION_MENU_OK:
|
||||
|
||||
@@ -94,7 +94,7 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void *initData, UILayer *parentLa
|
||||
|
||||
if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 )
|
||||
{
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)TRUE);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)TRUE);
|
||||
}
|
||||
|
||||
TelemetryManager->RecordMenuShown(m_iPad, eUIScene_PauseMenu, 0);
|
||||
@@ -367,7 +367,7 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed
|
||||
|
||||
if( iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() )
|
||||
{
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE);
|
||||
}
|
||||
|
||||
ui.PlayUISFX(eSFX_Back);
|
||||
@@ -379,7 +379,7 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
case ACTION_MENU_UP:
|
||||
@@ -409,7 +409,7 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed
|
||||
case ACTION_MENU_Y:
|
||||
{
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__))
|
||||
#if defined(__PS3__) || defined(__ORBIS__)
|
||||
if(pressed && iPad == ProfileManager.GetPrimaryPad())
|
||||
{
|
||||
#ifdef __ORBIS__
|
||||
@@ -473,7 +473,7 @@ void UIScene_PauseMenu::handleInput(int iPad, int key, bool repeat, bool pressed
|
||||
bool bCanScreenshot = true;
|
||||
for(int j=0; j < XUSER_MAX_COUNT;++j)
|
||||
{
|
||||
if(app.GetXuiAction(j) == eAppAction_SocialPostScreenshot)
|
||||
if(app.GetUIAction(j) == eAppAction_SocialPostScreenshot)
|
||||
{
|
||||
bCanScreenshot = false;
|
||||
break;
|
||||
@@ -511,7 +511,7 @@ void UIScene_PauseMenu::handlePress(F64 controlId, F64 childId)
|
||||
case BUTTON_PAUSE_RESUMEGAME:
|
||||
if( m_iPad == ProfileManager.GetPrimaryPad() && g_NetworkManager.IsLocalGame() )
|
||||
{
|
||||
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE);
|
||||
app.SetUIServerAction(ProfileManager.GetPrimaryPad(),eUIServerAction_PauseServer,(void *)FALSE);
|
||||
}
|
||||
navigateBack();
|
||||
break;
|
||||
@@ -1029,9 +1029,6 @@ int UIScene_PauseMenu::BanGameDialogReturned(void *pParam,int iPad,C4JStorage::E
|
||||
#if defined(__PS3__) || defined (__PSVITA__) || defined(__ORBIS__)
|
||||
int UIScene_PauseMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
#ifdef DISABLE_PSN
|
||||
return 0;
|
||||
#else
|
||||
UIScene_PauseMenu* pClass = (UIScene_PauseMenu*)ui.GetSceneFromCallbackId((size_t)pParam);
|
||||
if(result==C4JStorage::EMessage_ResultAccept && pClass)
|
||||
{
|
||||
@@ -1094,7 +1091,6 @@ int UIScene_PauseMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::E
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int UIScene_PauseMenu::ViewLeaderboards_SignInReturned(void *pParam,bool bContinue, int iPad)
|
||||
@@ -1135,9 +1131,6 @@ int UIScene_PauseMenu::ViewLeaderboards_SignInReturned(void *pParam,bool bContin
|
||||
|
||||
int UIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
#ifdef DISABLE_PSN
|
||||
return 0;
|
||||
#else
|
||||
UIScene_PauseMenu* pClass = (UIScene_PauseMenu*)ui.GetSceneFromCallbackId((size_t)pParam);
|
||||
|
||||
#ifdef __ORBIS__
|
||||
@@ -1251,7 +1244,7 @@ int UIScene_PauseMenu::WarningTrialTexturePackReturned(void *pParam,int iPad,C4J
|
||||
}
|
||||
}
|
||||
#endif //
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1340,7 +1333,6 @@ int UIScene_PauseMenu::ViewInvites_SignInReturned(void *pParam,bool bContinue, i
|
||||
// Check if we're signed in to LIVE
|
||||
if(ProfileManager.IsSignedInLive(iPad))
|
||||
{
|
||||
#ifndef DISABLE_PSN
|
||||
#ifdef __ORBIS__
|
||||
SQRNetworkManager_Orbis::RecvInviteGUI();
|
||||
#elif defined __PS3__
|
||||
@@ -1348,7 +1340,6 @@ int UIScene_PauseMenu::ViewInvites_SignInReturned(void *pParam,bool bContinue, i
|
||||
app.DebugPrintf("sceNpBasicRecvMessageCustom return %d ( %08x )\n", ret, ret);
|
||||
#else // __PSVITA__
|
||||
PSVITA_STUBBED;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ void UIScene_QuadrantSignin::handleInput(int iPad, int key, bool repeat, bool pr
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
if(pressed)
|
||||
|
||||
@@ -69,7 +69,7 @@ void UIScene_ReinstallMenu::handleInput(int iPad, int key, bool repeat, bool pre
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
case ACTION_MENU_UP:
|
||||
|
||||
@@ -71,7 +71,7 @@ void UIScene_SaveMessage::handleInput(int iPad, int key, bool repeat, bool press
|
||||
switch(key)
|
||||
{
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
@@ -110,7 +110,7 @@ void UIScene_SaveMessage::handlePress(F64 controlId, F64 childId)
|
||||
|
||||
m_bIgnoreInput=true;
|
||||
|
||||
#if !defined(DISABLE_PSN) && (defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__))
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
// wait for the profile to be read - this has been kicked off earlier, so should be read by now
|
||||
addTimer(PROFILE_LOADED_TIMER_ID,PROFILE_LOADED_TIMER_TIME);
|
||||
#else
|
||||
@@ -141,17 +141,13 @@ void UIScene_SaveMessage::handleTimerComplete(int id)
|
||||
// set defaults - which has already been done
|
||||
killTimer(PROFILE_LOADED_TIMER_ID);
|
||||
ui.NavigateToHomeMenu();
|
||||
#ifndef DISABLE_PSN
|
||||
SQRNetworkManager::SafeToRespondToGameBootInvite();
|
||||
#endif
|
||||
app.SetOptionsCallbackStatus(0,C4JStorage::eOptions_Callback_Idle);
|
||||
break;
|
||||
case C4JStorage::eOptions_Callback_Read_CorruptDeleted:
|
||||
killTimer(PROFILE_LOADED_TIMER_ID);
|
||||
ui.NavigateToHomeMenu();
|
||||
#ifndef DISABLE_PSN
|
||||
SQRNetworkManager::SafeToRespondToGameBootInvite();
|
||||
#endif
|
||||
app.SetOptionsCallbackStatus(0,C4JStorage::eOptions_Callback_Idle);
|
||||
break;
|
||||
case C4JStorage::eOptions_Callback_Read_Corrupt:
|
||||
|
||||
@@ -76,7 +76,7 @@ void UIScene_SettingsAudioMenu::handleInput(int iPad, int key, bool repeat, bool
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
@@ -76,7 +76,7 @@ void UIScene_SettingsControlMenu::handleInput(int iPad, int key, bool repeat, bo
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
@@ -113,7 +113,7 @@ void UIScene_SettingsGraphicsMenu::handleInput(int iPad, int key, bool repeat, b
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
@@ -102,7 +102,7 @@ void UIScene_SettingsMenu::handleInput(int iPad, int key, bool repeat, bool pres
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
@@ -224,7 +224,7 @@ void UIScene_SettingsOptionsMenu::handleInput(int iPad, int key, bool repeat, bo
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
@@ -129,7 +129,7 @@ void UIScene_SettingsUIMenu::handleInput(int iPad, int key, bool repeat, bool pr
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
|
||||
@@ -46,7 +46,6 @@ UIScene_SignEntryMenu::UIScene_SignEntryMenu(int iPad, void *_initData, UILayer
|
||||
m_signRows[i].SetTitleAndText(IDS_SIGN_TITLE,IDS_SIGN_TITLE_TEXT);
|
||||
#endif
|
||||
m_textInputLines[i].init(m_sign->GetMessage(i).c_str(), i);
|
||||
m_textInputLines[i].SetCharLimit(15);
|
||||
}
|
||||
|
||||
parentLayer->addComponent(iPad,eUIComponent_MenuBackground);
|
||||
@@ -130,7 +129,7 @@ void UIScene_SignEntryMenu::handleInput(int iPad, int key, bool repeat, bool pre
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
case ACTION_MENU_UP:
|
||||
@@ -151,7 +150,6 @@ int UIScene_SignEntryMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
|
||||
uint16_t pchText[128];
|
||||
ZeroMemory(pchText, 128 * sizeof(uint16_t) );
|
||||
InputManager.GetText(pchText);
|
||||
pchText[15] = 0;
|
||||
pClass->m_textInputLines[pClass->m_iEditingLine].setLabel((wchar_t *)pchText);
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -217,7 +217,7 @@ void UIScene_SkinSelectMenu::handleInput(int iPad, int key, bool repeat, bool pr
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
if(pressed)
|
||||
@@ -1518,7 +1518,6 @@ void UIScene_SkinSelectMenu::HandleDLCMountingComplete()
|
||||
void UIScene_SkinSelectMenu::showNotOnlineDialog(int iPad)
|
||||
{
|
||||
// need to be signed in to live. get them to sign in to online
|
||||
#ifndef DISABLE_PSN
|
||||
#if defined(__PS3__)
|
||||
SQRNetworkManager_PS3::AttemptPSNSignIn(NULL, this);
|
||||
|
||||
@@ -1544,7 +1543,6 @@ void UIScene_SkinSelectMenu::showNotOnlineDialog(int iPad)
|
||||
UINT uiIDA[1] = { IDS_CONFIRM_OK };
|
||||
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1703,16 +1701,12 @@ int UIScene_SkinSelectMenu::MustSignInReturned(void *pParam,int iPad,C4JStorage:
|
||||
{
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
#ifdef DISABLE_PSN
|
||||
UIScene_SkinSelectMenu::PSNSignInReturned(pParam, true, iPad);
|
||||
#else
|
||||
#ifdef __PS3__
|
||||
SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_SkinSelectMenu::PSNSignInReturned, pParam,true);
|
||||
#elif defined __PSVITA__
|
||||
SQRNetworkManager_Vita::AttemptPSNSignIn(&UIScene_SkinSelectMenu::PSNSignInReturned, pParam,true);
|
||||
#elif defined __ORBIS__
|
||||
SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_SkinSelectMenu::PSNSignInReturned, pParam,true);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -236,7 +236,7 @@ void UIScene_TeleportMenu::handleInput(int iPad, int key, bool repeat, bool pres
|
||||
}
|
||||
break;
|
||||
case ACTION_MENU_OK:
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
case ACTION_MENU_UP:
|
||||
|
||||
@@ -53,7 +53,7 @@ UIScene_TradingMenu::UIScene_TradingMenu(int iPad, void *_initData, UILayer *par
|
||||
// in this scene, we override the press sound with our own for crafting success or fail
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_A,true);
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_OK,true);
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_TOUCHPAD_PRESS,true);
|
||||
#endif
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_LEFT_SCROLL,true);
|
||||
@@ -99,7 +99,7 @@ void UIScene_TradingMenu::handleDestroy()
|
||||
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_A,false);
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_OK,false);
|
||||
#ifdef __ORBIS__
|
||||
#if defined __ORBIS__ || _WINDOWS64
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_TOUCHPAD_PRESS,false);
|
||||
#endif
|
||||
ui.OverrideSFX(m_iPad,ACTION_MENU_LEFT_SCROLL,false);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user