forked from cafeberry/cafeberry
add lcemp networking + ps3 support
YES I KNOW ITS GARBAGE, THATS WHY ITS NOT ON MAIN ILL FIX IT UP IN FUTURE COMMITS THEN MERGE TO MAIN
This commit is contained in:
@@ -30,7 +30,7 @@ public:
|
||||
virtual vector<FileEntry *> *getFilesWithPrefix(const wstring &prefix) = 0;
|
||||
virtual vector<FileEntry *> *getRegionFilesByDimension(unsigned int dimensionIndex) = 0;
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
virtual wstring getPlayerDataFilenameForLoad(const PlayerUID& pUID) = 0;
|
||||
virtual wstring getPlayerDataFilenameForSave(const PlayerUID& pUID) = 0;
|
||||
virtual vector<FileEntry *> *getValidPlayerDatFiles() = 0;
|
||||
|
||||
@@ -78,7 +78,7 @@ void ConsoleSaveFileConverter::ConvertSave(ConsoleSaveFile *sourceSave, ConsoleS
|
||||
}
|
||||
|
||||
// MGH added - find any player data files and copy them across
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
vector<FileEntry *>* playerFiles = sourceSave->getValidPlayerDatFiles();
|
||||
#else
|
||||
vector<FileEntry *> *playerFiles = sourceSave->getFilesWithPrefix( DirectoryLevelStorage::getPlayerDir() );
|
||||
|
||||
@@ -920,7 +920,7 @@ vector<FileEntry *> *ConsoleSaveFileOriginal::getRegionFilesByDimension(unsigned
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
wstring ConsoleSaveFileOriginal::getPlayerDataFilenameForLoad(const PlayerUID& pUID)
|
||||
{
|
||||
return header.getPlayerDataFilenameForLoad( pUID );
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
virtual vector<FileEntry *> *getFilesWithPrefix(const wstring &prefix);
|
||||
virtual vector<FileEntry *> *getRegionFilesByDimension(unsigned int dimensionIndex);
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
virtual wstring getPlayerDataFilenameForLoad(const PlayerUID& pUID);
|
||||
virtual wstring getPlayerDataFilenameForSave(const PlayerUID& pUID);
|
||||
virtual vector<FileEntry *> *getValidPlayerDatFiles();
|
||||
|
||||
@@ -519,7 +519,7 @@ int DataInputStream::readUTFChar()
|
||||
PlayerUID DataInputStream::readPlayerUID()
|
||||
{
|
||||
PlayerUID returnValue;
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
for(int idPos=0;idPos<sizeof(PlayerUID); idPos++)
|
||||
((char*)&returnValue)[idPos] = readByte();
|
||||
#elif defined(_DURANGO)
|
||||
|
||||
@@ -265,11 +265,13 @@ void DataOutputStream::writeUTF(const wstring& str)
|
||||
// 4J Added
|
||||
void DataOutputStream::writePlayerUID(PlayerUID player)
|
||||
{
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
|
||||
for(int idPos=0;idPos<sizeof(PlayerUID); idPos++)
|
||||
writeByte(((char*)&player)[idPos]);
|
||||
#elif defined(_DURANGO)
|
||||
writeUTF(player.toString());
|
||||
#elif defined(DISABLE_PSN) && defined(__PS3__)
|
||||
writeLong(player.XUID);
|
||||
#else
|
||||
writeLong(player);
|
||||
#endif // PS3
|
||||
|
||||
@@ -393,7 +393,7 @@ void DirectoryLevelStorage::save(shared_ptr<Player> player)
|
||||
{
|
||||
CompoundTag *tag = new CompoundTag();
|
||||
player->saveWithoutId(tag);
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
ConsoleSavePath realFile = ConsoleSavePath( m_saveFile->getPlayerDataFilenameForSave(playerXuid).c_str() );
|
||||
#elif defined(_DURANGO)
|
||||
ConsoleSavePath realFile = ConsoleSavePath( playerDir.getName() + player->getXuid().toString() + L".dat" );
|
||||
@@ -442,7 +442,7 @@ CompoundTag *DirectoryLevelStorage::load(shared_ptr<Player> player)
|
||||
CompoundTag *DirectoryLevelStorage::loadPlayerDataTag(PlayerUID xuid)
|
||||
{
|
||||
// 4J Jev, removed try/catch.
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
ConsoleSavePath realFile = ConsoleSavePath( m_saveFile->getPlayerDataFilenameForLoad(xuid).c_str() );
|
||||
#elif defined(_DURANGO)
|
||||
ConsoleSavePath realFile = ConsoleSavePath( playerDir.getName() + xuid.toString() + L".dat" );
|
||||
@@ -472,7 +472,7 @@ void DirectoryLevelStorage::clearOldPlayerFiles()
|
||||
{
|
||||
if(StorageManager.GetSaveDisabled() ) return;
|
||||
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
vector<FileEntry *> *playerFiles = m_saveFile->getValidPlayerDatFiles();
|
||||
#else
|
||||
vector<FileEntry *> *playerFiles = m_saveFile->getFilesWithPrefix( playerDir.getName() );
|
||||
@@ -561,7 +561,7 @@ void DirectoryLevelStorage::resetNetherPlayerPositions()
|
||||
{
|
||||
if(app.GetResetNether())
|
||||
{
|
||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
#if !defined(DISABLE_PSN) && defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||
vector<FileEntry *> *playerFiles = m_saveFile->getValidPlayerDatFiles();
|
||||
#else
|
||||
vector<FileEntry *> *playerFiles = m_saveFile->getFilesWithPrefix( playerDir.getName() );
|
||||
|
||||
@@ -1197,7 +1197,7 @@
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG_MENUS_ENABLED;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CallAttributedProfiling>Disabled</CallAttributedProfiling>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<ShowIncludes>false</ShowIncludes>
|
||||
|
||||
@@ -334,8 +334,9 @@ HRESULT Compression::Decompress(void *pDestination, unsigned int *pDestSize, voi
|
||||
*pDestSize = (unsigned int)destSize;
|
||||
return ( ( res == Z_OK ) ? S_OK : -1 );
|
||||
#elif defined __PS3__
|
||||
uint32_t destSize = (uint32_t)(*pDestSize);
|
||||
bool res = EdgeZLib::Decompress(pDestination, &destSize, pSource, SrcSize);
|
||||
uLongf destSize = (uLongf)(*pDestSize);
|
||||
bool res = uncompress((Bytef*)pDestination, &destSize, (Bytef*)pSource, SrcSize);
|
||||
|
||||
*pDestSize = (unsigned int)destSize;
|
||||
return ( ( res ) ? S_OK : -1 );
|
||||
#else
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
|
||||
#define MULTITHREAD_ENABLE
|
||||
|
||||
#ifdef __PS3__
|
||||
#define DISABLE_PSN
|
||||
#endif
|
||||
|
||||
typedef unsigned char byte;
|
||||
|
||||
const int XUSER_INDEX_ANY = 255;
|
||||
@@ -42,9 +46,15 @@ typedef SQRNetworkManager_Orbis::PresenceSyncInfo INVITE_INFO;
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include "..\..\Minecraft.Client\PS3\PS3_PlayerUID.h"
|
||||
|
||||
#ifndef DISABLE_PSN
|
||||
#include "..\..\Minecraft.Client\PS3\Network\SQRNetworkManager_PS3.h"
|
||||
typedef SQRNetworkManager::SessionID SessionID;
|
||||
typedef SQRNetworkManager::PresenceSyncInfo INVITE_INFO;
|
||||
#else
|
||||
typedef ULONGLONG SessionID;
|
||||
class INVITE_INFO;
|
||||
#endif
|
||||
|
||||
#elif defined __PSVITA__
|
||||
#include <np.h>
|
||||
@@ -215,10 +225,17 @@ public:
|
||||
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);
|
||||
|
||||
const int QNET_GETSENDQUEUESIZE_SECONDARY_TYPE = 0;
|
||||
const int QNET_GETSENDQUEUESIZE_MESSAGES = 0;
|
||||
const int QNET_GETSENDQUEUESIZE_BYTES = 0;
|
||||
@@ -309,9 +326,12 @@ public:
|
||||
bool IsHost();
|
||||
HRESULT JoinGameFromInviteInfo(DWORD dwUserIndex, DWORD dwUserMask, const INVITE_INFO *pInviteInfo);
|
||||
void HostGame();
|
||||
void ClientJoinGame();
|
||||
void EndGame();
|
||||
|
||||
static IQNetPlayer m_player[4];
|
||||
static IQNetPlayer m_player[MINECRAFT_NET_MAX_PLAYERS];
|
||||
static DWORD s_playerCount;
|
||||
static bool s_isHosting;
|
||||
};
|
||||
|
||||
#ifdef _DURANGO
|
||||
|
||||
Reference in New Issue
Block a user