Replace all windows types
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
#include "InputOutputStream.h"
|
#include "InputOutputStream.h"
|
||||||
#include "StringHelpers.h"
|
#include "StringHelpers.h"
|
||||||
|
|
||||||
AbstractTexturePack::AbstractTexturePack(DWORD id, File *file, const wstring &name, TexturePack *fallback) : id(id), name(name)
|
AbstractTexturePack::AbstractTexturePack(unsigned long id, File *file, const wstring &name, TexturePack *fallback) : id(id), name(name)
|
||||||
{
|
{
|
||||||
// 4J init
|
// 4J init
|
||||||
textureId = -1;
|
textureId = -1;
|
||||||
@@ -38,14 +38,14 @@ void AbstractTexturePack::loadIcon()
|
|||||||
{
|
{
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
// 4J Stu - Temporary only
|
// 4J Stu - Temporary only
|
||||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
wchar_t szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL);
|
||||||
swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/TexturePackIcon.png");
|
swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/TexturePackIcon.png");
|
||||||
|
|
||||||
UINT size = 0;
|
unsigned int size = 0;
|
||||||
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size);
|
int hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_iconData, &size);
|
||||||
m_iconSize = size;
|
m_iconSize = size;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -54,14 +54,14 @@ void AbstractTexturePack::loadComparison()
|
|||||||
{
|
{
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
// 4J Stu - Temporary only
|
// 4J Stu - Temporary only
|
||||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
wchar_t szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL);
|
||||||
swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/DefaultPack_Comparison.png");
|
swprintf(szResourceLocator, LOCATOR_SIZE ,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/Graphics/DefaultPack_Comparison.png");
|
||||||
|
|
||||||
UINT size = 0;
|
unsigned int size = 0;
|
||||||
HRESULT hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_comparisonData, &size);
|
int hr = XuiResourceLoadAllNoLoc(szResourceLocator, &m_comparisonData, &size);
|
||||||
m_comparisonSize = size;
|
m_comparisonSize = size;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,7 @@ bool AbstractTexturePack::hasFile(const wstring &name, bool allowFallback)
|
|||||||
return !hasFile && (allowFallback && fallback != NULL) ? fallback->hasFile(name, allowFallback) : hasFile;
|
return !hasFile && (allowFallback && fallback != NULL) ? fallback->hasFile(name, allowFallback) : hasFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD AbstractTexturePack::getId()
|
unsigned long AbstractTexturePack::getId()
|
||||||
{
|
{
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
@@ -227,11 +227,11 @@ void AbstractTexturePack::loadDefaultUI()
|
|||||||
{
|
{
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
// load from the .xzp file
|
// load from the .xzp file
|
||||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL);
|
||||||
|
|
||||||
// Load new skin
|
// Load new skin
|
||||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
wchar_t szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/skin_Minecraft.xur");
|
swprintf(szResourceLocator, LOCATOR_SIZE,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/skin_Minecraft.xur");
|
||||||
|
|
||||||
@@ -257,7 +257,7 @@ void AbstractTexturePack::loadDefaultColourTable()
|
|||||||
|
|
||||||
if(coloursFile.exists())
|
if(coloursFile.exists())
|
||||||
{
|
{
|
||||||
DWORD dwLength = coloursFile.length();
|
unsigned long dwLength = coloursFile.length();
|
||||||
byteArray data(dwLength);
|
byteArray data(dwLength);
|
||||||
|
|
||||||
FileInputStream fis(coloursFile);
|
FileInputStream fis(coloursFile);
|
||||||
@@ -279,15 +279,15 @@ void AbstractTexturePack::loadDefaultHTMLColourTable()
|
|||||||
{
|
{
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
// load from the .xzp file
|
// load from the .xzp file
|
||||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL);
|
||||||
|
|
||||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
wchar_t szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
// Try and load the HTMLColours.col based off the common XML first, before the deprecated xuiscene_colourtable
|
// Try and load the HTMLColours.col based off the common XML first, before the deprecated xuiscene_colourtable
|
||||||
wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/HTMLColours.col");
|
wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/HTMLColours.col");
|
||||||
BYTE *data;
|
uint8_t *data;
|
||||||
UINT dataLength;
|
unsigned int dataLength;
|
||||||
if(XuiResourceLoadAll(szResourceLocator, &data, &dataLength) == S_OK)
|
if(XuiResourceLoadAll(szResourceLocator, &data, &dataLength) == S_OK)
|
||||||
{
|
{
|
||||||
m_colourTable->loadColoursFromData(data,dataLength);
|
m_colourTable->loadColoursFromData(data,dataLength);
|
||||||
@@ -298,7 +298,7 @@ void AbstractTexturePack::loadDefaultHTMLColourTable()
|
|||||||
{
|
{
|
||||||
wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/");
|
wsprintfW(szResourceLocator,L"section://%X,%s#%s",c_ModuleHandle,L"media", L"media/");
|
||||||
HXUIOBJ hScene;
|
HXUIOBJ hScene;
|
||||||
HRESULT hr = XuiSceneCreate(szResourceLocator,L"xuiscene_colourtable.xur", NULL, &hScene);
|
int hr = XuiSceneCreate(szResourceLocator,L"xuiscene_colourtable.xur", NULL, &hScene);
|
||||||
|
|
||||||
if(HRESULT_SUCCEEDED(hr))
|
if(HRESULT_SUCCEEDED(hr))
|
||||||
{
|
{
|
||||||
@@ -320,11 +320,11 @@ void AbstractTexturePack::loadDefaultHTMLColourTable()
|
|||||||
void AbstractTexturePack::loadHTMLColourTableFromXuiScene(HXUIOBJ hObj)
|
void AbstractTexturePack::loadHTMLColourTableFromXuiScene(HXUIOBJ hObj)
|
||||||
{
|
{
|
||||||
HXUIOBJ child;
|
HXUIOBJ child;
|
||||||
HRESULT hr = XuiElementGetFirstChild(hObj, &child);
|
int hr = XuiElementGetFirstChild(hObj, &child);
|
||||||
|
|
||||||
while(HRESULT_SUCCEEDED(hr) && child != NULL)
|
while(HRESULT_SUCCEEDED(hr) && child != NULL)
|
||||||
{
|
{
|
||||||
LPCWSTR childName;
|
const wchar_t* childName;
|
||||||
XuiElementGetId(child,&childName);
|
XuiElementGetId(child,&childName);
|
||||||
m_colourTable->setColour(childName,XuiTextElementGetText(child));
|
m_colourTable->setColour(childName,XuiTextElementGetText(child));
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ void AbstractTexturePack::loadHTMLColourTableFromXuiScene(HXUIOBJ hObj)
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//LPCWSTR stringValue = XuiTextElementGetText(child);
|
//const wchar_t* stringValue = XuiTextElementGetText(child);
|
||||||
|
|
||||||
//m_htmlColourTable[colourIndex] = XuiTextElementGetText(child);
|
//m_htmlColourTable[colourIndex] = XuiTextElementGetText(child);
|
||||||
|
|
||||||
@@ -363,24 +363,24 @@ void AbstractTexturePack::unloadUI()
|
|||||||
|
|
||||||
wstring AbstractTexturePack::getXuiRootPath()
|
wstring AbstractTexturePack::getXuiRootPath()
|
||||||
{
|
{
|
||||||
const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL);
|
const uintptr_t c_ModuleHandle = (uintptr_t)GetModuleHandle(NULL);
|
||||||
|
|
||||||
// Load new skin
|
// Load new skin
|
||||||
const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
const unsigned long LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string
|
||||||
WCHAR szResourceLocator[ LOCATOR_SIZE ];
|
wchar_t szResourceLocator[ LOCATOR_SIZE ];
|
||||||
|
|
||||||
swprintf(szResourceLocator, LOCATOR_SIZE,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/");
|
swprintf(szResourceLocator, LOCATOR_SIZE,L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/");
|
||||||
return szResourceLocator;
|
return szResourceLocator;
|
||||||
}
|
}
|
||||||
|
|
||||||
PBYTE AbstractTexturePack::getPackIcon(DWORD &dwImageBytes)
|
uint8_t* AbstractTexturePack::getPackIcon(unsigned long &dwImageBytes)
|
||||||
{
|
{
|
||||||
if(m_iconSize == 0 || m_iconData == NULL) loadIcon();
|
if(m_iconSize == 0 || m_iconData == NULL) loadIcon();
|
||||||
dwImageBytes = m_iconSize;
|
dwImageBytes = m_iconSize;
|
||||||
return m_iconData;
|
return m_iconData;
|
||||||
}
|
}
|
||||||
|
|
||||||
PBYTE AbstractTexturePack::getPackComparison(DWORD &dwImageBytes)
|
uint8_t* AbstractTexturePack::getPackComparison(unsigned long &dwImageBytes)
|
||||||
{
|
{
|
||||||
if(m_comparisonSize == 0 || m_comparisonData == NULL) loadComparison();
|
if(m_comparisonSize == 0 || m_comparisonData == NULL) loadComparison();
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class BufferedImage;
|
|||||||
class AbstractTexturePack : public TexturePack
|
class AbstractTexturePack : public TexturePack
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
const DWORD id;
|
const unsigned long id;
|
||||||
const wstring name;
|
const wstring name;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -19,11 +19,11 @@ protected:
|
|||||||
wstring desc1;
|
wstring desc1;
|
||||||
wstring desc2;
|
wstring desc2;
|
||||||
|
|
||||||
PBYTE m_iconData;
|
uint8_t* m_iconData;
|
||||||
DWORD m_iconSize;
|
unsigned long m_iconSize;
|
||||||
|
|
||||||
PBYTE m_comparisonData;
|
uint8_t* m_comparisonData;
|
||||||
DWORD m_comparisonSize;
|
unsigned long m_comparisonSize;
|
||||||
|
|
||||||
TexturePack *fallback;
|
TexturePack *fallback;
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ private:
|
|||||||
int textureId;
|
int textureId;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AbstractTexturePack(DWORD id, File *file, const wstring &name, TexturePack *fallback);
|
AbstractTexturePack(unsigned long id, File *file, const wstring &name, TexturePack *fallback);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static wstring trim(wstring line);
|
static wstring trim(wstring line);
|
||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
virtual void load(Textures *textures);
|
virtual void load(Textures *textures);
|
||||||
virtual bool hasFile(const wstring &name, bool allowFallback);
|
virtual bool hasFile(const wstring &name, bool allowFallback);
|
||||||
virtual bool hasFile(const wstring &name) = 0;
|
virtual bool hasFile(const wstring &name) = 0;
|
||||||
virtual DWORD getId();
|
virtual unsigned long getId();
|
||||||
virtual wstring getName();
|
virtual wstring getName();
|
||||||
virtual wstring getDesc1();
|
virtual wstring getDesc1();
|
||||||
virtual wstring getDesc2();
|
virtual wstring getDesc2();
|
||||||
@@ -84,8 +84,8 @@ public:
|
|||||||
virtual void loadUI();
|
virtual void loadUI();
|
||||||
virtual void unloadUI();
|
virtual void unloadUI();
|
||||||
virtual wstring getXuiRootPath();
|
virtual wstring getXuiRootPath();
|
||||||
virtual PBYTE getPackIcon(DWORD &dwImageBytes);
|
virtual uint8_t* getPackIcon(unsigned long &dwImageBytes);
|
||||||
virtual PBYTE getPackComparison(DWORD &dwImageBytes);
|
virtual uint8_t* getPackComparison(unsigned long &dwImageBytes);
|
||||||
virtual unsigned int getDLCParentPackId();
|
virtual unsigned int getDLCParentPackId();
|
||||||
virtual unsigned char getDLCSubPackId();
|
virtual unsigned char getDLCSubPackId();
|
||||||
virtual ColourTable *getColourTable() { return m_colourTable; }
|
virtual ColourTable *getColourTable() { return m_colourTable; }
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ private:
|
|||||||
wstring title;
|
wstring title;
|
||||||
wstring desc;
|
wstring desc;
|
||||||
Achievement *ach;
|
Achievement *ach;
|
||||||
__int64 startTime;
|
int64_t startTime;
|
||||||
ItemRenderer *ir;
|
ItemRenderer *ir;
|
||||||
bool isHelper;
|
bool isHelper;
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ byteArray ArchiveFile::getFile(const wstring &filename)
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#ifdef _UNICODE
|
#ifdef _UNICODE
|
||||||
HANDLE hfile = CreateFile( m_sourcefile.getPath().c_str(),
|
void* hfile = CreateFile( m_sourcefile.getPath().c_str(),
|
||||||
GENERIC_READ,
|
GENERIC_READ,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -132,7 +132,7 @@ byteArray ArchiveFile::getFile(const wstring &filename)
|
|||||||
);
|
);
|
||||||
#else
|
#else
|
||||||
app.DebugPrintf("Createfile archive\n");
|
app.DebugPrintf("Createfile archive\n");
|
||||||
HANDLE hfile = CreateFile( wstringtofilename(m_sourcefile.getPath()),
|
void* hfile = CreateFile( wstringtofilename(m_sourcefile.getPath()),
|
||||||
GENERIC_READ,
|
GENERIC_READ,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -145,7 +145,7 @@ byteArray ArchiveFile::getFile(const wstring &filename)
|
|||||||
if (hfile != INVALID_HANDLE_VALUE)
|
if (hfile != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
app.DebugPrintf("hfile ok\n");
|
app.DebugPrintf("hfile ok\n");
|
||||||
DWORD ok = SetFilePointer( hfile,
|
unsigned long ok = SetFilePointer( hfile,
|
||||||
data->ptr,
|
data->ptr,
|
||||||
NULL,
|
NULL,
|
||||||
FILE_BEGIN
|
FILE_BEGIN
|
||||||
@@ -153,11 +153,11 @@ byteArray ArchiveFile::getFile(const wstring &filename)
|
|||||||
|
|
||||||
if (ok != INVALID_SET_FILE_POINTER)
|
if (ok != INVALID_SET_FILE_POINTER)
|
||||||
{
|
{
|
||||||
PBYTE pbData = new BYTE[ data->filesize ];
|
uint8_t* pbData = new uint8_t[ data->filesize ];
|
||||||
|
|
||||||
DWORD bytesRead = -1;
|
unsigned long bytesRead = -1;
|
||||||
BOOL bSuccess = ReadFile( hfile,
|
bool bSuccess = ReadFile( hfile,
|
||||||
(LPVOID) pbData,
|
(void*) pbData,
|
||||||
data->filesize,
|
data->filesize,
|
||||||
&bytesRead,
|
&bytesRead,
|
||||||
NULL
|
NULL
|
||||||
@@ -198,7 +198,7 @@ byteArray ArchiveFile::getFile(const wstring &filename)
|
|||||||
unsigned int decompressedSize = dis.readInt();
|
unsigned int decompressedSize = dis.readInt();
|
||||||
dis.close();
|
dis.close();
|
||||||
|
|
||||||
PBYTE uncompressedBuffer = new BYTE[decompressedSize];
|
uint8_t* uncompressedBuffer = new uint8_t[decompressedSize];
|
||||||
Compression::getCompression()->Decompress(uncompressedBuffer, &decompressedSize, out.data+4, out.length-4);
|
Compression::getCompression()->Decompress(uncompressedBuffer, &decompressedSize, out.data+4, out.length-4);
|
||||||
|
|
||||||
delete [] out.data;
|
delete [] out.data;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class ArchiveFile
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
File m_sourcefile;
|
File m_sourcefile;
|
||||||
BYTE *m_cachedData;
|
uint8_t *m_cachedData;
|
||||||
|
|
||||||
typedef struct _MetaData
|
typedef struct _MetaData
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ void BufferedImage::ByteFlip4(unsigned int &data)
|
|||||||
// 24-bits used (ie no alpha channel) whereas method 0 is a full 32-bit image with a valid alpha channel.
|
// 24-bits used (ie no alpha channel) whereas method 0 is a full 32-bit image with a valid alpha channel.
|
||||||
BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=false*/, bool bTitleUpdateTexture /*=false*/, const wstring &drive /*=L""*/)
|
BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=false*/, bool bTitleUpdateTexture /*=false*/, const wstring &drive /*=L""*/)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
int hr;
|
||||||
wstring wDrive;
|
wstring wDrive;
|
||||||
wstring filePath;
|
wstring filePath;
|
||||||
filePath = File;
|
filePath = File;
|
||||||
@@ -191,10 +191,10 @@ BufferedImage::BufferedImage(const wstring& File, bool filenameHasExtension /*=f
|
|||||||
|
|
||||||
BufferedImage::BufferedImage(DLCPack *dlcPack, const wstring& File, bool filenameHasExtension /*= false*/ )
|
BufferedImage::BufferedImage(DLCPack *dlcPack, const wstring& File, bool filenameHasExtension /*= false*/ )
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
int hr;
|
||||||
wstring filePath = File;
|
wstring filePath = File;
|
||||||
BYTE *pbData = NULL;
|
uint8_t *pbData = NULL;
|
||||||
DWORD dwBytes = 0;
|
unsigned long dwBytes = 0;
|
||||||
|
|
||||||
for( int l = 0 ; l < 10; l++ )
|
for( int l = 0 ; l < 10; l++ )
|
||||||
{
|
{
|
||||||
@@ -264,7 +264,7 @@ BufferedImage::BufferedImage(DLCPack *dlcPack, const wstring& File, bool filenam
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BufferedImage::BufferedImage(BYTE *pbData, DWORD dwBytes)
|
BufferedImage::BufferedImage(uint8_t *pbData, unsigned long dwBytes)
|
||||||
{
|
{
|
||||||
int iCurrentByte=0;
|
int iCurrentByte=0;
|
||||||
for( int l = 0 ; l < 10; l++ )
|
for( int l = 0 ; l < 10; l++ )
|
||||||
@@ -274,7 +274,7 @@ BufferedImage::BufferedImage(BYTE *pbData, DWORD dwBytes)
|
|||||||
|
|
||||||
D3DXIMAGE_INFO ImageInfo;
|
D3DXIMAGE_INFO ImageInfo;
|
||||||
ZeroMemory(&ImageInfo,sizeof(D3DXIMAGE_INFO));
|
ZeroMemory(&ImageInfo,sizeof(D3DXIMAGE_INFO));
|
||||||
HRESULT hr=RenderManager.LoadTextureData(pbData,dwBytes,&ImageInfo,&data[0]);
|
int hr=RenderManager.LoadTextureData(pbData,dwBytes,&ImageInfo,&data[0]);
|
||||||
|
|
||||||
if(hr==ERROR_SUCCESS)
|
if(hr==ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public:
|
|||||||
BufferedImage(int width,int height,int type);
|
BufferedImage(int width,int height,int type);
|
||||||
BufferedImage(const wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const wstring &drive =L""); // 4J added
|
BufferedImage(const wstring& File, bool filenameHasExtension = false, bool bTitleUpdateTexture=false, const wstring &drive =L""); // 4J added
|
||||||
BufferedImage(DLCPack *dlcPack, const wstring& File, bool filenameHasExtension = false ); // 4J Added
|
BufferedImage(DLCPack *dlcPack, const wstring& File, bool filenameHasExtension = false ); // 4J Added
|
||||||
BufferedImage(BYTE *pbData, DWORD dwBytes); // 4J added
|
BufferedImage(uint8_t *pbData, unsigned long dwBytes); // 4J added
|
||||||
~BufferedImage();
|
~BufferedImage();
|
||||||
|
|
||||||
int getWidth();
|
int getWidth();
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
int Chunk::updates = 0;
|
int Chunk::updates = 0;
|
||||||
|
|
||||||
#ifdef _LARGE_WORLDS
|
#ifdef _LARGE_WORLDS
|
||||||
DWORD Chunk::tlsIdx = TlsAlloc();
|
unsigned long Chunk::tlsIdx = TlsAlloc();
|
||||||
|
|
||||||
void Chunk::CreateNewThreadStorage()
|
void Chunk::CreateNewThreadStorage()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ private:
|
|||||||
#ifndef _LARGE_WORLDS
|
#ifndef _LARGE_WORLDS
|
||||||
static Tesselator *t;
|
static Tesselator *t;
|
||||||
#else
|
#else
|
||||||
static DWORD tlsIdx;
|
static unsigned long tlsIdx;
|
||||||
public:
|
public:
|
||||||
static void CreateNewThreadStorage();
|
static void CreateNewThreadStorage();
|
||||||
static void ReleaseThreadStorage();
|
static void ReleaseThreadStorage();
|
||||||
|
|||||||
@@ -43,9 +43,9 @@
|
|||||||
#include "SoundTypes.h"
|
#include "SoundTypes.h"
|
||||||
#include "TexturePackRepository.h"
|
#include "TexturePackRepository.h"
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
#include "Common/XUI\XUI_Scene_Trading.h"
|
#include "Common/XUI/XUI_Scene_Trading.h"
|
||||||
#else
|
#else
|
||||||
#include "Common/UI\UI.h"
|
#include "Common/UI/UI.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef __PS3__
|
#ifdef __PS3__
|
||||||
#include "PS3/Network/SonyVoiceChat.h"
|
#include "PS3/Network/SonyVoiceChat.h"
|
||||||
@@ -197,8 +197,8 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> packet)
|
|||||||
|
|
||||||
if(iUserID!=-1)
|
if(iUserID!=-1)
|
||||||
{
|
{
|
||||||
BYTE *pBuffer=NULL;
|
uint8_t *pBuffer=NULL;
|
||||||
DWORD dwSize=0;
|
unsigned long dwSize=0;
|
||||||
bool bRes;
|
bool bRes;
|
||||||
|
|
||||||
// if there's a special skin or cloak for this player, add it in
|
// if there's a special skin or cloak for this player, add it in
|
||||||
@@ -305,7 +305,7 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> packet)
|
|||||||
//minecraft->setScreen(new ReceivingLevelScreen(this));
|
//minecraft->setScreen(new ReceivingLevelScreen(this));
|
||||||
minecraft->player->entityId = packet->clientVersion;
|
minecraft->player->entityId = packet->clientVersion;
|
||||||
|
|
||||||
BYTE networkSmallId = getSocket()->getSmallId();
|
uint8_t networkSmallId = getSocket()->getSmallId();
|
||||||
app.UpdatePlayerInfo(networkSmallId, packet->m_playerIndex, packet->m_uiGamePrivileges);
|
app.UpdatePlayerInfo(networkSmallId, packet->m_playerIndex, packet->m_uiGamePrivileges);
|
||||||
minecraft->player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All, packet->m_uiGamePrivileges);
|
minecraft->player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All, packet->m_uiGamePrivileges);
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ void ClientConnection::handleLogin(shared_ptr<LoginPacket> packet)
|
|||||||
player->setCustomCape( app.GetPlayerCapeId(m_userIndex) );
|
player->setCustomCape( app.GetPlayerCapeId(m_userIndex) );
|
||||||
|
|
||||||
|
|
||||||
BYTE networkSmallId = getSocket()->getSmallId();
|
uint8_t networkSmallId = getSocket()->getSmallId();
|
||||||
app.UpdatePlayerInfo(networkSmallId, packet->m_playerIndex, packet->m_uiGamePrivileges);
|
app.UpdatePlayerInfo(networkSmallId, packet->m_playerIndex, packet->m_uiGamePrivileges);
|
||||||
player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All, packet->m_uiGamePrivileges);
|
player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_All, packet->m_uiGamePrivileges);
|
||||||
|
|
||||||
@@ -1163,7 +1163,7 @@ void ClientConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason,
|
|||||||
m_userIndex == ProfileManager.GetPrimaryPad() &&
|
m_userIndex == ProfileManager.GetPrimaryPad() &&
|
||||||
!MinecraftServer::saveOnExitAnswered() )
|
!MinecraftServer::saveOnExitAnswered() )
|
||||||
{
|
{
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_CONFIRM_OK;
|
uiIDA[0]=IDS_CONFIRM_OK;
|
||||||
ui.RequestMessageBox(IDS_EXITING_GAME, IDS_GENERIC_ERROR, uiIDA, 1, ProfileManager.GetPrimaryPad(),&ClientConnection::HostDisconnectReturned,NULL, app.GetStringTable());
|
ui.RequestMessageBox(IDS_EXITING_GAME, IDS_GENERIC_ERROR, uiIDA, 1, ProfileManager.GetPrimaryPad(),&ClientConnection::HostDisconnectReturned,NULL, app.GetStringTable());
|
||||||
}
|
}
|
||||||
@@ -1610,11 +1610,11 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
// printf("Client: handlePreLogin\n");
|
// printf("Client: handlePreLogin\n");
|
||||||
#if 1
|
#if 1
|
||||||
// 4J - Check that we can play with all the players already in the game who have Friends-Only UGC set
|
// 4J - Check that we can play with all the players already in the game who have Friends-Only UGC set
|
||||||
BOOL canPlay = true;
|
bool canPlay = true;
|
||||||
BOOL canPlayLocal = true;
|
bool canPlayLocal = true;
|
||||||
BOOL isAtLeastOneFriend = g_NetworkManager.IsHost();
|
bool isAtLeastOneFriend = g_NetworkManager.IsHost();
|
||||||
BOOL isFriendsWithHost = true;
|
bool isFriendsWithHost = true;
|
||||||
BOOL cantPlayContentRestricted = false;
|
bool cantPlayContentRestricted = false;
|
||||||
|
|
||||||
if(!g_NetworkManager.IsHost())
|
if(!g_NetworkManager.IsHost())
|
||||||
{
|
{
|
||||||
@@ -1633,7 +1633,7 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
{
|
{
|
||||||
if(m_userIndex == ProfileManager.GetPrimaryPad() )
|
if(m_userIndex == ProfileManager.GetPrimaryPad() )
|
||||||
{
|
{
|
||||||
for(DWORD idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
for(unsigned long idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||||
{
|
{
|
||||||
if(ProfileManager.IsSignedIn(m_userIndex) && ProfileManager.IsGuest(idx))
|
if(ProfileManager.IsSignedIn(m_userIndex) && ProfileManager.IsGuest(idx))
|
||||||
{
|
{
|
||||||
@@ -1650,8 +1650,8 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
if( playerXuid != INVALID_XUID )
|
if( playerXuid != INVALID_XUID )
|
||||||
{
|
{
|
||||||
// Is this user friends with the host player?
|
// Is this user friends with the host player?
|
||||||
BOOL result;
|
bool result;
|
||||||
DWORD error;
|
unsigned long error;
|
||||||
error = XUserAreUsersFriends(idx,&packet->m_playerXuids[packet->m_hostIndex],1,&result,NULL);
|
error = XUserAreUsersFriends(idx,&packet->m_playerXuids[packet->m_hostIndex],1,&result,NULL);
|
||||||
if(error == ERROR_SUCCESS && result != true)
|
if(error == ERROR_SUCCESS && result != true)
|
||||||
{
|
{
|
||||||
@@ -1680,8 +1680,8 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
if( playerXuid != INVALID_XUID )
|
if( playerXuid != INVALID_XUID )
|
||||||
{
|
{
|
||||||
// Is this user friends with the host player?
|
// Is this user friends with the host player?
|
||||||
BOOL result;
|
bool result;
|
||||||
DWORD error;
|
unsigned long error;
|
||||||
error = XUserAreUsersFriends(m_userIndex,&packet->m_playerXuids[packet->m_hostIndex],1,&result,NULL);
|
error = XUserAreUsersFriends(m_userIndex,&packet->m_playerXuids[packet->m_hostIndex],1,&result,NULL);
|
||||||
if(error == ERROR_SUCCESS && result != true)
|
if(error == ERROR_SUCCESS && result != true)
|
||||||
{
|
{
|
||||||
@@ -1695,10 +1695,10 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
|
|
||||||
if( canPlay )
|
if( canPlay )
|
||||||
{
|
{
|
||||||
for(DWORD i = 0; i < packet->m_dwPlayerCount; ++i)
|
for(unsigned long i = 0; i < packet->m_dwPlayerCount; ++i)
|
||||||
{
|
{
|
||||||
bool localPlayer = false;
|
bool localPlayer = false;
|
||||||
for(DWORD idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
for(unsigned long idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||||
{
|
{
|
||||||
if( ProfileManager.IsSignedInLive(idx) )
|
if( ProfileManager.IsSignedInLive(idx) )
|
||||||
{
|
{
|
||||||
@@ -1728,9 +1728,9 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
// Local players are implied friends
|
// Local players are implied friends
|
||||||
if( isAtLeastOneFriend != true )
|
if( isAtLeastOneFriend != true )
|
||||||
{
|
{
|
||||||
BOOL result;
|
bool result;
|
||||||
DWORD error;
|
unsigned long error;
|
||||||
for(DWORD idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
for(unsigned long idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||||
{
|
{
|
||||||
if( ProfileManager.IsSignedIn(idx) && !ProfileManager.IsGuest(idx) )
|
if( ProfileManager.IsSignedIn(idx) && !ProfileManager.IsGuest(idx) )
|
||||||
{
|
{
|
||||||
@@ -1756,9 +1756,9 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
bool thisQuadrantOnly = true;
|
bool thisQuadrantOnly = true;
|
||||||
if( m_userIndex == ProfileManager.GetPrimaryPad() ) thisQuadrantOnly = false;
|
if( m_userIndex == ProfileManager.GetPrimaryPad() ) thisQuadrantOnly = false;
|
||||||
|
|
||||||
BOOL result;
|
bool result;
|
||||||
DWORD error;
|
unsigned long error;
|
||||||
for(DWORD idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
for(unsigned long idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||||
{
|
{
|
||||||
if( (!thisQuadrantOnly || m_userIndex == idx) && ProfileManager.IsSignedIn(idx) && !ProfileManager.IsGuest(idx) )
|
if( (!thisQuadrantOnly || m_userIndex == idx) && ProfileManager.IsSignedIn(idx) && !ProfileManager.IsGuest(idx) )
|
||||||
{
|
{
|
||||||
@@ -1978,7 +1978,7 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
else if(cantPlayContentRestricted) reason = DisconnectPacket::eDisconnect_ContentRestricted_Single_Local;
|
else if(cantPlayContentRestricted) reason = DisconnectPacket::eDisconnect_ContentRestricted_Single_Local;
|
||||||
|
|
||||||
app.DebugPrintf("Exiting player %d on handling Pre-Login packet due UGC privileges: %d\n", m_userIndex, reason);
|
app.DebugPrintf("Exiting player %d on handling Pre-Login packet due UGC privileges: %d\n", m_userIndex, reason);
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_CONFIRM_OK;
|
uiIDA[0]=IDS_CONFIRM_OK;
|
||||||
if(!isFriendsWithHost) ui.RequestMessageBox( IDS_CANTJOIN_TITLE, IDS_NOTALLOWED_FRIENDSOFFRIENDS, uiIDA,1,m_userIndex,NULL,NULL, app.GetStringTable());
|
if(!isFriendsWithHost) ui.RequestMessageBox( IDS_CANTJOIN_TITLE, IDS_NOTALLOWED_FRIENDSOFFRIENDS, uiIDA,1,m_userIndex,NULL,NULL, app.GetStringTable());
|
||||||
else ui.RequestMessageBox( IDS_CANTJOIN_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_SINGLE_LOCAL, uiIDA,1,m_userIndex,NULL,NULL, app.GetStringTable());
|
else ui.RequestMessageBox( IDS_CANTJOIN_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_SINGLE_LOCAL, uiIDA,1,m_userIndex,NULL,NULL, app.GetStringTable());
|
||||||
@@ -2047,7 +2047,7 @@ void ClientConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
|||||||
// All other players we use their offline XUID so that they can play the game offline
|
// All other players we use their offline XUID so that they can play the game offline
|
||||||
ProfileManager.GetXUID(m_userIndex,&offlineXUID,false);
|
ProfileManager.GetXUID(m_userIndex,&offlineXUID,false);
|
||||||
}
|
}
|
||||||
BOOL allAllowed, friendsAllowed;
|
bool allAllowed, friendsAllowed;
|
||||||
ProfileManager.AllowedPlayerCreatedContent(m_userIndex,true,&allAllowed,&friendsAllowed);
|
ProfileManager.AllowedPlayerCreatedContent(m_userIndex,true,&allAllowed,&friendsAllowed);
|
||||||
send( shared_ptr<LoginPacket>( new LoginPacket(minecraft->user->name, SharedConstants::NETWORK_PROTOCOL_VERSION, offlineXUID, onlineXUID, (allAllowed!=true && friendsAllowed==true),
|
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 ))));
|
packet->m_ugcPlayersVersion, app.GetPlayerSkinId(m_userIndex), app.GetPlayerCapeId(m_userIndex), ProfileManager.IsGuest( m_userIndex ))));
|
||||||
@@ -2229,8 +2229,8 @@ void ClientConnection::handleTexture(shared_ptr<TexturePacket> packet)
|
|||||||
#ifndef _CONTENT_PACKAGE
|
#ifndef _CONTENT_PACKAGE
|
||||||
wprintf(L"Client received request for custom texture %ls\n",packet->textureName.c_str());
|
wprintf(L"Client received request for custom texture %ls\n",packet->textureName.c_str());
|
||||||
#endif
|
#endif
|
||||||
PBYTE pbData=NULL;
|
uint8_t* pbData=NULL;
|
||||||
DWORD dwBytes=0;
|
unsigned long dwBytes=0;
|
||||||
app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes);
|
app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes);
|
||||||
|
|
||||||
if(dwBytes!=0)
|
if(dwBytes!=0)
|
||||||
@@ -2261,8 +2261,8 @@ void ClientConnection::handleTextureAndGeometry(shared_ptr<TextureAndGeometryPac
|
|||||||
#ifndef _CONTENT_PACKAGE
|
#ifndef _CONTENT_PACKAGE
|
||||||
wprintf(L"Client received request for custom texture and geometry %ls\n",packet->textureName.c_str());
|
wprintf(L"Client received request for custom texture and geometry %ls\n",packet->textureName.c_str());
|
||||||
#endif
|
#endif
|
||||||
PBYTE pbData=NULL;
|
uint8_t* pbData=NULL;
|
||||||
DWORD dwBytes=0;
|
unsigned long dwBytes=0;
|
||||||
app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes);
|
app.GetMemFileDetails(packet->textureName,&pbData,&dwBytes);
|
||||||
DLCSkinFile *pDLCSkinFile = app.m_dlcManager.getSkinFile(packet->textureName);
|
DLCSkinFile *pDLCSkinFile = app.m_dlcManager.getSkinFile(packet->textureName);
|
||||||
|
|
||||||
@@ -2871,7 +2871,7 @@ void ClientConnection::handleGameEvent(shared_ptr<GameEventPacket> gameEventPack
|
|||||||
}
|
}
|
||||||
else if (event == GameEventPacket::WIN_GAME)
|
else if (event == GameEventPacket::WIN_GAME)
|
||||||
{
|
{
|
||||||
ui.SetWinUserIndex( (BYTE)gameEventPacket->param );
|
ui.SetWinUserIndex( (uint8_t)gameEventPacket->param );
|
||||||
|
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
|
|
||||||
@@ -3166,7 +3166,7 @@ void ClientConnection::handleCustomPayload(shared_ptr<CustomPayloadPacket> custo
|
|||||||
if( XuiClassDerivesFrom( objClass, thisClass ) )
|
if( XuiClassDerivesFrom( objClass, thisClass ) )
|
||||||
{
|
{
|
||||||
CXuiSceneTrading *screen;
|
CXuiSceneTrading *screen;
|
||||||
HRESULT hr = XuiObjectFromHandle(scene, (void **) &screen);
|
int hr = XuiObjectFromHandle(scene, (void **) &screen);
|
||||||
if (FAILED(hr)) return;
|
if (FAILED(hr)) return;
|
||||||
trader = screen->getMerchant();
|
trader = screen->getMerchant();
|
||||||
}
|
}
|
||||||
@@ -3231,7 +3231,7 @@ void ClientConnection::handleUpdateProgress(shared_ptr<UpdateProgressPacket> pac
|
|||||||
|
|
||||||
void ClientConnection::handleUpdateGameRuleProgressPacket(shared_ptr<UpdateGameRuleProgressPacket> packet)
|
void ClientConnection::handleUpdateGameRuleProgressPacket(shared_ptr<UpdateGameRuleProgressPacket> packet)
|
||||||
{
|
{
|
||||||
LPCWSTR string = app.GetGameRulesString(packet->m_messageId);
|
const wchar_t* string = app.GetGameRulesString(packet->m_messageId);
|
||||||
if(string != NULL)
|
if(string != NULL)
|
||||||
{
|
{
|
||||||
wstring message(string);
|
wstring message(string);
|
||||||
@@ -3279,7 +3279,7 @@ int ClientConnection::HostDisconnectReturned(void *pParam,int iPad,C4JStorage::E
|
|||||||
// we need to ask if they are sure they want to overwrite the existing game
|
// we need to ask if they are sure they want to overwrite the existing game
|
||||||
if(bSaveExists && StorageManager.GetSaveDisabled())
|
if(bSaveExists && StorageManager.GetSaveDisabled())
|
||||||
{
|
{
|
||||||
UINT uiIDA[2];
|
unsigned int uiIDA[2];
|
||||||
uiIDA[0]=IDS_CONFIRM_CANCEL;
|
uiIDA[0]=IDS_CONFIRM_CANCEL;
|
||||||
uiIDA[1]=IDS_CONFIRM_OK;
|
uiIDA[1]=IDS_CONFIRM_OK;
|
||||||
ui.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&ClientConnection::ExitGameAndSaveReturned,NULL, app.GetStringTable());
|
ui.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&ClientConnection::ExitGameAndSaveReturned,NULL, app.GetStringTable());
|
||||||
@@ -3294,7 +3294,7 @@ int ClientConnection::HostDisconnectReturned(void *pParam,int iPad,C4JStorage::E
|
|||||||
// we need to ask if they are sure they want to overwrite the existing game
|
// we need to ask if they are sure they want to overwrite the existing game
|
||||||
if(bSaveExists)
|
if(bSaveExists)
|
||||||
{
|
{
|
||||||
UINT uiIDA[2];
|
unsigned int uiIDA[2];
|
||||||
uiIDA[0]=IDS_CONFIRM_CANCEL;
|
uiIDA[0]=IDS_CONFIRM_CANCEL;
|
||||||
uiIDA[1]=IDS_CONFIRM_OK;
|
uiIDA[1]=IDS_CONFIRM_OK;
|
||||||
ui.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&ClientConnection::ExitGameAndSaveReturned,NULL, app.GetStringTable());
|
ui.RequestMessageBox(IDS_TITLE_SAVE_GAME, IDS_CONFIRM_SAVE_GAME, uiIDA, 2, ProfileManager.GetPrimaryPad(),&ClientConnection::ExitGameAndSaveReturned,NULL, app.GetStringTable());
|
||||||
@@ -3318,7 +3318,7 @@ int ClientConnection::ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage::
|
|||||||
// results switched for this dialog
|
// results switched for this dialog
|
||||||
if(result==C4JStorage::EMessage_ResultDecline)
|
if(result==C4JStorage::EMessage_ResultDecline)
|
||||||
{
|
{
|
||||||
//INT saveOrCheckpointId = 0;
|
//int saveOrCheckpointId = 0;
|
||||||
//bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
//bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId);
|
||||||
//SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId);
|
//SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId);
|
||||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public:
|
|||||||
Socket *getSocket() { return connection->getSocket(); } // 4J Added
|
Socket *getSocket() { return connection->getSocket(); } // 4J Added
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DWORD m_userIndex; // 4J Added
|
unsigned long m_userIndex; // 4J Added
|
||||||
public:
|
public:
|
||||||
SavedDataStorage *savedDataStorage;
|
SavedDataStorage *savedDataStorage;
|
||||||
ClientConnection(Minecraft *minecraft, const wstring& ip, int port);
|
ClientConnection(Minecraft *minecraft, const wstring& ip, int port);
|
||||||
|
|||||||
@@ -5,24 +5,24 @@ typedef struct
|
|||||||
wchar_t *wchFilename;
|
wchar_t *wchFilename;
|
||||||
eFileExtensionType eEXT;
|
eFileExtensionType eEXT;
|
||||||
eTMSFileType eTMSType;
|
eTMSFileType eTMSType;
|
||||||
PBYTE pbData;
|
uint8_t* pbData;
|
||||||
UINT uiSize;
|
unsigned int uiSize;
|
||||||
int iConfig; // used for texture pack data files
|
int iConfig; // used for texture pack data files
|
||||||
}
|
}
|
||||||
TMS_FILE;
|
TMS_FILE;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
PBYTE pbData;
|
uint8_t* pbData;
|
||||||
DWORD dwBytes;
|
unsigned long dwBytes;
|
||||||
BYTE ucRefCount;
|
uint8_t ucRefCount;
|
||||||
}
|
}
|
||||||
MEMDATA,*PMEMDATA;
|
MEMDATA,*PMEMDATA;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
DWORD dwNotification;
|
unsigned long dwNotification;
|
||||||
UINT uiParam;
|
unsigned int uiParam;
|
||||||
}
|
}
|
||||||
NOTIFICATION,*PNOTIFICATION;
|
NOTIFICATION,*PNOTIFICATION;
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ typedef struct
|
|||||||
// adding new flags for interim TU to 1.6.6
|
// adding new flags for interim TU to 1.6.6
|
||||||
|
|
||||||
// A value that encodes the skin that the player has set as their default
|
// A value that encodes the skin that the player has set as their default
|
||||||
DWORD dwSelectedSkin;
|
unsigned long dwSelectedSkin;
|
||||||
|
|
||||||
// In-Menu sensitivity
|
// In-Menu sensitivity
|
||||||
unsigned char ucMenuSensitivity;
|
unsigned char ucMenuSensitivity;
|
||||||
@@ -90,7 +90,7 @@ typedef struct
|
|||||||
unsigned int uiSpecialTutorialBitmask;
|
unsigned int uiSpecialTutorialBitmask;
|
||||||
|
|
||||||
// A value that encodes the cape that the player has set
|
// A value that encodes the cape that the player has set
|
||||||
DWORD dwSelectedCape;
|
unsigned long dwSelectedCape;
|
||||||
|
|
||||||
unsigned int uiFavoriteSkinA[MAX_FAVORITE_SKINS];
|
unsigned int uiFavoriteSkinA[MAX_FAVORITE_SKINS];
|
||||||
unsigned char ucCurrentFavoriteSkinPos;
|
unsigned char ucCurrentFavoriteSkinPos;
|
||||||
@@ -102,7 +102,7 @@ typedef struct
|
|||||||
unsigned char ucLanguage;
|
unsigned char ucLanguage;
|
||||||
// 4J Stu - See comment for GAME_SETTINGS_PROFILE_DATA_BYTES below
|
// 4J Stu - See comment for GAME_SETTINGS_PROFILE_DATA_BYTES below
|
||||||
// was 192
|
// was 192
|
||||||
//unsigned char ucUnused[192-TUTORIAL_PROFILE_STORAGE_BYTES-sizeof(DWORD)-sizeof(char)-sizeof(char)-sizeof(char)-sizeof(char)-sizeof(LONG)-sizeof(LONG)-sizeof(DWORD)];
|
//unsigned char ucUnused[192-TUTORIAL_PROFILE_STORAGE_BYTES-sizeof(unsigned long)-sizeof(char)-sizeof(char)-sizeof(char)-sizeof(char)-sizeof(int32_t)-sizeof(int32_t)-sizeof(unsigned long)];
|
||||||
// 4J-PB - don't need to define the padded space, the union with ucReservedSpace will make the sizeof GAME_SETTINGS correct
|
// 4J-PB - don't need to define the padded space, the union with ucReservedSpace will make the sizeof GAME_SETTINGS correct
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ GAME_SETTINGS;
|
|||||||
#ifdef _XBOX_ONE
|
#ifdef _XBOX_ONE
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
WCHAR wchPlayerUID[64];
|
wchar_t wchPlayerUID[64];
|
||||||
char pszLevelName[14];
|
char pszLevelName[14];
|
||||||
}
|
}
|
||||||
BANNEDLISTDATA,*PBANNEDLISTDATA;
|
BANNEDLISTDATA,*PBANNEDLISTDATA;
|
||||||
@@ -142,7 +142,7 @@ XuiActionParam;
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int iSortValue;
|
int iSortValue;
|
||||||
UINT uiStringID;
|
unsigned int uiStringID;
|
||||||
}
|
}
|
||||||
TIPSTRUCT;
|
TIPSTRUCT;
|
||||||
|
|
||||||
@@ -150,8 +150,8 @@ TIPSTRUCT;
|
|||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
eXUID eXuid;
|
eXUID eXuid;
|
||||||
WCHAR wchCape[MAX_CAPENAME_SIZE];
|
wchar_t wchCape[MAX_CAPENAME_SIZE];
|
||||||
WCHAR wchSkin[MAX_CAPENAME_SIZE];
|
wchar_t wchSkin[MAX_CAPENAME_SIZE];
|
||||||
}
|
}
|
||||||
MOJANG_DATA;
|
MOJANG_DATA;
|
||||||
|
|
||||||
@@ -168,14 +168,14 @@ typedef struct
|
|||||||
wstring wsDisplayName;
|
wstring wsDisplayName;
|
||||||
|
|
||||||
// add a store for the local DLC image
|
// add a store for the local DLC image
|
||||||
PBYTE pbImageData;
|
uint8_t* pbImageData;
|
||||||
DWORD dwImageBytes;
|
unsigned long dwImageBytes;
|
||||||
#else
|
#else
|
||||||
ULONGLONG ullOfferID_Full;
|
uint64_t ullOfferID_Full;
|
||||||
ULONGLONG ullOfferID_Trial;
|
uint64_t ullOfferID_Trial;
|
||||||
#endif
|
#endif
|
||||||
WCHAR wchBanner[MAX_BANNERNAME_SIZE];
|
wchar_t wchBanner[MAX_BANNERNAME_SIZE];
|
||||||
WCHAR wchDataFile[MAX_BANNERNAME_SIZE];
|
wchar_t wchDataFile[MAX_BANNERNAME_SIZE];
|
||||||
int iGender;
|
int iGender;
|
||||||
#endif
|
#endif
|
||||||
int iConfig;
|
int iConfig;
|
||||||
@@ -194,14 +194,14 @@ FEATURE_DATA;
|
|||||||
// banned list
|
// banned list
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
BYTE *pBannedList;
|
uint8_t *pBannedList;
|
||||||
DWORD dwBytes;
|
unsigned long dwBytes;
|
||||||
}
|
}
|
||||||
BANNEDLIST;
|
BANNEDLIST;
|
||||||
|
|
||||||
typedef struct _DLCRequest
|
typedef struct _DLCRequest
|
||||||
{
|
{
|
||||||
DWORD dwType;
|
unsigned long dwType;
|
||||||
eDLCContentState eState;
|
eDLCContentState eState;
|
||||||
}
|
}
|
||||||
DLCRequest;
|
DLCRequest;
|
||||||
@@ -214,13 +214,13 @@ typedef struct _TMSPPRequest
|
|||||||
C4JStorage::eTMS_FILETYPEVAL eFileTypeVal;
|
C4JStorage::eTMS_FILETYPEVAL eFileTypeVal;
|
||||||
//char szFilename[MAX_TMSFILENAME_SIZE];
|
//char szFilename[MAX_TMSFILENAME_SIZE];
|
||||||
#ifdef _XBOX_ONE
|
#ifdef _XBOX_ONE
|
||||||
int( *CallbackFunc)(LPVOID,int,int,LPVOID, WCHAR *);
|
int( *CallbackFunc)(void*,int,int,void*, wchar_t *);
|
||||||
#else
|
#else
|
||||||
int( *CallbackFunc)(LPVOID,int,int,C4JStorage::PTMSPP_FILEDATA, LPCSTR szFilename);
|
int( *CallbackFunc)(void*,int,int,C4JStorage::PTMSPP_FILEDATA, const char* szFilename);
|
||||||
#endif
|
#endif
|
||||||
WCHAR wchFilename[MAX_TMSFILENAME_SIZE];
|
wchar_t wchFilename[MAX_TMSFILENAME_SIZE];
|
||||||
|
|
||||||
LPVOID lpCallbackParam;
|
void* lpCallbackParam;
|
||||||
}
|
}
|
||||||
TMSPPRequest;
|
TMSPPRequest;
|
||||||
|
|
||||||
|
|||||||
@@ -66,8 +66,8 @@ public:
|
|||||||
virtual bool GetIsPlayingNetherMusic() ;
|
virtual bool GetIsPlayingNetherMusic() ;
|
||||||
virtual void SetIsPlayingEndMusic(bool bVal) ;
|
virtual void SetIsPlayingEndMusic(bool bVal) ;
|
||||||
virtual void SetIsPlayingNetherMusic(bool bVal) ;
|
virtual void SetIsPlayingNetherMusic(bool bVal) ;
|
||||||
static const WCHAR *wchSoundNames[eSoundType_MAX];
|
static const wchar_t *wchSoundNames[eSoundType_MAX];
|
||||||
static const WCHAR *wchUISoundNames[eSFX_MAX];
|
static const wchar_t *wchUISoundNames[eSFX_MAX];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// platform specific functions
|
// platform specific functions
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ private:
|
|||||||
int m_MusicType;
|
int m_MusicType;
|
||||||
AUDIO_INFO m_StreamingAudioInfo;
|
AUDIO_INFO m_StreamingAudioInfo;
|
||||||
wstring m_CDMusic;
|
wstring m_CDMusic;
|
||||||
BOOL m_bSystemMusicPlaying;
|
bool m_bSystemMusicPlaying;
|
||||||
float m_MasterMusicVolume;
|
float m_MasterMusicVolume;
|
||||||
float m_MasterEffectsVolume;
|
float m_MasterEffectsVolume;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
|
const wchar_t *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
|
||||||
{
|
{
|
||||||
L"mob.chicken", // eSoundType_MOB_CHICKEN_AMBIENT
|
L"mob.chicken", // eSoundType_MOB_CHICKEN_AMBIENT
|
||||||
L"mob.chickenhurt", // eSoundType_MOB_CHICKEN_HURT
|
L"mob.chickenhurt", // eSoundType_MOB_CHICKEN_HURT
|
||||||
@@ -154,7 +154,7 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const WCHAR *ConsoleSoundEngine::wchUISoundNames[eSFX_MAX]=
|
const wchar_t *ConsoleSoundEngine::wchUISoundNames[eSFX_MAX]=
|
||||||
{
|
{
|
||||||
L"back",
|
L"back",
|
||||||
L"craft",
|
L"craft",
|
||||||
|
|||||||
@@ -314,18 +314,18 @@ void ColourTable::staticCtor()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColourTable::ColourTable(PBYTE pbData, DWORD dwLength)
|
ColourTable::ColourTable(uint8_t* pbData, unsigned long dwLength)
|
||||||
{
|
{
|
||||||
loadColoursFromData(pbData, dwLength);
|
loadColoursFromData(pbData, dwLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
ColourTable::ColourTable(ColourTable *defaultColours, PBYTE pbData, DWORD dwLength)
|
ColourTable::ColourTable(ColourTable *defaultColours, uint8_t* pbData, unsigned long dwLength)
|
||||||
{
|
{
|
||||||
// 4J Stu - Default the colours that of the table passed in
|
// 4J Stu - Default the colours that of the table passed in
|
||||||
XMemCpy( (void *)m_colourValues, (void *)defaultColours->m_colourValues, sizeof(int) * eMinecraftColour_COUNT);
|
XMemCpy( (void *)m_colourValues, (void *)defaultColours->m_colourValues, sizeof(int) * eMinecraftColour_COUNT);
|
||||||
loadColoursFromData(pbData, dwLength);
|
loadColoursFromData(pbData, dwLength);
|
||||||
}
|
}
|
||||||
void ColourTable::loadColoursFromData(PBYTE pbData, DWORD dwLength)
|
void ColourTable::loadColoursFromData(uint8_t* pbData, unsigned long dwLength)
|
||||||
{
|
{
|
||||||
byteArray src(pbData, dwLength);
|
byteArray src(pbData, dwLength);
|
||||||
|
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ private:
|
|||||||
public:
|
public:
|
||||||
static void staticCtor();
|
static void staticCtor();
|
||||||
|
|
||||||
ColourTable(PBYTE pbData, DWORD dwLength);
|
ColourTable(uint8_t* pbData, unsigned long dwLength);
|
||||||
ColourTable(ColourTable *defaultColours, PBYTE pbData, DWORD dwLength);
|
ColourTable(ColourTable *defaultColours, uint8_t* pbData, unsigned long dwLength);
|
||||||
|
|
||||||
unsigned int getColour(eMinecraftColour id);
|
unsigned int getColour(eMinecraftColour id);
|
||||||
unsigned int getColor(eMinecraftColour id) { return getColour(id); }
|
unsigned int getColor(eMinecraftColour id) { return getColour(id); }
|
||||||
|
|
||||||
void loadColoursFromData(PBYTE pbData, DWORD dwLength);
|
void loadColoursFromData(uint8_t* pbData, unsigned long dwLength);
|
||||||
void setColour(const wstring &colourName, int value);
|
void setColour(const wstring &colourName, int value);
|
||||||
void setColour(const wstring &colourName, const wstring &value);
|
void setColour(const wstring &colourName, const wstring &value);
|
||||||
};
|
};
|
||||||
@@ -5,12 +5,12 @@
|
|||||||
// Desc: Internal helper function
|
// Desc: Internal helper function
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
#ifndef _CONTENT_PACKAGE
|
#ifndef _CONTENT_PACKAGE
|
||||||
static VOID DebugSpewV( const CHAR* strFormat, const va_list pArgList )
|
static void DebugSpewV( const char* strFormat, const va_list pArgList )
|
||||||
{
|
{
|
||||||
#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||||
assert(0);
|
assert(0);
|
||||||
#else
|
#else
|
||||||
CHAR str[2048];
|
char str[2048];
|
||||||
// Use the secure CRT to avoid buffer overruns. Specify a count of
|
// Use the secure CRT to avoid buffer overruns. Specify a count of
|
||||||
// _TRUNCATE so that too long strings will be silently truncated
|
// _TRUNCATE so that too long strings will be silently truncated
|
||||||
// rather than triggering an error.
|
// rather than triggering an error.
|
||||||
@@ -25,9 +25,9 @@ static VOID DebugSpewV( const CHAR* strFormat, const va_list pArgList )
|
|||||||
// Desc: Prints formatted debug spew
|
// Desc: Prints formatted debug spew
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
#ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation
|
#ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation
|
||||||
VOID CDECL DebugSpew( _In_z_ _Printf_format_string_ const CHAR* strFormat, ... )
|
void CDECL DebugSpew( _In_z_ _Printf_format_string_ const char* strFormat, ... )
|
||||||
#else
|
#else
|
||||||
VOID CDECL DebugPrintf( const CHAR* strFormat, ... )
|
void CDECL DebugPrintf( const char* strFormat, ... )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifndef _CONTENT_PACKAGE
|
#ifndef _CONTENT_PACKAGE
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -25,8 +25,8 @@ using namespace std;
|
|||||||
|
|
||||||
typedef struct _JoinFromInviteData
|
typedef struct _JoinFromInviteData
|
||||||
{
|
{
|
||||||
DWORD dwUserIndex; // dwUserIndex
|
unsigned long dwUserIndex; // dwUserIndex
|
||||||
DWORD dwLocalUsersMask; // dwUserMask
|
unsigned long dwLocalUsersMask; // dwUserMask
|
||||||
const INVITE_INFO *pInviteInfo; // pInviteInfo
|
const INVITE_INFO *pInviteInfo; // pInviteInfo
|
||||||
}
|
}
|
||||||
JoinFromInviteData;
|
JoinFromInviteData;
|
||||||
@@ -121,7 +121,7 @@ public:
|
|||||||
|
|
||||||
bool IsAppPaused();
|
bool IsAppPaused();
|
||||||
void SetAppPaused(bool val);
|
void SetAppPaused(bool val);
|
||||||
static int DisplaySavingMessage(LPVOID pParam,const C4JStorage::ESavingMessage eMsg, int iPad);
|
static int DisplaySavingMessage(void* pParam,const C4JStorage::ESavingMessage eMsg, int iPad);
|
||||||
bool GetGameStarted() {return m_bGameStarted;}
|
bool GetGameStarted() {return m_bGameStarted;}
|
||||||
void SetGameStarted(bool bVal) { if(bVal) DebugPrintf("SetGameStarted - true\n"); else DebugPrintf("SetGameStarted - false\n"); m_bGameStarted = bVal; m_bIsAppPaused = !bVal;}
|
void SetGameStarted(bool bVal) { if(bVal) DebugPrintf("SetGameStarted - true\n"); else DebugPrintf("SetGameStarted - false\n"); m_bGameStarted = bVal; m_bIsAppPaused = !bVal;}
|
||||||
int GetLocalPlayerCount(void);
|
int GetLocalPlayerCount(void);
|
||||||
@@ -143,7 +143,7 @@ public:
|
|||||||
|
|
||||||
void SetSpecialTutorialCompletionFlag(int iPad, int index);
|
void SetSpecialTutorialCompletionFlag(int iPad, int index);
|
||||||
|
|
||||||
static LPCWSTR GetString(int iID);
|
static const wchar_t* GetString(int iID);
|
||||||
|
|
||||||
eGameMode GetGameMode() { return m_eGameMode;}
|
eGameMode GetGameMode() { return m_eGameMode;}
|
||||||
void SetGameMode(eGameMode eMode) { m_eGameMode=eMode;}
|
void SetGameMode(eGameMode eMode) { m_eGameMode=eMode;}
|
||||||
@@ -151,12 +151,12 @@ public:
|
|||||||
eXuiAction GetGlobalXuiAction() {return m_eGlobalXuiAction;}
|
eXuiAction GetGlobalXuiAction() {return m_eGlobalXuiAction;}
|
||||||
void SetGlobalXuiAction(eXuiAction action) {m_eGlobalXuiAction=action;}
|
void SetGlobalXuiAction(eXuiAction action) {m_eGlobalXuiAction=action;}
|
||||||
eXuiAction GetXuiAction(int iPad) {return m_eXuiAction[iPad];}
|
eXuiAction GetXuiAction(int iPad) {return m_eXuiAction[iPad];}
|
||||||
void SetAction(int iPad, eXuiAction action, LPVOID param = NULL);
|
void SetAction(int iPad, eXuiAction action, void* param = NULL);
|
||||||
void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; }
|
void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; }
|
||||||
eTMSAction GetTMSAction(int iPad) {return m_eTMSAction[iPad];}
|
eTMSAction GetTMSAction(int iPad) {return m_eTMSAction[iPad];}
|
||||||
eXuiServerAction GetXuiServerAction(int iPad) {return m_eXuiServerAction[iPad];}
|
eXuiServerAction GetXuiServerAction(int iPad) {return m_eXuiServerAction[iPad];}
|
||||||
LPVOID GetXuiServerActionParam(int iPad) {return m_eXuiServerActionParam[iPad];}
|
void* GetXuiServerActionParam(int iPad) {return m_eXuiServerActionParam[iPad];}
|
||||||
void SetXuiServerAction(int iPad, eXuiServerAction action, LPVOID param = NULL) {m_eXuiServerAction[iPad]=action; m_eXuiServerActionParam[iPad] = param;}
|
void SetXuiServerAction(int iPad, eXuiServerAction action, void* param = NULL) {m_eXuiServerAction[iPad]=action; m_eXuiServerActionParam[iPad] = param;}
|
||||||
eXuiServerAction GetGlobalXuiServerAction() {return m_eGlobalXuiServerAction;}
|
eXuiServerAction GetGlobalXuiServerAction() {return m_eGlobalXuiServerAction;}
|
||||||
void SetGlobalXuiServerAction(eXuiServerAction action) {m_eGlobalXuiServerAction=action;}
|
void SetGlobalXuiServerAction(eXuiServerAction action) {m_eGlobalXuiServerAction=action;}
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// 4J Stu - Added so that we can call this when a confirmation box is selected
|
// 4J Stu - Added so that we can call this when a confirmation box is selected
|
||||||
static void SetActionConfirmed(LPVOID param);
|
static void SetActionConfirmed(void* param);
|
||||||
void HandleXuiActions(void);
|
void HandleXuiActions(void);
|
||||||
|
|
||||||
// 4J Stu - Functions used for Minecon and other promo work
|
// 4J Stu - Functions used for Minecon and other promo work
|
||||||
@@ -192,7 +192,7 @@ public:
|
|||||||
void SetFreezePlayers(bool bVal) { m_bFreezePlayers = bVal; }
|
void SetFreezePlayers(bool bVal) { m_bFreezePlayers = bVal; }
|
||||||
|
|
||||||
// debug -0 show safe area
|
// debug -0 show safe area
|
||||||
void ShowSafeArea(BOOL bShow)
|
void ShowSafeArea(bool bShow)
|
||||||
{
|
{
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
CXuiSceneBase::ShowSafeArea( bShow );
|
CXuiSceneBase::ShowSafeArea( bShow );
|
||||||
@@ -203,23 +203,23 @@ public:
|
|||||||
//void GetPreviewImage(int iPad,XSOCIAL_PREVIEWIMAGE *preview);
|
//void GetPreviewImage(int iPad,XSOCIAL_PREVIEWIMAGE *preview);
|
||||||
|
|
||||||
void InitGameSettings();
|
void InitGameSettings();
|
||||||
static int OldProfileVersionCallback(LPVOID pParam,unsigned char *pucData, const unsigned short usVersion, const int iPad);
|
static int OldProfileVersionCallback(void* pParam,unsigned char *pucData, const unsigned short usVersion, const int iPad);
|
||||||
|
|
||||||
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ )
|
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ )
|
||||||
static int DefaultOptionsCallback(LPVOID pParam,C4JStorage::PROFILESETTINGS *pSettings, const int iPad);
|
static int DefaultOptionsCallback(void* pParam,C4JStorage::PROFILESETTINGS *pSettings, const int iPad);
|
||||||
int SetDefaultOptions(C4JStorage::PROFILESETTINGS *pSettings,const int iPad,bool bWriteProfile=true);
|
int SetDefaultOptions(C4JStorage::PROFILESETTINGS *pSettings,const int iPad,bool bWriteProfile=true);
|
||||||
#ifdef __ORBIS__
|
#ifdef __ORBIS__
|
||||||
static int OptionsDataCallback(LPVOID pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus,int iBlocksRequired);
|
static int OptionsDataCallback(void* pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus,int iBlocksRequired);
|
||||||
int GetOptionsBlocksRequired(int iPad);
|
int GetOptionsBlocksRequired(int iPad);
|
||||||
#else
|
#else
|
||||||
static int OptionsDataCallback(LPVOID pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus);
|
static int OptionsDataCallback(void* pParam,int iPad,unsigned short usVersion,C4JStorage::eOptionsCallback eStatus);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
C4JStorage::eOptionsCallback GetOptionsCallbackStatus(int iPad);
|
C4JStorage::eOptionsCallback GetOptionsCallbackStatus(int iPad);
|
||||||
|
|
||||||
void SetOptionsCallbackStatus(int iPad, C4JStorage::eOptionsCallback eStatus);
|
void SetOptionsCallbackStatus(int iPad, C4JStorage::eOptionsCallback eStatus);
|
||||||
#else
|
#else
|
||||||
static int DefaultOptionsCallback(LPVOID pParam,C_4JProfile::PROFILESETTINGS *pSettings, const int iPad);
|
static int DefaultOptionsCallback(void* pParam,C_4JProfile::PROFILESETTINGS *pSettings, const int iPad);
|
||||||
int SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,const int iPad);
|
int SetDefaultOptions(C_4JProfile::PROFILESETTINGS *pSettings,const int iPad);
|
||||||
#endif
|
#endif
|
||||||
virtual void SetRichPresenceContext(int iPad, int contextId) = 0;
|
virtual void SetRichPresenceContext(int iPad, int contextId) = 0;
|
||||||
@@ -229,9 +229,9 @@ public:
|
|||||||
unsigned char GetGameSettings(int iPad,eGameSetting eVal);
|
unsigned char GetGameSettings(int iPad,eGameSetting eVal);
|
||||||
unsigned char GetGameSettings(eGameSetting eVal); // for the primary pad
|
unsigned char GetGameSettings(eGameSetting eVal); // for the primary pad
|
||||||
void SetPlayerSkin(int iPad,const wstring &name);
|
void SetPlayerSkin(int iPad,const wstring &name);
|
||||||
void SetPlayerSkin(int iPad,DWORD dwSkinId);
|
void SetPlayerSkin(int iPad,unsigned long dwSkinId);
|
||||||
void SetPlayerCape(int iPad,const wstring &name);
|
void SetPlayerCape(int iPad,const wstring &name);
|
||||||
void SetPlayerCape(int iPad,DWORD dwCapeId);
|
void SetPlayerCape(int iPad,unsigned long dwCapeId);
|
||||||
void SetPlayerFavoriteSkin(int iPad, int iIndex,unsigned int uiSkinID);
|
void SetPlayerFavoriteSkin(int iPad, int iIndex,unsigned int uiSkinID);
|
||||||
unsigned int GetPlayerFavoriteSkin(int iPad,int iIndex);
|
unsigned int GetPlayerFavoriteSkin(int iPad,int iIndex);
|
||||||
unsigned char GetPlayerFavoriteSkinsPos(int iPad);
|
unsigned char GetPlayerFavoriteSkinsPos(int iPad);
|
||||||
@@ -256,10 +256,10 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
wstring GetPlayerSkinName(int iPad);
|
wstring GetPlayerSkinName(int iPad);
|
||||||
DWORD GetPlayerSkinId(int iPad);
|
unsigned long GetPlayerSkinId(int iPad);
|
||||||
wstring GetPlayerCapeName(int iPad);
|
wstring GetPlayerCapeName(int iPad);
|
||||||
DWORD GetPlayerCapeId(int iPad);
|
unsigned long GetPlayerCapeId(int iPad);
|
||||||
DWORD GetAdditionalModelParts(int iPad);
|
unsigned long GetAdditionalModelParts(int iPad);
|
||||||
void CheckGameSettingsChanged(bool bOverride5MinuteTimer=false, int iPad=XUSER_INDEX_ANY);
|
void CheckGameSettingsChanged(bool bOverride5MinuteTimer=false, int iPad=XUSER_INDEX_ANY);
|
||||||
void ApplyGameSettingsChanged(int iPad);
|
void ApplyGameSettingsChanged(int iPad);
|
||||||
void ClearGameSettingsChangedFlag(int iPad);
|
void ClearGameSettingsChangedFlag(int iPad);
|
||||||
@@ -272,7 +272,7 @@ public:
|
|||||||
bool IsLocalMultiplayerAvailable();
|
bool IsLocalMultiplayerAvailable();
|
||||||
|
|
||||||
// for sign in change monitoring
|
// for sign in change monitoring
|
||||||
static void SignInChangeCallback(LPVOID pParam, bool bVal, unsigned int uiSignInData);
|
static void SignInChangeCallback(void* pParam, bool bVal, unsigned int uiSignInData);
|
||||||
static void ClearSignInChangeUsersMask();
|
static void ClearSignInChangeUsersMask();
|
||||||
static int SignoutExitWorldThreadProc( void* lpParameter );
|
static int SignoutExitWorldThreadProc( void* lpParameter );
|
||||||
static int PrimaryPlayerSignedOutReturned(void *pParam, int iPad, const C4JStorage::EMessageResult);
|
static int PrimaryPlayerSignedOutReturned(void *pParam, int iPad, const C4JStorage::EMessageResult);
|
||||||
@@ -283,14 +283,14 @@ public:
|
|||||||
virtual void FatalLoadError();
|
virtual void FatalLoadError();
|
||||||
|
|
||||||
// Notifications from the game listener to be passed to the qnet listener
|
// Notifications from the game listener to be passed to the qnet listener
|
||||||
static void NotificationsCallback(LPVOID pParam,DWORD dwNotification, unsigned int uiParam);
|
static void NotificationsCallback(void* pParam,unsigned long dwNotification, unsigned int uiParam);
|
||||||
|
|
||||||
// for the ethernet being disconnected
|
// for the ethernet being disconnected
|
||||||
static void LiveLinkChangeCallback(LPVOID pParam,BOOL bConnected);
|
static void LiveLinkChangeCallback(void* pParam,bool bConnected);
|
||||||
bool GetLiveLinkRequired() {return m_bLiveLinkRequired;}
|
bool GetLiveLinkRequired() {return m_bLiveLinkRequired;}
|
||||||
void SetLiveLinkRequired(bool required) {m_bLiveLinkRequired=required;}
|
void SetLiveLinkRequired(bool required) {m_bLiveLinkRequired=required;}
|
||||||
|
|
||||||
static void UpsellReturnedCallback(LPVOID pParam, eUpsellType type, eUpsellResponse result, int iUserData);
|
static void UpsellReturnedCallback(void* pParam, eUpsellType type, eUpsellResponse result, int iUserData);
|
||||||
|
|
||||||
#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__
|
#if defined __PS3__ || defined __PSVITA__ || defined __ORBIS__
|
||||||
static int NowDisplayFullVersionPurchase(void *pParam, bool bContinue, int iPad);
|
static int NowDisplayFullVersionPurchase(void *pParam, bool bContinue, int iPad);
|
||||||
@@ -306,21 +306,21 @@ public:
|
|||||||
bool DebugSettingsOn() { return false;}
|
bool DebugSettingsOn() { return false;}
|
||||||
#endif
|
#endif
|
||||||
void SetDebugSequence(const char *pchSeq);
|
void SetDebugSequence(const char *pchSeq);
|
||||||
static int DebugInputCallback(LPVOID pParam);
|
static int DebugInputCallback(void* pParam);
|
||||||
//bool UploadFileToGlobalStorage(int iQuadrant, C4JStorage::eGlobalStorage eStorageFacility, wstring *wsFile );
|
//bool UploadFileToGlobalStorage(int iQuadrant, C4JStorage::eGlobalStorage eStorageFacility, wstring *wsFile );
|
||||||
|
|
||||||
// Installed DLC
|
// Installed DLC
|
||||||
bool StartInstallDLCProcess(int iPad);
|
bool StartInstallDLCProcess(int iPad);
|
||||||
static int DLCInstalledCallback(LPVOID pParam,int iOfferC,int iPad);
|
static int DLCInstalledCallback(void* pParam,int iOfferC,int iPad);
|
||||||
void HandleDLCLicenseChange();
|
void HandleDLCLicenseChange();
|
||||||
static int DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask);
|
static int DLCMountedCallback(void* pParam,int iPad,unsigned long dwErr,unsigned long dwLicenceMask);
|
||||||
void MountNextDLC(int iPad);
|
void MountNextDLC(int iPad);
|
||||||
//static int DLCReadCallback(LPVOID pParam,C4JStorage::DLC_FILE_DETAILS *pDLCData);
|
//static int DLCReadCallback(void* pParam,C4JStorage::DLC_FILE_DETAILS *pDLCData);
|
||||||
void HandleDLC(DLCPack *pack);
|
void HandleDLC(DLCPack *pack);
|
||||||
bool DLCInstallPending() {return m_bDLCInstallPending;}
|
bool DLCInstallPending() {return m_bDLCInstallPending;}
|
||||||
bool DLCInstallProcessCompleted() {return m_bDLCInstallProcessCompleted;}
|
bool DLCInstallProcessCompleted() {return m_bDLCInstallProcessCompleted;}
|
||||||
void ClearDLCInstalled() { m_bDLCInstallProcessCompleted=false;}
|
void ClearDLCInstalled() { m_bDLCInstallProcessCompleted=false;}
|
||||||
static int MarketplaceCountsCallback(LPVOID pParam,C4JStorage::DLC_TMS_DETAILS *,int iPad);
|
static int MarketplaceCountsCallback(void* pParam,C4JStorage::DLC_TMS_DETAILS *,int iPad);
|
||||||
|
|
||||||
bool AlreadySeenCreditText(const wstring &wstemp);
|
bool AlreadySeenCreditText(const wstring &wstemp);
|
||||||
|
|
||||||
@@ -336,19 +336,19 @@ public:
|
|||||||
bool isXuidNotch(PlayerUID xuid);
|
bool isXuidNotch(PlayerUID xuid);
|
||||||
bool isXuidDeadmau5(PlayerUID xuid);
|
bool isXuidDeadmau5(PlayerUID xuid);
|
||||||
|
|
||||||
void AddMemoryTextureFile(const wstring &wName, PBYTE pbData, DWORD dwBytes);
|
void AddMemoryTextureFile(const wstring &wName, uint8_t* pbData, unsigned long dwBytes);
|
||||||
void RemoveMemoryTextureFile(const wstring &wName);
|
void RemoveMemoryTextureFile(const wstring &wName);
|
||||||
void GetMemFileDetails(const wstring &wName,PBYTE *ppbData,DWORD *pdwBytes);
|
void GetMemFileDetails(const wstring &wName,uint8_t* *ppbData,unsigned long *pdwBytes);
|
||||||
bool IsFileInMemoryTextures(const wstring &wName);
|
bool IsFileInMemoryTextures(const wstring &wName);
|
||||||
|
|
||||||
// Texture Pack Data files (icon, banner, comparison shot & text)
|
// Texture Pack Data files (icon, banner, comparison shot & text)
|
||||||
void AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes);
|
void AddMemoryTPDFile(int iConfig,uint8_t* pbData,unsigned long dwBytes);
|
||||||
void RemoveMemoryTPDFile(int iConfig);
|
void RemoveMemoryTPDFile(int iConfig);
|
||||||
bool IsFileInTPD(int iConfig);
|
bool IsFileInTPD(int iConfig);
|
||||||
void GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes);
|
void GetTPD(int iConfig,uint8_t* *ppbData,unsigned long *pdwBytes);
|
||||||
int GetTPDSize() {return m_MEM_TPD.size();}
|
int GetTPDSize() {return m_MEM_TPD.size();}
|
||||||
#ifndef __PS3__
|
#ifndef __PS3__
|
||||||
int GetTPConfigVal(WCHAR *pwchDataFile);
|
int GetTPConfigVal(wchar_t *pwchDataFile);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool DefaultCapeExists();
|
bool DefaultCapeExists();
|
||||||
@@ -356,17 +356,17 @@ public:
|
|||||||
|
|
||||||
// invites
|
// invites
|
||||||
//void ProcessInvite(JoinFromInviteData *pJoinData);
|
//void ProcessInvite(JoinFromInviteData *pJoinData);
|
||||||
void ProcessInvite(DWORD dwUserIndex, DWORD dwLocalUsersMask, const INVITE_INFO * pInviteInfo);
|
void ProcessInvite(unsigned long dwUserIndex, unsigned long dwLocalUsersMask, const INVITE_INFO * pInviteInfo);
|
||||||
|
|
||||||
// Add credits for DLC installed
|
// Add credits for DLC installed
|
||||||
void AddCreditText(LPCWSTR lpStr);
|
void AddCreditText(const wchar_t* lpStr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PlayerUID m_xuidNotch;
|
PlayerUID m_xuidNotch;
|
||||||
#ifdef _DURANGO
|
#ifdef _DURANGO
|
||||||
unordered_map<PlayerUID, PBYTE, PlayerUID::Hash> m_GTS_Files;
|
unordered_map<PlayerUID, uint8_t*, PlayerUID::Hash> m_GTS_Files;
|
||||||
#else
|
#else
|
||||||
unordered_map<PlayerUID, PBYTE> m_GTS_Files;
|
unordered_map<PlayerUID, uint8_t*> m_GTS_Files;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// for storing memory textures - player skin
|
// for storing memory textures - player skin
|
||||||
@@ -380,8 +380,8 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// launch data
|
// launch data
|
||||||
BYTE* m_pLaunchData;
|
uint8_t* m_pLaunchData;
|
||||||
DWORD m_dwLaunchDataSize;
|
unsigned long m_dwLaunchDataSize;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// BAN LIST
|
// BAN LIST
|
||||||
@@ -480,7 +480,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static const DWORD m_dwOfferID = 0x00000001;
|
static const unsigned long m_dwOfferID = 0x00000001;
|
||||||
|
|
||||||
// timer
|
// timer
|
||||||
void InitTime();
|
void InitTime();
|
||||||
@@ -500,10 +500,10 @@ private:
|
|||||||
// we'll action these at the end of the game loop
|
// we'll action these at the end of the game loop
|
||||||
eXuiAction m_eXuiAction[XUSER_MAX_COUNT];
|
eXuiAction m_eXuiAction[XUSER_MAX_COUNT];
|
||||||
eTMSAction m_eTMSAction[XUSER_MAX_COUNT];
|
eTMSAction m_eTMSAction[XUSER_MAX_COUNT];
|
||||||
LPVOID m_eXuiActionParam[XUSER_MAX_COUNT];
|
void* m_eXuiActionParam[XUSER_MAX_COUNT];
|
||||||
eXuiAction m_eGlobalXuiAction;
|
eXuiAction m_eGlobalXuiAction;
|
||||||
eXuiServerAction m_eXuiServerAction[XUSER_MAX_COUNT];
|
eXuiServerAction m_eXuiServerAction[XUSER_MAX_COUNT];
|
||||||
LPVOID m_eXuiServerActionParam[XUSER_MAX_COUNT];
|
void* m_eXuiServerActionParam[XUSER_MAX_COUNT];
|
||||||
eXuiServerAction m_eGlobalXuiServerAction;
|
eXuiServerAction m_eGlobalXuiServerAction;
|
||||||
|
|
||||||
bool m_bLiveLinkRequired;
|
bool m_bLiveLinkRequired;
|
||||||
@@ -544,7 +544,7 @@ protected:
|
|||||||
static Random *TipRandom;
|
static Random *TipRandom;
|
||||||
public:
|
public:
|
||||||
void InitialiseTips();
|
void InitialiseTips();
|
||||||
UINT GetNextTip();
|
unsigned int GetNextTip();
|
||||||
int GetHTMLColour(eMinecraftColour colour);
|
int GetHTMLColour(eMinecraftColour colour);
|
||||||
int GetHTMLColor(eMinecraftColour colour) { return GetHTMLColour(colour); }
|
int GetHTMLColor(eMinecraftColour colour) { return GetHTMLColour(colour); }
|
||||||
int GetHTMLFontSize(EHTMLFontSize size);
|
int GetHTMLFontSize(EHTMLFontSize size);
|
||||||
@@ -557,11 +557,11 @@ public:
|
|||||||
void UpdateTrialPausedTimer() { mfTrialPausedTime+= m_Time.fElapsedTime;}
|
void UpdateTrialPausedTimer() { mfTrialPausedTime+= m_Time.fElapsedTime;}
|
||||||
|
|
||||||
static int RemoteSaveThreadProc( void* lpParameter );
|
static int RemoteSaveThreadProc( void* lpParameter );
|
||||||
static void ExitGameFromRemoteSave( LPVOID lpParameter );
|
static void ExitGameFromRemoteSave( void* lpParameter );
|
||||||
static int ExitGameFromRemoteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
static int ExitGameFromRemoteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||||
private:
|
private:
|
||||||
UINT m_TipIDA[MAX_TIPS_GAMETIP+MAX_TIPS_TRIVIATIP];
|
unsigned int m_TipIDA[MAX_TIPS_GAMETIP+MAX_TIPS_TRIVIATIP];
|
||||||
UINT m_uiCurrentTip;
|
unsigned int m_uiCurrentTip;
|
||||||
static int TipsSortFunction(const void* a, const void* b);
|
static int TipsSortFunction(const void* a, const void* b);
|
||||||
|
|
||||||
// XML
|
// XML
|
||||||
@@ -574,26 +574,26 @@ public:
|
|||||||
bool GetTerrainFeaturePosition(_eTerrainFeatureType eType, int *pX, int *pZ);
|
bool GetTerrainFeaturePosition(_eTerrainFeatureType eType, int *pX, int *pZ);
|
||||||
std::vector <FEATURE_DATA *> m_vTerrainFeatures;
|
std::vector <FEATURE_DATA *> m_vTerrainFeatures;
|
||||||
|
|
||||||
static HRESULT RegisterMojangData(WCHAR *, PlayerUID, WCHAR *, WCHAR *);
|
static int RegisterMojangData(wchar_t *, PlayerUID, wchar_t *, wchar_t *);
|
||||||
MOJANG_DATA *GetMojangDataForXuid(PlayerUID xuid);
|
MOJANG_DATA *GetMojangDataForXuid(PlayerUID xuid);
|
||||||
static HRESULT RegisterConfigValues(WCHAR *pType, int iValue);
|
static int RegisterConfigValues(wchar_t *pType, int iValue);
|
||||||
|
|
||||||
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__)
|
||||||
HRESULT RegisterDLCData(char *pchDLCName, unsigned int uiSortIndex, char *pchImageURL);
|
int RegisterDLCData(char *pchDLCName, unsigned int uiSortIndex, char *pchImageURL);
|
||||||
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal);
|
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,uint64_t *pullVal);
|
||||||
DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial);
|
DLC_INFO *GetDLCInfoForTrialOfferID(uint64_t ullOfferID_Trial);
|
||||||
DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full);
|
DLC_INFO *GetDLCInfoForFullOfferID(uint64_t ullOfferID_Full);
|
||||||
#elif defined(_XBOX_ONE)
|
#elif defined(_XBOX_ONE)
|
||||||
static HRESULT RegisterDLCData(eDLCContentType, WCHAR *, WCHAR *, WCHAR *, WCHAR *, int, unsigned int);
|
static int RegisterDLCData(eDLCContentType, wchar_t *, wchar_t *, wchar_t *, wchar_t *, int, unsigned int);
|
||||||
//bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,WCHAR *pwchProductId);
|
//bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,wchar_t *pwchProductId);
|
||||||
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,wstring &wsProductId);
|
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,wstring &wsProductId);
|
||||||
DLC_INFO *GetDLCInfoForFullOfferID(WCHAR *pwchProductId);
|
DLC_INFO *GetDLCInfoForFullOfferID(wchar_t *pwchProductId);
|
||||||
DLC_INFO *GetDLCInfoForProductName(WCHAR *pwchProductName);
|
DLC_INFO *GetDLCInfoForProductName(wchar_t *pwchProductName);
|
||||||
#else
|
#else
|
||||||
static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, __uint64, __uint64, WCHAR *, unsigned int, int, WCHAR *pDataFile);
|
static int RegisterDLCData(wchar_t *, wchar_t *, int, uint64_t, uint64_t, wchar_t *, unsigned int, int, wchar_t *pDataFile);
|
||||||
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal);
|
bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,uint64_t *pullVal);
|
||||||
DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial);
|
DLC_INFO *GetDLCInfoForTrialOfferID(uint64_t ullOfferID_Trial);
|
||||||
DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full);
|
DLC_INFO *GetDLCInfoForFullOfferID(uint64_t ullOfferID_Full);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned int GetDLCCreditsCount();
|
unsigned int GetDLCCreditsCount();
|
||||||
@@ -605,9 +605,9 @@ public:
|
|||||||
|
|
||||||
// images for save thumbnail/social post
|
// images for save thumbnail/social post
|
||||||
virtual void CaptureSaveThumbnail() =0;
|
virtual void CaptureSaveThumbnail() =0;
|
||||||
virtual void GetSaveThumbnail(PBYTE*,DWORD*)=0;
|
virtual void GetSaveThumbnail(uint8_t**,unsigned long*)=0;
|
||||||
virtual void ReleaseSaveThumbnail()=0;
|
virtual void ReleaseSaveThumbnail()=0;
|
||||||
virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize)=0;
|
virtual void GetScreenshot(int iPad,uint8_t* *pbData,unsigned long *pdwSize)=0;
|
||||||
|
|
||||||
virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false)=0;
|
virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false)=0;
|
||||||
|
|
||||||
@@ -619,7 +619,7 @@ private:
|
|||||||
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
|
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<int, char * > DLCTextures_PackID; // for mash-up packs & texture packs
|
||||||
static unordered_map<string,DLC_INFO * > DLCInfo;
|
static unordered_map<string,DLC_INFO * > DLCInfo;
|
||||||
static unordered_map<wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id
|
static unordered_map<wstring, uint64_t > DLCInfo_SkinName; // skin name, full offer id
|
||||||
#elif defined(_DURANGO)
|
#elif defined(_DURANGO)
|
||||||
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
|
static unordered_map<PlayerUID,MOJANG_DATA *, PlayerUID::Hash > MojangData;
|
||||||
static unordered_map<int, wstring > DLCTextures_PackID; // for mash-up packs & texture packs
|
static unordered_map<int, wstring > DLCTextures_PackID; // for mash-up packs & texture packs
|
||||||
@@ -628,10 +628,10 @@ private:
|
|||||||
static unordered_map<wstring, wstring > DLCInfo_SkinName; // skin name, full offer id
|
static unordered_map<wstring, wstring > DLCInfo_SkinName; // skin name, full offer id
|
||||||
#else
|
#else
|
||||||
static unordered_map<PlayerUID,MOJANG_DATA * > MojangData;
|
static unordered_map<PlayerUID,MOJANG_DATA * > MojangData;
|
||||||
static unordered_map<int, ULONGLONG > DLCTextures_PackID; // for mash-up packs & texture packs
|
static unordered_map<int, uint64_t > DLCTextures_PackID; // for mash-up packs & texture packs
|
||||||
static unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info
|
static unordered_map<uint64_t,DLC_INFO * > DLCInfo_Trial; // full offerid, dlc_info
|
||||||
static unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info
|
static unordered_map<uint64_t,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info
|
||||||
static unordered_map<wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id
|
static unordered_map<wstring, uint64_t > DLCInfo_SkinName; // skin name, full offer id
|
||||||
#endif
|
#endif
|
||||||
// bool m_bRead_TMS_XUIDS_XML; // track whether we have already read the TMS xuids.xml file
|
// bool m_bRead_TMS_XUIDS_XML; // track whether we have already read the TMS xuids.xml file
|
||||||
// bool m_bRead_TMS_DLCINFO_XML; // track whether we have already read the TMS DLC.xml file
|
// bool m_bRead_TMS_DLCINFO_XML; // track whether we have already read the TMS DLC.xml file
|
||||||
@@ -700,8 +700,8 @@ public:
|
|||||||
bool CanRecordStatsAndAchievements();
|
bool CanRecordStatsAndAchievements();
|
||||||
|
|
||||||
// World seed from png image
|
// World seed from png image
|
||||||
void GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsigned char *pszSeed,unsigned int &uiHostOptions,bool &bHostOptionsRead,DWORD &uiTexturePack);
|
void GetImageTextData(uint8_t* pbImageData, unsigned long dwImageBytes,unsigned char *pszSeed,unsigned int &uiHostOptions,bool &bHostOptionsRead,unsigned long &uiTexturePack);
|
||||||
unsigned int CreateImageTextData(PBYTE bTextMetadata, __int64 seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId);
|
unsigned int CreateImageTextData(uint8_t* bTextMetadata, int64_t seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId);
|
||||||
|
|
||||||
// Game rules
|
// Game rules
|
||||||
GameRuleManager m_gameRules;
|
GameRuleManager m_gameRules;
|
||||||
@@ -714,16 +714,16 @@ public:
|
|||||||
void setLevelGenerationOptions(LevelGenerationOptions *levelGen);
|
void setLevelGenerationOptions(LevelGenerationOptions *levelGen);
|
||||||
LevelRuleset *getGameRuleDefinitions() { return m_gameRules.getGameRuleDefinitions(); }
|
LevelRuleset *getGameRuleDefinitions() { return m_gameRules.getGameRuleDefinitions(); }
|
||||||
LevelGenerationOptions *getLevelGenerationOptions() { return m_gameRules.getLevelGenerationOptions(); }
|
LevelGenerationOptions *getLevelGenerationOptions() { return m_gameRules.getLevelGenerationOptions(); }
|
||||||
LPCWSTR GetGameRulesString(const wstring &key);
|
const wchar_t* GetGameRulesString(const wstring &key);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BYTE m_playerColours[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's
|
uint8_t m_playerColours[MINECRAFT_NET_MAX_PLAYERS]; // An array of QNet small-id's
|
||||||
unsigned int m_playerGamePrivileges[MINECRAFT_NET_MAX_PLAYERS];
|
unsigned int m_playerGamePrivileges[MINECRAFT_NET_MAX_PLAYERS];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void UpdatePlayerInfo(BYTE networkSmallId, SHORT playerColourIndex, unsigned int playerGamePrivileges);
|
void UpdatePlayerInfo(uint8_t networkSmallId, int16_t playerColourIndex, unsigned int playerGamePrivileges);
|
||||||
short GetPlayerColour(BYTE networkSmallId);
|
short GetPlayerColour(uint8_t networkSmallId);
|
||||||
unsigned int GetPlayerPrivileges(BYTE networkSmallId);
|
unsigned int GetPlayerPrivileges(uint8_t networkSmallId);
|
||||||
|
|
||||||
wstring getEntityName(eINSTANCEOF type);
|
wstring getEntityName(eINSTANCEOF type);
|
||||||
|
|
||||||
@@ -732,9 +732,9 @@ public:
|
|||||||
unsigned int AddDLCRequest(eDLCMarketplaceType eContentType, bool bPromote=false);
|
unsigned int AddDLCRequest(eDLCMarketplaceType eContentType, bool bPromote=false);
|
||||||
bool RetrieveNextDLCContent();
|
bool RetrieveNextDLCContent();
|
||||||
bool CheckTMSDLCCanStop();
|
bool CheckTMSDLCCanStop();
|
||||||
static int DLCOffersReturned(void *pParam, int iOfferC, DWORD dwType, int iPad);
|
static int DLCOffersReturned(void *pParam, int iOfferC, unsigned long dwType, int iPad);
|
||||||
DWORD GetDLCContentType(eDLCContentType eType) { return m_dwContentTypeA[eType];}
|
unsigned long GetDLCContentType(eDLCContentType eType) { return m_dwContentTypeA[eType];}
|
||||||
eDLCContentType Find_eDLCContentType(DWORD dwType);
|
eDLCContentType Find_eDLCContentType(unsigned long dwType);
|
||||||
int GetDLCOffersCount() { return m_iDLCOfferC;}
|
int GetDLCOffersCount() { return m_iDLCOfferC;}
|
||||||
bool DLCContentRetrieved(eDLCMarketplaceType eType);
|
bool DLCContentRetrieved(eDLCMarketplaceType eType);
|
||||||
void TickDLCOffersRetrieved();
|
void TickDLCOffersRetrieved();
|
||||||
@@ -754,10 +754,10 @@ public:
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#ifdef _XBOX_ONE
|
#ifdef _XBOX_ONE
|
||||||
static int TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,LPVOID, WCHAR *wchFilename);
|
static int TMSPPFileReturned(void* pParam,int iPad,int iUserData,void*, wchar_t *wchFilename);
|
||||||
unordered_map<wstring,DLC_INFO * > *GetDLCInfo();
|
unordered_map<wstring,DLC_INFO * > *GetDLCInfo();
|
||||||
#else
|
#else
|
||||||
static int TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, LPCSTR szFilename);
|
static int TMSPPFileReturned(void* pParam,int iPad,int iUserData,C4JStorage::PTMSPP_FILEDATA pFileData, const char* szFilename);
|
||||||
#endif
|
#endif
|
||||||
DLC_INFO *GetDLCInfoTrialOffer(int iIndex);
|
DLC_INFO *GetDLCInfoTrialOffer(int iIndex);
|
||||||
DLC_INFO *GetDLCInfoFullOffer(int iIndex);
|
DLC_INFO *GetDLCInfoFullOffer(int iIndex);
|
||||||
@@ -769,8 +769,8 @@ public:
|
|||||||
wstring GetDLCInfoTexturesFullOffer(int iIndex);
|
wstring GetDLCInfoTexturesFullOffer(int iIndex);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
bool GetDLCFullOfferIDForPackID(const int iPackID,ULONGLONG *pullVal);
|
bool GetDLCFullOfferIDForPackID(const int iPackID,uint64_t *pullVal);
|
||||||
ULONGLONG GetDLCInfoTexturesFullOffer(int iIndex);
|
uint64_t GetDLCInfoTexturesFullOffer(int iIndex);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -787,7 +787,7 @@ private:
|
|||||||
//Request current_download;
|
//Request current_download;
|
||||||
vector<DLCRequest *> m_DLCDownloadQueue;
|
vector<DLCRequest *> m_DLCDownloadQueue;
|
||||||
vector<TMSPPRequest *> m_TMSPPDownloadQueue;
|
vector<TMSPPRequest *> m_TMSPPDownloadQueue;
|
||||||
static DWORD m_dwContentTypeA[e_Marketplace_MAX];
|
static unsigned long m_dwContentTypeA[e_Marketplace_MAX];
|
||||||
int m_iDLCOfferC;
|
int m_iDLCOfferC;
|
||||||
bool m_bAllDLCContentRetrieved;
|
bool m_bAllDLCContentRetrieved;
|
||||||
bool m_bAllTMSContentRetrieved;
|
bool m_bAllTMSContentRetrieved;
|
||||||
@@ -799,34 +799,34 @@ private:
|
|||||||
CRITICAL_SECTION csAnimOverrideBitmask;
|
CRITICAL_SECTION csAnimOverrideBitmask;
|
||||||
bool m_bCorruptSaveDeleted;
|
bool m_bCorruptSaveDeleted;
|
||||||
|
|
||||||
DWORD m_dwAdditionalModelParts[XUSER_MAX_COUNT];
|
unsigned long m_dwAdditionalModelParts[XUSER_MAX_COUNT];
|
||||||
|
|
||||||
BYTE *m_pBannedListFileBuffer;
|
uint8_t *m_pBannedListFileBuffer;
|
||||||
DWORD m_dwBannedListFileSize;
|
unsigned long m_dwBannedListFileSize;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DWORD m_dwDLCFileSize;
|
unsigned long m_dwDLCFileSize;
|
||||||
BYTE *m_pDLCFileBuffer;
|
uint8_t *m_pDLCFileBuffer;
|
||||||
|
|
||||||
// static int CallbackReadXuidsFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction);
|
// static int CallbackReadXuidsFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, bool bResult, int iAction);
|
||||||
// static int CallbackDLCFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction);
|
// static int CallbackDLCFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, bool bResult, int iAction);
|
||||||
// static int CallbackBannedListFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction);
|
// static int CallbackBannedListFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, bool bResult, int iAction);
|
||||||
|
|
||||||
// Storing additional model parts per skin texture
|
// Storing additional model parts per skin texture
|
||||||
void SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, DWORD dwSkinBoxC);
|
void SetAdditionalSkinBoxes(unsigned long dwSkinID, SKIN_BOX *SkinBoxA, unsigned long dwSkinBoxC);
|
||||||
vector<ModelPart *> * SetAdditionalSkinBoxes(DWORD dwSkinID, vector<SKIN_BOX *> *pvSkinBoxA);
|
vector<ModelPart *> * SetAdditionalSkinBoxes(unsigned long dwSkinID, vector<SKIN_BOX *> *pvSkinBoxA);
|
||||||
vector<ModelPart *> *GetAdditionalModelParts(DWORD dwSkinID);
|
vector<ModelPart *> *GetAdditionalModelParts(unsigned long dwSkinID);
|
||||||
vector<SKIN_BOX *> *GetAdditionalSkinBoxes(DWORD dwSkinID);
|
vector<SKIN_BOX *> *GetAdditionalSkinBoxes(unsigned long dwSkinID);
|
||||||
void SetAnimOverrideBitmask(DWORD dwSkinID,unsigned int uiAnimOverrideBitmask);
|
void SetAnimOverrideBitmask(unsigned long dwSkinID,unsigned int uiAnimOverrideBitmask);
|
||||||
unsigned int GetAnimOverrideBitmask(DWORD dwSkinID);
|
unsigned int GetAnimOverrideBitmask(unsigned long dwSkinID);
|
||||||
|
|
||||||
static DWORD getSkinIdFromPath(const wstring &skin);
|
static unsigned long getSkinIdFromPath(const wstring &skin);
|
||||||
static wstring getSkinPathFromId(DWORD skinId);
|
static wstring getSkinPathFromId(unsigned long skinId);
|
||||||
|
|
||||||
virtual int LoadLocalTMSFile(WCHAR *wchTMSFile)=0;
|
virtual int LoadLocalTMSFile(wchar_t *wchTMSFile)=0;
|
||||||
virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt)=0;
|
virtual int LoadLocalTMSFile(wchar_t *wchTMSFile, eFileExtensionType eExt)=0;
|
||||||
virtual void FreeLocalTMSFiles(eTMSFileType eType)=0;
|
virtual void FreeLocalTMSFiles(eTMSFileType eType)=0;
|
||||||
virtual int GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT)=0;
|
virtual int GetLocalTMSFileIndex(wchar_t *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT)=0;
|
||||||
|
|
||||||
virtual bool GetTMSGlobalFileListRead() { return true;}
|
virtual bool GetTMSGlobalFileListRead() { return true;}
|
||||||
virtual bool GetTMSDLCInfoRead() { return true;}
|
virtual bool GetTMSDLCInfoRead() { return true;}
|
||||||
@@ -836,24 +836,24 @@ public:
|
|||||||
void SetBanListRead(int iPad,bool bVal) { m_bRead_BannedListA[iPad]=bVal;}
|
void SetBanListRead(int iPad,bool bVal) { m_bRead_BannedListA[iPad]=bVal;}
|
||||||
void ClearBanList(int iPad) { BannedListA[iPad].pBannedList=NULL;BannedListA[iPad].dwBytes=0;}
|
void ClearBanList(int iPad) { BannedListA[iPad].pBannedList=NULL;BannedListA[iPad].dwBytes=0;}
|
||||||
|
|
||||||
DWORD GetRequiredTexturePackID() {return m_dwRequiredTexturePackID;}
|
unsigned long GetRequiredTexturePackID() {return m_dwRequiredTexturePackID;}
|
||||||
void SetRequiredTexturePackID(DWORD dwID) {m_dwRequiredTexturePackID=dwID;}
|
void SetRequiredTexturePackID(unsigned long dwID) {m_dwRequiredTexturePackID=dwID;}
|
||||||
|
|
||||||
virtual void GetFileFromTPD(eTPDFileType eType,PBYTE pbData,DWORD dwBytes,PBYTE *ppbData,DWORD *pdwBytes ) {*ppbData = NULL; *pdwBytes = 0;}
|
virtual void GetFileFromTPD(eTPDFileType eType,uint8_t* pbData,unsigned long dwBytes,uint8_t* *ppbData,unsigned long *pdwBytes ) {*ppbData = NULL; *pdwBytes = 0;}
|
||||||
|
|
||||||
//XTITLE_DEPLOYMENT_TYPE getDeploymentType() { return m_titleDeploymentType; }
|
//XTITLE_DEPLOYMENT_TYPE getDeploymentType() { return m_titleDeploymentType; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// vector of additional skin model parts, indexed by the skin texture id
|
// vector of additional skin model parts, indexed by the skin texture id
|
||||||
unordered_map<DWORD, vector<ModelPart *> *> m_AdditionalModelParts;
|
unordered_map<unsigned long, vector<ModelPart *> *> m_AdditionalModelParts;
|
||||||
unordered_map<DWORD, vector<SKIN_BOX *> *> m_AdditionalSkinBoxes;
|
unordered_map<unsigned long, vector<SKIN_BOX *> *> m_AdditionalSkinBoxes;
|
||||||
unordered_map<DWORD, unsigned int> m_AnimOverrides;
|
unordered_map<unsigned long, unsigned int> m_AnimOverrides;
|
||||||
|
|
||||||
|
|
||||||
bool m_bResetNether;
|
bool m_bResetNether;
|
||||||
DWORD m_dwRequiredTexturePackID;
|
unsigned long m_dwRequiredTexturePackID;
|
||||||
#ifdef _XBOX_ONE
|
#ifdef _XBOX_ONE
|
||||||
vector <PBYTE> m_vTMSPPData;
|
vector <uint8_t*> m_vTMSPPData;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
|
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__)
|
||||||
@@ -870,18 +870,18 @@ public:
|
|||||||
|
|
||||||
void LocaleAndLanguageInit();
|
void LocaleAndLanguageInit();
|
||||||
void getLocale(vector<wstring> &vecWstrLocales);
|
void getLocale(vector<wstring> &vecWstrLocales);
|
||||||
DWORD get_eMCLang(WCHAR *pwchLocale);
|
unsigned long get_eMCLang(wchar_t *pwchLocale);
|
||||||
DWORD get_xcLang(WCHAR *pwchLocale);
|
unsigned long get_xcLang(wchar_t *pwchLocale);
|
||||||
|
|
||||||
void SetTickTMSDLCFiles(bool bVal);
|
void SetTickTMSDLCFiles(bool bVal);
|
||||||
|
|
||||||
wstring getFilePath(DWORD packId, wstring filename, bool bAddDataFolder);
|
wstring getFilePath(unsigned long packId, wstring filename, bool bAddDataFolder);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unordered_map<int, wstring>m_localeA;
|
unordered_map<int, wstring>m_localeA;
|
||||||
unordered_map<wstring, int>m_eMCLangA;
|
unordered_map<wstring, int>m_eMCLangA;
|
||||||
unordered_map<wstring, int>m_xcLangA;
|
unordered_map<wstring, int>m_xcLangA;
|
||||||
wstring getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder);
|
wstring getRootPath(unsigned long packId, bool allowOverride, bool bAddDataFolder);
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
@@ -908,4 +908,4 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//singleton
|
//singleton
|
||||||
//extern CMinecraftApp app;
|
extern CMinecraftApp app;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ DLCAudioFile::DLCAudioFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_
|
|||||||
m_dwBytes = 0;
|
m_dwBytes = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCAudioFile::addData(PBYTE pbData, DWORD dwBytes)
|
void DLCAudioFile::addData(uint8_t* pbData, unsigned long dwBytes)
|
||||||
{
|
{
|
||||||
m_pbData = pbData;
|
m_pbData = pbData;
|
||||||
m_dwBytes = dwBytes;
|
m_dwBytes = dwBytes;
|
||||||
@@ -20,13 +20,13 @@ void DLCAudioFile::addData(PBYTE pbData, DWORD dwBytes)
|
|||||||
processDLCDataFile(pbData,dwBytes);
|
processDLCDataFile(pbData,dwBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
PBYTE DLCAudioFile::getData(DWORD &dwBytes)
|
uint8_t* DLCAudioFile::getData(unsigned long &dwBytes)
|
||||||
{
|
{
|
||||||
dwBytes = m_dwBytes;
|
dwBytes = m_dwBytes;
|
||||||
return m_pbData;
|
return m_pbData;
|
||||||
}
|
}
|
||||||
|
|
||||||
WCHAR *DLCAudioFile::wchTypeNamesA[]=
|
wchar_t *DLCAudioFile::wchTypeNamesA[]=
|
||||||
{
|
{
|
||||||
L"CUENAME",
|
L"CUENAME",
|
||||||
L"CREDIT",
|
L"CREDIT",
|
||||||
@@ -36,7 +36,7 @@ DLCAudioFile::EAudioParameterType DLCAudioFile::getParameterType(const wstring &
|
|||||||
{
|
{
|
||||||
EAudioParameterType type = e_AudioParamType_Invalid;
|
EAudioParameterType type = e_AudioParamType_Invalid;
|
||||||
|
|
||||||
for(DWORD i = 0; i < e_AudioParamType_Max; ++i)
|
for(unsigned long i = 0; i < e_AudioParamType_Max; ++i)
|
||||||
{
|
{
|
||||||
if(paramName.compare(wchTypeNamesA[i]) == 0)
|
if(paramName.compare(wchTypeNamesA[i]) == 0)
|
||||||
{
|
{
|
||||||
@@ -120,7 +120,7 @@ void DLCAudioFile::addParameter(EAudioType type, EAudioParameterType ptype, cons
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
|
bool DLCAudioFile::processDLCDataFile(uint8_t* pbData, unsigned long dwLength)
|
||||||
{
|
{
|
||||||
unordered_map<int, EAudioParameterType> parameterMapping;
|
unordered_map<int, EAudioParameterType> parameterMapping;
|
||||||
unsigned int uiCurrentByte=0;
|
unsigned int uiCurrentByte=0;
|
||||||
@@ -145,26 +145,26 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
|
|||||||
for(unsigned int i=0;i<uiParameterTypeCount;i++)
|
for(unsigned int i=0;i<uiParameterTypeCount;i++)
|
||||||
{
|
{
|
||||||
// Map DLC strings to application strings, then store the DLC index mapping to application index
|
// Map DLC strings to application strings, then store the DLC index mapping to application index
|
||||||
wstring parameterName((WCHAR *)pParams->wchData);
|
wstring parameterName((wchar_t *)pParams->wchData);
|
||||||
EAudioParameterType type = getParameterType(parameterName);
|
EAudioParameterType type = getParameterType(parameterName);
|
||||||
if( type != e_AudioParamType_Invalid )
|
if( type != e_AudioParamType_Invalid )
|
||||||
{
|
{
|
||||||
parameterMapping[pParams->dwType] = type;
|
parameterMapping[pParams->dwType] = type;
|
||||||
}
|
}
|
||||||
uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(WCHAR));
|
uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(wchar_t));
|
||||||
pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
||||||
}
|
}
|
||||||
unsigned int uiFileCount=*(unsigned int *)&pbData[uiCurrentByte];
|
unsigned int uiFileCount=*(unsigned int *)&pbData[uiCurrentByte];
|
||||||
uiCurrentByte+=sizeof(int);
|
uiCurrentByte+=sizeof(int);
|
||||||
C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
||||||
|
|
||||||
DWORD dwTemp=uiCurrentByte;
|
unsigned long dwTemp=uiCurrentByte;
|
||||||
for(unsigned int i=0;i<uiFileCount;i++)
|
for(unsigned int i=0;i<uiFileCount;i++)
|
||||||
{
|
{
|
||||||
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR);
|
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t);
|
||||||
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
|
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
|
||||||
}
|
}
|
||||||
PBYTE pbTemp=((PBYTE )pFile);
|
uint8_t* pbTemp=((uint8_t* )pFile);
|
||||||
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
||||||
|
|
||||||
for(unsigned int i=0;i<uiFileCount;i++)
|
for(unsigned int i=0;i<uiFileCount;i++)
|
||||||
@@ -182,14 +182,14 @@ bool DLCAudioFile::processDLCDataFile(PBYTE pbData, DWORD dwLength)
|
|||||||
|
|
||||||
if(it != parameterMapping.end() )
|
if(it != parameterMapping.end() )
|
||||||
{
|
{
|
||||||
addParameter(type,(EAudioParameterType)pParams->dwType,(WCHAR *)pParams->wchData);
|
addParameter(type,(EAudioParameterType)pParams->dwType,(wchar_t *)pParams->wchData);
|
||||||
}
|
}
|
||||||
pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(WCHAR)*pParams->dwWchCount);
|
pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(wchar_t)*pParams->dwWchCount);
|
||||||
pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp;
|
pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp;
|
||||||
}
|
}
|
||||||
// Move the pointer to the start of the next files data;
|
// Move the pointer to the start of the next files data;
|
||||||
pbTemp+=pFile->uiFileSize;
|
pbTemp+=pFile->uiFileSize;
|
||||||
uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR);
|
uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t);
|
||||||
|
|
||||||
pFile=(C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
pFile=(C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
||||||
|
|
||||||
|
|||||||
@@ -28,22 +28,22 @@ public:
|
|||||||
e_AudioParamType_Max,
|
e_AudioParamType_Max,
|
||||||
|
|
||||||
};
|
};
|
||||||
static WCHAR *wchTypeNamesA[e_AudioParamType_Max];
|
static wchar_t *wchTypeNamesA[e_AudioParamType_Max];
|
||||||
|
|
||||||
DLCAudioFile(const wstring &path);
|
DLCAudioFile(const wstring &path);
|
||||||
|
|
||||||
virtual void addData(PBYTE pbData, DWORD dwBytes);
|
virtual void addData(uint8_t* pbData, unsigned long dwBytes);
|
||||||
virtual PBYTE getData(DWORD &dwBytes);
|
virtual uint8_t* getData(unsigned long &dwBytes);
|
||||||
|
|
||||||
bool processDLCDataFile(PBYTE pbData, DWORD dwLength);
|
bool processDLCDataFile(uint8_t* pbData, unsigned long dwLength);
|
||||||
int GetCountofType(DLCAudioFile::EAudioType ptype);
|
int GetCountofType(DLCAudioFile::EAudioType ptype);
|
||||||
wstring &GetSoundName(int iIndex);
|
wstring &GetSoundName(int iIndex);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using DLCFile::addParameter;
|
using DLCFile::addParameter;
|
||||||
|
|
||||||
PBYTE m_pbData;
|
uint8_t* m_pbData;
|
||||||
DWORD m_dwBytes;
|
unsigned long m_dwBytes;
|
||||||
static const int CURRENT_AUDIO_VERSION_NUM=1;
|
static const int CURRENT_AUDIO_VERSION_NUM=1;
|
||||||
//unordered_map<int, wstring> m_parameters;
|
//unordered_map<int, wstring> m_parameters;
|
||||||
vector<wstring> m_parameters[e_AudioType_Max];
|
vector<wstring> m_parameters[e_AudioType_Max];
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ DLCCapeFile::DLCCapeFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_Ca
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCCapeFile::addData(PBYTE pbData, DWORD dwBytes)
|
void DLCCapeFile::addData(uint8_t* pbData, unsigned long dwBytes)
|
||||||
{
|
{
|
||||||
app.AddMemoryTextureFile(m_path,pbData,dwBytes);
|
app.AddMemoryTextureFile(m_path,pbData,dwBytes);
|
||||||
}
|
}
|
||||||
@@ -6,5 +6,5 @@ class DLCCapeFile : public DLCFile
|
|||||||
public:
|
public:
|
||||||
DLCCapeFile(const wstring &path);
|
DLCCapeFile(const wstring &path);
|
||||||
|
|
||||||
virtual void addData(PBYTE pbData, DWORD dwBytes);
|
virtual void addData(uint8_t* pbData, unsigned long dwBytes);
|
||||||
};
|
};
|
||||||
@@ -19,7 +19,7 @@ DLCColourTableFile::~DLCColourTableFile()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCColourTableFile::addData(PBYTE pbData, DWORD dwBytes)
|
void DLCColourTableFile::addData(uint8_t* pbData, unsigned long dwBytes)
|
||||||
{
|
{
|
||||||
ColourTable *defaultColourTable = Minecraft::GetInstance()->skins->getDefault()->getColourTable();
|
ColourTable *defaultColourTable = Minecraft::GetInstance()->skins->getDefault()->getColourTable();
|
||||||
m_colourTable = new ColourTable(defaultColourTable, pbData, dwBytes);
|
m_colourTable = new ColourTable(defaultColourTable, pbData, dwBytes);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public:
|
|||||||
DLCColourTableFile(const wstring &path);
|
DLCColourTableFile(const wstring &path);
|
||||||
~DLCColourTableFile();
|
~DLCColourTableFile();
|
||||||
|
|
||||||
virtual void addData(PBYTE pbData, DWORD dwBytes);
|
virtual void addData(uint8_t* pbData, unsigned long dwBytes);
|
||||||
|
|
||||||
ColourTable *getColourTable() { return m_colourTable; }
|
ColourTable *getColourTable() { return m_colourTable; }
|
||||||
};
|
};
|
||||||
@@ -6,7 +6,7 @@ class DLCFile
|
|||||||
protected:
|
protected:
|
||||||
DLCManager::EDLCType m_type;
|
DLCManager::EDLCType m_type;
|
||||||
wstring m_path;
|
wstring m_path;
|
||||||
DWORD m_dwSkinId;
|
unsigned long m_dwSkinId;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DLCFile(DLCManager::EDLCType type, const wstring &path);
|
DLCFile(DLCManager::EDLCType type, const wstring &path);
|
||||||
@@ -14,10 +14,10 @@ public:
|
|||||||
|
|
||||||
DLCManager::EDLCType getType() { return m_type; }
|
DLCManager::EDLCType getType() { return m_type; }
|
||||||
wstring getPath() { return m_path; }
|
wstring getPath() { return m_path; }
|
||||||
DWORD getSkinID() { return m_dwSkinId; }
|
unsigned long getSkinID() { return m_dwSkinId; }
|
||||||
|
|
||||||
virtual void addData(PBYTE pbData, DWORD dwBytes) {}
|
virtual void addData(uint8_t* pbData, unsigned long dwBytes) {}
|
||||||
virtual PBYTE getData(DWORD &dwBytes) { dwBytes = 0; return NULL; }
|
virtual uint8_t* getData(unsigned long &dwBytes) { dwBytes = 0; return NULL; }
|
||||||
virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value) {}
|
virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value) {}
|
||||||
|
|
||||||
virtual wstring getParameterAsString(DLCManager::EDLCParameterType type) { return L""; }
|
virtual wstring getParameterAsString(DLCManager::EDLCParameterType type) { return L""; }
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ DLCGameRulesFile::DLCGameRulesFile(const wstring &path) : DLCGameRules(DLCManage
|
|||||||
m_dwBytes = 0;
|
m_dwBytes = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCGameRulesFile::addData(PBYTE pbData, DWORD dwBytes)
|
void DLCGameRulesFile::addData(uint8_t* pbData, unsigned long dwBytes)
|
||||||
{
|
{
|
||||||
m_pbData = pbData;
|
m_pbData = pbData;
|
||||||
m_dwBytes = dwBytes;
|
m_dwBytes = dwBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
PBYTE DLCGameRulesFile::getData(DWORD &dwBytes)
|
uint8_t* DLCGameRulesFile::getData(unsigned long &dwBytes)
|
||||||
{
|
{
|
||||||
dwBytes = m_dwBytes;
|
dwBytes = m_dwBytes;
|
||||||
return m_pbData;
|
return m_pbData;
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
class DLCGameRulesFile : public DLCGameRules
|
class DLCGameRulesFile : public DLCGameRules
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
PBYTE m_pbData;
|
uint8_t* m_pbData;
|
||||||
DWORD m_dwBytes;
|
unsigned long m_dwBytes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DLCGameRulesFile(const wstring &path);
|
DLCGameRulesFile(const wstring &path);
|
||||||
|
|
||||||
virtual void addData(PBYTE pbData, DWORD dwBytes);
|
virtual void addData(uint8_t* pbData, unsigned long dwBytes);
|
||||||
virtual PBYTE getData(DWORD &dwBytes);
|
virtual uint8_t* getData(unsigned long &dwBytes);
|
||||||
};
|
};
|
||||||
@@ -21,7 +21,7 @@ DLCGameRulesHeader::DLCGameRulesHeader(const wstring &path) : DLCGameRules(DLCMa
|
|||||||
lgo = NULL;
|
lgo = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCGameRulesHeader::addData(PBYTE pbData, DWORD dwBytes)
|
void DLCGameRulesHeader::addData(uint8_t* pbData, unsigned long dwBytes)
|
||||||
{
|
{
|
||||||
m_pbData = pbData;
|
m_pbData = pbData;
|
||||||
m_dwBytes = dwBytes;
|
m_dwBytes = dwBytes;
|
||||||
@@ -73,13 +73,13 @@ void DLCGameRulesHeader::addData(PBYTE pbData, DWORD dwBytes)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
PBYTE DLCGameRulesHeader::getData(DWORD &dwBytes)
|
uint8_t* DLCGameRulesHeader::getData(unsigned long &dwBytes)
|
||||||
{
|
{
|
||||||
dwBytes = m_dwBytes;
|
dwBytes = m_dwBytes;
|
||||||
return m_pbData;
|
return m_pbData;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCGameRulesHeader::setGrfData(PBYTE fData, DWORD fSize, StringTable *st)
|
void DLCGameRulesHeader::setGrfData(uint8_t* fData, unsigned long fSize, StringTable *st)
|
||||||
{
|
{
|
||||||
if (!m_hasData)
|
if (!m_hasData)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,21 +8,21 @@ class DLCGameRulesHeader : public DLCGameRules, public JustGrSource
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
// GR-Header
|
// GR-Header
|
||||||
PBYTE m_pbData;
|
uint8_t* m_pbData;
|
||||||
DWORD m_dwBytes;
|
unsigned long m_dwBytes;
|
||||||
|
|
||||||
bool m_hasData;
|
bool m_hasData;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool requiresTexturePack() {return m_bRequiresTexturePack;}
|
virtual bool requiresTexturePack() {return m_bRequiresTexturePack;}
|
||||||
virtual UINT getRequiredTexturePackId() {return m_requiredTexturePackId;}
|
virtual unsigned int getRequiredTexturePackId() {return m_requiredTexturePackId;}
|
||||||
virtual wstring getDefaultSaveName() {return m_defaultSaveName;}
|
virtual wstring getDefaultSaveName() {return m_defaultSaveName;}
|
||||||
virtual LPCWSTR getWorldName() {return m_worldName.c_str();}
|
virtual const wchar_t* getWorldName() {return m_worldName.c_str();}
|
||||||
virtual LPCWSTR getDisplayName() {return m_displayName.c_str();}
|
virtual const wchar_t* getDisplayName() {return m_displayName.c_str();}
|
||||||
virtual wstring getGrfPath() {return L"GameRules.grf";}
|
virtual wstring getGrfPath() {return L"GameRules.grf";}
|
||||||
|
|
||||||
virtual void setRequiresTexturePack(bool x) {m_bRequiresTexturePack = x;}
|
virtual void setRequiresTexturePack(bool x) {m_bRequiresTexturePack = x;}
|
||||||
virtual void setRequiredTexturePackId(UINT x) {m_requiredTexturePackId = x;}
|
virtual void setRequiredTexturePackId(unsigned int x) {m_requiredTexturePackId = x;}
|
||||||
virtual void setDefaultSaveName(const wstring &x) {m_defaultSaveName = x;}
|
virtual void setDefaultSaveName(const wstring &x) {m_defaultSaveName = x;}
|
||||||
virtual void setWorldName(const wstring & x) {m_worldName = x;}
|
virtual void setWorldName(const wstring & x) {m_worldName = x;}
|
||||||
virtual void setDisplayName(const wstring & x) {m_displayName = x;}
|
virtual void setDisplayName(const wstring & x) {m_displayName = x;}
|
||||||
@@ -33,10 +33,10 @@ public:
|
|||||||
public:
|
public:
|
||||||
DLCGameRulesHeader(const wstring &path);
|
DLCGameRulesHeader(const wstring &path);
|
||||||
|
|
||||||
virtual void addData(PBYTE pbData, DWORD dwBytes);
|
virtual void addData(uint8_t* pbData, unsigned long dwBytes);
|
||||||
virtual PBYTE getData(DWORD &dwBytes);
|
virtual uint8_t* getData(unsigned long &dwBytes);
|
||||||
|
|
||||||
void setGrfData(PBYTE fData, DWORD fSize, StringTable *);
|
void setGrfData(uint8_t* fData, unsigned long fSize, StringTable *);
|
||||||
|
|
||||||
virtual bool ready() { return m_hasData; }
|
virtual bool ready() { return m_hasData; }
|
||||||
};
|
};
|
||||||
@@ -8,7 +8,7 @@ DLCLocalisationFile::DLCLocalisationFile(const wstring &path) : DLCFile(DLCManag
|
|||||||
m_strings = NULL;
|
m_strings = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCLocalisationFile::addData(PBYTE pbData, DWORD dwBytes)
|
void DLCLocalisationFile::addData(uint8_t* pbData, unsigned long dwBytes)
|
||||||
{
|
{
|
||||||
m_strings = new StringTable(pbData, dwBytes);
|
m_strings = new StringTable(pbData, dwBytes);
|
||||||
}
|
}
|
||||||
@@ -10,9 +10,9 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
DLCLocalisationFile(const wstring &path);
|
DLCLocalisationFile(const wstring &path);
|
||||||
DLCLocalisationFile(PBYTE pbData, DWORD dwBytes); // when we load in a texture pack details file from TMS++
|
DLCLocalisationFile(uint8_t* pbData, unsigned long dwBytes); // when we load in a texture pack details file from TMS++
|
||||||
|
|
||||||
virtual void addData(PBYTE pbData, DWORD dwBytes);
|
virtual void addData(uint8_t* pbData, unsigned long dwBytes);
|
||||||
|
|
||||||
StringTable *getStringTable() { return m_strings; }
|
StringTable *getStringTable() { return m_strings; }
|
||||||
};
|
};
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
#include "Minecraft.h"
|
#include "Minecraft.h"
|
||||||
#include "TexturePackRepository.h"
|
#include "TexturePackRepository.h"
|
||||||
|
|
||||||
WCHAR *DLCManager::wchTypeNamesA[]=
|
wchar_t *DLCManager::wchTypeNamesA[]=
|
||||||
{
|
{
|
||||||
L"DISPLAYNAME",
|
L"DISPLAYNAME",
|
||||||
L"THEMENAME",
|
L"THEMENAME",
|
||||||
@@ -43,7 +43,7 @@ DLCManager::EDLCParameterType DLCManager::getParameterType(const wstring ¶mN
|
|||||||
{
|
{
|
||||||
EDLCParameterType type = e_DLCParamType_Invalid;
|
EDLCParameterType type = e_DLCParamType_Invalid;
|
||||||
|
|
||||||
for(DWORD i = 0; i < e_DLCParamType_Max; ++i)
|
for(unsigned long i = 0; i < e_DLCParamType_Max; ++i)
|
||||||
{
|
{
|
||||||
if(paramName.compare(wchTypeNamesA[i]) == 0)
|
if(paramName.compare(wchTypeNamesA[i]) == 0)
|
||||||
{
|
{
|
||||||
@@ -55,9 +55,9 @@ DLCManager::EDLCParameterType DLCManager::getParameterType(const wstring ¶mN
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/)
|
unsigned long DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/)
|
||||||
{
|
{
|
||||||
DWORD packCount = 0;
|
unsigned long packCount = 0;
|
||||||
if( type != e_DLCType_All )
|
if( type != e_DLCType_All )
|
||||||
{
|
{
|
||||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||||
@@ -71,7 +71,7 @@ DWORD DLCManager::getPackCount(EDLCType type /*= e_DLCType_All*/)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packCount = (DWORD)m_packs.size();
|
packCount = (unsigned long)m_packs.size();
|
||||||
}
|
}
|
||||||
return packCount;
|
return packCount;
|
||||||
}
|
}
|
||||||
@@ -94,7 +94,7 @@ void DLCManager::removePack(DLCPack *pack)
|
|||||||
DLCPack *DLCManager::getPack(const wstring &name)
|
DLCPack *DLCManager::getPack(const wstring &name)
|
||||||
{
|
{
|
||||||
DLCPack *pack = NULL;
|
DLCPack *pack = NULL;
|
||||||
//DWORD currentIndex = 0;
|
//unsigned long currentIndex = 0;
|
||||||
DLCPack *currentPack = NULL;
|
DLCPack *currentPack = NULL;
|
||||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||||
{
|
{
|
||||||
@@ -114,7 +114,7 @@ DLCPack *DLCManager::getPack(const wstring &name)
|
|||||||
DLCPack *DLCManager::getPackFromProductID(const wstring &productID)
|
DLCPack *DLCManager::getPackFromProductID(const wstring &productID)
|
||||||
{
|
{
|
||||||
DLCPack *pack = NULL;
|
DLCPack *pack = NULL;
|
||||||
//DWORD currentIndex = 0;
|
//unsigned long currentIndex = 0;
|
||||||
DLCPack *currentPack = NULL;
|
DLCPack *currentPack = NULL;
|
||||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||||
{
|
{
|
||||||
@@ -131,12 +131,12 @@ DLCPack *DLCManager::getPackFromProductID(const wstring &productID)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DLCPack *DLCManager::getPack(DWORD index, EDLCType type /*= e_DLCType_All*/)
|
DLCPack *DLCManager::getPack(unsigned long index, EDLCType type /*= e_DLCType_All*/)
|
||||||
{
|
{
|
||||||
DLCPack *pack = NULL;
|
DLCPack *pack = NULL;
|
||||||
if( type != e_DLCType_All )
|
if( type != e_DLCType_All )
|
||||||
{
|
{
|
||||||
DWORD currentIndex = 0;
|
unsigned long currentIndex = 0;
|
||||||
DLCPack *currentPack = NULL;
|
DLCPack *currentPack = NULL;
|
||||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||||
{
|
{
|
||||||
@@ -165,9 +165,9 @@ DLCPack *DLCManager::getPack(DWORD index, EDLCType type /*= e_DLCType_All*/)
|
|||||||
return pack;
|
return pack;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_DLCType_All*/)
|
unsigned long DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_DLCType_All*/)
|
||||||
{
|
{
|
||||||
DWORD foundIndex = 0;
|
unsigned long foundIndex = 0;
|
||||||
found = false;
|
found = false;
|
||||||
if(pack == NULL)
|
if(pack == NULL)
|
||||||
{
|
{
|
||||||
@@ -177,7 +177,7 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D
|
|||||||
}
|
}
|
||||||
if( type != e_DLCType_All )
|
if( type != e_DLCType_All )
|
||||||
{
|
{
|
||||||
DWORD index = 0;
|
unsigned long index = 0;
|
||||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||||
{
|
{
|
||||||
DLCPack *thisPack = *it;
|
DLCPack *thisPack = *it;
|
||||||
@@ -195,7 +195,7 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DWORD index = 0;
|
unsigned long index = 0;
|
||||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||||
{
|
{
|
||||||
DLCPack *thisPack = *it;
|
DLCPack *thisPack = *it;
|
||||||
@@ -211,11 +211,11 @@ DWORD DLCManager::getPackIndex(DLCPack *pack, bool &found, EDLCType type /*= e_D
|
|||||||
return foundIndex;
|
return foundIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD DLCManager::getPackIndexContainingSkin(const wstring &path, bool &found)
|
unsigned long DLCManager::getPackIndexContainingSkin(const wstring &path, bool &found)
|
||||||
{
|
{
|
||||||
DWORD foundIndex = 0;
|
unsigned long foundIndex = 0;
|
||||||
found = false;
|
found = false;
|
||||||
DWORD index = 0;
|
unsigned long index = 0;
|
||||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||||
{
|
{
|
||||||
DLCPack *pack = *it;
|
DLCPack *pack = *it;
|
||||||
@@ -266,9 +266,9 @@ DLCSkinFile *DLCManager::getSkinFile(const wstring &path)
|
|||||||
return foundSkinfile;
|
return foundSkinfile;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD DLCManager::checkForCorruptDLCAndAlert(bool showMessage /*= true*/)
|
unsigned long DLCManager::checkForCorruptDLCAndAlert(bool showMessage /*= true*/)
|
||||||
{
|
{
|
||||||
DWORD corruptDLCCount = m_dwUnnamedCorruptDLCCount;
|
unsigned long corruptDLCCount = m_dwUnnamedCorruptDLCCount;
|
||||||
DLCPack *pack = NULL;
|
DLCPack *pack = NULL;
|
||||||
DLCPack *firstCorruptPack = NULL;
|
DLCPack *firstCorruptPack = NULL;
|
||||||
|
|
||||||
@@ -284,12 +284,12 @@ DWORD DLCManager::checkForCorruptDLCAndAlert(bool showMessage /*= true*/)
|
|||||||
|
|
||||||
if(corruptDLCCount > 0 && showMessage)
|
if(corruptDLCCount > 0 && showMessage)
|
||||||
{
|
{
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_CONFIRM_OK;
|
uiIDA[0]=IDS_CONFIRM_OK;
|
||||||
if(corruptDLCCount == 1 && firstCorruptPack != NULL)
|
if(corruptDLCCount == 1 && firstCorruptPack != NULL)
|
||||||
{
|
{
|
||||||
// pass in the pack format string
|
// pass in the pack format string
|
||||||
WCHAR wchFormat[132];
|
wchar_t wchFormat[132];
|
||||||
swprintf(wchFormat, 132, L"%ls\n\n%%ls", firstCorruptPack->getName().c_str());
|
swprintf(wchFormat, 132, L"%ls\n\n%%ls", firstCorruptPack->getName().c_str());
|
||||||
|
|
||||||
C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_CORRUPT_DLC_TITLE, IDS_CORRUPT_DLC, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),wchFormat);
|
C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_CORRUPT_DLC_TITLE, IDS_CORRUPT_DLC, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),wchFormat);
|
||||||
@@ -306,13 +306,13 @@ DWORD DLCManager::checkForCorruptDLCAndAlert(bool showMessage /*= true*/)
|
|||||||
return corruptDLCCount;
|
return corruptDLCCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive)
|
bool DLCManager::readDLCDataFile(unsigned long &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive)
|
||||||
{
|
{
|
||||||
return readDLCDataFile( dwFilesProcessed, wstringtofilename(path), pack, fromArchive);
|
return readDLCDataFile( dwFilesProcessed, wstringtofilename(path), pack, fromArchive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive)
|
bool DLCManager::readDLCDataFile(unsigned long &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive)
|
||||||
{
|
{
|
||||||
wstring wPath = convStringToWstring(path);
|
wstring wPath = convStringToWstring(path);
|
||||||
if (fromArchive && app.getArchiveFileSize(wPath) >= 0)
|
if (fromArchive && app.getArchiveFileSize(wPath) >= 0)
|
||||||
@@ -325,26 +325,26 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DL
|
|||||||
#ifdef _WINDOWS64
|
#ifdef _WINDOWS64
|
||||||
string finalPath = StorageManager.GetMountedPath(path.c_str());
|
string finalPath = StorageManager.GetMountedPath(path.c_str());
|
||||||
if(finalPath.size() == 0) finalPath = path;
|
if(finalPath.size() == 0) finalPath = path;
|
||||||
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
void* file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
#elif defined(_DURANGO)
|
#elif defined(_DURANGO)
|
||||||
wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
|
wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
|
||||||
if(finalPath.size() == 0) finalPath = wPath;
|
if(finalPath.size() == 0) finalPath = wPath;
|
||||||
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
void* file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
#else
|
#else
|
||||||
HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
void* file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
#endif
|
#endif
|
||||||
if( file == INVALID_HANDLE_VALUE )
|
if( file == INVALID_HANDLE_VALUE )
|
||||||
{
|
{
|
||||||
DWORD error = GetLastError();
|
unsigned long error = GetLastError();
|
||||||
app.DebugPrintf("Failed to open DLC data file with error code %d (%x)\n", error, error);
|
app.DebugPrintf("Failed to open DLC data file with error code %d (%x)\n", error, error);
|
||||||
if( dwFilesProcessed == 0 ) removePack(pack);
|
if( dwFilesProcessed == 0 ) removePack(pack);
|
||||||
assert(false);
|
assert(false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD bytesRead,dwFileSize = GetFileSize(file,NULL);
|
unsigned long bytesRead,dwFileSize = GetFileSize(file,NULL);
|
||||||
PBYTE pbData = (PBYTE) new BYTE[dwFileSize];
|
uint8_t* pbData = (uint8_t*) new uint8_t[dwFileSize];
|
||||||
BOOL bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL);
|
bool bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL);
|
||||||
if(bSuccess==false)
|
if(bSuccess==false)
|
||||||
{
|
{
|
||||||
// need to treat the file as corrupt, and flag it, so can't call fatal error
|
// need to treat the file as corrupt, and flag it, so can't call fatal error
|
||||||
@@ -365,7 +365,7 @@ bool DLCManager::readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DL
|
|||||||
return processDLCDataFile(dwFilesProcessed, pbData, bytesRead, pack);
|
return processDLCDataFile(dwFilesProcessed, pbData, bytesRead, pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack)
|
bool DLCManager::processDLCDataFile(unsigned long &dwFilesProcessed, uint8_t* pbData, unsigned long dwLength, DLCPack *pack)
|
||||||
{
|
{
|
||||||
unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
|
unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
|
||||||
unsigned int uiCurrentByte=0;
|
unsigned int uiCurrentByte=0;
|
||||||
@@ -394,17 +394,17 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||||||
unsigned int uiParameterCount=*(unsigned int *)&pbData[uiCurrentByte];
|
unsigned int uiParameterCount=*(unsigned int *)&pbData[uiCurrentByte];
|
||||||
uiCurrentByte+=sizeof(int);
|
uiCurrentByte+=sizeof(int);
|
||||||
C4JStorage::DLC_FILE_PARAM *pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
C4JStorage::DLC_FILE_PARAM *pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
||||||
//DWORD dwwchCount=0;
|
//unsigned long dwwchCount=0;
|
||||||
for(unsigned int i=0;i<uiParameterCount;i++)
|
for(unsigned int i=0;i<uiParameterCount;i++)
|
||||||
{
|
{
|
||||||
// Map DLC strings to application strings, then store the DLC index mapping to application index
|
// Map DLC strings to application strings, then store the DLC index mapping to application index
|
||||||
wstring parameterName((WCHAR *)pParams->wchData);
|
wstring parameterName((wchar_t *)pParams->wchData);
|
||||||
DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName);
|
DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName);
|
||||||
if( type != DLCManager::e_DLCParamType_Invalid )
|
if( type != DLCManager::e_DLCParamType_Invalid )
|
||||||
{
|
{
|
||||||
parameterMapping[pParams->dwType] = type;
|
parameterMapping[pParams->dwType] = type;
|
||||||
}
|
}
|
||||||
uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(WCHAR));
|
uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(wchar_t));
|
||||||
pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
||||||
}
|
}
|
||||||
//ulCurrentByte+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM);
|
//ulCurrentByte+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM);
|
||||||
@@ -413,13 +413,13 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||||||
uiCurrentByte+=sizeof(int);
|
uiCurrentByte+=sizeof(int);
|
||||||
C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
||||||
|
|
||||||
DWORD dwTemp=uiCurrentByte;
|
unsigned long dwTemp=uiCurrentByte;
|
||||||
for(unsigned int i=0;i<uiFileCount;i++)
|
for(unsigned int i=0;i<uiFileCount;i++)
|
||||||
{
|
{
|
||||||
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR);
|
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t);
|
||||||
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
|
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
|
||||||
}
|
}
|
||||||
PBYTE pbTemp=((PBYTE )pFile);//+ sizeof(C4JStorage::DLC_FILE_DETAILS)*ulFileCount;
|
uint8_t* pbTemp=((uint8_t* )pFile);//+ sizeof(C4JStorage::DLC_FILE_DETAILS)*ulFileCount;
|
||||||
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
||||||
|
|
||||||
for(unsigned int i=0;i<uiFileCount;i++)
|
for(unsigned int i=0;i<uiFileCount;i++)
|
||||||
@@ -435,7 +435,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||||||
}
|
}
|
||||||
else if(type != e_DLCType_PackConfig)
|
else if(type != e_DLCType_PackConfig)
|
||||||
{
|
{
|
||||||
dlcFile = pack->addFile(type,(WCHAR *)pFile->wchFile);
|
dlcFile = pack->addFile(type,(wchar_t *)pFile->wchFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Params
|
// Params
|
||||||
@@ -452,22 +452,22 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||||||
{
|
{
|
||||||
if(type == e_DLCType_PackConfig)
|
if(type == e_DLCType_PackConfig)
|
||||||
{
|
{
|
||||||
pack->addParameter(it->second,(WCHAR *)pParams->wchData);
|
pack->addParameter(it->second,(wchar_t *)pParams->wchData);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(dlcFile != NULL) dlcFile->addParameter(it->second,(WCHAR *)pParams->wchData);
|
if(dlcFile != NULL) dlcFile->addParameter(it->second,(wchar_t *)pParams->wchData);
|
||||||
else if(dlcTexturePack != NULL) dlcTexturePack->addParameter(it->second, (WCHAR *)pParams->wchData);
|
else if(dlcTexturePack != NULL) dlcTexturePack->addParameter(it->second, (wchar_t *)pParams->wchData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(WCHAR)*pParams->dwWchCount);
|
pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(wchar_t)*pParams->dwWchCount);
|
||||||
pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp;
|
pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp;
|
||||||
}
|
}
|
||||||
//pbTemp+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM);
|
//pbTemp+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM);
|
||||||
|
|
||||||
if(dlcTexturePack != NULL)
|
if(dlcTexturePack != NULL)
|
||||||
{
|
{
|
||||||
DWORD texturePackFilesProcessed = 0;
|
unsigned long texturePackFilesProcessed = 0;
|
||||||
bool validPack = processDLCDataFile(texturePackFilesProcessed,pbTemp,pFile->uiFileSize,dlcTexturePack);
|
bool validPack = processDLCDataFile(texturePackFilesProcessed,pbTemp,pFile->uiFileSize,dlcTexturePack);
|
||||||
pack->SetDataPointer(NULL); // If it's a child pack, it doesn't own the data
|
pack->SetDataPointer(NULL); // If it's a child pack, it doesn't own the data
|
||||||
if(!validPack || texturePackFilesProcessed == 0)
|
if(!validPack || texturePackFilesProcessed == 0)
|
||||||
@@ -495,7 +495,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||||||
switch(pFile->dwType)
|
switch(pFile->dwType)
|
||||||
{
|
{
|
||||||
case DLCManager::e_DLCType_Skin:
|
case DLCManager::e_DLCType_Skin:
|
||||||
app.vSkinNames.push_back((WCHAR *)pFile->wchFile);
|
app.vSkinNames.push_back((wchar_t *)pFile->wchFile);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,7 +504,7 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||||||
|
|
||||||
// Move the pointer to the start of the next files data;
|
// Move the pointer to the start of the next files data;
|
||||||
pbTemp+=pFile->uiFileSize;
|
pbTemp+=pFile->uiFileSize;
|
||||||
uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR);
|
uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t);
|
||||||
|
|
||||||
pFile=(C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
pFile=(C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
||||||
}
|
}
|
||||||
@@ -524,30 +524,30 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD DLCManager::retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack)
|
unsigned long DLCManager::retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack)
|
||||||
{
|
{
|
||||||
DWORD packId = 0;
|
unsigned long packId = 0;
|
||||||
wstring wPath = convStringToWstring(path);
|
wstring wPath = convStringToWstring(path);
|
||||||
|
|
||||||
#ifdef _WINDOWS64
|
#ifdef _WINDOWS64
|
||||||
string finalPath = StorageManager.GetMountedPath(path.c_str());
|
string finalPath = StorageManager.GetMountedPath(path.c_str());
|
||||||
if(finalPath.size() == 0) finalPath = path;
|
if(finalPath.size() == 0) finalPath = path;
|
||||||
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
void* file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
#elif defined(_DURANGO)
|
#elif defined(_DURANGO)
|
||||||
wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
|
wstring finalPath = StorageManager.GetMountedPath(wPath.c_str());
|
||||||
if(finalPath.size() == 0) finalPath = wPath;
|
if(finalPath.size() == 0) finalPath = wPath;
|
||||||
HANDLE file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
void* file = CreateFile(finalPath.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
#else
|
#else
|
||||||
HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
void* file = CreateFile(path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
#endif
|
#endif
|
||||||
if( file == INVALID_HANDLE_VALUE )
|
if( file == INVALID_HANDLE_VALUE )
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD bytesRead,dwFileSize = GetFileSize(file,NULL);
|
unsigned long bytesRead,dwFileSize = GetFileSize(file,NULL);
|
||||||
PBYTE pbData = (PBYTE) new BYTE[dwFileSize];
|
uint8_t* pbData = (uint8_t*) new uint8_t[dwFileSize];
|
||||||
BOOL bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL);
|
bool bSuccess = ReadFile(file,pbData,dwFileSize,&bytesRead,NULL);
|
||||||
if(bSuccess==false)
|
if(bSuccess==false)
|
||||||
{
|
{
|
||||||
// need to treat the file as corrupt, and flag it, so can't call fatal error
|
// need to treat the file as corrupt, and flag it, so can't call fatal error
|
||||||
@@ -570,9 +570,9 @@ DWORD DLCManager::retrievePackIDFromDLCDataFile(const string &path, DLCPack *pac
|
|||||||
return packId;
|
return packId;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
|
unsigned long DLCManager::retrievePackID(uint8_t* pbData, unsigned long dwLength, DLCPack *pack)
|
||||||
{
|
{
|
||||||
DWORD packId=0;
|
unsigned long packId=0;
|
||||||
bool bPackIDSet=false;
|
bool bPackIDSet=false;
|
||||||
unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
|
unordered_map<int, DLCManager::EDLCParameterType> parameterMapping;
|
||||||
unsigned int uiCurrentByte=0;
|
unsigned int uiCurrentByte=0;
|
||||||
@@ -603,13 +603,13 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
|
|||||||
for(unsigned int i=0;i<uiParameterCount;i++)
|
for(unsigned int i=0;i<uiParameterCount;i++)
|
||||||
{
|
{
|
||||||
// Map DLC strings to application strings, then store the DLC index mapping to application index
|
// Map DLC strings to application strings, then store the DLC index mapping to application index
|
||||||
wstring parameterName((WCHAR *)pParams->wchData);
|
wstring parameterName((wchar_t *)pParams->wchData);
|
||||||
DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName);
|
DLCManager::EDLCParameterType type = DLCManager::getParameterType(parameterName);
|
||||||
if( type != DLCManager::e_DLCParamType_Invalid )
|
if( type != DLCManager::e_DLCParamType_Invalid )
|
||||||
{
|
{
|
||||||
parameterMapping[pParams->dwType] = type;
|
parameterMapping[pParams->dwType] = type;
|
||||||
}
|
}
|
||||||
uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(WCHAR));
|
uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(wchar_t));
|
||||||
pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -617,13 +617,13 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
|
|||||||
uiCurrentByte+=sizeof(int);
|
uiCurrentByte+=sizeof(int);
|
||||||
C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
||||||
|
|
||||||
DWORD dwTemp=uiCurrentByte;
|
unsigned long dwTemp=uiCurrentByte;
|
||||||
for(unsigned int i=0;i<uiFileCount;i++)
|
for(unsigned int i=0;i<uiFileCount;i++)
|
||||||
{
|
{
|
||||||
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR);
|
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t);
|
||||||
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
|
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
|
||||||
}
|
}
|
||||||
PBYTE pbTemp=((PBYTE )pFile);
|
uint8_t* pbTemp=((uint8_t* )pFile);
|
||||||
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
||||||
|
|
||||||
for(unsigned int i=0;i<uiFileCount;i++)
|
for(unsigned int i=0;i<uiFileCount;i++)
|
||||||
@@ -644,7 +644,7 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
|
|||||||
{
|
{
|
||||||
if(it->second==e_DLCParamType_PackId)
|
if(it->second==e_DLCParamType_PackId)
|
||||||
{
|
{
|
||||||
wstring wsTemp=(WCHAR *)pParams->wchData;
|
wstring wsTemp=(wchar_t *)pParams->wchData;
|
||||||
std::wstringstream ss;
|
std::wstringstream ss;
|
||||||
// 4J Stu - numbered using decimal to make it easier for artists/people to number manually
|
// 4J Stu - numbered using decimal to make it easier for artists/people to number manually
|
||||||
ss << std::dec << wsTemp.c_str();
|
ss << std::dec << wsTemp.c_str();
|
||||||
@@ -654,14 +654,14 @@ DWORD DLCManager::retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(WCHAR)*pParams->dwWchCount);
|
pbTemp+=sizeof(C4JStorage::DLC_FILE_PARAM)+(sizeof(wchar_t)*pParams->dwWchCount);
|
||||||
pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp;
|
pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bPackIDSet) break;
|
if(bPackIDSet) break;
|
||||||
// Move the pointer to the start of the next files data;
|
// Move the pointer to the start of the next files data;
|
||||||
pbTemp+=pFile->uiFileSize;
|
pbTemp+=pFile->uiFileSize;
|
||||||
uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR);
|
uiCurrentByte+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(wchar_t);
|
||||||
|
|
||||||
pFile=(C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
pFile=(C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,20 +48,20 @@ public:
|
|||||||
e_DLCParamType_Max,
|
e_DLCParamType_Max,
|
||||||
|
|
||||||
};
|
};
|
||||||
static WCHAR *wchTypeNamesA[e_DLCParamType_Max];
|
static wchar_t *wchTypeNamesA[e_DLCParamType_Max];
|
||||||
|
|
||||||
private:
|
private:
|
||||||
vector<DLCPack *> m_packs;
|
vector<DLCPack *> m_packs;
|
||||||
//bool m_bNeedsUpdated;
|
//bool m_bNeedsUpdated;
|
||||||
bool m_bNeedsCorruptCheck;
|
bool m_bNeedsCorruptCheck;
|
||||||
DWORD m_dwUnnamedCorruptDLCCount;
|
unsigned long m_dwUnnamedCorruptDLCCount;
|
||||||
public:
|
public:
|
||||||
DLCManager();
|
DLCManager();
|
||||||
~DLCManager();
|
~DLCManager();
|
||||||
|
|
||||||
static EDLCParameterType getParameterType(const wstring ¶mName);
|
static EDLCParameterType getParameterType(const wstring ¶mName);
|
||||||
|
|
||||||
DWORD getPackCount(EDLCType type = e_DLCType_All);
|
unsigned long getPackCount(EDLCType type = e_DLCType_All);
|
||||||
|
|
||||||
//bool NeedsUpdated() { return m_bNeedsUpdated; }
|
//bool NeedsUpdated() { return m_bNeedsUpdated; }
|
||||||
//void SetNeedsUpdated(bool val) { m_bNeedsUpdated = val; }
|
//void SetNeedsUpdated(bool val) { m_bNeedsUpdated = val; }
|
||||||
@@ -79,21 +79,21 @@ public:
|
|||||||
#ifdef _XBOX_ONE
|
#ifdef _XBOX_ONE
|
||||||
DLCPack *DLCManager::getPackFromProductID(const wstring &productID);
|
DLCPack *DLCManager::getPackFromProductID(const wstring &productID);
|
||||||
#endif
|
#endif
|
||||||
DLCPack *getPack(DWORD index, EDLCType type = e_DLCType_All);
|
DLCPack *getPack(unsigned long index, EDLCType type = e_DLCType_All);
|
||||||
DWORD getPackIndex(DLCPack *pack, bool &found, EDLCType type = e_DLCType_All);
|
unsigned long getPackIndex(DLCPack *pack, bool &found, EDLCType type = e_DLCType_All);
|
||||||
DLCSkinFile *getSkinFile(const wstring &path); // Will hunt all packs of type skin to find the right skinfile
|
DLCSkinFile *getSkinFile(const wstring &path); // Will hunt all packs of type skin to find the right skinfile
|
||||||
|
|
||||||
DLCPack *getPackContainingSkin(const wstring &path);
|
DLCPack *getPackContainingSkin(const wstring &path);
|
||||||
DWORD getPackIndexContainingSkin(const wstring &path, bool &found);
|
unsigned long getPackIndexContainingSkin(const wstring &path, bool &found);
|
||||||
|
|
||||||
DWORD checkForCorruptDLCAndAlert(bool showMessage = true);
|
unsigned long checkForCorruptDLCAndAlert(bool showMessage = true);
|
||||||
|
|
||||||
bool readDLCDataFile(DWORD &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive = false);
|
bool readDLCDataFile(unsigned long &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive = false);
|
||||||
bool readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive = false);
|
bool readDLCDataFile(unsigned long &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive = false);
|
||||||
DWORD retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack);
|
unsigned long retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack);
|
bool processDLCDataFile(unsigned long &dwFilesProcessed, uint8_t* pbData, unsigned long dwLength, DLCPack *pack);
|
||||||
|
|
||||||
DWORD retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack);
|
unsigned long retrievePackID(uint8_t* pbData, unsigned long dwLength, DLCPack *pack);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include "DLCColourTableFile.h"
|
#include "DLCColourTableFile.h"
|
||||||
#include "StringHelpers.h"
|
#include "StringHelpers.h"
|
||||||
|
|
||||||
DLCPack::DLCPack(const wstring &name,DWORD dwLicenseMask)
|
DLCPack::DLCPack(const wstring &name,unsigned long dwLicenseMask)
|
||||||
{
|
{
|
||||||
m_dataPath = L"";
|
m_dataPath = L"";
|
||||||
m_packName = name;
|
m_packName = name;
|
||||||
@@ -35,7 +35,7 @@ DLCPack::DLCPack(const wstring &name,DWORD dwLicenseMask)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _XBOX_ONE
|
#ifdef _XBOX_ONE
|
||||||
DLCPack::DLCPack(const wstring &name,const wstring &productID,DWORD dwLicenseMask)
|
DLCPack::DLCPack(const wstring &name,const wstring &productID,unsigned long dwLicenseMask)
|
||||||
{
|
{
|
||||||
m_dataPath = L"";
|
m_dataPath = L"";
|
||||||
m_packName = name;
|
m_packName = name;
|
||||||
@@ -81,7 +81,7 @@ DLCPack::~DLCPack()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD DLCPack::GetDLCMountIndex()
|
unsigned long DLCPack::GetDLCMountIndex()
|
||||||
{
|
{
|
||||||
if(m_parentPack != NULL)
|
if(m_parentPack != NULL)
|
||||||
{
|
{
|
||||||
@@ -125,7 +125,7 @@ void DLCPack::addParameter(DLCManager::EDLCParameterType type, const wstring &va
|
|||||||
{
|
{
|
||||||
case DLCManager::e_DLCParamType_PackId:
|
case DLCManager::e_DLCParamType_PackId:
|
||||||
{
|
{
|
||||||
DWORD packId = 0;
|
unsigned long packId = 0;
|
||||||
|
|
||||||
std::wstringstream ss;
|
std::wstringstream ss;
|
||||||
// 4J Stu - numbered using decimal to make it easier for artists/people to number manually
|
// 4J Stu - numbered using decimal to make it easier for artists/people to number manually
|
||||||
@@ -137,7 +137,7 @@ void DLCPack::addParameter(DLCManager::EDLCParameterType type, const wstring &va
|
|||||||
break;
|
break;
|
||||||
case DLCManager::e_DLCParamType_PackVersion:
|
case DLCManager::e_DLCParamType_PackVersion:
|
||||||
{
|
{
|
||||||
DWORD version = 0;
|
unsigned long version = 0;
|
||||||
|
|
||||||
std::wstringstream ss;
|
std::wstringstream ss;
|
||||||
// 4J Stu - numbered using decimal to make it easier for artists/people to number manually
|
// 4J Stu - numbered using decimal to make it easier for artists/people to number manually
|
||||||
@@ -200,7 +200,7 @@ DLCFile *DLCPack::addFile(DLCManager::EDLCType type, const wstring &path)
|
|||||||
#ifdef _XBOX_ONE
|
#ifdef _XBOX_ONE
|
||||||
app.GetDLCFullOfferIDForSkinID(strippedPath,m_wsProductId);
|
app.GetDLCFullOfferIDForSkinID(strippedPath,m_wsProductId);
|
||||||
#else
|
#else
|
||||||
ULONGLONG ullVal=0LL;
|
uint64_t ullVal=0LL;
|
||||||
|
|
||||||
if(app.GetDLCFullOfferIDForSkinID(strippedPath,&ullVal))
|
if(app.GetDLCFullOfferIDForSkinID(strippedPath,&ullVal))
|
||||||
{
|
{
|
||||||
@@ -278,7 +278,7 @@ bool DLCPack::doesPackContainFile(DLCManager::EDLCType type, const wstring &path
|
|||||||
return hasFile;
|
return hasFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
DLCFile *DLCPack::getFile(DLCManager::EDLCType type, DWORD index)
|
DLCFile *DLCPack::getFile(DLCManager::EDLCType type, unsigned long index)
|
||||||
{
|
{
|
||||||
DLCFile *file = NULL;
|
DLCFile *file = NULL;
|
||||||
if(type == DLCManager::e_DLCType_All)
|
if(type == DLCManager::e_DLCType_All)
|
||||||
@@ -333,9 +333,9 @@ DLCFile *DLCPack::getFile(DLCManager::EDLCType type, const wstring &path)
|
|||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCType_All*/)
|
unsigned long DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCType_All*/)
|
||||||
{
|
{
|
||||||
DWORD count = 0;
|
unsigned long count = 0;
|
||||||
|
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
@@ -346,13 +346,13 @@ DWORD DLCPack::getDLCItemsCount(DLCManager::EDLCType type /*= DLCManager::e_DLCT
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
count = (DWORD)m_files[(int)type].size();
|
count = (unsigned long)m_files[(int)type].size();
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
return count;
|
return count;
|
||||||
};
|
};
|
||||||
|
|
||||||
DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bool &found)
|
unsigned long DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bool &found)
|
||||||
{
|
{
|
||||||
if(type == DLCManager::e_DLCType_All)
|
if(type == DLCManager::e_DLCType_All)
|
||||||
{
|
{
|
||||||
@@ -363,9 +363,9 @@ DWORD DLCPack::getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bo
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD foundIndex = 0;
|
unsigned long foundIndex = 0;
|
||||||
found = false;
|
found = false;
|
||||||
DWORD index = 0;
|
unsigned long index = 0;
|
||||||
for(AUTO_VAR(it, m_files[type].begin()); it != m_files[type].end(); ++it)
|
for(AUTO_VAR(it, m_files[type].begin()); it != m_files[type].end(); ++it)
|
||||||
{
|
{
|
||||||
if(path.compare((*it)->getPath()) == 0)
|
if(path.compare((*it)->getPath()) == 0)
|
||||||
|
|||||||
@@ -16,45 +16,45 @@ private:
|
|||||||
|
|
||||||
wstring m_packName;
|
wstring m_packName;
|
||||||
wstring m_dataPath;
|
wstring m_dataPath;
|
||||||
DWORD m_dwLicenseMask;
|
unsigned long m_dwLicenseMask;
|
||||||
int m_dlcMountIndex;
|
int m_dlcMountIndex;
|
||||||
XCONTENTDEVICEID m_dlcDeviceID;
|
XCONTENTDEVICEID m_dlcDeviceID;
|
||||||
#ifdef _XBOX_ONE
|
#ifdef _XBOX_ONE
|
||||||
wstring m_wsProductId;
|
wstring m_wsProductId;
|
||||||
#else
|
#else
|
||||||
ULONGLONG m_ullFullOfferId;
|
uint64_t m_ullFullOfferId;
|
||||||
#endif
|
#endif
|
||||||
bool m_isCorrupt;
|
bool m_isCorrupt;
|
||||||
DWORD m_packId;
|
unsigned long m_packId;
|
||||||
DWORD m_packVersion;
|
unsigned long m_packVersion;
|
||||||
|
|
||||||
PBYTE m_data; // This pointer is for all the data used for this pack, so deleting it invalidates ALL of it's children.
|
uint8_t* m_data; // This pointer is for all the data used for this pack, so deleting it invalidates ALL of it's children.
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DLCPack(const wstring &name,DWORD dwLicenseMask);
|
DLCPack(const wstring &name,unsigned long dwLicenseMask);
|
||||||
#ifdef _XBOX_ONE
|
#ifdef _XBOX_ONE
|
||||||
DLCPack(const wstring &name,const wstring &productID,DWORD dwLicenseMask);
|
DLCPack(const wstring &name,const wstring &productID,unsigned long dwLicenseMask);
|
||||||
#endif
|
#endif
|
||||||
~DLCPack();
|
~DLCPack();
|
||||||
|
|
||||||
wstring getFullDataPath() { return m_dataPath; }
|
wstring getFullDataPath() { return m_dataPath; }
|
||||||
|
|
||||||
void SetDataPointer(PBYTE pbData) { m_data = pbData; }
|
void SetDataPointer(uint8_t* pbData) { m_data = pbData; }
|
||||||
|
|
||||||
bool IsCorrupt() { return m_isCorrupt; }
|
bool IsCorrupt() { return m_isCorrupt; }
|
||||||
void SetIsCorrupt(bool val) { m_isCorrupt = val; }
|
void SetIsCorrupt(bool val) { m_isCorrupt = val; }
|
||||||
|
|
||||||
void SetPackId(DWORD id) { m_packId = id; }
|
void SetPackId(unsigned long id) { m_packId = id; }
|
||||||
DWORD GetPackId() { return m_packId; }
|
unsigned long GetPackId() { return m_packId; }
|
||||||
|
|
||||||
void SetPackVersion(DWORD version) { m_packVersion = version; }
|
void SetPackVersion(unsigned long version) { m_packVersion = version; }
|
||||||
DWORD GetPackVersion() { return m_packVersion; }
|
unsigned long GetPackVersion() { return m_packVersion; }
|
||||||
|
|
||||||
DLCPack * GetParentPack() { return m_parentPack; }
|
DLCPack * GetParentPack() { return m_parentPack; }
|
||||||
DWORD GetParentPackId() { return m_parentPack->m_packId; }
|
unsigned long GetParentPackId() { return m_parentPack->m_packId; }
|
||||||
|
|
||||||
void SetDLCMountIndex(DWORD id) { m_dlcMountIndex = id; }
|
void SetDLCMountIndex(unsigned long id) { m_dlcMountIndex = id; }
|
||||||
DWORD GetDLCMountIndex();
|
unsigned long GetDLCMountIndex();
|
||||||
void SetDLCDeviceID(XCONTENTDEVICEID deviceId) { m_dlcDeviceID = deviceId; }
|
void SetDLCDeviceID(XCONTENTDEVICEID deviceId) { m_dlcDeviceID = deviceId; }
|
||||||
XCONTENTDEVICEID GetDLCDeviceID();
|
XCONTENTDEVICEID GetDLCDeviceID();
|
||||||
|
|
||||||
@@ -64,29 +64,29 @@ public:
|
|||||||
void addParameter(DLCManager::EDLCParameterType type, const wstring &value);
|
void addParameter(DLCManager::EDLCParameterType type, const wstring &value);
|
||||||
bool getParameterAsUInt(DLCManager::EDLCParameterType type, unsigned int ¶m);
|
bool getParameterAsUInt(DLCManager::EDLCParameterType type, unsigned int ¶m);
|
||||||
|
|
||||||
void updateLicenseMask( DWORD dwLicenseMask ) { m_dwLicenseMask = dwLicenseMask; }
|
void updateLicenseMask( unsigned long dwLicenseMask ) { m_dwLicenseMask = dwLicenseMask; }
|
||||||
DWORD getLicenseMask( ) { return m_dwLicenseMask; }
|
unsigned long getLicenseMask( ) { return m_dwLicenseMask; }
|
||||||
|
|
||||||
wstring getName() { return m_packName; }
|
wstring getName() { return m_packName; }
|
||||||
#ifdef _XBOX_ONE
|
#ifdef _XBOX_ONE
|
||||||
wstring getPurchaseOfferId() { return m_wsProductId; }
|
wstring getPurchaseOfferId() { return m_wsProductId; }
|
||||||
#else
|
#else
|
||||||
ULONGLONG getPurchaseOfferId() { return m_ullFullOfferId; }
|
uint64_t getPurchaseOfferId() { return m_ullFullOfferId; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DLCFile *addFile(DLCManager::EDLCType type, const wstring &path);
|
DLCFile *addFile(DLCManager::EDLCType type, const wstring &path);
|
||||||
DLCFile *getFile(DLCManager::EDLCType type, DWORD index);
|
DLCFile *getFile(DLCManager::EDLCType type, unsigned long index);
|
||||||
DLCFile *getFile(DLCManager::EDLCType type, const wstring &path);
|
DLCFile *getFile(DLCManager::EDLCType type, const wstring &path);
|
||||||
|
|
||||||
DWORD getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All);
|
unsigned long getDLCItemsCount(DLCManager::EDLCType type = DLCManager::e_DLCType_All);
|
||||||
DWORD getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bool &found);
|
unsigned long getFileIndexAt(DLCManager::EDLCType type, const wstring &path, bool &found);
|
||||||
bool doesPackContainFile(DLCManager::EDLCType type, const wstring &path);
|
bool doesPackContainFile(DLCManager::EDLCType type, const wstring &path);
|
||||||
DWORD GetPackID() {return m_packId;}
|
unsigned long GetPackID() {return m_packId;}
|
||||||
|
|
||||||
DWORD getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); }
|
unsigned long getSkinCount() { return getDLCItemsCount(DLCManager::e_DLCType_Skin); }
|
||||||
DWORD getSkinIndexAt(const wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); }
|
unsigned long getSkinIndexAt(const wstring &path, bool &found) { return getFileIndexAt(DLCManager::e_DLCType_Skin, path, found); }
|
||||||
DLCSkinFile *getSkinFile(const wstring &path) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, path); }
|
DLCSkinFile *getSkinFile(const wstring &path) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, path); }
|
||||||
DLCSkinFile *getSkinFile(DWORD index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); }
|
DLCSkinFile *getSkinFile(unsigned long index) { return (DLCSkinFile *)getFile(DLCManager::e_DLCType_Skin, index); }
|
||||||
bool doesPackContainSkin(const wstring &path) { return doesPackContainFile(DLCManager::e_DLCType_Skin, path); }
|
bool doesPackContainSkin(const wstring &path) { return doesPackContainFile(DLCManager::e_DLCType_Skin, path); }
|
||||||
|
|
||||||
bool hasPurchasedFile(DLCManager::EDLCType type, const wstring &path);
|
bool hasPurchasedFile(DLCManager::EDLCType type, const wstring &path);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ DLCSkinFile::DLCSkinFile(const wstring &path) : DLCFile(DLCManager::e_DLCType_Sk
|
|||||||
m_uiAnimOverrideBitmask=0L;
|
m_uiAnimOverrideBitmask=0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCSkinFile::addData(PBYTE pbData, DWORD dwBytes)
|
void DLCSkinFile::addData(uint8_t* pbData, unsigned long dwBytes)
|
||||||
{
|
{
|
||||||
app.AddMemoryTextureFile(m_path,pbData,dwBytes);
|
app.AddMemoryTextureFile(m_path,pbData,dwBytes);
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring
|
|||||||
break;
|
break;
|
||||||
case DLCManager::e_DLCParamType_Box:
|
case DLCManager::e_DLCParamType_Box:
|
||||||
{
|
{
|
||||||
WCHAR wchBodyPart[10];
|
wchar_t wchBodyPart[10];
|
||||||
SKIN_BOX *pSkinBox = new SKIN_BOX;
|
SKIN_BOX *pSkinBox = new SKIN_BOX;
|
||||||
ZeroMemory(pSkinBox,sizeof(SKIN_BOX));
|
ZeroMemory(pSkinBox,sizeof(SKIN_BOX));
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type, const wstring
|
|||||||
#else
|
#else
|
||||||
swscanf_s(value.c_str(), L"%X", &m_uiAnimOverrideBitmask,sizeof(unsigned int));
|
swscanf_s(value.c_str(), L"%X", &m_uiAnimOverrideBitmask,sizeof(unsigned int));
|
||||||
#endif
|
#endif
|
||||||
DWORD skinId = app.getSkinIdFromPath(m_path);
|
unsigned long skinId = app.getSkinIdFromPath(m_path);
|
||||||
app.SetAnimOverrideBitmask(skinId, m_uiAnimOverrideBitmask);
|
app.SetAnimOverrideBitmask(skinId, m_uiAnimOverrideBitmask);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public:
|
|||||||
|
|
||||||
DLCSkinFile(const wstring &path);
|
DLCSkinFile(const wstring &path);
|
||||||
|
|
||||||
virtual void addData(PBYTE pbData, DWORD dwBytes);
|
virtual void addData(uint8_t* pbData, unsigned long dwBytes);
|
||||||
virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value);
|
virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value);
|
||||||
|
|
||||||
virtual wstring getParameterAsString(DLCManager::EDLCParameterType type);
|
virtual wstring getParameterAsString(DLCManager::EDLCParameterType type);
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ DLCTextureFile::DLCTextureFile(const wstring &path) : DLCFile(DLCManager::e_DLCT
|
|||||||
m_dwBytes = 0;
|
m_dwBytes = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCTextureFile::addData(PBYTE pbData, DWORD dwBytes)
|
void DLCTextureFile::addData(uint8_t* pbData, unsigned long dwBytes)
|
||||||
{
|
{
|
||||||
//app.AddMemoryTextureFile(m_path,pbData,dwBytes);
|
//app.AddMemoryTextureFile(m_path,pbData,dwBytes);
|
||||||
m_pbData = pbData;
|
m_pbData = pbData;
|
||||||
m_dwBytes = dwBytes;
|
m_dwBytes = dwBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
PBYTE DLCTextureFile::getData(DWORD &dwBytes)
|
uint8_t* DLCTextureFile::getData(unsigned long &dwBytes)
|
||||||
{
|
{
|
||||||
dwBytes = m_dwBytes;
|
dwBytes = m_dwBytes;
|
||||||
return m_pbData;
|
return m_pbData;
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ private:
|
|||||||
bool m_bIsAnim;
|
bool m_bIsAnim;
|
||||||
wstring m_animString;
|
wstring m_animString;
|
||||||
|
|
||||||
PBYTE m_pbData;
|
uint8_t* m_pbData;
|
||||||
DWORD m_dwBytes;
|
unsigned long m_dwBytes;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DLCTextureFile(const wstring &path);
|
DLCTextureFile(const wstring &path);
|
||||||
|
|
||||||
virtual void addData(PBYTE pbData, DWORD dwBytes);
|
virtual void addData(uint8_t* pbData, unsigned long dwBytes);
|
||||||
virtual PBYTE getData(DWORD &dwBytes);
|
virtual uint8_t* getData(unsigned long &dwBytes);
|
||||||
|
|
||||||
virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value);
|
virtual void addParameter(DLCManager::EDLCParameterType type, const wstring &value);
|
||||||
|
|
||||||
|
|||||||
@@ -18,14 +18,14 @@ DLCUIDataFile::~DLCUIDataFile()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DLCUIDataFile::addData(PBYTE pbData, DWORD dwBytes,bool canDeleteData)
|
void DLCUIDataFile::addData(uint8_t* pbData, unsigned long dwBytes,bool canDeleteData)
|
||||||
{
|
{
|
||||||
m_pbData = pbData;
|
m_pbData = pbData;
|
||||||
m_dwBytes = dwBytes;
|
m_dwBytes = dwBytes;
|
||||||
m_canDeleteData = canDeleteData;
|
m_canDeleteData = canDeleteData;
|
||||||
}
|
}
|
||||||
|
|
||||||
PBYTE DLCUIDataFile::getData(DWORD &dwBytes)
|
uint8_t* DLCUIDataFile::getData(unsigned long &dwBytes)
|
||||||
{
|
{
|
||||||
dwBytes = m_dwBytes;
|
dwBytes = m_dwBytes;
|
||||||
return m_pbData;
|
return m_pbData;
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
class DLCUIDataFile : public DLCFile
|
class DLCUIDataFile : public DLCFile
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
PBYTE m_pbData;
|
uint8_t* m_pbData;
|
||||||
DWORD m_dwBytes;
|
unsigned long m_dwBytes;
|
||||||
bool m_canDeleteData;
|
bool m_canDeleteData;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -15,6 +15,6 @@ public:
|
|||||||
using DLCFile::addData;
|
using DLCFile::addData;
|
||||||
using DLCFile::addParameter;
|
using DLCFile::addParameter;
|
||||||
|
|
||||||
virtual void addData(PBYTE pbData, DWORD dwBytes,bool canDeleteData = false);
|
virtual void addData(uint8_t* pbData, unsigned long dwBytes,bool canDeleteData = false);
|
||||||
virtual PBYTE getData(DWORD &dwBytes);
|
virtual uint8_t* getData(unsigned long &dwBytes);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ AddEnchantmentRuleDefinition::AddEnchantmentRuleDefinition()
|
|||||||
m_enchantmentId = m_enchantmentLevel = 0;
|
m_enchantmentId = m_enchantmentLevel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddEnchantmentRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes)
|
void AddEnchantmentRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes)
|
||||||
{
|
{
|
||||||
GameRuleDefinition::writeAttributes(dos, numAttributes + 2);
|
GameRuleDefinition::writeAttributes(dos, numAttributes + 2);
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public:
|
|||||||
|
|
||||||
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_AddEnchantment; }
|
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_AddEnchantment; }
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *, UINT numAttrs);
|
virtual void writeAttributes(DataOutputStream *, unsigned int numAttrs);
|
||||||
|
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ AddItemRuleDefinition::AddItemRuleDefinition()
|
|||||||
m_slot = -1;
|
m_slot = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddItemRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
void AddItemRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttrs)
|
||||||
{
|
{
|
||||||
GameRuleDefinition::writeAttributes(dos, numAttrs + 5);
|
GameRuleDefinition::writeAttributes(dos, numAttrs + 5);
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
AddItemRuleDefinition();
|
AddItemRuleDefinition();
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *, UINT numAttributes);
|
virtual void writeAttributes(DataOutputStream *, unsigned int numAttributes);
|
||||||
virtual void getChildren(vector<GameRuleDefinition *> *children);
|
virtual void getChildren(vector<GameRuleDefinition *> *children);
|
||||||
|
|
||||||
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_AddItem; }
|
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_AddItem; }
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ ApplySchematicRuleDefinition::~ApplySchematicRuleDefinition()
|
|||||||
delete m_location;
|
delete m_location;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApplySchematicRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
void ApplySchematicRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttrs)
|
||||||
{
|
{
|
||||||
GameRuleDefinition::writeAttributes(dos, numAttrs + 5);
|
GameRuleDefinition::writeAttributes(dos, numAttrs + 5);
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ private:
|
|||||||
ConsoleSchematicFile::ESchematicRotation m_rotation;
|
ConsoleSchematicFile::ESchematicRotation m_rotation;
|
||||||
int m_dimension;
|
int m_dimension;
|
||||||
|
|
||||||
__int64 m_totalBlocksChanged;
|
int64_t m_totalBlocksChanged;
|
||||||
__int64 m_totalBlocksChangedLighting;
|
int64_t m_totalBlocksChangedLighting;
|
||||||
bool m_completed;
|
bool m_completed;
|
||||||
|
|
||||||
void updateLocationBox();
|
void updateLocationBox();
|
||||||
@@ -30,7 +30,7 @@ public:
|
|||||||
|
|
||||||
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_ApplySchematic; }
|
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_ApplySchematic; }
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs);
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
void processSchematic(AABB *chunkBox, LevelChunk *chunk);
|
void processSchematic(AABB *chunkBox, LevelChunk *chunk);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ BiomeOverride::BiomeOverride()
|
|||||||
m_biomeId = 0;
|
m_biomeId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BiomeOverride::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
void BiomeOverride::writeAttributes(DataOutputStream *dos, unsigned int numAttrs)
|
||||||
{
|
{
|
||||||
GameRuleDefinition::writeAttributes(dos, numAttrs + 3);
|
GameRuleDefinition::writeAttributes(dos, numAttrs + 3);
|
||||||
|
|
||||||
@@ -52,8 +52,8 @@ bool BiomeOverride::isBiome(int id)
|
|||||||
return m_biomeId == id;
|
return m_biomeId == id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BiomeOverride::getTileValues(BYTE &tile, BYTE &topTile)
|
void BiomeOverride::getTileValues(uint8_t &tile, uint8_t &topTile)
|
||||||
{
|
{
|
||||||
if(m_tile != 0) tile = (BYTE)m_tile;
|
if(m_tile != 0) tile = (uint8_t)m_tile;
|
||||||
if(m_topTile != 0) topTile = (BYTE)m_topTile;
|
if(m_topTile != 0) topTile = (uint8_t)m_topTile;
|
||||||
}
|
}
|
||||||
@@ -6,8 +6,8 @@ using namespace std;
|
|||||||
class BiomeOverride : public GameRuleDefinition
|
class BiomeOverride : public GameRuleDefinition
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
BYTE m_topTile;
|
uint8_t m_topTile;
|
||||||
BYTE m_tile;
|
uint8_t m_tile;
|
||||||
int m_biomeId;
|
int m_biomeId;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -15,9 +15,9 @@ public:
|
|||||||
|
|
||||||
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_BiomeOverride; }
|
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_BiomeOverride; }
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs);
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
bool isBiome(int id);
|
bool isBiome(int id);
|
||||||
void getTileValues(BYTE &tile, BYTE &topTile);
|
void getTileValues(uint8_t &tile, uint8_t &topTile);
|
||||||
};
|
};
|
||||||
@@ -17,7 +17,7 @@ CollectItemRuleDefinition::~CollectItemRuleDefinition()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollectItemRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes)
|
void CollectItemRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes)
|
||||||
{
|
{
|
||||||
GameRuleDefinition::writeAttributes(dos, numAttributes + 3);
|
GameRuleDefinition::writeAttributes(dos, numAttributes + 3);
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public:
|
|||||||
|
|
||||||
ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_CollectItemRule; }
|
ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_CollectItemRule; }
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *, UINT numAttributes);
|
virtual void writeAttributes(DataOutputStream *, unsigned int numAttributes);
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
virtual int getGoal();
|
virtual int getGoal();
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ GameRuleDefinition *ConsoleGenerateStructure::addChild(ConsoleGameRules::EGameRu
|
|||||||
return rule;
|
return rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConsoleGenerateStructure::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
void ConsoleGenerateStructure::writeAttributes(DataOutputStream *dos, unsigned int numAttrs)
|
||||||
{
|
{
|
||||||
GameRuleDefinition::writeAttributes(dos, numAttrs + 5);
|
GameRuleDefinition::writeAttributes(dos, numAttrs + 5);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public:
|
|||||||
virtual void getChildren(vector<GameRuleDefinition *> *children);
|
virtual void getChildren(vector<GameRuleDefinition *> *children);
|
||||||
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs);
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
// StructurePiece
|
// StructurePiece
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ void ConsoleSchematicFile::save(DataOutputStream *dos)
|
|||||||
dos->writeInt(m_ySize);
|
dos->writeInt(m_ySize);
|
||||||
dos->writeInt(m_zSize);
|
dos->writeInt(m_zSize);
|
||||||
|
|
||||||
byteArray ba(new BYTE[ m_data.length ], m_data.length);
|
byteArray ba(new uint8_t[ m_data.length ], m_data.length);
|
||||||
Compression::getCompression()->CompressLZXRLE( ba.data, &ba.length,
|
Compression::getCompression()->CompressLZXRLE( ba.data, &ba.length,
|
||||||
m_data.data, m_data.length);
|
m_data.data, m_data.length);
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream *dos)
|
|||||||
delete tag;
|
delete tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
||||||
{
|
{
|
||||||
int xStart = max(destinationBox->x0, (double)chunk->x*16);
|
int xStart = max(destinationBox->x0, (double)chunk->x*16);
|
||||||
int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16);
|
int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16);
|
||||||
@@ -323,7 +323,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB
|
|||||||
|
|
||||||
// At the point that this is called, we have all the neighbouring chunks loaded in (and generally post-processed, apart from this lighting pass), so
|
// At the point that this is called, we have all the neighbouring chunks loaded in (and generally post-processed, apart from this lighting pass), so
|
||||||
// we can do the sort of lighting that might propagate out of the chunk.
|
// we can do the sort of lighting that might propagate out of the chunk.
|
||||||
__int64 ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
int64_t ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot)
|
||||||
{
|
{
|
||||||
int xStart = max(destinationBox->x0, (double)chunk->x*16);
|
int xStart = max(destinationBox->x0, (double)chunk->x*16);
|
||||||
int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16);
|
int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16);
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ public:
|
|||||||
void save(DataOutputStream *dos);
|
void save(DataOutputStream *dos);
|
||||||
void load(DataInputStream *dis);
|
void load(DataInputStream *dis);
|
||||||
|
|
||||||
__int64 applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
int64_t applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||||
__int64 applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
int64_t applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||||
void applyTileEntities(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
void applyTileEntities(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot);
|
||||||
|
|
||||||
static void generateSchematicFile(DataOutputStream *dos, Level *level, int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, bool bSaveMobs, Compression::ECompressionTypes);
|
static void generateSchematicFile(DataOutputStream *dos, Level *level, int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, bool bSaveMobs, Compression::ECompressionTypes);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public:
|
|||||||
typedef struct _ValueType
|
typedef struct _ValueType
|
||||||
{
|
{
|
||||||
union{
|
union{
|
||||||
__int64 i64;
|
int64_t i64;
|
||||||
int i;
|
int i;
|
||||||
char c;
|
char c;
|
||||||
bool b;
|
bool b;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ void GameRuleDefinition::write(DataOutputStream *dos)
|
|||||||
(*it)->write(dos);
|
(*it)->write(dos);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes)
|
void GameRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes)
|
||||||
{
|
{
|
||||||
dos->writeInt(numAttributes + 3);
|
dos->writeInt(numAttributes + 3);
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
|
|
||||||
virtual void write(DataOutputStream *);
|
virtual void write(DataOutputStream *);
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes);
|
||||||
virtual void getChildren(vector<GameRuleDefinition *> *);
|
virtual void getChildren(vector<GameRuleDefinition *> *);
|
||||||
|
|
||||||
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include "ConsoleGameRules.h"
|
#include "ConsoleGameRules.h"
|
||||||
#include "GameRuleManager.h"
|
#include "GameRuleManager.h"
|
||||||
|
|
||||||
WCHAR *GameRuleManager::wchTagNameA[] =
|
wchar_t *GameRuleManager::wchTagNameA[] =
|
||||||
{
|
{
|
||||||
L"", // eGameRuleType_Root
|
L"", // eGameRuleType_Root
|
||||||
L"MapOptions", // eGameRuleType_LevelGenerationOptions
|
L"MapOptions", // eGameRuleType_LevelGenerationOptions
|
||||||
@@ -34,7 +34,7 @@ WCHAR *GameRuleManager::wchTagNameA[] =
|
|||||||
L"UpdatePlayer", // eGameRuleType_UpdatePlayerRule
|
L"UpdatePlayer", // eGameRuleType_UpdatePlayerRule
|
||||||
};
|
};
|
||||||
|
|
||||||
WCHAR *GameRuleManager::wchAttrNameA[] =
|
wchar_t *GameRuleManager::wchAttrNameA[] =
|
||||||
{
|
{
|
||||||
L"descriptionName", // eGameRuleAttr_descriptionName
|
L"descriptionName", // eGameRuleAttr_descriptionName
|
||||||
L"promptName", // eGameRuleAttr_promptName
|
L"promptName", // eGameRuleAttr_promptName
|
||||||
@@ -103,7 +103,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
|
|||||||
for(int i = 0; i < gameRulesCount; ++i)
|
for(int i = 0; i < gameRulesCount; ++i)
|
||||||
{
|
{
|
||||||
DLCGameRulesHeader *dlcHeader = (DLCGameRulesHeader *)pack->getFile(DLCManager::e_DLCType_GameRulesHeader, i);
|
DLCGameRulesHeader *dlcHeader = (DLCGameRulesHeader *)pack->getFile(DLCManager::e_DLCType_GameRulesHeader, i);
|
||||||
DWORD dSize;
|
unsigned long dSize;
|
||||||
byte *dData = dlcHeader->getData(dSize);
|
byte *dData = dlcHeader->getData(dSize);
|
||||||
|
|
||||||
LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions();
|
LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions();
|
||||||
@@ -125,7 +125,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
|
|||||||
{
|
{
|
||||||
DLCGameRulesFile *dlcFile = (DLCGameRulesFile *)pack->getFile(DLCManager::e_DLCType_GameRules, i);
|
DLCGameRulesFile *dlcFile = (DLCGameRulesFile *)pack->getFile(DLCManager::e_DLCType_GameRules, i);
|
||||||
|
|
||||||
DWORD dSize;
|
unsigned long dSize;
|
||||||
byte *dData = dlcFile->getData(dSize);
|
byte *dData = dlcFile->getData(dSize);
|
||||||
|
|
||||||
LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions();
|
LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions();
|
||||||
@@ -142,7 +142,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LevelGenerationOptions *GameRuleManager::loadGameRules(byte *dIn, UINT dSize)
|
LevelGenerationOptions *GameRuleManager::loadGameRules(byte *dIn, unsigned int dSize)
|
||||||
{
|
{
|
||||||
LevelGenerationOptions *lgo = new LevelGenerationOptions();
|
LevelGenerationOptions *lgo = new LevelGenerationOptions();
|
||||||
lgo->setGrSource( new JustGrSource() );
|
lgo->setGrSource( new JustGrSource() );
|
||||||
@@ -153,7 +153,7 @@ LevelGenerationOptions *GameRuleManager::loadGameRules(byte *dIn, UINT dSize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 4J-JEV: Reverse of saveGameRules.
|
// 4J-JEV: Reverse of saveGameRules.
|
||||||
void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT dSize)
|
void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, unsigned int dSize)
|
||||||
{
|
{
|
||||||
app.DebugPrintf("GameRuleManager::LoadingGameRules:\n");
|
app.DebugPrintf("GameRuleManager::LoadingGameRules:\n");
|
||||||
|
|
||||||
@@ -170,11 +170,11 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||||||
|
|
||||||
for (int i = 0; i < 8; i++) dis.readByte();
|
for (int i = 0; i < 8; i++) dis.readByte();
|
||||||
|
|
||||||
BYTE compression_type = dis.readByte();
|
uint8_t compression_type = dis.readByte();
|
||||||
|
|
||||||
app.DebugPrintf("\tcompressionType=%d.\n", compression_type);
|
app.DebugPrintf("\tcompressionType=%d.\n", compression_type);
|
||||||
|
|
||||||
UINT compr_len, decomp_len;
|
unsigned int compr_len, decomp_len;
|
||||||
compr_len = dis.readInt();
|
compr_len = dis.readInt();
|
||||||
decomp_len = dis.readInt();
|
decomp_len = dis.readInt();
|
||||||
|
|
||||||
@@ -183,8 +183,8 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||||||
|
|
||||||
// Decompress File Body
|
// Decompress File Body
|
||||||
|
|
||||||
byteArray content(new BYTE[decomp_len], decomp_len),
|
byteArray content(new uint8_t[decomp_len], decomp_len),
|
||||||
compr_content(new BYTE[compr_len], compr_len);
|
compr_content(new uint8_t[compr_len], compr_len);
|
||||||
dis.read(compr_content);
|
dis.read(compr_content);
|
||||||
|
|
||||||
Compression::getCompression()->SetDecompressionType( (Compression::ECompressionTypes)compression_type );
|
Compression::getCompression()->SetDecompressionType( (Compression::ECompressionTypes)compression_type );
|
||||||
@@ -203,14 +203,14 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||||||
// Read StringTable.
|
// Read StringTable.
|
||||||
byteArray bStringTable;
|
byteArray bStringTable;
|
||||||
bStringTable.length = dis2.readInt();
|
bStringTable.length = dis2.readInt();
|
||||||
bStringTable.data = new BYTE[ bStringTable.length ];
|
bStringTable.data = new uint8_t[ bStringTable.length ];
|
||||||
dis2.read(bStringTable);
|
dis2.read(bStringTable);
|
||||||
StringTable *strings = new StringTable(bStringTable.data, bStringTable.length);
|
StringTable *strings = new StringTable(bStringTable.data, bStringTable.length);
|
||||||
|
|
||||||
// Read RuleFile.
|
// Read RuleFile.
|
||||||
byteArray bRuleFile;
|
byteArray bRuleFile;
|
||||||
bRuleFile.length = content.length - bStringTable.length;
|
bRuleFile.length = content.length - bStringTable.length;
|
||||||
bRuleFile.data = new BYTE[ bRuleFile.length ];
|
bRuleFile.data = new uint8_t[ bRuleFile.length ];
|
||||||
dis2.read(bRuleFile);
|
dis2.read(bRuleFile);
|
||||||
|
|
||||||
// 4J-JEV: I don't believe that the path-name is ever used.
|
// 4J-JEV: I don't believe that the path-name is ever used.
|
||||||
@@ -240,7 +240,7 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 4J-JEV: Reverse of loadGameRules.
|
// 4J-JEV: Reverse of loadGameRules.
|
||||||
void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize)
|
void GameRuleManager::saveGameRules(byte **dOut, unsigned int *dSize)
|
||||||
{
|
{
|
||||||
if (m_currentGameRuleDefinitions == NULL &&
|
if (m_currentGameRuleDefinitions == NULL &&
|
||||||
m_currentLevelGenerationOptions == NULL)
|
m_currentLevelGenerationOptions == NULL)
|
||||||
@@ -264,7 +264,7 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize)
|
|||||||
|
|
||||||
// Write 8 bytes of empty space in case we need them later.
|
// Write 8 bytes of empty space in case we need them later.
|
||||||
// Mainly useful for the ones we save embedded in game saves.
|
// Mainly useful for the ones we save embedded in game saves.
|
||||||
for (UINT i = 0; i < 8; i++)
|
for (unsigned int i = 0; i < 8; i++)
|
||||||
dos.writeByte(0x0);
|
dos.writeByte(0x0);
|
||||||
|
|
||||||
dos.writeByte(APPROPRIATE_COMPRESSION_TYPE); // m_compressionType
|
dos.writeByte(APPROPRIATE_COMPRESSION_TYPE); // m_compressionType
|
||||||
@@ -306,7 +306,7 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compress compr_dos and write to dos.
|
// Compress compr_dos and write to dos.
|
||||||
byteArray compr_ba(new BYTE[ compr_baos.buf.length ], compr_baos.buf.length);
|
byteArray compr_ba(new uint8_t[ compr_baos.buf.length ], compr_baos.buf.length);
|
||||||
Compression::getCompression()->CompressLZXRLE( compr_ba.data, &compr_ba.length,
|
Compression::getCompression()->CompressLZXRLE( compr_ba.data, &compr_ba.length,
|
||||||
compr_baos.buf.data, compr_baos.buf.length );
|
compr_baos.buf.data, compr_baos.buf.length );
|
||||||
|
|
||||||
@@ -373,15 +373,15 @@ void GameRuleManager::writeRuleFile(DataOutputStream *dos)
|
|||||||
m_currentGameRuleDefinitions->write(dos);
|
m_currentGameRuleDefinitions->write(dos);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT dSize, StringTable *strings) //(DLCGameRulesFile *dlcFile, StringTable *strings)
|
bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, unsigned int dSize, StringTable *strings) //(DLCGameRulesFile *dlcFile, StringTable *strings)
|
||||||
{
|
{
|
||||||
bool levelGenAdded = false;
|
bool levelGenAdded = false;
|
||||||
bool gameRulesAdded = false;
|
bool gameRulesAdded = false;
|
||||||
LevelGenerationOptions *levelGenerator = lgo;//new LevelGenerationOptions();
|
LevelGenerationOptions *levelGenerator = lgo;//new LevelGenerationOptions();
|
||||||
LevelRuleset *gameRules = new LevelRuleset();
|
LevelRuleset *gameRules = new LevelRuleset();
|
||||||
|
|
||||||
//DWORD dwLen = 0;
|
//unsigned long dwLen = 0;
|
||||||
//PBYTE pbData = dlcFile->getData(dwLen);
|
//uint8_t* pbData = dlcFile->getData(dwLen);
|
||||||
//byteArray data(pbData,dwLen);
|
//byteArray data(pbData,dwLen);
|
||||||
|
|
||||||
byteArray data(dIn, dSize);
|
byteArray data(dIn, dSize);
|
||||||
@@ -391,7 +391,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||||||
// Read File.
|
// Read File.
|
||||||
|
|
||||||
// version_number
|
// version_number
|
||||||
__int64 version = dis.readShort();
|
int64_t version = dis.readShort();
|
||||||
unsigned char compressionType = 0;
|
unsigned char compressionType = 0;
|
||||||
if(version == 0)
|
if(version == 0)
|
||||||
{
|
{
|
||||||
@@ -469,15 +469,15 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||||||
}
|
}
|
||||||
|
|
||||||
// string lookup.
|
// string lookup.
|
||||||
UINT numStrings = contentDis->readInt();
|
unsigned int numStrings = contentDis->readInt();
|
||||||
vector<wstring> tagsAndAtts;
|
vector<wstring> tagsAndAtts;
|
||||||
for (UINT i = 0; i < numStrings; i++)
|
for (unsigned int i = 0; i < numStrings; i++)
|
||||||
tagsAndAtts.push_back( contentDis->readUTF() );
|
tagsAndAtts.push_back( contentDis->readUTF() );
|
||||||
|
|
||||||
unordered_map<int, ConsoleGameRules::EGameRuleType> tagIdMap;
|
unordered_map<int, ConsoleGameRules::EGameRuleType> tagIdMap;
|
||||||
for(int type = (int)ConsoleGameRules::eGameRuleType_Root; type < (int)ConsoleGameRules::eGameRuleType_Count; ++type)
|
for(int type = (int)ConsoleGameRules::eGameRuleType_Root; type < (int)ConsoleGameRules::eGameRuleType_Count; ++type)
|
||||||
{
|
{
|
||||||
for(UINT i = 0; i < numStrings; ++i)
|
for(unsigned int i = 0; i < numStrings; ++i)
|
||||||
{
|
{
|
||||||
if(tagsAndAtts[i].compare(wchTagNameA[type]) == 0)
|
if(tagsAndAtts[i].compare(wchTagNameA[type]) == 0)
|
||||||
{
|
{
|
||||||
@@ -492,7 +492,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||||||
unordered_map<int, ConsoleGameRules::EGameRuleAttr> attrIdMap;
|
unordered_map<int, ConsoleGameRules::EGameRuleAttr> attrIdMap;
|
||||||
for(int attr = (int)ConsoleGameRules::eGameRuleAttr_descriptionName; attr < (int)ConsoleGameRules::eGameRuleAttr_Count; ++attr)
|
for(int attr = (int)ConsoleGameRules::eGameRuleAttr_descriptionName; attr < (int)ConsoleGameRules::eGameRuleAttr_Count; ++attr)
|
||||||
{
|
{
|
||||||
for (UINT i = 0; i < numStrings; i++)
|
for (unsigned int i = 0; i < numStrings; i++)
|
||||||
{
|
{
|
||||||
if (tagsAndAtts[i].compare(wchAttrNameA[attr]) == 0)
|
if (tagsAndAtts[i].compare(wchAttrNameA[attr]) == 0)
|
||||||
{
|
{
|
||||||
@@ -503,8 +503,8 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
// subfile
|
// subfile
|
||||||
UINT numFiles = contentDis->readInt();
|
unsigned int numFiles = contentDis->readInt();
|
||||||
for (UINT i = 0; i < numFiles; i++)
|
for (unsigned int i = 0; i < numFiles; i++)
|
||||||
{
|
{
|
||||||
wstring sFilename = contentDis->readUTF();
|
wstring sFilename = contentDis->readUTF();
|
||||||
int length = contentDis->readInt();
|
int length = contentDis->readInt();
|
||||||
@@ -519,8 +519,8 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||||||
LEVEL_GEN_ID lgoID = LEVEL_GEN_ID_NULL;
|
LEVEL_GEN_ID lgoID = LEVEL_GEN_ID_NULL;
|
||||||
|
|
||||||
// xml objects
|
// xml objects
|
||||||
UINT numObjects = contentDis->readInt();
|
unsigned int numObjects = contentDis->readInt();
|
||||||
for(UINT i = 0; i < numObjects; ++i)
|
for(unsigned int i = 0; i < numObjects; ++i)
|
||||||
{
|
{
|
||||||
int tagId = contentDis->readInt();
|
int tagId = contentDis->readInt();
|
||||||
ConsoleGameRules::EGameRuleType tagVal = ConsoleGameRules::eGameRuleType_Invalid;
|
ConsoleGameRules::EGameRuleType tagVal = ConsoleGameRules::eGameRuleType_Invalid;
|
||||||
@@ -584,7 +584,7 @@ LevelGenerationOptions *GameRuleManager::readHeader(DLCGameRulesHeader *grh)
|
|||||||
void GameRuleManager::readAttributes(DataInputStream *dis, vector<wstring> *tagsAndAtts, GameRuleDefinition *rule)
|
void GameRuleManager::readAttributes(DataInputStream *dis, vector<wstring> *tagsAndAtts, GameRuleDefinition *rule)
|
||||||
{
|
{
|
||||||
int numAttrs = dis->readInt();
|
int numAttrs = dis->readInt();
|
||||||
for (UINT att = 0; att < numAttrs; ++att)
|
for (unsigned int att = 0; att < numAttrs; ++att)
|
||||||
{
|
{
|
||||||
int attID = dis->readInt();
|
int attID = dis->readInt();
|
||||||
wstring value = dis->readUTF();
|
wstring value = dis->readUTF();
|
||||||
@@ -596,7 +596,7 @@ void GameRuleManager::readAttributes(DataInputStream *dis, vector<wstring> *tags
|
|||||||
void GameRuleManager::readChildren(DataInputStream *dis, vector<wstring> *tagsAndAtts, unordered_map<int, ConsoleGameRules::EGameRuleType> *tagIdMap, GameRuleDefinition *rule)
|
void GameRuleManager::readChildren(DataInputStream *dis, vector<wstring> *tagsAndAtts, unordered_map<int, ConsoleGameRules::EGameRuleType> *tagIdMap, GameRuleDefinition *rule)
|
||||||
{
|
{
|
||||||
int numChildren = dis->readInt();
|
int numChildren = dis->readInt();
|
||||||
for(UINT child = 0; child < numChildren; ++child)
|
for(unsigned int child = 0; child < numChildren; ++child)
|
||||||
{
|
{
|
||||||
int tagId = dis->readInt();
|
int tagId = dis->readInt();
|
||||||
ConsoleGameRules::EGameRuleType tagVal = ConsoleGameRules::eGameRuleType_Invalid;
|
ConsoleGameRules::EGameRuleType tagVal = ConsoleGameRules::eGameRuleType_Invalid;
|
||||||
@@ -663,7 +663,7 @@ void GameRuleManager::loadDefaultGameRules()
|
|||||||
if(app.getArchiveFileSize(fpTutorial) >= 0)
|
if(app.getArchiveFileSize(fpTutorial) >= 0)
|
||||||
{
|
{
|
||||||
DLCPack *pack = new DLCPack(L"",0xffffffff);
|
DLCPack *pack = new DLCPack(L"",0xffffffff);
|
||||||
DWORD dwFilesProcessed = 0;
|
unsigned long dwFilesProcessed = 0;
|
||||||
if ( app.m_dlcManager.readDLCDataFile(dwFilesProcessed,fpTutorial,pack,true) )
|
if ( app.m_dlcManager.readDLCDataFile(dwFilesProcessed,fpTutorial,pack,true) )
|
||||||
{
|
{
|
||||||
app.m_dlcManager.addPack(pack);
|
app.m_dlcManager.addPack(pack);
|
||||||
@@ -689,7 +689,7 @@ bool GameRuleManager::loadGameRulesPack(File *path)
|
|||||||
if(path->exists())
|
if(path->exists())
|
||||||
{
|
{
|
||||||
DLCPack *pack = new DLCPack(L"",0xffffffff);
|
DLCPack *pack = new DLCPack(L"",0xffffffff);
|
||||||
DWORD dwFilesProcessed = 0;
|
unsigned long dwFilesProcessed = 0;
|
||||||
if( app.m_dlcManager.readDLCDataFile(dwFilesProcessed, path->getPath(),pack))
|
if( app.m_dlcManager.readDLCDataFile(dwFilesProcessed, path->getPath(),pack))
|
||||||
{
|
{
|
||||||
app.m_dlcManager.addPack(pack);
|
app.m_dlcManager.addPack(pack);
|
||||||
@@ -718,7 +718,7 @@ void GameRuleManager::setLevelGenerationOptions(LevelGenerationOptions *levelGen
|
|||||||
m_currentLevelGenerationOptions->reset_start();
|
m_currentLevelGenerationOptions->reset_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
LPCWSTR GameRuleManager::GetGameRulesString(const wstring &key)
|
const wchar_t* GameRuleManager::GetGameRulesString(const wstring &key)
|
||||||
{
|
{
|
||||||
if(m_currentGameRuleDefinitions != NULL && !key.empty() )
|
if(m_currentGameRuleDefinitions != NULL && !key.empty() )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ class WstringLookup;
|
|||||||
class GameRuleManager
|
class GameRuleManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static WCHAR *wchTagNameA[ConsoleGameRules::eGameRuleType_Count];
|
static wchar_t *wchTagNameA[ConsoleGameRules::eGameRuleType_Count];
|
||||||
static WCHAR *wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count];
|
static wchar_t *wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count];
|
||||||
|
|
||||||
static const short version_number = 2;
|
static const short version_number = 2;
|
||||||
|
|
||||||
@@ -40,10 +40,10 @@ public:
|
|||||||
|
|
||||||
void loadGameRules(DLCPack *);
|
void loadGameRules(DLCPack *);
|
||||||
|
|
||||||
LevelGenerationOptions *loadGameRules(byte *dIn, UINT dSize);
|
LevelGenerationOptions *loadGameRules(byte *dIn, unsigned int dSize);
|
||||||
void loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT dSize);
|
void loadGameRules(LevelGenerationOptions *lgo, byte *dIn, unsigned int dSize);
|
||||||
|
|
||||||
void saveGameRules(byte **dOut, UINT *dSize);
|
void saveGameRules(byte **dOut, unsigned int *dSize);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LevelGenerationOptions *readHeader(DLCGameRulesHeader *grh);
|
LevelGenerationOptions *readHeader(DLCGameRulesHeader *grh);
|
||||||
@@ -51,7 +51,7 @@ private:
|
|||||||
void writeRuleFile(DataOutputStream *dos);
|
void writeRuleFile(DataOutputStream *dos);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT dSize, StringTable *strings); //(DLCGameRulesFile *dlcFile, StringTable *strings);
|
bool readRuleFile(LevelGenerationOptions *lgo, byte *dIn, unsigned int dSize, StringTable *strings); //(DLCGameRulesFile *dlcFile, StringTable *strings);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void readAttributes(DataInputStream *dis, vector<wstring> *tagsAndAtts, GameRuleDefinition *rule);
|
void readAttributes(DataInputStream *dis, vector<wstring> *tagsAndAtts, GameRuleDefinition *rule);
|
||||||
@@ -72,7 +72,7 @@ public:
|
|||||||
void setLevelGenerationOptions(LevelGenerationOptions *levelGen);
|
void setLevelGenerationOptions(LevelGenerationOptions *levelGen);
|
||||||
LevelRuleset *getGameRuleDefinitions() { return m_currentGameRuleDefinitions; }
|
LevelRuleset *getGameRuleDefinitions() { return m_currentGameRuleDefinitions; }
|
||||||
LevelGenerationOptions *getLevelGenerationOptions() { return m_currentLevelGenerationOptions; }
|
LevelGenerationOptions *getLevelGenerationOptions() { return m_currentLevelGenerationOptions; }
|
||||||
LPCWSTR GetGameRulesString(const wstring &key);
|
const wchar_t* GetGameRulesString(const wstring &key);
|
||||||
|
|
||||||
// 4J-JEV:
|
// 4J-JEV:
|
||||||
// Properly cleans-up and unloads the current set of gameRules.
|
// Properly cleans-up and unloads the current set of gameRules.
|
||||||
|
|||||||
@@ -23,16 +23,16 @@ JustGrSource::JustGrSource()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool JustGrSource::requiresTexturePack() {return m_bRequiresTexturePack;}
|
bool JustGrSource::requiresTexturePack() {return m_bRequiresTexturePack;}
|
||||||
UINT JustGrSource::getRequiredTexturePackId() {return m_requiredTexturePackId;}
|
unsigned int JustGrSource::getRequiredTexturePackId() {return m_requiredTexturePackId;}
|
||||||
wstring JustGrSource::getDefaultSaveName() {return m_defaultSaveName;}
|
wstring JustGrSource::getDefaultSaveName() {return m_defaultSaveName;}
|
||||||
LPCWSTR JustGrSource::getWorldName() {return m_worldName.c_str();}
|
const wchar_t* JustGrSource::getWorldName() {return m_worldName.c_str();}
|
||||||
LPCWSTR JustGrSource::getDisplayName() {return m_displayName.c_str();}
|
const wchar_t* JustGrSource::getDisplayName() {return m_displayName.c_str();}
|
||||||
wstring JustGrSource::getGrfPath() {return m_grfPath;}
|
wstring JustGrSource::getGrfPath() {return m_grfPath;}
|
||||||
bool JustGrSource::requiresBaseSave() { return m_bRequiresBaseSave; };
|
bool JustGrSource::requiresBaseSave() { return m_bRequiresBaseSave; };
|
||||||
wstring JustGrSource::getBaseSavePath() { return m_baseSavePath; };
|
wstring JustGrSource::getBaseSavePath() { return m_baseSavePath; };
|
||||||
|
|
||||||
void JustGrSource::setRequiresTexturePack(bool x) {m_bRequiresTexturePack = x;}
|
void JustGrSource::setRequiresTexturePack(bool x) {m_bRequiresTexturePack = x;}
|
||||||
void JustGrSource::setRequiredTexturePackId(UINT x) {m_requiredTexturePackId = x;}
|
void JustGrSource::setRequiredTexturePackId(unsigned int x) {m_requiredTexturePackId = x;}
|
||||||
void JustGrSource::setDefaultSaveName(const wstring &x) {m_defaultSaveName = x;}
|
void JustGrSource::setDefaultSaveName(const wstring &x) {m_defaultSaveName = x;}
|
||||||
void JustGrSource::setWorldName(const wstring &x) {m_worldName = x;}
|
void JustGrSource::setWorldName(const wstring &x) {m_worldName = x;}
|
||||||
void JustGrSource::setDisplayName(const wstring &x) {m_displayName = x;}
|
void JustGrSource::setDisplayName(const wstring &x) {m_displayName = x;}
|
||||||
@@ -90,7 +90,7 @@ LevelGenerationOptions::~LevelGenerationOptions()
|
|||||||
|
|
||||||
ConsoleGameRules::EGameRuleType LevelGenerationOptions::getActionType() { return ConsoleGameRules::eGameRuleType_LevelGenerationOptions; }
|
ConsoleGameRules::EGameRuleType LevelGenerationOptions::getActionType() { return ConsoleGameRules::eGameRuleType_LevelGenerationOptions; }
|
||||||
|
|
||||||
void LevelGenerationOptions::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
void LevelGenerationOptions::writeAttributes(DataOutputStream *dos, unsigned int numAttrs)
|
||||||
{
|
{
|
||||||
GameRuleDefinition::writeAttributes(dos, numAttrs + 5);
|
GameRuleDefinition::writeAttributes(dos, numAttrs + 5);
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws
|
|||||||
{
|
{
|
||||||
if(attributeName.compare(L"seed") == 0)
|
if(attributeName.compare(L"seed") == 0)
|
||||||
{
|
{
|
||||||
m_seed = _fromString<__int64>(attributeValue);
|
m_seed = _fromString<int64_t>(attributeValue);
|
||||||
app.DebugPrintf("LevelGenerationOptions: Adding parameter m_seed=%I64d\n",m_seed);
|
app.DebugPrintf("LevelGenerationOptions: Adding parameter m_seed=%I64d\n",m_seed);
|
||||||
}
|
}
|
||||||
else if(attributeName.compare(L"spawnX") == 0)
|
else if(attributeName.compare(L"spawnX") == 0)
|
||||||
@@ -331,7 +331,7 @@ void LevelGenerationOptions::clearSchematics()
|
|||||||
m_schematics.clear();
|
m_schematics.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
ConsoleSchematicFile *LevelGenerationOptions::loadSchematicFile(const wstring &filename, PBYTE pbData, DWORD dwLen)
|
ConsoleSchematicFile *LevelGenerationOptions::loadSchematicFile(const wstring &filename, uint8_t* pbData, unsigned long dwLen)
|
||||||
{
|
{
|
||||||
// If we have already loaded this, just return
|
// If we have already loaded this, just return
|
||||||
AUTO_VAR(it, m_schematics.find(filename));
|
AUTO_VAR(it, m_schematics.find(filename));
|
||||||
@@ -388,7 +388,7 @@ void LevelGenerationOptions::loadStringTable(StringTable *table)
|
|||||||
m_stringTable = table;
|
m_stringTable = table;
|
||||||
}
|
}
|
||||||
|
|
||||||
LPCWSTR LevelGenerationOptions::getString(const wstring &key)
|
const wchar_t* LevelGenerationOptions::getString(const wstring &key)
|
||||||
{
|
{
|
||||||
if(m_stringTable == NULL)
|
if(m_stringTable == NULL)
|
||||||
{
|
{
|
||||||
@@ -400,7 +400,7 @@ LPCWSTR LevelGenerationOptions::getString(const wstring &key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LevelGenerationOptions::getBiomeOverride(int biomeId, BYTE &tile, BYTE &topTile)
|
void LevelGenerationOptions::getBiomeOverride(int biomeId, uint8_t &tile, uint8_t &topTile)
|
||||||
{
|
{
|
||||||
for(AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); ++it)
|
for(AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); ++it)
|
||||||
{
|
{
|
||||||
@@ -477,10 +477,10 @@ bool LevelGenerationOptions::isFromSave() { return getSrc() == eSrc_fromSave; }
|
|||||||
bool LevelGenerationOptions::isFromDLC() { return getSrc() == eSrc_fromDLC; }
|
bool LevelGenerationOptions::isFromDLC() { return getSrc() == eSrc_fromDLC; }
|
||||||
|
|
||||||
bool LevelGenerationOptions::requiresTexturePack() { return info()->requiresTexturePack(); }
|
bool LevelGenerationOptions::requiresTexturePack() { return info()->requiresTexturePack(); }
|
||||||
UINT LevelGenerationOptions::getRequiredTexturePackId() { return info()->getRequiredTexturePackId(); }
|
unsigned int LevelGenerationOptions::getRequiredTexturePackId() { return info()->getRequiredTexturePackId(); }
|
||||||
wstring LevelGenerationOptions::getDefaultSaveName() { return info()->getDefaultSaveName(); }
|
wstring LevelGenerationOptions::getDefaultSaveName() { return info()->getDefaultSaveName(); }
|
||||||
LPCWSTR LevelGenerationOptions::getWorldName() { return info()->getWorldName(); }
|
const wchar_t* LevelGenerationOptions::getWorldName() { return info()->getWorldName(); }
|
||||||
LPCWSTR LevelGenerationOptions::getDisplayName() { return info()->getDisplayName(); }
|
const wchar_t* LevelGenerationOptions::getDisplayName() { return info()->getDisplayName(); }
|
||||||
wstring LevelGenerationOptions::getGrfPath() { return info()->getGrfPath(); }
|
wstring LevelGenerationOptions::getGrfPath() { return info()->getGrfPath(); }
|
||||||
bool LevelGenerationOptions::requiresBaseSave() { return info()->requiresBaseSave(); }
|
bool LevelGenerationOptions::requiresBaseSave() { return info()->requiresBaseSave(); }
|
||||||
wstring LevelGenerationOptions::getBaseSavePath() { return info()->getBaseSavePath(); }
|
wstring LevelGenerationOptions::getBaseSavePath() { return info()->getBaseSavePath(); }
|
||||||
@@ -488,7 +488,7 @@ wstring LevelGenerationOptions::getBaseSavePath() { return info()->getBaseSavePa
|
|||||||
void LevelGenerationOptions::setGrSource(GrSource *grs) { m_pSrc = grs; }
|
void LevelGenerationOptions::setGrSource(GrSource *grs) { m_pSrc = grs; }
|
||||||
|
|
||||||
void LevelGenerationOptions::setRequiresTexturePack(bool x) { info()->setRequiresTexturePack(x); }
|
void LevelGenerationOptions::setRequiresTexturePack(bool x) { info()->setRequiresTexturePack(x); }
|
||||||
void LevelGenerationOptions::setRequiredTexturePackId(UINT x) { info()->setRequiredTexturePackId(x); }
|
void LevelGenerationOptions::setRequiredTexturePackId(unsigned int x) { info()->setRequiredTexturePackId(x); }
|
||||||
void LevelGenerationOptions::setDefaultSaveName(const wstring &x) { info()->setDefaultSaveName(x); }
|
void LevelGenerationOptions::setDefaultSaveName(const wstring &x) { info()->setDefaultSaveName(x); }
|
||||||
void LevelGenerationOptions::setWorldName(const wstring &x) { info()->setWorldName(x); }
|
void LevelGenerationOptions::setWorldName(const wstring &x) { info()->setWorldName(x); }
|
||||||
void LevelGenerationOptions::setDisplayName(const wstring &x) { info()->setDisplayName(x); }
|
void LevelGenerationOptions::setDisplayName(const wstring &x) { info()->setDisplayName(x); }
|
||||||
@@ -497,15 +497,15 @@ void LevelGenerationOptions::setBaseSavePath(const wstring &x) { info()->setBase
|
|||||||
|
|
||||||
bool LevelGenerationOptions::ready() { return info()->ready(); }
|
bool LevelGenerationOptions::ready() { return info()->ready(); }
|
||||||
|
|
||||||
void LevelGenerationOptions::setBaseSaveData(PBYTE pbData, DWORD dwSize) { m_pbBaseSaveData = pbData; m_dwBaseSaveSize = dwSize; }
|
void LevelGenerationOptions::setBaseSaveData(uint8_t* pbData, unsigned long dwSize) { m_pbBaseSaveData = pbData; m_dwBaseSaveSize = dwSize; }
|
||||||
PBYTE LevelGenerationOptions::getBaseSaveData(DWORD &size) { size = m_dwBaseSaveSize; return m_pbBaseSaveData; }
|
uint8_t* LevelGenerationOptions::getBaseSaveData(unsigned long &size) { size = m_dwBaseSaveSize; return m_pbBaseSaveData; }
|
||||||
bool LevelGenerationOptions::hasBaseSaveData() { return m_dwBaseSaveSize > 0 && m_pbBaseSaveData != NULL; }
|
bool LevelGenerationOptions::hasBaseSaveData() { return m_dwBaseSaveSize > 0 && m_pbBaseSaveData != NULL; }
|
||||||
void LevelGenerationOptions::deleteBaseSaveData() { if(m_pbBaseSaveData) delete m_pbBaseSaveData; m_pbBaseSaveData = NULL; m_dwBaseSaveSize = 0; }
|
void LevelGenerationOptions::deleteBaseSaveData() { if(m_pbBaseSaveData) delete m_pbBaseSaveData; m_pbBaseSaveData = NULL; m_dwBaseSaveSize = 0; }
|
||||||
|
|
||||||
bool LevelGenerationOptions::hasLoadedData() { return m_hasLoadedData; }
|
bool LevelGenerationOptions::hasLoadedData() { return m_hasLoadedData; }
|
||||||
void LevelGenerationOptions::setLoadedData() { m_hasLoadedData = true; }
|
void LevelGenerationOptions::setLoadedData() { m_hasLoadedData = true; }
|
||||||
|
|
||||||
__int64 LevelGenerationOptions::getLevelSeed() { return m_seed; }
|
int64_t LevelGenerationOptions::getLevelSeed() { return m_seed; }
|
||||||
Pos *LevelGenerationOptions::getSpawnPos() { return m_spawnPos; }
|
Pos *LevelGenerationOptions::getSpawnPos() { return m_spawnPos; }
|
||||||
bool LevelGenerationOptions::getuseFlatWorld() { return m_useFlatWorld; }
|
bool LevelGenerationOptions::getuseFlatWorld() { return m_useFlatWorld; }
|
||||||
|
|
||||||
|
|||||||
@@ -23,16 +23,16 @@ public:
|
|||||||
// completely different lifespans.
|
// completely different lifespans.
|
||||||
|
|
||||||
virtual bool requiresTexturePack()=0;
|
virtual bool requiresTexturePack()=0;
|
||||||
virtual UINT getRequiredTexturePackId()=0;
|
virtual unsigned int getRequiredTexturePackId()=0;
|
||||||
virtual wstring getDefaultSaveName()=0;
|
virtual wstring getDefaultSaveName()=0;
|
||||||
virtual LPCWSTR getWorldName()=0;
|
virtual const wchar_t* getWorldName()=0;
|
||||||
virtual LPCWSTR getDisplayName()=0;
|
virtual const wchar_t* getDisplayName()=0;
|
||||||
virtual wstring getGrfPath()=0;
|
virtual wstring getGrfPath()=0;
|
||||||
virtual bool requiresBaseSave() = 0;
|
virtual bool requiresBaseSave() = 0;
|
||||||
virtual wstring getBaseSavePath() = 0;
|
virtual wstring getBaseSavePath() = 0;
|
||||||
|
|
||||||
virtual void setRequiresTexturePack(bool)=0;
|
virtual void setRequiresTexturePack(bool)=0;
|
||||||
virtual void setRequiredTexturePackId(UINT)=0;
|
virtual void setRequiredTexturePackId(unsigned int)=0;
|
||||||
virtual void setDefaultSaveName(const wstring &)=0;
|
virtual void setDefaultSaveName(const wstring &)=0;
|
||||||
virtual void setWorldName(const wstring &)=0;
|
virtual void setWorldName(const wstring &)=0;
|
||||||
virtual void setDisplayName(const wstring &)=0;
|
virtual void setDisplayName(const wstring &)=0;
|
||||||
@@ -41,7 +41,7 @@ public:
|
|||||||
|
|
||||||
virtual bool ready()=0;
|
virtual bool ready()=0;
|
||||||
|
|
||||||
//virtual void getGrfData(PBYTE &pData, DWORD &pSize)=0;
|
//virtual void getGrfData(uint8_t* &pData, unsigned long &pSize)=0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class JustGrSource : public GrSource
|
class JustGrSource : public GrSource
|
||||||
@@ -58,16 +58,16 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool requiresTexturePack();
|
virtual bool requiresTexturePack();
|
||||||
virtual UINT getRequiredTexturePackId();
|
virtual unsigned int getRequiredTexturePackId();
|
||||||
virtual wstring getDefaultSaveName();
|
virtual wstring getDefaultSaveName();
|
||||||
virtual LPCWSTR getWorldName();
|
virtual const wchar_t* getWorldName();
|
||||||
virtual LPCWSTR getDisplayName();
|
virtual const wchar_t* getDisplayName();
|
||||||
virtual wstring getGrfPath();
|
virtual wstring getGrfPath();
|
||||||
virtual bool requiresBaseSave();
|
virtual bool requiresBaseSave();
|
||||||
virtual wstring getBaseSavePath();
|
virtual wstring getBaseSavePath();
|
||||||
|
|
||||||
virtual void setRequiresTexturePack(bool x);
|
virtual void setRequiresTexturePack(bool x);
|
||||||
virtual void setRequiredTexturePackId(UINT x);
|
virtual void setRequiredTexturePackId(unsigned int x);
|
||||||
virtual void setDefaultSaveName(const wstring &x);
|
virtual void setDefaultSaveName(const wstring &x);
|
||||||
virtual void setWorldName(const wstring &x);
|
virtual void setWorldName(const wstring &x);
|
||||||
virtual void setDisplayName(const wstring &x);
|
virtual void setDisplayName(const wstring &x);
|
||||||
@@ -103,8 +103,8 @@ private:
|
|||||||
|
|
||||||
bool m_hasLoadedData;
|
bool m_hasLoadedData;
|
||||||
|
|
||||||
PBYTE m_pbBaseSaveData;
|
uint8_t* m_pbBaseSaveData;
|
||||||
DWORD m_dwBaseSaveSize;
|
unsigned long m_dwBaseSaveSize;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -116,10 +116,10 @@ public:
|
|||||||
bool isFromDLC();
|
bool isFromDLC();
|
||||||
|
|
||||||
bool requiresTexturePack();
|
bool requiresTexturePack();
|
||||||
UINT getRequiredTexturePackId();
|
unsigned int getRequiredTexturePackId();
|
||||||
wstring getDefaultSaveName();
|
wstring getDefaultSaveName();
|
||||||
LPCWSTR getWorldName();
|
const wchar_t* getWorldName();
|
||||||
LPCWSTR getDisplayName();
|
const wchar_t* getDisplayName();
|
||||||
wstring getGrfPath();
|
wstring getGrfPath();
|
||||||
bool requiresBaseSave();
|
bool requiresBaseSave();
|
||||||
wstring getBaseSavePath();
|
wstring getBaseSavePath();
|
||||||
@@ -127,7 +127,7 @@ public:
|
|||||||
void setGrSource(GrSource *grs);
|
void setGrSource(GrSource *grs);
|
||||||
|
|
||||||
void setRequiresTexturePack(bool x);
|
void setRequiresTexturePack(bool x);
|
||||||
void setRequiredTexturePackId(UINT x);
|
void setRequiredTexturePackId(unsigned int x);
|
||||||
void setDefaultSaveName(const wstring &x);
|
void setDefaultSaveName(const wstring &x);
|
||||||
void setWorldName(const wstring &x);
|
void setWorldName(const wstring &x);
|
||||||
void setDisplayName(const wstring &x);
|
void setDisplayName(const wstring &x);
|
||||||
@@ -136,8 +136,8 @@ public:
|
|||||||
|
|
||||||
bool ready();
|
bool ready();
|
||||||
|
|
||||||
void setBaseSaveData(PBYTE pbData, DWORD dwSize);
|
void setBaseSaveData(uint8_t* pbData, unsigned long dwSize);
|
||||||
PBYTE getBaseSaveData(DWORD &size);
|
uint8_t* getBaseSaveData(unsigned long &size);
|
||||||
bool hasBaseSaveData();
|
bool hasBaseSaveData();
|
||||||
void deleteBaseSaveData();
|
void deleteBaseSaveData();
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// This should match the "MapOptionsRule" definition in the XML schema
|
// This should match the "MapOptionsRule" definition in the XML schema
|
||||||
__int64 m_seed;
|
int64_t m_seed;
|
||||||
bool m_useFlatWorld;
|
bool m_useFlatWorld;
|
||||||
Pos *m_spawnPos;
|
Pos *m_spawnPos;
|
||||||
vector<ApplySchematicRuleDefinition *> m_schematicRules;
|
vector<ApplySchematicRuleDefinition *> m_schematicRules;
|
||||||
@@ -168,12 +168,12 @@ public:
|
|||||||
|
|
||||||
virtual ConsoleGameRules::EGameRuleType getActionType();
|
virtual ConsoleGameRules::EGameRuleType getActionType();
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes);
|
||||||
virtual void getChildren(vector<GameRuleDefinition *> *children);
|
virtual void getChildren(vector<GameRuleDefinition *> *children);
|
||||||
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
__int64 getLevelSeed();
|
int64_t getLevelSeed();
|
||||||
Pos *getSpawnPos();
|
Pos *getSpawnPos();
|
||||||
bool getuseFlatWorld();
|
bool getuseFlatWorld();
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ private:
|
|||||||
void clearSchematics();
|
void clearSchematics();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ConsoleSchematicFile *loadSchematicFile(const wstring &filename, PBYTE pbData, DWORD dwLen);
|
ConsoleSchematicFile *loadSchematicFile(const wstring &filename, uint8_t* pbData, unsigned long dwLen);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ConsoleSchematicFile *getSchematicFile(const wstring &filename);
|
ConsoleSchematicFile *getSchematicFile(const wstring &filename);
|
||||||
@@ -196,11 +196,11 @@ public:
|
|||||||
void setRequiredGameRules(LevelRuleset *rules);
|
void setRequiredGameRules(LevelRuleset *rules);
|
||||||
LevelRuleset *getRequiredGameRules();
|
LevelRuleset *getRequiredGameRules();
|
||||||
|
|
||||||
void getBiomeOverride(int biomeId, BYTE &tile, BYTE &topTile);
|
void getBiomeOverride(int biomeId, uint8_t &tile, uint8_t &topTile);
|
||||||
bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature);
|
bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature);
|
||||||
|
|
||||||
void loadStringTable(StringTable *table);
|
void loadStringTable(StringTable *table);
|
||||||
LPCWSTR getString(const wstring &key);
|
const wchar_t* getString(const wstring &key);
|
||||||
|
|
||||||
unordered_map<wstring, ConsoleSchematicFile *> *getUnfinishedSchematicFiles();
|
unordered_map<wstring, ConsoleSchematicFile *> *getUnfinishedSchematicFiles();
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ LevelRules::LevelRules()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LevelRules::addLevelRule(const wstring &displayName, PBYTE pbData, DWORD dwLen)
|
void LevelRules::addLevelRule(const wstring &displayName, uint8_t* pbData, unsigned long dwLen)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class LevelRules
|
|||||||
public:
|
public:
|
||||||
LevelRules();
|
LevelRules();
|
||||||
|
|
||||||
void addLevelRule(const wstring &displayName, PBYTE pbData, DWORD dwLen);
|
void addLevelRule(const wstring &displayName, uint8_t* pbData, unsigned long dwLen);
|
||||||
void addLevelRule(const wstring &displayName, LevelRuleset *rootRule);
|
void addLevelRule(const wstring &displayName, LevelRuleset *rootRule);
|
||||||
|
|
||||||
void removeLevelRule(LevelRuleset *removing);
|
void removeLevelRule(LevelRuleset *removing);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ void LevelRuleset::loadStringTable(StringTable *table)
|
|||||||
m_stringTable = table;
|
m_stringTable = table;
|
||||||
}
|
}
|
||||||
|
|
||||||
LPCWSTR LevelRuleset::getString(const wstring &key)
|
const wchar_t* LevelRuleset::getString(const wstring &key)
|
||||||
{
|
{
|
||||||
if(m_stringTable == NULL)
|
if(m_stringTable == NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public:
|
|||||||
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_LevelRules; }
|
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_LevelRules; }
|
||||||
|
|
||||||
void loadStringTable(StringTable *table);
|
void loadStringTable(StringTable *table);
|
||||||
LPCWSTR getString(const wstring &key);
|
const wchar_t* getString(const wstring &key);
|
||||||
|
|
||||||
AABB *getNamedArea(const wstring &areaName);
|
AABB *getNamedArea(const wstring &areaName);
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ NamedAreaRuleDefinition::~NamedAreaRuleDefinition()
|
|||||||
delete m_area;
|
delete m_area;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NamedAreaRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes)
|
void NamedAreaRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes)
|
||||||
{
|
{
|
||||||
GameRuleDefinition::writeAttributes(dos, numAttributes + 7);
|
GameRuleDefinition::writeAttributes(dos, numAttributes + 7);
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public:
|
|||||||
NamedAreaRuleDefinition();
|
NamedAreaRuleDefinition();
|
||||||
~NamedAreaRuleDefinition();
|
~NamedAreaRuleDefinition();
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes);
|
||||||
|
|
||||||
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_NamedArea; }
|
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_NamedArea; }
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ StartFeature::StartFeature()
|
|||||||
m_feature = StructureFeature::eFeature_Temples;
|
m_feature = StructureFeature::eFeature_Temples;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartFeature::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
void StartFeature::writeAttributes(DataOutputStream *dos, unsigned int numAttrs)
|
||||||
{
|
{
|
||||||
GameRuleDefinition::writeAttributes(dos, numAttrs + 3);
|
GameRuleDefinition::writeAttributes(dos, numAttrs + 3);
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public:
|
|||||||
|
|
||||||
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_StartFeature; }
|
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_StartFeature; }
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs);
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature);
|
bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ UpdatePlayerRuleDefinition::~UpdatePlayerRuleDefinition()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdatePlayerRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes)
|
void UpdatePlayerRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes)
|
||||||
{
|
{
|
||||||
int attrCount = 3;
|
int attrCount = 3;
|
||||||
if(m_bUpdateHealth) ++attrCount;
|
if(m_bUpdateHealth) ++attrCount;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public:
|
|||||||
virtual void getChildren(vector<GameRuleDefinition *> *children);
|
virtual void getChildren(vector<GameRuleDefinition *> *children);
|
||||||
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes);
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
virtual void postProcessPlayer(shared_ptr<Player> player);
|
virtual void postProcessPlayer(shared_ptr<Player> player);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ UseTileRuleDefinition::UseTileRuleDefinition()
|
|||||||
m_useCoords = false;
|
m_useCoords = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UseTileRuleDefinition::writeAttributes(DataOutputStream *dos, UINT numAttributes)
|
void UseTileRuleDefinition::writeAttributes(DataOutputStream *dos, unsigned int numAttributes)
|
||||||
{
|
{
|
||||||
GameRuleDefinition::writeAttributes(dos, numAttributes + 5);
|
GameRuleDefinition::writeAttributes(dos, numAttributes + 5);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public:
|
|||||||
|
|
||||||
ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_UseTileRule; }
|
ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_UseTileRule; }
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes);
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z);
|
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ XboxStructureActionGenerateBox::XboxStructureActionGenerateBox()
|
|||||||
m_skipAir = false;
|
m_skipAir = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XboxStructureActionGenerateBox::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
void XboxStructureActionGenerateBox::writeAttributes(DataOutputStream *dos, unsigned int numAttrs)
|
||||||
{
|
{
|
||||||
ConsoleGenerateStructureAction::writeAttributes(dos, numAttrs + 9);
|
ConsoleGenerateStructureAction::writeAttributes(dos, numAttrs + 9);
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public:
|
|||||||
virtual int getEndY() { return m_y1; }
|
virtual int getEndY() { return m_y1; }
|
||||||
virtual int getEndZ() { return m_z1; }
|
virtual int getEndZ() { return m_z1; }
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs);
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
bool generateBoxInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB);
|
bool generateBoxInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ XboxStructureActionPlaceBlock::XboxStructureActionPlaceBlock()
|
|||||||
m_x = m_y = m_z = m_tile = m_data = 0;
|
m_x = m_y = m_z = m_tile = m_data = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void XboxStructureActionPlaceBlock::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
void XboxStructureActionPlaceBlock::writeAttributes(DataOutputStream *dos, unsigned int numAttrs)
|
||||||
{
|
{
|
||||||
ConsoleGenerateStructureAction::writeAttributes(dos, numAttrs + 5);
|
ConsoleGenerateStructureAction::writeAttributes(dos, numAttrs + 5);
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public:
|
|||||||
virtual int getEndY() { return m_y; }
|
virtual int getEndY() { return m_y; }
|
||||||
virtual int getEndZ() { return m_z; }
|
virtual int getEndZ() { return m_z; }
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs);
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
bool placeBlockInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB);
|
bool placeBlockInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ XboxStructureActionPlaceContainer::~XboxStructureActionPlaceContainer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 4J-JEV: Super class handles attr-facing fine.
|
// 4J-JEV: Super class handles attr-facing fine.
|
||||||
//void XboxStructureActionPlaceContainer::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
//void XboxStructureActionPlaceContainer::writeAttributes(DataOutputStream *dos, unsigned int numAttrs)
|
||||||
|
|
||||||
|
|
||||||
void XboxStructureActionPlaceContainer::getChildren(vector<GameRuleDefinition *> *children)
|
void XboxStructureActionPlaceContainer::getChildren(vector<GameRuleDefinition *> *children)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public:
|
|||||||
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
||||||
|
|
||||||
// 4J-JEV: Super class handles attr-facing fine.
|
// 4J-JEV: Super class handles attr-facing fine.
|
||||||
//virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
|
//virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttributes);
|
||||||
|
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ XboxStructureActionPlaceSpawner::~XboxStructureActionPlaceSpawner()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void XboxStructureActionPlaceSpawner::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
void XboxStructureActionPlaceSpawner::writeAttributes(DataOutputStream *dos, unsigned int numAttrs)
|
||||||
{
|
{
|
||||||
XboxStructureActionPlaceBlock::writeAttributes(dos, numAttrs + 1);
|
XboxStructureActionPlaceBlock::writeAttributes(dos, numAttrs + 1);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public:
|
|||||||
|
|
||||||
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_PlaceSpawner; }
|
virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_PlaceSpawner; }
|
||||||
|
|
||||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
|
virtual void writeAttributes(DataOutputStream *dos, unsigned int numAttrs);
|
||||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||||
|
|
||||||
bool placeSpawnerInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB);
|
bool placeSpawnerInLevel(StructurePiece *structure, Level *level, BoundingBox *chunkBB);
|
||||||
|
|||||||
@@ -35,8 +35,8 @@
|
|||||||
#define MAKE_SKIN_BITMASK(bDlcSkin, dwSkinId) ( (bDlcSkin?0x80000000:0) | (dwSkinId & 0x7FFFFFFF) )
|
#define MAKE_SKIN_BITMASK(bDlcSkin, dwSkinId) ( (bDlcSkin?0x80000000:0) | (dwSkinId & 0x7FFFFFFF) )
|
||||||
#define IS_SKIN_ID_IN_RANGE(dwSkinId) (dwSkinId <= 0x7FFFFFFF)
|
#define IS_SKIN_ID_IN_RANGE(dwSkinId) (dwSkinId <= 0x7FFFFFFF)
|
||||||
|
|
||||||
#define GET_DLC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFFF)
|
#define GET_DLC_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x7FFFFFFF)
|
||||||
#define GET_UGC_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x7FFFFFE0)
|
#define GET_UGC_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x7FFFFFE0)
|
||||||
#define GET_DEFAULT_SKIN_ID_FROM_BITMASK(uiBitmask) (((DWORD)uiBitmask)&0x0000001F)
|
#define GET_DEFAULT_SKIN_ID_FROM_BITMASK(uiBitmask) (((unsigned long)uiBitmask)&0x0000001F)
|
||||||
#define GET_IS_DLC_SKIN_FROM_BITMASK(uiBitmask) ((((DWORD)uiBitmask)&0x80000000)?true:false)
|
#define GET_IS_DLC_SKIN_FROM_BITMASK(uiBitmask) ((((unsigned long)uiBitmask)&0x80000000)?true:false)
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,8 @@
|
|||||||
CGameNetworkManager g_NetworkManager;
|
CGameNetworkManager g_NetworkManager;
|
||||||
CPlatformNetworkManager *CGameNetworkManager::s_pPlatformNetworkManager;
|
CPlatformNetworkManager *CGameNetworkManager::s_pPlatformNetworkManager;
|
||||||
|
|
||||||
__int64 CGameNetworkManager::messageQueue[512];
|
int64_t CGameNetworkManager::messageQueue[512];
|
||||||
__int64 CGameNetworkManager::byteQueue[512];
|
int64_t CGameNetworkManager::byteQueue[512];
|
||||||
int CGameNetworkManager::messageQueuePos = 0;
|
int CGameNetworkManager::messageQueuePos = 0;
|
||||||
|
|
||||||
CGameNetworkManager::CGameNetworkManager()
|
CGameNetworkManager::CGameNetworkManager()
|
||||||
@@ -144,7 +144,7 @@ void CGameNetworkManager::DoWork()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGameNetworkManager::_RunNetworkGame(LPVOID lpParameter)
|
bool CGameNetworkManager::_RunNetworkGame(void* lpParameter)
|
||||||
{
|
{
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
|
||||||
@@ -182,13 +182,13 @@ bool CGameNetworkManager::_RunNetworkGame(LPVOID lpParameter)
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParameter)
|
bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, void* lpParameter)
|
||||||
{
|
{
|
||||||
#ifdef _DURANGO
|
#ifdef _DURANGO
|
||||||
ProfileManager.SetDeferredSignoutEnabled(true);
|
ProfileManager.SetDeferredSignoutEnabled(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__int64 seed = 0;
|
int64_t seed = 0;
|
||||||
if(lpParameter != NULL)
|
if(lpParameter != NULL)
|
||||||
{
|
{
|
||||||
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
|
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
|
||||||
@@ -209,7 +209,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static __int64 sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running
|
static int64_t sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running
|
||||||
ServerStoppedCreate(false);
|
ServerStoppedCreate(false);
|
||||||
if( g_NetworkManager.IsHost() )
|
if( g_NetworkManager.IsHost() )
|
||||||
{
|
{
|
||||||
@@ -329,7 +329,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 4J Stu - Host needs to generate a unique multiplayer id for sentient telemetry reporting
|
// 4J Stu - Host needs to generate a unique multiplayer id for sentient telemetry reporting
|
||||||
INT multiplayerInstanceId = TelemetryManager->GenerateMultiplayerInstanceId();
|
int multiplayerInstanceId = TelemetryManager->GenerateMultiplayerInstanceId();
|
||||||
TelemetryManager->SetMultiplayerInstanceId(multiplayerInstanceId);
|
TelemetryManager->SetMultiplayerInstanceId(multiplayerInstanceId);
|
||||||
}
|
}
|
||||||
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
|
TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected();
|
||||||
@@ -632,7 +632,7 @@ bool CGameNetworkManager::GetGameSessionInfo(int iPad, SessionID sessionId,Frien
|
|||||||
return s_pPlatformNetworkManager->GetGameSessionInfo( iPad, sessionId, foundSession );
|
return s_pPlatformNetworkManager->GetGameSessionInfo( iPad, sessionId, foundSession );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameNetworkManager::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam )
|
void CGameNetworkManager::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam )
|
||||||
{
|
{
|
||||||
s_pPlatformNetworkManager->SetSessionsUpdatedCallback( SessionsUpdatedCallback, pSearchParam );
|
s_pPlatformNetworkManager->SetSessionsUpdatedCallback( SessionsUpdatedCallback, pSearchParam );
|
||||||
}
|
}
|
||||||
@@ -668,7 +668,7 @@ CGameNetworkManager::eJoinGameResult CGameNetworkManager::JoinGame(FriendSession
|
|||||||
return (eJoinGameResult)(s_pPlatformNetworkManager->JoinGame( searchResult, localUsersMask, primaryUserIndex ));
|
return (eJoinGameResult)(s_pPlatformNetworkManager->JoinGame( searchResult, localUsersMask, primaryUserIndex ));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameNetworkManager::CancelJoinGame(LPVOID lpParam)
|
void CGameNetworkManager::CancelJoinGame(void* lpParam)
|
||||||
{
|
{
|
||||||
#ifdef _XBOX_ONE
|
#ifdef _XBOX_ONE
|
||||||
s_pPlatformNetworkManager->CancelJoinGame();
|
s_pPlatformNetworkManager->CancelJoinGame();
|
||||||
@@ -692,7 +692,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
|
|||||||
int npAvailability = ProfileManager.getNPAvailability(iPad);
|
int npAvailability = ProfileManager.getNPAvailability(iPad);
|
||||||
if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION)
|
if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION)
|
||||||
{
|
{
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0] = IDS_OK;
|
uiIDA[0] = IDS_OK;
|
||||||
ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable());
|
ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable());
|
||||||
|
|
||||||
@@ -736,7 +736,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
|
|||||||
}
|
}
|
||||||
else if(noPrivileges)
|
else if(noPrivileges)
|
||||||
{
|
{
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_CONFIRM_OK;
|
uiIDA[0]=IDS_CONFIRM_OK;
|
||||||
ui.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable());
|
ui.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable());
|
||||||
}
|
}
|
||||||
@@ -850,7 +850,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter )
|
|||||||
|
|
||||||
int CGameNetworkManager::ServerThreadProc( void* lpParameter )
|
int CGameNetworkManager::ServerThreadProc( void* lpParameter )
|
||||||
{
|
{
|
||||||
__int64 seed = 0;
|
int64_t seed = 0;
|
||||||
if(lpParameter != NULL)
|
if(lpParameter != NULL)
|
||||||
{
|
{
|
||||||
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
|
NetworkGameInitData *param = (NetworkGameInitData *)lpParameter;
|
||||||
@@ -911,7 +911,7 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc( void* lpParam )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UINT uiIDA[2];
|
unsigned int uiIDA[2];
|
||||||
uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT;
|
uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT;
|
||||||
uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE;
|
uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE;
|
||||||
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CGameNetworkManager::MustSignInReturned_0,lpParam, app.GetStringTable());
|
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CGameNetworkManager::MustSignInReturned_0,lpParam, app.GetStringTable());
|
||||||
@@ -1047,7 +1047,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
|||||||
MinecraftServer *pServer = MinecraftServer::getInstance();
|
MinecraftServer *pServer = MinecraftServer::getInstance();
|
||||||
|
|
||||||
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
|
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_CONFIRM_OK;
|
uiIDA[0]=IDS_CONFIRM_OK;
|
||||||
if( g_NetworkManager.m_bLastDisconnectWasLostRoomOnly )
|
if( g_NetworkManager.m_bLastDisconnectWasLostRoomOnly )
|
||||||
{
|
{
|
||||||
@@ -1071,7 +1071,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
|||||||
#elif defined(_XBOX_ONE)
|
#elif defined(_XBOX_ONE)
|
||||||
if( g_NetworkManager.m_bFullSessionMessageOnNextSessionChange )
|
if( g_NetworkManager.m_bFullSessionMessageOnNextSessionChange )
|
||||||
{
|
{
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_CONFIRM_OK;
|
uiIDA[0]=IDS_CONFIRM_OK;
|
||||||
C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME, IDS_IN_PARTY_SESSION_FULL, uiIDA,1,ProfileManager.GetPrimaryPad());
|
C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME, IDS_IN_PARTY_SESSION_FULL, uiIDA,1,ProfileManager.GetPrimaryPad());
|
||||||
pMinecraft->progressRenderer->progressStartNoAbort( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME );
|
pMinecraft->progressRenderer->progressStartNoAbort( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME );
|
||||||
@@ -1570,7 +1570,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||||||
if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION)
|
if (npAvailability == SCE_NP_ERROR_AGE_RESTRICTION)
|
||||||
{
|
{
|
||||||
// 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive if the npAvailability isn't SCE_OK
|
// 4J Stu - This is a bit messy and is due to the library incorrectly returning false for IsSignedInLive if the npAvailability isn't SCE_OK
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_OK;
|
uiIDA[0]=IDS_OK;
|
||||||
ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable());
|
ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable());
|
||||||
}
|
}
|
||||||
@@ -1579,14 +1579,14 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||||||
// Signed in to PSN but not connected (no internet access)
|
// Signed in to PSN but not connected (no internet access)
|
||||||
assert(!ProfileManager.isConnectedToPSN(iPadNotSignedInLive));
|
assert(!ProfileManager.isConnectedToPSN(iPadNotSignedInLive));
|
||||||
|
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0] = IDS_OK;
|
uiIDA[0] = IDS_OK;
|
||||||
ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable());
|
ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Not signed in to PSN
|
// Not signed in to PSN
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
||||||
ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPadNotSignedInLive, &CGameNetworkManager::MustSignInReturned_1, (void *)pInviteInfo, app.GetStringTable(), NULL, 0, false);
|
ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, iPadNotSignedInLive, &CGameNetworkManager::MustSignInReturned_1, (void *)pInviteInfo, app.GetStringTable(), NULL, 0, false);
|
||||||
}
|
}
|
||||||
@@ -1620,14 +1620,14 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||||||
// if (ProfileManager.IsSignedInPSN(ProfileManager.GetPrimaryPad()))
|
// if (ProfileManager.IsSignedInPSN(ProfileManager.GetPrimaryPad()))
|
||||||
// {
|
// {
|
||||||
// // Signed in to PSN but not connected (no internet access)
|
// // Signed in to PSN but not connected (no internet access)
|
||||||
// UINT uiIDA[1];
|
// unsigned int uiIDA[1];
|
||||||
// uiIDA[0] = IDS_OK;
|
// uiIDA[0] = IDS_OK;
|
||||||
// ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL, app.GetStringTable());
|
// ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL, app.GetStringTable());
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
{
|
{
|
||||||
// Not signed in to PSN
|
// Not signed in to PSN
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT;
|
||||||
ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &CGameNetworkManager::MustSignInReturned_1, (void *)pInviteInfo, app.GetStringTable(), NULL, 0, false);
|
ui.RequestMessageBox( IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), &CGameNetworkManager::MustSignInReturned_1, (void *)pInviteInfo, app.GetStringTable(), NULL, 0, false);
|
||||||
}
|
}
|
||||||
@@ -1659,8 +1659,8 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||||||
// Check if user-created content is allowed, as we cannot play multiplayer if it's not
|
// Check if user-created content is allowed, as we cannot play multiplayer if it's not
|
||||||
bool noUGC = false;
|
bool noUGC = false;
|
||||||
bool bContentRestricted=false;
|
bool bContentRestricted=false;
|
||||||
BOOL pccAllowed = true;
|
bool pccAllowed = true;
|
||||||
BOOL pccFriendsAllowed = true;
|
bool pccFriendsAllowed = true;
|
||||||
#if defined(__PS3__) || defined(__PSVITA__)
|
#if defined(__PS3__) || defined(__PSVITA__)
|
||||||
ProfileManager.GetChatAndContentRestrictions(userIndex,false,&noUGC,&bContentRestricted,NULL);
|
ProfileManager.GetChatAndContentRestrictions(userIndex,false,&noUGC,&bContentRestricted,NULL);
|
||||||
#else
|
#else
|
||||||
@@ -1671,7 +1671,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||||||
#if defined(_XBOX) || defined(__PS3__)
|
#if defined(_XBOX) || defined(__PS3__)
|
||||||
if(joiningUsers > 1 && !RenderManager.IsHiDef() && userIndex != ProfileManager.GetPrimaryPad())
|
if(joiningUsers > 1 && !RenderManager.IsHiDef() && userIndex != ProfileManager.GetPrimaryPad())
|
||||||
{
|
{
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_CONFIRM_OK;
|
uiIDA[0]=IDS_CONFIRM_OK;
|
||||||
|
|
||||||
// 4J-PB - it's possible there is no primary pad here, when accepting an invite from the dashboard
|
// 4J-PB - it's possible there is no primary pad here, when accepting an invite from the dashboard
|
||||||
@@ -1698,7 +1698,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||||||
#endif
|
#endif
|
||||||
else if(noPrivileges)
|
else if(noPrivileges)
|
||||||
{
|
{
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_CONFIRM_OK;
|
uiIDA[0]=IDS_CONFIRM_OK;
|
||||||
|
|
||||||
// 4J-PB - it's possible there is no primary pad here, when accepting an invite from the dashboard
|
// 4J-PB - it's possible there is no primary pad here, when accepting an invite from the dashboard
|
||||||
@@ -1727,7 +1727,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO *
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UINT uiIDA[2];
|
unsigned int uiIDA[2];
|
||||||
uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT;
|
uiIDA[0]=IDS_PRO_NOTONLINE_ACCEPT;
|
||||||
uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE;
|
uiIDA[1]=IDS_PRO_NOTONLINE_DECLINE;
|
||||||
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CGameNetworkManager::MustSignInReturned_1,(void *)pInviteInfo, app.GetStringTable());
|
ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_NOTONLINE_TEXT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CGameNetworkManager::MustSignInReturned_1,(void *)pInviteInfo, app.GetStringTable());
|
||||||
@@ -1793,7 +1793,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
|||||||
|
|
||||||
if(noPrivileges)
|
if(noPrivileges)
|
||||||
{
|
{
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_CONFIRM_OK;
|
uiIDA[0]=IDS_CONFIRM_OK;
|
||||||
ui.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable());
|
ui.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable());
|
||||||
}
|
}
|
||||||
@@ -1827,11 +1827,11 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I
|
|||||||
{
|
{
|
||||||
// the FromInvite will make the lib decide how many panes to display based on connected pads/signed in players
|
// the FromInvite will make the lib decide how many panes to display based on connected pads/signed in players
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
ProfileManager.RequestSignInUI(true, false, false, false, false,&CGameNetworkManager::JoinFromInvite_SignInReturned, (LPVOID)pInviteInfo,userIndex);
|
ProfileManager.RequestSignInUI(true, false, false, false, false,&CGameNetworkManager::JoinFromInvite_SignInReturned, (void*)pInviteInfo,userIndex);
|
||||||
#else
|
#else
|
||||||
SignInInfo info;
|
SignInInfo info;
|
||||||
info.Func = &CGameNetworkManager::JoinFromInvite_SignInReturned;
|
info.Func = &CGameNetworkManager::JoinFromInvite_SignInReturned;
|
||||||
info.lpParam = (LPVOID)pInviteInfo;
|
info.lpParam = (void*)pInviteInfo;
|
||||||
info.requireOnline = true;
|
info.requireOnline = true;
|
||||||
app.DebugPrintf("Using fullscreen layer\n");
|
app.DebugPrintf("Using fullscreen layer\n");
|
||||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info,eUILayer_Alert,eUIGroup_Fullscreen);
|
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info,eUILayer_Alert,eUIGroup_Fullscreen);
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ public:
|
|||||||
void Initialise();
|
void Initialise();
|
||||||
void Terminate();
|
void Terminate();
|
||||||
void DoWork();
|
void DoWork();
|
||||||
bool _RunNetworkGame(LPVOID lpParameter);
|
bool _RunNetworkGame(void* lpParameter);
|
||||||
bool StartNetworkGame(Minecraft *minecraft, LPVOID lpParameter);
|
bool StartNetworkGame(Minecraft *minecraft, void* lpParameter);
|
||||||
int CorrectErrorIDS(int IDS);
|
int CorrectErrorIDS(int IDS);
|
||||||
|
|
||||||
// Player management
|
// Player management
|
||||||
@@ -96,7 +96,7 @@ public:
|
|||||||
bool SessionHasSpace(unsigned int spaceRequired = 1);
|
bool SessionHasSpace(unsigned int spaceRequired = 1);
|
||||||
vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly);
|
vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly);
|
||||||
bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession);
|
bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession);
|
||||||
void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam );
|
void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam );
|
||||||
void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
||||||
void ForceFriendsSessionRefresh();
|
void ForceFriendsSessionRefresh();
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ public:
|
|||||||
|
|
||||||
bool JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo);
|
bool JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo);
|
||||||
eJoinGameResult JoinGame(FriendSessionInfo *searchResult, int localUsersMask);
|
eJoinGameResult JoinGame(FriendSessionInfo *searchResult, int localUsersMask);
|
||||||
static void CancelJoinGame(LPVOID lpParam); // Not part of the shared interface
|
static void CancelJoinGame(void* lpParam); // Not part of the shared interface
|
||||||
bool LeaveGame(bool bMigrateHost);
|
bool LeaveGame(bool bMigrateHost);
|
||||||
static int JoinFromInvite_SignInReturned(void *pParam,bool bContinue, int iPad);
|
static int JoinFromInvite_SignInReturned(void *pParam,bool bContinue, int iPad);
|
||||||
void UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving = NULL);
|
void UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving = NULL);
|
||||||
@@ -163,9 +163,9 @@ public:
|
|||||||
|
|
||||||
// Used for debugging output
|
// Used for debugging output
|
||||||
static const int messageQueue_length = 512;
|
static const int messageQueue_length = 512;
|
||||||
static __int64 messageQueue[messageQueue_length];
|
static int64_t messageQueue[messageQueue_length];
|
||||||
static const int byteQueue_length = 512;
|
static const int byteQueue_length = 512;
|
||||||
static __int64 byteQueue[byteQueue_length];
|
static int64_t byteQueue[byteQueue_length];
|
||||||
static int messageQueuePos;
|
static int messageQueuePos;
|
||||||
|
|
||||||
// Methods called from PlatformNetworkManager
|
// Methods called from PlatformNetworkManager
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class CGameNetworkManager;
|
|||||||
|
|
||||||
typedef struct _SearchForGamesData
|
typedef struct _SearchForGamesData
|
||||||
{
|
{
|
||||||
DWORD sessionIDCount;
|
unsigned long sessionIDCount;
|
||||||
XSESSION_SEARCHRESULT_HEADER *searchBuffer;
|
XSESSION_SEARCHRESULT_HEADER *searchBuffer;
|
||||||
XNQOS **ppQos;
|
XNQOS **ppQos;
|
||||||
SessionID *sessionIDList;
|
SessionID *sessionIDList;
|
||||||
@@ -107,12 +107,12 @@ public:
|
|||||||
private:
|
private:
|
||||||
virtual void SetSessionTexturePackParentId( int id ) = 0;
|
virtual void SetSessionTexturePackParentId( int id ) = 0;
|
||||||
virtual void SetSessionSubTexturePackId( int id ) = 0;
|
virtual void SetSessionSubTexturePackId( int id ) = 0;
|
||||||
virtual void Notify(int ID, ULONG_PTR Param) = 0;
|
virtual void Notify(int ID, uintptr_t Param) = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly) = 0;
|
virtual vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly) = 0;
|
||||||
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession) = 0;
|
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession) = 0;
|
||||||
virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ) = 0;
|
virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam ) = 0;
|
||||||
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ) = 0;
|
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ) = 0;
|
||||||
virtual void ForceFriendsSessionRefresh() = 0;
|
virtual void ForceFriendsSessionRefresh() = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ bool CPlatformNetworkManagerStub::_RunNetworkGame()
|
|||||||
|
|
||||||
void CPlatformNetworkManagerStub::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/)
|
void CPlatformNetworkManagerStub::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving /*= NULL*/)
|
||||||
{
|
{
|
||||||
// DWORD playerCount = m_pIQNet->GetPlayerCount();
|
// unsigned long playerCount = m_pIQNet->GetPlayerCount();
|
||||||
//
|
//
|
||||||
// if( this->m_bLeavingGame )
|
// if( this->m_bLeavingGame )
|
||||||
// return;
|
// return;
|
||||||
@@ -493,7 +493,7 @@ wstring CPlatformNetworkManagerStub::GatherRTTStats()
|
|||||||
|
|
||||||
if(!pQNetPlayer->IsLocal())
|
if(!pQNetPlayer->IsLocal())
|
||||||
{
|
{
|
||||||
ZeroMemory(stat,32*sizeof(WCHAR));
|
ZeroMemory(stat,32*sizeof(wchar_t));
|
||||||
swprintf(stat, 32, L"%d: %d/", i, pQNetPlayer->GetCurrentRtt() );
|
swprintf(stat, 32, L"%d: %d/", i, pQNetPlayer->GetCurrentRtt() );
|
||||||
stats.append(stat);
|
stats.append(stat);
|
||||||
}
|
}
|
||||||
@@ -531,7 +531,7 @@ bool CPlatformNetworkManagerStub::GetGameSessionInfo(int iPad, SessionID session
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlatformNetworkManagerStub::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam )
|
void CPlatformNetworkManagerStub::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam )
|
||||||
{
|
{
|
||||||
m_SessionsUpdatedCallback = SessionsUpdatedCallback; m_pSearchParam = pSearchParam;
|
m_SessionsUpdatedCallback = SessionsUpdatedCallback; m_pSearchParam = pSearchParam;
|
||||||
}
|
}
|
||||||
@@ -557,7 +557,7 @@ void CPlatformNetworkManagerStub::ForceFriendsSessionRefresh()
|
|||||||
INetworkPlayer *CPlatformNetworkManagerStub::addNetworkPlayer(IQNetPlayer *pQNetPlayer)
|
INetworkPlayer *CPlatformNetworkManagerStub::addNetworkPlayer(IQNetPlayer *pQNetPlayer)
|
||||||
{
|
{
|
||||||
NetworkPlayerXbox *pNetworkPlayer = new NetworkPlayerXbox(pQNetPlayer);
|
NetworkPlayerXbox *pNetworkPlayer = new NetworkPlayerXbox(pQNetPlayer);
|
||||||
pQNetPlayer->SetCustomDataValue((ULONG_PTR)pNetworkPlayer);
|
pQNetPlayer->SetCustomDataValue((uintptr_t)pNetworkPlayer);
|
||||||
currentNetworkPlayers.push_back( pNetworkPlayer );
|
currentNetworkPlayers.push_back( pNetworkPlayer );
|
||||||
return pNetworkPlayer;
|
return pNetworkPlayer;
|
||||||
}
|
}
|
||||||
@@ -626,7 +626,7 @@ void CPlatformNetworkManagerStub::SetSessionSubTexturePackId( int id )
|
|||||||
m_hostGameSessionData.subTexturePackId = id;
|
m_hostGameSessionData.subTexturePackId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlatformNetworkManagerStub::Notify(int ID, ULONG_PTR Param)
|
void CPlatformNetworkManagerStub::Notify(int ID, uintptr_t Param)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ private:
|
|||||||
|
|
||||||
IQNet * m_pIQNet; // pointer to QNet interface
|
IQNet * m_pIQNet; // pointer to QNet interface
|
||||||
|
|
||||||
HANDLE m_notificationListener;
|
void* m_notificationListener;
|
||||||
|
|
||||||
vector<IQNetPlayer *> m_machineQNetPrimaryPlayers; // collection of players that we deem to be the main one for that system
|
vector<IQNetPlayer *> m_machineQNetPrimaryPlayers; // collection of players that we deem to be the main one for that system
|
||||||
|
|
||||||
@@ -134,8 +134,8 @@ private:
|
|||||||
int m_lastSearchPad;
|
int m_lastSearchPad;
|
||||||
bool m_bSearchResultsReady;
|
bool m_bSearchResultsReady;
|
||||||
bool m_bSearchPending;
|
bool m_bSearchPending;
|
||||||
LPVOID m_pSearchParam;
|
void* m_pSearchParam;
|
||||||
void (*m_SessionsUpdatedCallback)(LPVOID pParam);
|
void (*m_SessionsUpdatedCallback)(void* pParam);
|
||||||
|
|
||||||
C4JThread* m_SearchingThread;
|
C4JThread* m_SearchingThread;
|
||||||
|
|
||||||
@@ -152,12 +152,12 @@ private:
|
|||||||
|
|
||||||
virtual void SetSessionTexturePackParentId( int id );
|
virtual void SetSessionTexturePackParentId( int id );
|
||||||
virtual void SetSessionSubTexturePackId( int id );
|
virtual void SetSessionSubTexturePackId( int id );
|
||||||
virtual void Notify(int ID, ULONG_PTR Param);
|
virtual void Notify(int ID, uintptr_t Param);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly);
|
virtual vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly);
|
||||||
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession);
|
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession);
|
||||||
virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam );
|
virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam );
|
||||||
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
||||||
virtual void ForceFriendsSessionRefresh();
|
virtual void ForceFriendsSessionRefresh();
|
||||||
|
|
||||||
|
|||||||
@@ -546,8 +546,8 @@ bool CPlatformNetworkManagerSony::isSystemPrimaryPlayer(SQRNetworkPlayer *pSQRPl
|
|||||||
void CPlatformNetworkManagerSony::DoWork()
|
void CPlatformNetworkManagerSony::DoWork()
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
DWORD dwNotifyId;
|
unsigned long dwNotifyId;
|
||||||
ULONG_PTR ulpNotifyParam;
|
uintptr_t ulpNotifyParam;
|
||||||
|
|
||||||
while( XNotifyGetNext(
|
while( XNotifyGetNext(
|
||||||
m_notificationListener,
|
m_notificationListener,
|
||||||
@@ -648,7 +648,7 @@ bool CPlatformNetworkManagerSony::RemoveLocalPlayerByUserIndex( int userIndex )
|
|||||||
bool CPlatformNetworkManagerSony::IsInStatsEnabledSession()
|
bool CPlatformNetworkManagerSony::IsInStatsEnabledSession()
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
DWORD dataSize = sizeof(QNET_LIVE_STATS_MODE);
|
unsigned long dataSize = sizeof(QNET_LIVE_STATS_MODE);
|
||||||
QNET_LIVE_STATS_MODE statsMode;
|
QNET_LIVE_STATS_MODE statsMode;
|
||||||
m_pIQNet->GetOpt(QNET_OPTION_LIVE_STATS_MODE, &statsMode , &dataSize );
|
m_pIQNet->GetOpt(QNET_OPTION_LIVE_STATS_MODE, &statsMode , &dataSize );
|
||||||
|
|
||||||
@@ -665,18 +665,18 @@ bool CPlatformNetworkManagerSony::SessionHasSpace(unsigned int spaceRequired /*=
|
|||||||
#if 0
|
#if 0
|
||||||
// This function is used while a session is running, so all players trying to join
|
// This function is used while a session is running, so all players trying to join
|
||||||
// should use public slots,
|
// should use public slots,
|
||||||
DWORD publicSlots = 0;
|
unsigned long publicSlots = 0;
|
||||||
DWORD filledPublicSlots = 0;
|
unsigned long filledPublicSlots = 0;
|
||||||
DWORD privateSlots = 0;
|
unsigned long privateSlots = 0;
|
||||||
DWORD filledPrivateSlots = 0;
|
unsigned long filledPrivateSlots = 0;
|
||||||
|
|
||||||
DWORD dataSize = sizeof(DWORD);
|
unsigned long dataSize = sizeof(unsigned long);
|
||||||
m_pIQNet->GetOpt(QNET_OPTION_TOTAL_PUBLIC_SLOTS, &publicSlots, &dataSize );
|
m_pIQNet->GetOpt(QNET_OPTION_TOTAL_PUBLIC_SLOTS, &publicSlots, &dataSize );
|
||||||
m_pIQNet->GetOpt(QNET_OPTION_FILLED_PUBLIC_SLOTS, &filledPublicSlots, &dataSize );
|
m_pIQNet->GetOpt(QNET_OPTION_FILLED_PUBLIC_SLOTS, &filledPublicSlots, &dataSize );
|
||||||
m_pIQNet->GetOpt(QNET_OPTION_TOTAL_PRIVATE_SLOTS, &privateSlots, &dataSize );
|
m_pIQNet->GetOpt(QNET_OPTION_TOTAL_PRIVATE_SLOTS, &privateSlots, &dataSize );
|
||||||
m_pIQNet->GetOpt(QNET_OPTION_FILLED_PRIVATE_SLOTS, &filledPrivateSlots, &dataSize );
|
m_pIQNet->GetOpt(QNET_OPTION_FILLED_PRIVATE_SLOTS, &filledPrivateSlots, &dataSize );
|
||||||
|
|
||||||
DWORD spaceLeft = (publicSlots - filledPublicSlots) + (privateSlots - filledPrivateSlots);
|
unsigned long spaceLeft = (publicSlots - filledPublicSlots) + (privateSlots - filledPrivateSlots);
|
||||||
|
|
||||||
return spaceLeft >= spaceRequired;
|
return spaceLeft >= spaceRequired;
|
||||||
#else
|
#else
|
||||||
@@ -712,7 +712,7 @@ bool CPlatformNetworkManagerSony::LeaveGame(bool bMigrateHost)
|
|||||||
if( socket != NULL )
|
if( socket != NULL )
|
||||||
{
|
{
|
||||||
//printf("Waiting for socket closed event\n");
|
//printf("Waiting for socket closed event\n");
|
||||||
DWORD result = socket->m_socketClosedEvent->WaitForSignal(INFINITE);
|
unsigned long result = socket->m_socketClosedEvent->WaitForSignal(INFINITE);
|
||||||
|
|
||||||
// The session might be gone once the socket releases
|
// The session might be gone once the socket releases
|
||||||
if( IsInSession() )
|
if( IsInSession() )
|
||||||
@@ -794,12 +794,12 @@ bool CPlatformNetworkManagerSony::_StartGame()
|
|||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
// Set the options that now allow players to join this game
|
// Set the options that now allow players to join this game
|
||||||
BOOL enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state
|
bool enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state
|
||||||
m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof BOOL );
|
m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof bool );
|
||||||
BOOL enableInv = !IsLocalGame();
|
bool enableInv = !IsLocalGame();
|
||||||
m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof BOOL );
|
m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof bool );
|
||||||
BOOL enablePres = !IsPrivateGame() && !IsLocalGame();
|
bool enablePres = !IsPrivateGame() && !IsLocalGame();
|
||||||
m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof BOOL );
|
m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof bool );
|
||||||
|
|
||||||
return ( m_pIQNet->StartGame() == S_OK );
|
return ( m_pIQNet->StartGame() == S_OK );
|
||||||
#else
|
#else
|
||||||
@@ -896,16 +896,16 @@ bool CPlatformNetworkManagerSony::_RunNetworkGame()
|
|||||||
#if 0
|
#if 0
|
||||||
// We delay actually starting the session so that we know the game server is running by the time the clients try to join
|
// We delay actually starting the session so that we know the game server is running by the time the clients try to join
|
||||||
// This does result in a host advantage
|
// This does result in a host advantage
|
||||||
HRESULT hr = m_pIQNet->StartGame();
|
int hr = m_pIQNet->StartGame();
|
||||||
if(FAILED(hr)) return false;
|
if(FAILED(hr)) return false;
|
||||||
|
|
||||||
// Set the options that now allow players to join this game
|
// Set the options that now allow players to join this game
|
||||||
BOOL enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state
|
bool enableJip = true; // Must always be true othewise nobody can join the game while in the PLAY state
|
||||||
m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof BOOL );
|
m_pIQNet->SetOpt( QNET_OPTION_JOIN_IN_PROGRESS_ALLOWED, &enableJip, sizeof bool );
|
||||||
BOOL enableInv = !IsLocalGame();
|
bool enableInv = !IsLocalGame();
|
||||||
m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof BOOL );
|
m_pIQNet->SetOpt( QNET_OPTION_INVITES_ALLOWED, &enableInv, sizeof bool );
|
||||||
BOOL enablePres = !IsPrivateGame() && !IsLocalGame();
|
bool enablePres = !IsPrivateGame() && !IsLocalGame();
|
||||||
m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof BOOL );
|
m_pIQNet->SetOpt( QNET_OPTION_PRESENCE_JOIN_MODE, &enablePres, sizeof bool );
|
||||||
#endif
|
#endif
|
||||||
if( IsHost() )
|
if( IsHost() )
|
||||||
{
|
{
|
||||||
@@ -1177,7 +1177,7 @@ vector<FriendSessionInfo *> *CPlatformNetworkManagerSony::GetSessionList(int iPa
|
|||||||
bool CPlatformNetworkManagerSony::GetGameSessionInfo(int iPad, SessionID sessionId, FriendSessionInfo *foundSessionInfo)
|
bool CPlatformNetworkManagerSony::GetGameSessionInfo(int iPad, SessionID sessionId, FriendSessionInfo *foundSessionInfo)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
HRESULT hr = E_FAIL;
|
int hr = E_FAIL;
|
||||||
|
|
||||||
const XSESSION_SEARCHRESULT *pSearchResult;
|
const XSESSION_SEARCHRESULT *pSearchResult;
|
||||||
const XNQOSINFO * pxnqi;
|
const XNQOSINFO * pxnqi;
|
||||||
@@ -1185,7 +1185,7 @@ bool CPlatformNetworkManagerSony::GetGameSessionInfo(int iPad, SessionID session
|
|||||||
if( m_currentSearchResultsCount[iPad] > 0 )
|
if( m_currentSearchResultsCount[iPad] > 0 )
|
||||||
{
|
{
|
||||||
// Loop through all the results.
|
// Loop through all the results.
|
||||||
for( DWORD dwResult = 0; dwResult < m_currentSearchResultsCount[iPad]; dwResult++ )
|
for( unsigned long dwResult = 0; dwResult < m_currentSearchResultsCount[iPad]; dwResult++ )
|
||||||
{
|
{
|
||||||
pSearchResult = &m_pCurrentSearchResults[iPad]->pResults[dwResult];
|
pSearchResult = &m_pCurrentSearchResults[iPad]->pResults[dwResult];
|
||||||
|
|
||||||
@@ -1254,7 +1254,7 @@ bool CPlatformNetworkManagerSony::GetGameSessionInfo(int iPad, SessionID session
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlatformNetworkManagerSony::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam )
|
void CPlatformNetworkManagerSony::SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam )
|
||||||
{
|
{
|
||||||
m_SessionsUpdatedCallback = SessionsUpdatedCallback; m_pSearchParam = pSearchParam;
|
m_SessionsUpdatedCallback = SessionsUpdatedCallback; m_pSearchParam = pSearchParam;
|
||||||
}
|
}
|
||||||
@@ -1276,7 +1276,7 @@ void CPlatformNetworkManagerSony::ForceFriendsSessionRefresh()
|
|||||||
INetworkPlayer *CPlatformNetworkManagerSony::addNetworkPlayer(SQRNetworkPlayer *pSQRPlayer)
|
INetworkPlayer *CPlatformNetworkManagerSony::addNetworkPlayer(SQRNetworkPlayer *pSQRPlayer)
|
||||||
{
|
{
|
||||||
NetworkPlayerSony *pNetworkPlayer = new NetworkPlayerSony(pSQRPlayer);
|
NetworkPlayerSony *pNetworkPlayer = new NetworkPlayerSony(pSQRPlayer);
|
||||||
pSQRPlayer->SetCustomDataValue((ULONG_PTR)pNetworkPlayer);
|
pSQRPlayer->SetCustomDataValue((uintptr_t)pNetworkPlayer);
|
||||||
currentNetworkPlayers.push_back( pNetworkPlayer );
|
currentNetworkPlayers.push_back( pNetworkPlayer );
|
||||||
return pNetworkPlayer;
|
return pNetworkPlayer;
|
||||||
}
|
}
|
||||||
@@ -1345,7 +1345,7 @@ void CPlatformNetworkManagerSony::SetSessionSubTexturePackId( int id )
|
|||||||
m_hostGameSessionData.subTexturePackId = id;
|
m_hostGameSessionData.subTexturePackId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlatformNetworkManagerSony::Notify(int ID, ULONG_PTR Param)
|
void CPlatformNetworkManagerSony::Notify(int ID, uintptr_t Param)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
m_pSQRNet->Notify( ID, Param );
|
m_pSQRNet->Notify( ID, Param );
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
SQRNetworkManager * m_pSQRNet; // pointer to SQRNetworkManager interface
|
SQRNetworkManager * m_pSQRNet; // pointer to SQRNetworkManager interface
|
||||||
|
|
||||||
HANDLE m_notificationListener;
|
void* m_notificationListener;
|
||||||
|
|
||||||
vector<SQRNetworkPlayer *> m_machineSQRPrimaryPlayers; // collection of players that we deem to be the main one for that system
|
vector<SQRNetworkPlayer *> m_machineSQRPrimaryPlayers; // collection of players that we deem to be the main one for that system
|
||||||
|
|
||||||
@@ -149,8 +149,8 @@ private:
|
|||||||
|
|
||||||
int m_lastSearchPad;
|
int m_lastSearchPad;
|
||||||
bool m_bSearchPending;
|
bool m_bSearchPending;
|
||||||
LPVOID m_pSearchParam;
|
void* m_pSearchParam;
|
||||||
void (*m_SessionsUpdatedCallback)(LPVOID pParam);
|
void (*m_SessionsUpdatedCallback)(void* pParam);
|
||||||
|
|
||||||
C4JThread* m_SearchingThread;
|
C4JThread* m_SearchingThread;
|
||||||
|
|
||||||
@@ -163,12 +163,12 @@ private:
|
|||||||
|
|
||||||
virtual void SetSessionTexturePackParentId( int id );
|
virtual void SetSessionTexturePackParentId( int id );
|
||||||
virtual void SetSessionSubTexturePackId( int id );
|
virtual void SetSessionSubTexturePackId( int id );
|
||||||
virtual void Notify(int ID, ULONG_PTR Param);
|
virtual void Notify(int ID, uintptr_t Param);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly);
|
virtual vector<FriendSessionInfo *> *GetSessionList(int iPad, int localPlayers, bool partyOnly);
|
||||||
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession);
|
virtual bool GetGameSessionInfo(int iPad, SessionID sessionId,FriendSessionInfo *foundSession);
|
||||||
virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam );
|
virtual void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(void* pParam), void* pSearchParam );
|
||||||
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
virtual void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam );
|
||||||
virtual void ForceFriendsSessionRefresh();
|
virtual void ForceFriendsSessionRefresh();
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ bool SonyCommerce::m_bCommerceInitialised = false;
|
|||||||
SceNpCommerce2SessionInfo SonyCommerce::m_sessionInfo;
|
SceNpCommerce2SessionInfo SonyCommerce::m_sessionInfo;
|
||||||
SonyCommerce::State SonyCommerce::m_state = e_state_noSession;
|
SonyCommerce::State SonyCommerce::m_state = e_state_noSession;
|
||||||
int SonyCommerce::m_errorCode = 0;
|
int SonyCommerce::m_errorCode = 0;
|
||||||
LPVOID SonyCommerce::m_callbackParam = NULL;
|
void* SonyCommerce::m_callbackParam = NULL;
|
||||||
|
|
||||||
void* SonyCommerce::m_receiveBuffer = NULL;
|
void* SonyCommerce::m_receiveBuffer = NULL;
|
||||||
SonyCommerce::Event SonyCommerce::m_event;
|
SonyCommerce::Event SonyCommerce::m_event;
|
||||||
@@ -29,7 +29,7 @@ sys_memory_container_t SonyCommerce::m_memContainer = SYS_MEMORY_CONTAINER_I
|
|||||||
bool SonyCommerce::m_bUpgradingTrial = false;
|
bool SonyCommerce::m_bUpgradingTrial = false;
|
||||||
|
|
||||||
SonyCommerce::CallbackFunc SonyCommerce::m_trialUpgradeCallbackFunc;
|
SonyCommerce::CallbackFunc SonyCommerce::m_trialUpgradeCallbackFunc;
|
||||||
LPVOID SonyCommerce::m_trialUpgradeCallbackParam;
|
void* SonyCommerce::m_trialUpgradeCallbackParam;
|
||||||
|
|
||||||
CRITICAL_SECTION SonyCommerce::m_queueLock;
|
CRITICAL_SECTION SonyCommerce::m_queueLock;
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ void SonyCommerce::Init()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SonyCommerce::CheckForTrialUpgradeKey_Callback(LPVOID param, bool bFullVersion)
|
void SonyCommerce::CheckForTrialUpgradeKey_Callback(void* param, bool bFullVersion)
|
||||||
{
|
{
|
||||||
ProfileManager.SetFullVersion(bFullVersion);
|
ProfileManager.SetFullVersion(bFullVersion);
|
||||||
if(ProfileManager.IsFullVersion())
|
if(ProfileManager.IsFullVersion())
|
||||||
@@ -798,20 +798,20 @@ int SonyCommerce::downloadList(DownloadListInputParams ¶ms)
|
|||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SonyCommerce::UpgradeTrialCallback2(LPVOID lpParam,int err)
|
void SonyCommerce::UpgradeTrialCallback2(void* lpParam,int err)
|
||||||
{
|
{
|
||||||
app.DebugPrintf(4,"SonyCommerce_UpgradeTrialCallback2 : err : 0x%08x\n", err);
|
app.DebugPrintf(4,"SonyCommerce_UpgradeTrialCallback2 : err : 0x%08x\n", err);
|
||||||
SonyCommerce::CheckForTrialUpgradeKey();
|
SonyCommerce::CheckForTrialUpgradeKey();
|
||||||
if(err != CELL_OK)
|
if(err != CELL_OK)
|
||||||
{
|
{
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_CONFIRM_OK;
|
uiIDA[0]=IDS_CONFIRM_OK;
|
||||||
C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_PRO_UNLOCKGAME_TITLE, IDS_NO_DLCOFFERS, uiIDA,1,ProfileManager.GetPrimaryPad());
|
C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_PRO_UNLOCKGAME_TITLE, IDS_NO_DLCOFFERS, uiIDA,1,ProfileManager.GetPrimaryPad());
|
||||||
}
|
}
|
||||||
m_trialUpgradeCallbackFunc(m_trialUpgradeCallbackParam, m_errorCode);
|
m_trialUpgradeCallbackFunc(m_trialUpgradeCallbackParam, m_errorCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SonyCommerce::UpgradeTrialCallback1(LPVOID lpParam,int err)
|
void SonyCommerce::UpgradeTrialCallback1(void* lpParam,int err)
|
||||||
{
|
{
|
||||||
|
|
||||||
app.DebugPrintf(4,"SonyCommerce_UpgradeTrialCallback1 : err : 0x%08x\n", err);
|
app.DebugPrintf(4,"SonyCommerce_UpgradeTrialCallback1 : err : 0x%08x\n", err);
|
||||||
@@ -831,7 +831,7 @@ void SonyCommerce::UpgradeTrialCallback1(LPVOID lpParam,int err)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UINT uiIDA[1];
|
unsigned int uiIDA[1];
|
||||||
uiIDA[0]=IDS_CONFIRM_OK;
|
uiIDA[0]=IDS_CONFIRM_OK;
|
||||||
C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_PRO_UNLOCKGAME_TITLE, IDS_NO_DLCOFFERS, uiIDA,1,ProfileManager.GetPrimaryPad());
|
C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_PRO_UNLOCKGAME_TITLE, IDS_NO_DLCOFFERS, uiIDA,1,ProfileManager.GetPrimaryPad());
|
||||||
m_trialUpgradeCallbackFunc(m_trialUpgradeCallbackParam, m_errorCode);
|
m_trialUpgradeCallbackFunc(m_trialUpgradeCallbackParam, m_errorCode);
|
||||||
@@ -847,7 +847,7 @@ void SonyCommerce_UpgradeTrial()
|
|||||||
app.UpgradeTrial();
|
app.UpgradeTrial();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SonyCommerce::UpgradeTrial(CallbackFunc cb, LPVOID lpParam)
|
void SonyCommerce::UpgradeTrial(CallbackFunc cb, void* lpParam)
|
||||||
{
|
{
|
||||||
m_trialUpgradeCallbackFunc = cb;
|
m_trialUpgradeCallbackFunc = cb;
|
||||||
m_trialUpgradeCallbackParam = lpParam;
|
m_trialUpgradeCallbackParam = lpParam;
|
||||||
@@ -1383,7 +1383,7 @@ int SonyCommerce::commerceEnd()
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SonyCommerce::CreateSession( CallbackFunc cb, LPVOID lpParam )
|
void SonyCommerce::CreateSession( CallbackFunc cb, void* lpParam )
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
EnterCriticalSection(&m_queueLock);
|
EnterCriticalSection(&m_queueLock);
|
||||||
@@ -1406,7 +1406,7 @@ void SonyCommerce::CloseSession()
|
|||||||
Shutdown();
|
Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SonyCommerce::GetProductList( CallbackFunc cb, LPVOID lpParam, std::vector<ProductInfo>* productList, const char *categoryId)
|
void SonyCommerce::GetProductList( CallbackFunc cb, void* lpParam, std::vector<ProductInfo>* productList, const char *categoryId)
|
||||||
{
|
{
|
||||||
EnterCriticalSection(&m_queueLock);
|
EnterCriticalSection(&m_queueLock);
|
||||||
setCallback(cb,lpParam);
|
setCallback(cb,lpParam);
|
||||||
@@ -1416,7 +1416,7 @@ void SonyCommerce::GetProductList( CallbackFunc cb, LPVOID lpParam, std::vector<
|
|||||||
LeaveCriticalSection(&m_queueLock);
|
LeaveCriticalSection(&m_queueLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SonyCommerce::GetDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, ProductInfoDetailed* productInfo, const char *productId, const char *categoryId )
|
void SonyCommerce::GetDetailedProductInfo( CallbackFunc cb, void* lpParam, ProductInfoDetailed* productInfo, const char *productId, const char *categoryId )
|
||||||
{
|
{
|
||||||
EnterCriticalSection(&m_queueLock);
|
EnterCriticalSection(&m_queueLock);
|
||||||
setCallback(cb,lpParam);
|
setCallback(cb,lpParam);
|
||||||
@@ -1428,7 +1428,7 @@ void SonyCommerce::GetDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, Prod
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 4J-PB - fill out the long description and the price for the product
|
// 4J-PB - fill out the long description and the price for the product
|
||||||
void SonyCommerce::AddDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, ProductInfo* productInfo, const char *productId, const char *categoryId )
|
void SonyCommerce::AddDetailedProductInfo( CallbackFunc cb, void* lpParam, ProductInfo* productInfo, const char *productId, const char *categoryId )
|
||||||
{
|
{
|
||||||
EnterCriticalSection(&m_queueLock);
|
EnterCriticalSection(&m_queueLock);
|
||||||
setCallback(cb,lpParam);
|
setCallback(cb,lpParam);
|
||||||
@@ -1438,7 +1438,7 @@ void SonyCommerce::AddDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, Prod
|
|||||||
m_messageQueue.push(e_message_commerceAddDetailedProductInfo);
|
m_messageQueue.push(e_message_commerceAddDetailedProductInfo);
|
||||||
LeaveCriticalSection(&m_queueLock);
|
LeaveCriticalSection(&m_queueLock);
|
||||||
}
|
}
|
||||||
void SonyCommerce::GetCategoryInfo( CallbackFunc cb, LPVOID lpParam, CategoryInfo *info, const char *categoryId )
|
void SonyCommerce::GetCategoryInfo( CallbackFunc cb, void* lpParam, CategoryInfo *info, const char *categoryId )
|
||||||
{
|
{
|
||||||
EnterCriticalSection(&m_queueLock);
|
EnterCriticalSection(&m_queueLock);
|
||||||
setCallback(cb,lpParam);
|
setCallback(cb,lpParam);
|
||||||
@@ -1448,7 +1448,7 @@ void SonyCommerce::GetCategoryInfo( CallbackFunc cb, LPVOID lpParam, CategoryInf
|
|||||||
LeaveCriticalSection(&m_queueLock);
|
LeaveCriticalSection(&m_queueLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SonyCommerce::Checkout( CallbackFunc cb, LPVOID lpParam, const char* skuID )
|
void SonyCommerce::Checkout( CallbackFunc cb, void* lpParam, const char* skuID )
|
||||||
{
|
{
|
||||||
if(m_memContainer != SYS_MEMORY_CONTAINER_ID_INVALID)
|
if(m_memContainer != SYS_MEMORY_CONTAINER_ID_INVALID)
|
||||||
{
|
{
|
||||||
@@ -1469,7 +1469,7 @@ void SonyCommerce::Checkout( CallbackFunc cb, LPVOID lpParam, const char* skuID
|
|||||||
LeaveCriticalSection(&m_queueLock);
|
LeaveCriticalSection(&m_queueLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SonyCommerce::DownloadAlreadyPurchased( CallbackFunc cb, LPVOID lpParam, const char* skuID )
|
void SonyCommerce::DownloadAlreadyPurchased( CallbackFunc cb, void* lpParam, const char* skuID )
|
||||||
{
|
{
|
||||||
if(m_memContainer != SYS_MEMORY_CONTAINER_ID_INVALID)
|
if(m_memContainer != SYS_MEMORY_CONTAINER_ID_INVALID)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class SonyCommerce
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef void (*CallbackFunc)(LPVOID lpParam, int error_code);
|
typedef void (*CallbackFunc)(void* lpParam, int error_code);
|
||||||
|
|
||||||
|
|
||||||
/// @brief
|
/// @brief
|
||||||
@@ -153,20 +153,20 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void CreateSession(CallbackFunc cb, LPVOID lpParam) = 0;
|
virtual void CreateSession(CallbackFunc cb, void* lpParam) = 0;
|
||||||
virtual void CloseSession() = 0;
|
virtual void CloseSession() = 0;
|
||||||
|
|
||||||
virtual void GetCategoryInfo(CallbackFunc cb, LPVOID lpParam, CategoryInfo *info, const char *categoryId) = 0;
|
virtual void GetCategoryInfo(CallbackFunc cb, void* lpParam, CategoryInfo *info, const char *categoryId) = 0;
|
||||||
virtual void GetProductList(CallbackFunc cb, LPVOID lpParam, std::vector<ProductInfo>* productList, const char *categoryId) = 0;
|
virtual void GetProductList(CallbackFunc cb, void* lpParam, std::vector<ProductInfo>* productList, const char *categoryId) = 0;
|
||||||
virtual void GetDetailedProductInfo(CallbackFunc cb, LPVOID lpParam, ProductInfoDetailed* productInfoDetailed, const char *productId, const char *categoryId) = 0;
|
virtual void GetDetailedProductInfo(CallbackFunc cb, void* lpParam, ProductInfoDetailed* productInfoDetailed, const char *productId, const char *categoryId) = 0;
|
||||||
virtual void AddDetailedProductInfo( CallbackFunc cb, LPVOID lpParam, ProductInfo* productInfo, const char *productId, const char *categoryId ) = 0;
|
virtual void AddDetailedProductInfo( CallbackFunc cb, void* lpParam, ProductInfo* productInfo, const char *productId, const char *categoryId ) = 0;
|
||||||
virtual void Checkout(CallbackFunc cb, LPVOID lpParam, const char* skuID) = 0;
|
virtual void Checkout(CallbackFunc cb, void* lpParam, const char* skuID) = 0;
|
||||||
virtual void DownloadAlreadyPurchased(CallbackFunc cb, LPVOID lpParam, const char* skuID) = 0;
|
virtual void DownloadAlreadyPurchased(CallbackFunc cb, void* lpParam, const char* skuID) = 0;
|
||||||
#if defined(__ORBIS__) || defined( __PSVITA__)
|
#if defined(__ORBIS__) || defined( __PSVITA__)
|
||||||
virtual void Checkout_Game(CallbackFunc cb, LPVOID lpParam, const char* skuID) = 0;
|
virtual void Checkout_Game(CallbackFunc cb, void* lpParam, const char* skuID) = 0;
|
||||||
virtual void DownloadAlreadyPurchased_Game(CallbackFunc cb, LPVOID lpParam, const char* skuID) = 0;
|
virtual void DownloadAlreadyPurchased_Game(CallbackFunc cb, void* lpParam, const char* skuID) = 0;
|
||||||
#endif
|
#endif
|
||||||
virtual void UpgradeTrial(CallbackFunc cb, LPVOID lpParam) = 0;
|
virtual void UpgradeTrial(CallbackFunc cb, void* lpParam) = 0;
|
||||||
virtual void CheckForTrialUpgradeKey() = 0;
|
virtual void CheckForTrialUpgradeKey() = 0;
|
||||||
virtual bool LicenseChecked() = 0;
|
virtual bool LicenseChecked() = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ static SceRemoteStorageStatus statParams;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// void remoteStorageGetCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
|
// void remoteStorageGetCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code)
|
||||||
// {
|
// {
|
||||||
// app.DebugPrintf("remoteStorageGetCallback err : 0x%08x\n");
|
// app.DebugPrintf("remoteStorageGetCallback err : 0x%08x\n");
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// void remoteStorageCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
|
// void remoteStorageCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code)
|
||||||
// {
|
// {
|
||||||
// app.DebugPrintf("remoteStorageCallback err : 0x%08x\n");
|
// app.DebugPrintf("remoteStorageCallback err : 0x%08x\n");
|
||||||
//
|
//
|
||||||
@@ -40,7 +40,7 @@ static SceRemoteStorageStatus statParams;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void getSaveInfoReturnCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
|
void getSaveInfoReturnCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code)
|
||||||
{
|
{
|
||||||
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
|
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
|
||||||
app.DebugPrintf("remoteStorageGetInfoCallback err : 0x%08x\n", error_code);
|
app.DebugPrintf("remoteStorageGetInfoCallback err : 0x%08x\n", error_code);
|
||||||
@@ -65,7 +65,7 @@ void getSaveInfoReturnCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void getSaveInfoInitCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
|
static void getSaveInfoInitCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code)
|
||||||
{
|
{
|
||||||
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
|
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
|
||||||
if(error_code != 0)
|
if(error_code != 0)
|
||||||
@@ -101,7 +101,7 @@ void SonyRemoteStorage::getSaveInfo()
|
|||||||
m_getInfoStatus = e_noInfoFound;
|
m_getInfoStatus = e_noInfoFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SonyRemoteStorage::getSaveData( const char* localDirname, CallbackFunc cb, LPVOID lpParam )
|
bool SonyRemoteStorage::getSaveData( const char* localDirname, CallbackFunc cb, void* lpParam )
|
||||||
{
|
{
|
||||||
m_startTime = System::currentTimeMillis();
|
m_startTime = System::currentTimeMillis();
|
||||||
m_dataProgress = 0;
|
m_dataProgress = 0;
|
||||||
@@ -109,7 +109,7 @@ bool SonyRemoteStorage::getSaveData( const char* localDirname, CallbackFunc cb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void setSaveDataInitCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
|
static void setSaveDataInitCallback(void* lpParam, SonyRemoteStorage::Status s, int error_code)
|
||||||
{
|
{
|
||||||
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
|
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
|
||||||
if(error_code != 0)
|
if(error_code != 0)
|
||||||
@@ -161,7 +161,7 @@ ESavePlatform SonyRemoteStorage::getSavePlatform()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__int64 SonyRemoteStorage::getSaveSeed()
|
int64_t SonyRemoteStorage::getSaveSeed()
|
||||||
{
|
{
|
||||||
if(m_getInfoStatus != e_infoFound)
|
if(m_getInfoStatus != e_infoFound)
|
||||||
return 0;
|
return 0;
|
||||||
@@ -171,7 +171,7 @@ __int64 SonyRemoteStorage::getSaveSeed()
|
|||||||
ZeroMemory(seedString,17);
|
ZeroMemory(seedString,17);
|
||||||
memcpy(seedString, pDescData->m_seed,16);
|
memcpy(seedString, pDescData->m_seed,16);
|
||||||
|
|
||||||
__uint64 seed = 0;
|
uint64_t seed = 0;
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << seedString;
|
ss << seedString;
|
||||||
ss >> std::hex >> seed;
|
ss >> std::hex >> seed;
|
||||||
@@ -227,7 +227,7 @@ int SonyRemoteStorage::getSaveFilesize()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SonyRemoteStorage::setData( PSAVE_INFO info, CallbackFunc cb, LPVOID lpParam )
|
bool SonyRemoteStorage::setData( PSAVE_INFO info, CallbackFunc cb, void* lpParam )
|
||||||
{
|
{
|
||||||
m_setDataSaveInfo = info;
|
m_setDataSaveInfo = info;
|
||||||
m_callbackFunc = cb;
|
m_callbackFunc = cb;
|
||||||
@@ -238,7 +238,7 @@ bool SonyRemoteStorage::setData( PSAVE_INFO info, CallbackFunc cb, LPVOID lpPara
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SonyRemoteStorage::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes)
|
int SonyRemoteStorage::LoadSaveDataThumbnailReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes)
|
||||||
{
|
{
|
||||||
SonyRemoteStorage *pClass= (SonyRemoteStorage *)lpParam;
|
SonyRemoteStorage *pClass= (SonyRemoteStorage *)lpParam;
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ bool SonyRemoteStorage::saveIsAvailable()
|
|||||||
|
|
||||||
int SonyRemoteStorage::getDataProgress()
|
int SonyRemoteStorage::getDataProgress()
|
||||||
{
|
{
|
||||||
__int64 time = System::currentTimeMillis();
|
int64_t time = System::currentTimeMillis();
|
||||||
int elapsedSecs = (time - m_startTime) / 1000;
|
int elapsedSecs = (time - m_startTime) / 1000;
|
||||||
int progVal = m_dataProgress + (elapsedSecs/3);
|
int progVal = m_dataProgress + (elapsedSecs/3);
|
||||||
if(progVal > 95)
|
if(progVal > 95)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public:
|
|||||||
e_getStatusInProgress,
|
e_getStatusInProgress,
|
||||||
e_getStatusSucceeded
|
e_getStatusSucceeded
|
||||||
};
|
};
|
||||||
typedef void (*CallbackFunc)(LPVOID lpParam, Status s, int error_code);
|
typedef void (*CallbackFunc)(void* lpParam, Status s, int error_code);
|
||||||
|
|
||||||
enum GetInfoStatus
|
enum GetInfoStatus
|
||||||
{
|
{
|
||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
bool saveIsAvailable();
|
bool saveIsAvailable();
|
||||||
|
|
||||||
int getSaveFilesize();
|
int getSaveFilesize();
|
||||||
bool getSaveData(const char* localDirname, CallbackFunc cb, LPVOID lpParam);
|
bool getSaveData(const char* localDirname, CallbackFunc cb, void* lpParam);
|
||||||
|
|
||||||
bool setSaveData(PSAVE_INFO info, CallbackFunc cb, void* lpParam);
|
bool setSaveData(PSAVE_INFO info, CallbackFunc cb, void* lpParam);
|
||||||
bool waitingForSetData() { return (m_setDataStatus == e_settingData); }
|
bool waitingForSetData() { return (m_setDataStatus == e_settingData); }
|
||||||
@@ -72,15 +72,15 @@ public:
|
|||||||
const char* getLocalFilename();
|
const char* getLocalFilename();
|
||||||
const char* getSaveNameUTF8();
|
const char* getSaveNameUTF8();
|
||||||
ESavePlatform getSavePlatform();
|
ESavePlatform getSavePlatform();
|
||||||
__int64 getSaveSeed();
|
int64_t getSaveSeed();
|
||||||
unsigned int getSaveHostOptions();
|
unsigned int getSaveHostOptions();
|
||||||
unsigned int getSaveTexturePack();
|
unsigned int getSaveTexturePack();
|
||||||
|
|
||||||
void SetServiceID(char *pchServiceID) { m_pchServiceID=pchServiceID; }
|
void SetServiceID(char *pchServiceID) { m_pchServiceID=pchServiceID; }
|
||||||
|
|
||||||
virtual bool init(CallbackFunc cb, LPVOID lpParam) = 0;
|
virtual bool init(CallbackFunc cb, void* lpParam) = 0;
|
||||||
virtual bool getRemoteFileInfo(SceRemoteStorageStatus* pInfo, CallbackFunc cb, LPVOID lpParam) = 0;
|
virtual bool getRemoteFileInfo(SceRemoteStorageStatus* pInfo, CallbackFunc cb, void* lpParam) = 0;
|
||||||
virtual bool getData(const char* remotePath, const char* localPath, CallbackFunc cb, LPVOID lpParam) = 0;
|
virtual bool getData(const char* remotePath, const char* localPath, CallbackFunc cb, void* lpParam) = 0;
|
||||||
virtual void abort() = 0;
|
virtual void abort() = 0;
|
||||||
virtual bool shutdown();
|
virtual bool shutdown();
|
||||||
virtual bool setDataInternal() = 0;
|
virtual bool setDataInternal() = 0;
|
||||||
@@ -93,8 +93,8 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool setData( PSAVE_INFO info, CallbackFunc cb, LPVOID lpParam );
|
bool setData( PSAVE_INFO info, CallbackFunc cb, void* lpParam );
|
||||||
static int LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes);
|
static int LoadSaveDataThumbnailReturned(void* lpParam,uint8_t* pbThumbnail,unsigned long dwThumbnailBytes);
|
||||||
static int setDataThread(void* lpParam);
|
static int setDataThread(void* lpParam);
|
||||||
|
|
||||||
SonyRemoteStorage() : m_memPoolBuffer(NULL), m_bInitialised(false),m_getInfoStatus(e_noInfoFound) {}
|
SonyRemoteStorage() : m_memPoolBuffer(NULL), m_bInitialised(false),m_getInfoStatus(e_noInfoFound) {}
|
||||||
@@ -107,11 +107,11 @@ protected:
|
|||||||
int m_dataProgress;
|
int m_dataProgress;
|
||||||
char *m_pchServiceID;
|
char *m_pchServiceID;
|
||||||
|
|
||||||
PBYTE m_thumbnailData;
|
uint8_t* m_thumbnailData;
|
||||||
unsigned int m_thumbnailDataSize;
|
unsigned int m_thumbnailDataSize;
|
||||||
C4JThread* m_SetDataThread;
|
C4JThread* m_SetDataThread;
|
||||||
PSAVE_INFO m_setDataSaveInfo;
|
PSAVE_INFO m_setDataSaveInfo;
|
||||||
__int64 m_startTime;
|
int64_t m_startTime;
|
||||||
|
|
||||||
bool m_bAborting;
|
bool m_bAborting;
|
||||||
bool m_bTransferStarted;
|
bool m_bTransferStarted;
|
||||||
|
|||||||
@@ -14,17 +14,17 @@ CTelemetryManager *TelemetryManager = new CTelemetryManager();
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
HRESULT CTelemetryManager::Init()
|
int CTelemetryManager::Init()
|
||||||
{
|
{
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CTelemetryManager::Tick()
|
int CTelemetryManager::Tick()
|
||||||
{
|
{
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CTelemetryManager::Flush()
|
int CTelemetryManager::Flush()
|
||||||
{
|
{
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
@@ -146,9 +146,9 @@ Title needs to track this and report it as a property.
|
|||||||
These times will be used to create timelines and understand durations.
|
These times will be used to create timelines and understand durations.
|
||||||
This should be tracked independently of saved games (restoring a save should not reset the seconds since initialize)
|
This should be tracked independently of saved games (restoring a save should not reset the seconds since initialize)
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetSecondsSinceInitialize()
|
int CTelemetryManager::GetSecondsSinceInitialize()
|
||||||
{
|
{
|
||||||
return (INT)(app.getAppTime() - m_initialiseTime);
|
return (int)(app.getAppTime() - m_initialiseTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -159,9 +159,9 @@ The intent is to allow teams to capture data on the highest level categories of
|
|||||||
For example, a game mode could be the name of the specific mini game (eg: golf vs darts) or a specific multiplayer mode (eg: hoard vs beast.) ModeID = 0 means undefined or unknown.
|
For example, a game mode could be the name of the specific mini game (eg: golf vs darts) or a specific multiplayer mode (eg: hoard vs beast.) ModeID = 0 means undefined or unknown.
|
||||||
The intent is to answer the question "How are players playing your game?"
|
The intent is to answer the question "How are players playing your game?"
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetMode(DWORD dwUserId)
|
int CTelemetryManager::GetMode(unsigned long dwUserId)
|
||||||
{
|
{
|
||||||
INT mode = (INT)eTelem_ModeId_Undefined;
|
int mode = (int)eTelem_ModeId_Undefined;
|
||||||
|
|
||||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||||
|
|
||||||
@@ -171,15 +171,15 @@ INT CTelemetryManager::GetMode(DWORD dwUserId)
|
|||||||
|
|
||||||
if (gameType->isSurvival())
|
if (gameType->isSurvival())
|
||||||
{
|
{
|
||||||
mode = (INT)eTelem_ModeId_Survival;
|
mode = (int)eTelem_ModeId_Survival;
|
||||||
}
|
}
|
||||||
else if (gameType->isCreative())
|
else if (gameType->isCreative())
|
||||||
{
|
{
|
||||||
mode = (INT)eTelem_ModeId_Creative;
|
mode = (int)eTelem_ModeId_Creative;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mode = (INT)eTelem_ModeId_Undefined;
|
mode = (int)eTelem_ModeId_Undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mode;
|
return mode;
|
||||||
@@ -192,17 +192,17 @@ For titles that have sub-modes (Sports/Football).
|
|||||||
Mode is always an indicator of "How is the player choosing to play my game?" so these do not have to be consecutive.
|
Mode is always an indicator of "How is the player choosing to play my game?" so these do not have to be consecutive.
|
||||||
LevelIDs and SubLevelIDs can be reused as they will always be paired with a Mode/SubModeID, Mode should be unique - SubMode can be shared between modes.
|
LevelIDs and SubLevelIDs can be reused as they will always be paired with a Mode/SubModeID, Mode should be unique - SubMode can be shared between modes.
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetSubMode(DWORD dwUserId)
|
int CTelemetryManager::GetSubMode(unsigned long dwUserId)
|
||||||
{
|
{
|
||||||
INT subMode = (INT)eTelem_SubModeId_Undefined;
|
int subMode = (int)eTelem_SubModeId_Undefined;
|
||||||
|
|
||||||
if(Minecraft::GetInstance()->isTutorial())
|
if(Minecraft::GetInstance()->isTutorial())
|
||||||
{
|
{
|
||||||
subMode = (INT)eTelem_SubModeId_Tutorial;
|
subMode = (int)eTelem_SubModeId_Tutorial;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
subMode = (INT)eTelem_SubModeId_Normal;
|
subMode = (int)eTelem_SubModeId_Normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
return subMode;
|
return subMode;
|
||||||
@@ -216,11 +216,11 @@ The intent is that level start and ends do not occur more than every 2 minutes o
|
|||||||
Levels are unique only within a given modeID - so you can have a ModeID =1, LevelID =1 and a different ModeID=2, LevelID = 1 indicate two completely different levels.
|
Levels are unique only within a given modeID - so you can have a ModeID =1, LevelID =1 and a different ModeID=2, LevelID = 1 indicate two completely different levels.
|
||||||
LevelID = 0 means undefined or unknown.
|
LevelID = 0 means undefined or unknown.
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetLevelId(DWORD dwUserId)
|
int CTelemetryManager::GetLevelId(unsigned long dwUserId)
|
||||||
{
|
{
|
||||||
INT levelId = (INT)eTelem_LevelId_Undefined;
|
int levelId = (int)eTelem_LevelId_Undefined;
|
||||||
|
|
||||||
levelId = (INT)eTelem_LevelId_PlayerGeneratedLevel;
|
levelId = (int)eTelem_LevelId_PlayerGeneratedLevel;
|
||||||
|
|
||||||
return levelId;
|
return levelId;
|
||||||
}
|
}
|
||||||
@@ -231,9 +231,9 @@ For titles that have sub-levels.
|
|||||||
Level is always an indicator of "How far has the player progressed." so when possible these should be consecutive or at least monotonically increasing.
|
Level is always an indicator of "How far has the player progressed." so when possible these should be consecutive or at least monotonically increasing.
|
||||||
LevelIDs and SubLevelIDs can be reused as they will always be paired with a Mode/SubModeID
|
LevelIDs and SubLevelIDs can be reused as they will always be paired with a Mode/SubModeID
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetSubLevelId(DWORD dwUserId)
|
int CTelemetryManager::GetSubLevelId(unsigned long dwUserId)
|
||||||
{
|
{
|
||||||
INT subLevelId = (INT)eTelem_SubLevelId_Undefined;
|
int subLevelId = (int)eTelem_SubLevelId_Undefined;
|
||||||
|
|
||||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||||
|
|
||||||
@@ -242,13 +242,13 @@ INT CTelemetryManager::GetSubLevelId(DWORD dwUserId)
|
|||||||
switch(pMinecraft->localplayers[dwUserId]->dimension)
|
switch(pMinecraft->localplayers[dwUserId]->dimension)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
subLevelId = (INT)eTelem_SubLevelId_Overworld;
|
subLevelId = (int)eTelem_SubLevelId_Overworld;
|
||||||
break;
|
break;
|
||||||
case -1:
|
case -1:
|
||||||
subLevelId = (INT)eTelem_SubLevelId_Nether;
|
subLevelId = (int)eTelem_SubLevelId_Nether;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
subLevelId = (INT)eTelem_SubLevelId_End;
|
subLevelId = (int)eTelem_SubLevelId_End;
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -260,9 +260,9 @@ INT CTelemetryManager::GetSubLevelId(DWORD dwUserId)
|
|||||||
Build version of the title, used to track changes in development as well as patches/title updates
|
Build version of the title, used to track changes in development as well as patches/title updates
|
||||||
Allows developer to separate out stats from different builds
|
Allows developer to separate out stats from different builds
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetTitleBuildId()
|
int CTelemetryManager::GetTitleBuildId()
|
||||||
{
|
{
|
||||||
return (INT)VER_PRODUCTBUILD;
|
return (int)VER_PRODUCTBUILD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -270,32 +270,32 @@ Generated by the game every time LevelStart or LevelResume is called.
|
|||||||
This should be a unique ID (can be sequential) within a session.
|
This should be a unique ID (can be sequential) within a session.
|
||||||
Helps differentiate level attempts when a play plays the same mode/level - especially with aggregated stats
|
Helps differentiate level attempts when a play plays the same mode/level - especially with aggregated stats
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetLevelInstanceID()
|
int CTelemetryManager::GetLevelInstanceID()
|
||||||
{
|
{
|
||||||
return (INT)m_levelInstanceID;
|
return (int)m_levelInstanceID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
MultiplayerinstanceID is a title-generated value that is the same for all players in the same multiplayer session.
|
MultiplayerinstanceID is a title-generated value that is the same for all players in the same multiplayer session.
|
||||||
Link up players into a single multiplayer session ID.
|
Link up players into a single multiplayer session ID.
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetMultiplayerInstanceID()
|
int CTelemetryManager::GetMultiplayerInstanceID()
|
||||||
{
|
{
|
||||||
return m_multiplayerInstanceID;
|
return m_multiplayerInstanceID;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT CTelemetryManager::GenerateMultiplayerInstanceId()
|
int CTelemetryManager::GenerateMultiplayerInstanceId()
|
||||||
{
|
{
|
||||||
#if defined(_DURANGO) || defined(_XBOX)
|
#if defined(_DURANGO) || defined(_XBOX)
|
||||||
FILETIME SystemTimeAsFileTime;
|
FILETIME SystemTimeAsFileTime;
|
||||||
GetSystemTimeAsFileTime( &SystemTimeAsFileTime );
|
GetSystemTimeAsFileTime( &SystemTimeAsFileTime );
|
||||||
return *((INT *)&SystemTimeAsFileTime.dwLowDateTime);
|
return *((int *)&SystemTimeAsFileTime.dwLowDateTime);
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTelemetryManager::SetMultiplayerInstanceId(INT value)
|
void CTelemetryManager::SetMultiplayerInstanceId(int value)
|
||||||
{
|
{
|
||||||
m_multiplayerInstanceID = value;
|
m_multiplayerInstanceID = value;
|
||||||
}
|
}
|
||||||
@@ -304,9 +304,9 @@ void CTelemetryManager::SetMultiplayerInstanceId(INT value)
|
|||||||
Indicates whether the game is being played in single or multiplayer mode and whether multiplayer is being played locally or over live.
|
Indicates whether the game is being played in single or multiplayer mode and whether multiplayer is being played locally or over live.
|
||||||
How social is your game? How do people play it?
|
How social is your game? How do people play it?
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetSingleOrMultiplayer()
|
int CTelemetryManager::GetSingleOrMultiplayer()
|
||||||
{
|
{
|
||||||
INT singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Undefined;
|
int singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Undefined;
|
||||||
|
|
||||||
// Unused
|
// Unused
|
||||||
//eSen_SingleOrMultiplayer_Single_Player
|
//eSen_SingleOrMultiplayer_Single_Player
|
||||||
@@ -314,19 +314,19 @@ INT CTelemetryManager::GetSingleOrMultiplayer()
|
|||||||
|
|
||||||
if(app.GetLocalPlayerCount() == 1 && g_NetworkManager.GetOnlinePlayerCount() == 0)
|
if(app.GetLocalPlayerCount() == 1 && g_NetworkManager.GetOnlinePlayerCount() == 0)
|
||||||
{
|
{
|
||||||
singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Single_Player;
|
singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Single_Player;
|
||||||
}
|
}
|
||||||
else if(app.GetLocalPlayerCount() > 1 && g_NetworkManager.GetOnlinePlayerCount() == 0)
|
else if(app.GetLocalPlayerCount() > 1 && g_NetworkManager.GetOnlinePlayerCount() == 0)
|
||||||
{
|
{
|
||||||
singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Local;
|
singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Multiplayer_Local;
|
||||||
}
|
}
|
||||||
else if(app.GetLocalPlayerCount() == 1 && g_NetworkManager.GetOnlinePlayerCount() > 0)
|
else if(app.GetLocalPlayerCount() == 1 && g_NetworkManager.GetOnlinePlayerCount() > 0)
|
||||||
{
|
{
|
||||||
singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Live;
|
singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Multiplayer_Live;
|
||||||
}
|
}
|
||||||
else if(app.GetLocalPlayerCount() > 1 && g_NetworkManager.GetOnlinePlayerCount() > 0)
|
else if(app.GetLocalPlayerCount() > 1 && g_NetworkManager.GetOnlinePlayerCount() > 0)
|
||||||
{
|
{
|
||||||
singleOrMultiplayer = (INT)eSen_SingleOrMultiplayer_Multiplayer_Both_Local_and_Live;
|
singleOrMultiplayer = (int)eSen_SingleOrMultiplayer_Multiplayer_Both_Local_and_Live;
|
||||||
}
|
}
|
||||||
|
|
||||||
return singleOrMultiplayer;
|
return singleOrMultiplayer;
|
||||||
@@ -336,23 +336,23 @@ INT CTelemetryManager::GetSingleOrMultiplayer()
|
|||||||
An in-game setting that differentiates the challenge imposed on the user.
|
An in-game setting that differentiates the challenge imposed on the user.
|
||||||
Normalized to a standard 5-point scale. Are players changing the difficulty?
|
Normalized to a standard 5-point scale. Are players changing the difficulty?
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetDifficultyLevel(INT diff)
|
int CTelemetryManager::GetDifficultyLevel(int diff)
|
||||||
{
|
{
|
||||||
INT difficultyLevel = (INT)eSen_DifficultyLevel_Undefined;
|
int difficultyLevel = (int)eSen_DifficultyLevel_Undefined;
|
||||||
|
|
||||||
switch(diff)
|
switch(diff)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
difficultyLevel = (INT)eSen_DifficultyLevel_Easiest;
|
difficultyLevel = (int)eSen_DifficultyLevel_Easiest;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
difficultyLevel = (INT)eSen_DifficultyLevel_Easier;
|
difficultyLevel = (int)eSen_DifficultyLevel_Easier;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
difficultyLevel = (INT)eSen_DifficultyLevel_Normal;
|
difficultyLevel = (int)eSen_DifficultyLevel_Normal;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
difficultyLevel = (INT)eSen_DifficultyLevel_Harder;
|
difficultyLevel = (int)eSen_DifficultyLevel_Harder;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,17 +366,17 @@ INT CTelemetryManager::GetDifficultyLevel(INT diff)
|
|||||||
Differentiates trial/demo from full purchased titles
|
Differentiates trial/demo from full purchased titles
|
||||||
Is this a full title or demo?
|
Is this a full title or demo?
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetLicense()
|
int CTelemetryManager::GetLicense()
|
||||||
{
|
{
|
||||||
INT license = eSen_License_Undefined;
|
int license = eSen_License_Undefined;
|
||||||
|
|
||||||
if(ProfileManager.IsFullVersion())
|
if(ProfileManager.IsFullVersion())
|
||||||
{
|
{
|
||||||
license = (INT)eSen_License_Full_Purchased_Title;
|
license = (int)eSen_License_Full_Purchased_Title;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
license = (INT)eSen_License_Trial_or_Demo;
|
license = (int)eSen_License_Trial_or_Demo;
|
||||||
}
|
}
|
||||||
return license;
|
return license;
|
||||||
}
|
}
|
||||||
@@ -385,9 +385,9 @@ INT CTelemetryManager::GetLicense()
|
|||||||
This is intended to capture whether players played using default control scheme or customized the control scheme.
|
This is intended to capture whether players played using default control scheme or customized the control scheme.
|
||||||
Are players customizing your controls?
|
Are players customizing your controls?
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetDefaultGameControls()
|
int CTelemetryManager::GetDefaultGameControls()
|
||||||
{
|
{
|
||||||
INT defaultGameControls = eSen_DefaultGameControls_Undefined;
|
int defaultGameControls = eSen_DefaultGameControls_Undefined;
|
||||||
|
|
||||||
// Unused
|
// Unused
|
||||||
//eSen_DefaultGameControls_Custom_controls
|
//eSen_DefaultGameControls_Custom_controls
|
||||||
@@ -401,25 +401,25 @@ INT CTelemetryManager::GetDefaultGameControls()
|
|||||||
Are players changing default audio settings?
|
Are players changing default audio settings?
|
||||||
This is intended to capture whether players are playing with or without volume and whether they make changes from the default audio settings.
|
This is intended to capture whether players are playing with or without volume and whether they make changes from the default audio settings.
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetAudioSettings(DWORD dwUserId)
|
int CTelemetryManager::GetAudioSettings(unsigned long dwUserId)
|
||||||
{
|
{
|
||||||
INT audioSettings = (INT)eSen_AudioSettings_Undefined;
|
int audioSettings = (int)eSen_AudioSettings_Undefined;
|
||||||
|
|
||||||
if(dwUserId == ProfileManager.GetPrimaryPad())
|
if(dwUserId == ProfileManager.GetPrimaryPad())
|
||||||
{
|
{
|
||||||
BYTE volume = app.GetGameSettings(dwUserId,eGameSetting_SoundFXVolume);
|
uint8_t volume = app.GetGameSettings(dwUserId,eGameSetting_SoundFXVolume);
|
||||||
|
|
||||||
if(volume == 0)
|
if(volume == 0)
|
||||||
{
|
{
|
||||||
audioSettings = (INT)eSen_AudioSettings_Off;
|
audioSettings = (int)eSen_AudioSettings_Off;
|
||||||
}
|
}
|
||||||
else if(volume == DEFAULT_VOLUME_LEVEL)
|
else if(volume == DEFAULT_VOLUME_LEVEL)
|
||||||
{
|
{
|
||||||
audioSettings = (INT)eSen_AudioSettings_On_Default;
|
audioSettings = (int)eSen_AudioSettings_On_Default;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
audioSettings = (INT)eSen_AudioSettings_On_CustomSetting;
|
audioSettings = (int)eSen_AudioSettings_On_CustomSetting;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return audioSettings;
|
return audioSettings;
|
||||||
@@ -431,7 +431,7 @@ For example, a performance metric could points earned, race time, total kills, e
|
|||||||
This is entirely up to you and will help us understand how well the player performed, or how far the player progressed <20>in the level before exiting.
|
This is entirely up to you and will help us understand how well the player performed, or how far the player progressed <20>in the level before exiting.
|
||||||
How far did users progress before failing/exiting the level?
|
How far did users progress before failing/exiting the level?
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetLevelExitProgressStat1()
|
int CTelemetryManager::GetLevelExitProgressStat1()
|
||||||
{
|
{
|
||||||
// 4J Stu - Unused
|
// 4J Stu - Unused
|
||||||
return 0;
|
return 0;
|
||||||
@@ -443,7 +443,7 @@ For example, a performance metric could points earned, race time, total kills, e
|
|||||||
This is entirely up to you and will help us understand how well the player performed, or how far the player progressed <20>in the level before exiting.
|
This is entirely up to you and will help us understand how well the player performed, or how far the player progressed <20>in the level before exiting.
|
||||||
How far did users progress before failing/exiting the level?
|
How far did users progress before failing/exiting the level?
|
||||||
*/
|
*/
|
||||||
INT CTelemetryManager::GetLevelExitProgressStat2()
|
int CTelemetryManager::GetLevelExitProgressStat2()
|
||||||
{
|
{
|
||||||
// 4J Stu - Unused
|
// 4J Stu - Unused
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
class CTelemetryManager
|
class CTelemetryManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual HRESULT Init();
|
virtual int Init();
|
||||||
virtual HRESULT Tick();
|
virtual int Tick();
|
||||||
virtual HRESULT Flush();
|
virtual int Flush();
|
||||||
|
|
||||||
virtual bool RecordPlayerSessionStart(int iPad);
|
virtual bool RecordPlayerSessionStart(int iPad);
|
||||||
virtual bool RecordPlayerSessionExit(int iPad, int exitStatus);
|
virtual bool RecordPlayerSessionExit(int iPad, int exitStatus);
|
||||||
@@ -42,24 +42,24 @@ protected:
|
|||||||
|
|
||||||
float m_fLevelStartTime[XUSER_MAX_COUNT];
|
float m_fLevelStartTime[XUSER_MAX_COUNT];
|
||||||
|
|
||||||
INT m_multiplayerInstanceID;
|
int m_multiplayerInstanceID;
|
||||||
DWORD m_levelInstanceID;
|
unsigned long m_levelInstanceID;
|
||||||
|
|
||||||
// Helper functions to get the various common settings
|
// Helper functions to get the various common settings
|
||||||
INT GetSecondsSinceInitialize();
|
int GetSecondsSinceInitialize();
|
||||||
INT GetMode(DWORD dwUserId);
|
int GetMode(unsigned long dwUserId);
|
||||||
INT GetSubMode(DWORD dwUserId);
|
int GetSubMode(unsigned long dwUserId);
|
||||||
INT GetLevelId(DWORD dwUserId);
|
int GetLevelId(unsigned long dwUserId);
|
||||||
INT GetSubLevelId(DWORD dwUserId);
|
int GetSubLevelId(unsigned long dwUserId);
|
||||||
INT GetTitleBuildId();
|
int GetTitleBuildId();
|
||||||
INT GetLevelInstanceID();
|
int GetLevelInstanceID();
|
||||||
INT GetSingleOrMultiplayer();
|
int GetSingleOrMultiplayer();
|
||||||
INT GetDifficultyLevel(INT diff);
|
int GetDifficultyLevel(int diff);
|
||||||
INT GetLicense();
|
int GetLicense();
|
||||||
INT GetDefaultGameControls();
|
int GetDefaultGameControls();
|
||||||
INT GetAudioSettings(DWORD dwUserId);
|
int GetAudioSettings(unsigned long dwUserId);
|
||||||
INT GetLevelExitProgressStat1();
|
int GetLevelExitProgressStat1();
|
||||||
INT GetLevelExitProgressStat2();
|
int GetLevelExitProgressStat2();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CTelemetryManager *TelemetryManager;
|
extern CTelemetryManager *TelemetryManager;
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
#include "ClientConnection.h"
|
#include "ClientConnection.h"
|
||||||
#include "net.minecraft.network.packet.h"
|
#include "net.minecraft.network.packet.h"
|
||||||
|
|
||||||
ChangeStateConstraint::ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], DWORD sourceStatesCount,
|
ChangeStateConstraint::ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], unsigned long sourceStatesCount,
|
||||||
double x0, double y0, double z0, double x1, double y1, double z1, bool contains /*= true*/, bool changeGameMode /*= false*/, GameType *targetGameMode /*= 0*/ )
|
double x0, double y0, double z0, double x1, double y1, double z1, bool contains /*= true*/, bool changeGameMode /*= false*/, GameType *targetGameMode /*= 0*/ )
|
||||||
: TutorialConstraint( -1 )
|
: TutorialConstraint( -1 )
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,7 @@ void ChangeStateConstraint::tick(int iPad)
|
|||||||
|
|
||||||
bool inASourceState = false;
|
bool inASourceState = false;
|
||||||
Minecraft *minecraft = Minecraft::GetInstance();
|
Minecraft *minecraft = Minecraft::GetInstance();
|
||||||
for(DWORD i = 0; i < m_sourceStatesCount; ++i)
|
for(unsigned long i = 0; i < m_sourceStatesCount; ++i)
|
||||||
{
|
{
|
||||||
if(m_sourceStates[i] == m_tutorial->getCurrentState())
|
if(m_sourceStates[i] == m_tutorial->getCurrentState())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ private:
|
|||||||
|
|
||||||
eTutorial_State m_targetState;
|
eTutorial_State m_targetState;
|
||||||
eTutorial_State *m_sourceStates;
|
eTutorial_State *m_sourceStates;
|
||||||
DWORD m_sourceStatesCount;
|
unsigned long m_sourceStatesCount;
|
||||||
|
|
||||||
bool m_bHasChanged;
|
bool m_bHasChanged;
|
||||||
eTutorial_State m_changedFromState;
|
eTutorial_State m_changedFromState;
|
||||||
@@ -30,7 +30,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
virtual ConstraintType getType() { return e_ConstraintChangeState; }
|
virtual ConstraintType getType() { return e_ConstraintChangeState; }
|
||||||
|
|
||||||
ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], DWORD sourceStatesCount, double x0, double y0, double z0, double x1, double y1, double z1, bool contains = true, bool changeGameMode = false, GameType *targetGameMode = NULL );
|
ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], unsigned long sourceStatesCount, double x0, double y0, double z0, double x1, double y1, double z1, bool contains = true, bool changeGameMode = false, GameType *targetGameMode = NULL );
|
||||||
~ChangeStateConstraint();
|
~ChangeStateConstraint();
|
||||||
|
|
||||||
virtual void tick(int iPad);
|
virtual void tick(int iPad);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user