feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a4399472.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
@@ -36,8 +36,29 @@
|
||||
#define GAME_HOST_OPTION_BITMASK_HOSTINVISIBLE 0x00010000
|
||||
#define GAME_HOST_OPTION_BITMASK_BEDROCKFOG 0x00020000
|
||||
#define GAME_HOST_OPTION_BITMASK_DISABLESAVE 0x00040000
|
||||
#define GAME_HOST_OPTION_BITMASK_NOTOWNER 0x00080000
|
||||
#define GAME_HOST_OPTION_BITMASK_WORLDSIZE 0x00700000 // 3 bits, 5 values (unset(0), classic(1), small(2), medium(3), large(4))
|
||||
#define GAME_HOST_OPTION_BITMASK_MOBGRIEFING 0x00800000
|
||||
#define GAME_HOST_OPTION_BITMASK_KEEPINVENTORY 0x01000000
|
||||
#define GAME_HOST_OPTION_BITMASK_DOMOBSPAWNING 0x02000000
|
||||
#define GAME_HOST_OPTION_BITMASK_DOMOBLOOT 0x04000000
|
||||
#define GAME_HOST_OPTION_BITMASK_DOTILEDROPS 0x08000000
|
||||
#define GAME_HOST_OPTION_BITMASK_NATURALREGEN 0x10000000
|
||||
#define GAME_HOST_OPTION_BITMASK_DODAYLIGHTCYCLE 0x20000000
|
||||
#define GAME_HOST_OPTION_BITMASK_ALL 0xFFFFFFFF
|
||||
|
||||
#define GAME_HOST_OPTION_BITMASK_WORLDSIZE_BITSHIFT 20
|
||||
|
||||
enum EGameHostOptionWorldSize
|
||||
{
|
||||
e_worldSize_Unknown = 0,
|
||||
e_worldSize_Classic,
|
||||
e_worldSize_Small,
|
||||
e_worldSize_Medium,
|
||||
e_worldSize_Large
|
||||
};
|
||||
|
||||
|
||||
#ifdef _XBOX
|
||||
#define PROFILE_VERSION_1 1
|
||||
#define PROFILE_VERSION_2 2
|
||||
@@ -53,7 +74,12 @@
|
||||
#define PROFILE_VERSION_10 12
|
||||
|
||||
// 4J-JEV: New Statistics and Achievements for 'NexGen' platforms.
|
||||
#define PROFILE_VERSION_BUILD_JUNE14 13
|
||||
#define PROFILE_VERSION_11 13
|
||||
|
||||
// Java 1.6.4
|
||||
#define PROFILE_VERSION_12 14
|
||||
|
||||
#define PROFILE_VERSION_CURRENT PROFILE_VERSION_12
|
||||
|
||||
#define MAX_FAVORITE_SKINS 10 // these are stored in the profile data so keep it small
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ enum eXuiAction
|
||||
eAppAction_LevelInBanLevelList,
|
||||
|
||||
eAppAction_ReloadTexturePack,
|
||||
eAppAction_ReloadFont,
|
||||
eAppAction_TexturePackRequired, // when the user has joined from invite, but doesn't have the texture pack
|
||||
|
||||
#ifdef __ORBIS__
|
||||
@@ -380,6 +381,10 @@ enum eMinecraftColour
|
||||
eMinecraftColour_Effect_Hunger,
|
||||
eMinecraftColour_Effect_Weakness,
|
||||
eMinecraftColour_Effect_Poison,
|
||||
eMinecraftColour_Effect_Wither,
|
||||
eMinecraftColour_Effect_HealthBoost,
|
||||
eMinecraftColour_Effect_Absoprtion,
|
||||
eMinecraftColour_Effect_Saturation,
|
||||
|
||||
eMinecraftColour_Potion_BaseColour,
|
||||
|
||||
@@ -425,6 +430,12 @@ enum eMinecraftColour
|
||||
eMinecraftColour_Mob_Ocelot_Colour2,
|
||||
eMinecraftColour_Mob_Villager_Colour1,
|
||||
eMinecraftColour_Mob_Villager_Colour2,
|
||||
eMinecraftColour_Mob_Bat_Colour1,
|
||||
eMinecraftColour_Mob_Bat_Colour2,
|
||||
eMinecraftColour_Mob_Witch_Colour1,
|
||||
eMinecraftColour_Mob_Witch_Colour2,
|
||||
eMinecraftColour_Mob_Horse_Colour1,
|
||||
eMinecraftColour_Mob_Horse_Colour2,
|
||||
|
||||
eMinecraftColour_Armour_Default_Leather_Colour,
|
||||
|
||||
@@ -443,6 +454,11 @@ enum eMinecraftColour
|
||||
eMinecraftColour_Sign_Text,
|
||||
eMinecraftColour_Map_Text,
|
||||
|
||||
eMinecraftColour_Leash_Light_Colour,
|
||||
eMinecraftColour_Leash_Dark_Colour,
|
||||
|
||||
eMinecraftColour_Fire_Overlay,
|
||||
|
||||
eHTMLColor_0,
|
||||
eHTMLColor_1,
|
||||
eHTMLColor_2,
|
||||
@@ -487,20 +503,20 @@ enum eMinecraftColour
|
||||
eTextColor_RenamedItemTitle,
|
||||
|
||||
//eHTMLColor_0 = 0x000000, //r:0 , g: 0, b: 0, i: 0
|
||||
//eHTMLColor_1 = 0x0000aa, //r:0 , g: 0, b: aa, i: 1
|
||||
//eHTMLColor_2 = 0x109e10, // Changed by request of Dave //0x00aa00, //r:0 , g: aa, b: 0, i: 2
|
||||
//eHTMLColor_3 = 0x109e9e, // Changed by request of Dave //0x00aaaa, //r:0 , g: aa, b: aa, i: 3
|
||||
//eHTMLColor_4 = 0xaa0000, //r:aa , g: 0, b: 0, i: 4
|
||||
//eHTMLColor_5 = 0xaa00aa, //r:aa , g: 0, b: aa, i: 5
|
||||
//eHTMLColor_6 = 0xffaa00, //r:ff , g: aa, b: 0, i: 6
|
||||
//eHTMLColor_7 = 0xaaaaaa, //r:aa , g: aa, b: aa, i: 7
|
||||
//eHTMLColor_8 = 0x555555, //r:55 , g: 55, b: 55, i: 8
|
||||
//eHTMLColor_9 = 0x5555ff, //r:55 , g: 55, b: ff, i: 9
|
||||
//eHTMLColor_a = 0x55ff55, //r:55 , g: ff, b: 55, i: a
|
||||
//eHTMLColor_b = 0x55ffff, //r:55 , g: ff, b: ff, i: b
|
||||
//eHTMLColor_c = 0xff5555, //r:ff , g: 55, b: 55, i: c
|
||||
//eHTMLColor_d = 0xff55ff, //r:ff , g: 55, b: ff, i: d
|
||||
//eHTMLColor_e = 0xffff55, //r:ff , g: ff, b: 55, i: e
|
||||
//eHTMLColor_1 = 0x0000aa, //r:0 , g: 0, b: aa, i: 1 // blue, quite dark
|
||||
//eHTMLColor_2 = 0x109e10, // Changed by request of Dave //0x00aa00, //r:0 , g: aa, b: 0, i: 2 // green
|
||||
//eHTMLColor_3 = 0x109e9e, // Changed by request of Dave //0x00aaaa, //r:0 , g: aa, b: aa, i: 3 // cyan
|
||||
//eHTMLColor_4 = 0xaa0000, //r:aa , g: 0, b: 0, i: 4 // red
|
||||
//eHTMLColor_5 = 0xaa00aa, //r:aa , g: 0, b: aa, i: 5 // purple
|
||||
//eHTMLColor_6 = 0xffaa00, //r:ff , g: aa, b: 0, i: 6 // orange
|
||||
//eHTMLColor_7 = 0xaaaaaa, //r:aa , g: aa, b: aa, i: 7 // light gray
|
||||
//eHTMLColor_8 = 0x555555, //r:55 , g: 55, b: 55, i: 8 // gray
|
||||
//eHTMLColor_9 = 0x5555ff, //r:55 , g: 55, b: ff, i: 9 // blue
|
||||
//eHTMLColor_a = 0x55ff55, //r:55 , g: ff, b: 55, i: a // green
|
||||
//eHTMLColor_b = 0x55ffff, //r:55 , g: ff, b: ff, i: b // cyan
|
||||
//eHTMLColor_c = 0xff5555, //r:ff , g: 55, b: 55, i: c // red pink
|
||||
//eHTMLColor_d = 0xff55ff, //r:ff , g: 55, b: ff, i: d // bright pink
|
||||
//eHTMLColor_e = 0xffff55, //r:ff , g: ff, b: 55, i: e // yellow
|
||||
//eHTMLColor_f = 0xffffff, //r:ff , g: ff, b: ff, i: f
|
||||
//eHTMLColor_0_dark = 0x000000, //r:0 , g: 0, b: 0, i: 10
|
||||
//eHTMLColor_1_dark = 0x00002a, //r:0 , g: 0, b: 2a, i: 11
|
||||
@@ -509,12 +525,12 @@ enum eMinecraftColour
|
||||
//eHTMLColor_4_dark = 0x2a0000, //r:2a , g: 0, b: 0, i: 14
|
||||
//eHTMLColor_5_dark = 0x2a002a, //r:2a , g: 0, b: 2a, i: 15
|
||||
//eHTMLColor_6_dark = 0x2a2a00, //r:2a , g: 2a, b: 0, i: 16
|
||||
//eHTMLColor_7_dark = 0x2a2a2a, //r:2a , g: 2a, b: 2a, i: 17
|
||||
//eHTMLColor_7_dark = 0x2a2a2a, //r:2a , g: 2a, b: 2a, i: 17 // dark gray
|
||||
//eHTMLColor_8_dark = 0x151515, //r:15 , g: 15, b: 15, i: 18
|
||||
//eHTMLColor_9_dark = 0x15153f, //r:15 , g: 15, b: 3f, i: 19
|
||||
//eHTMLColor_a_dark = 0x153f15, //r:15 , g: 3f, b: 15, i: 1a
|
||||
//eHTMLColor_b_dark = 0x153f3f, //r:15 , g: 3f, b: 3f, i: 1b
|
||||
//eHTMLColor_c_dark = 0x3f1515, //r:3f , g: 15, b: 15, i: 1c
|
||||
//eHTMLColor_c_dark = 0x3f1515, //r:3f , g: 15, b: 15, i: 1c // brown
|
||||
//eHTMLColor_d_dark = 0x3f153f, //r:3f , g: 15, b: 3f, i: 1d
|
||||
//eHTMLColor_e_dark = 0x3f3f15, //r:3f , g: 3f, b: 15, i: 1e
|
||||
//eHTMLColor_f_dark = 0x3f3f3f, //r:3f , g: 3f, b: 3f, i: 1f
|
||||
@@ -617,9 +633,19 @@ enum eGameHostOption
|
||||
eGameHostOption_HostCanBeInvisible,
|
||||
eGameHostOption_BedrockFog,
|
||||
eGameHostOption_NoHUD,
|
||||
eGameHostOption_WorldSize,
|
||||
eGameHostOption_All,
|
||||
|
||||
eGameHostOption_DisableSaving,
|
||||
eGameHostOption_WasntSaveOwner, // Added for PS3 save transfer, so we can add a nice message in the future instead of the creative mode one
|
||||
|
||||
eGameHostOption_MobGriefing,
|
||||
eGameHostOption_KeepInventory,
|
||||
eGameHostOption_DoMobSpawning,
|
||||
eGameHostOption_DoMobLoot,
|
||||
eGameHostOption_DoTileDrops,
|
||||
eGameHostOption_NaturalRegeneration,
|
||||
eGameHostOption_DoDaylightCycle,
|
||||
};
|
||||
|
||||
// 4J-PB - If any new DLC items are added to the TMSFiles, this array needs updated
|
||||
@@ -639,6 +665,8 @@ enum _TMSFILES
|
||||
TMS_SPM,
|
||||
TMS_SPI,
|
||||
TMS_SPG,
|
||||
TMS_SPD1,
|
||||
TMS_SPSW1,
|
||||
|
||||
TMS_THST,
|
||||
TMS_THIR,
|
||||
@@ -748,6 +776,8 @@ enum _TMSFILES
|
||||
TMS_MPSR_DAT,
|
||||
TMS_MPHA,
|
||||
TMS_MPHA_DAT,
|
||||
TMS_MPFE,
|
||||
TMS_MPFE_DAT,
|
||||
|
||||
TMS_TP01,
|
||||
TMS_TP01_DAT,
|
||||
@@ -761,6 +791,8 @@ enum _TMSFILES
|
||||
TMS_TP06_DAT,
|
||||
TMS_TP07,
|
||||
TMS_TP07_DAT,
|
||||
TMS_TP08,
|
||||
TMS_TP08_DAT,
|
||||
|
||||
TMS_COUNT
|
||||
};
|
||||
@@ -875,7 +907,7 @@ enum eMCLang
|
||||
eMCLang_plPL,
|
||||
eMCLang_trTR,
|
||||
eMCLang_elEL,
|
||||
eMCLang_zhCHS,
|
||||
eMCLang_csCS,
|
||||
eMCLang_zhCHT,
|
||||
eMCLang_laLAS,
|
||||
|
||||
@@ -910,4 +942,7 @@ enum eMCLang
|
||||
eMCLang_elGR,
|
||||
eMCLang_nnNO,
|
||||
eMCLang_skSK,
|
||||
|
||||
eMCLang_hans,
|
||||
eMCLang_hant,
|
||||
};
|
||||
@@ -100,6 +100,10 @@ typedef struct
|
||||
|
||||
// PS3 1.05 - Adding Greek, so need a language
|
||||
unsigned char ucLanguage;
|
||||
|
||||
// 29/Oct/2014 - Language selector.
|
||||
unsigned char ucLocale;
|
||||
|
||||
// 4J Stu - See comment for GAME_SETTINGS_PROFILE_DATA_BYTES below
|
||||
// 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)];
|
||||
|
||||
@@ -35,4 +35,43 @@ void ConsoleSoundEngine::SetIsPlayingNetherMusic(bool bVal)
|
||||
m_bIsPlayingNetherMusic=bVal;
|
||||
}
|
||||
|
||||
void ConsoleSoundEngine::tick()
|
||||
{
|
||||
if (scheduledSounds.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(AUTO_VAR(it,scheduledSounds.begin()); it != scheduledSounds.end();)
|
||||
{
|
||||
SoundEngine::ScheduledSound *next = *it;
|
||||
next->delay--;
|
||||
|
||||
if (next->delay <= 0)
|
||||
{
|
||||
play(next->iSound, next->x, next->y, next->z, next->volume, next->pitch);
|
||||
it =scheduledSounds.erase(it);
|
||||
delete next;
|
||||
}
|
||||
else
|
||||
{
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConsoleSoundEngine::schedule(int iSound, float x, float y, float z, float volume, float pitch, int delayTicks)
|
||||
{
|
||||
scheduledSounds.push_back(new SoundEngine::ScheduledSound(iSound, x, y, z, volume, pitch, delayTicks));
|
||||
}
|
||||
|
||||
ConsoleSoundEngine::ScheduledSound::ScheduledSound(int iSound, float x, float y, float z, float volume, float pitch, int delay)
|
||||
{
|
||||
this->iSound = iSound;
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
this->volume = volume;
|
||||
this->pitch = pitch;
|
||||
this->delay = delay;
|
||||
}
|
||||
@@ -69,6 +69,25 @@ public:
|
||||
static const WCHAR *wchSoundNames[eSoundType_MAX];
|
||||
static const WCHAR *wchUISoundNames[eSFX_MAX];
|
||||
|
||||
public:
|
||||
void tick();
|
||||
void schedule(int iSound, float x, float y, float z, float volume, float pitch, int delayTicks);
|
||||
|
||||
private:
|
||||
class ScheduledSound
|
||||
{
|
||||
public:
|
||||
int iSound;
|
||||
float x, y, z;
|
||||
float volume, pitch;
|
||||
int delay;
|
||||
|
||||
public:
|
||||
ScheduledSound(int iSound, float x, float y, float z, float volume, float pitch, int delay);
|
||||
};
|
||||
|
||||
vector<ScheduledSound *> scheduledSounds;
|
||||
|
||||
private:
|
||||
// platform specific functions
|
||||
|
||||
|
||||
@@ -490,6 +490,12 @@ void SoundEngine::updateMiles()
|
||||
case eSoundType_MOB_ENDERDRAGON_HIT:
|
||||
distanceScaler=100.0f;
|
||||
break;
|
||||
case eSoundType_FIREWORKS_BLAST:
|
||||
case eSoundType_FIREWORKS_BLAST_FAR:
|
||||
case eSoundType_FIREWORKS_LARGE_BLAST:
|
||||
case eSoundType_FIREWORKS_LARGE_BLAST_FAR:
|
||||
distanceScaler=100.0f;
|
||||
break;
|
||||
case eSoundType_MOB_GHAST_MOAN:
|
||||
case eSoundType_MOB_GHAST_SCREAM:
|
||||
case eSoundType_MOB_GHAST_DEATH:
|
||||
@@ -624,6 +630,7 @@ static S32 running = AIL_ms_count();
|
||||
|
||||
void SoundEngine::tick(shared_ptr<Mob> *players, float a)
|
||||
{
|
||||
ConsoleSoundEngine::tick();
|
||||
#ifdef __DISABLE_MILES__
|
||||
return;
|
||||
#endif
|
||||
@@ -1129,6 +1136,11 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
|
||||
#endif
|
||||
SoundEngine *soundEngine = (SoundEngine *)lpParameter;
|
||||
soundEngine->m_hStream = AIL_open_stream(soundEngine->m_hDriver,soundEngine->m_szStreamName,0);
|
||||
|
||||
if(soundEngine->m_hStream==0)
|
||||
{
|
||||
app.DebugPrintf("SoundEngine::OpenStreamThreadProc - Could not open - %s\n",soundEngine->m_szStreamName);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1225,7 +1237,11 @@ void SoundEngine::playMusicUpdate()
|
||||
char szName[255];
|
||||
wcstombs(szName,wstrSoundName.c_str(),255);
|
||||
|
||||
#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
string strFile="TPACK:/Data/" + string(szName) + ".binka";
|
||||
#else
|
||||
string strFile="TPACK:\\Data\\" + string(szName) + ".binka";
|
||||
#endif
|
||||
std::string mountedPath = StorageManager.GetMountedPath(strFile);
|
||||
strcpy(m_szStreamName,mountedPath.c_str());
|
||||
#endif
|
||||
|
||||
@@ -151,6 +151,78 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]=
|
||||
L"dig.snow", // eSoundType_DIG_SNOW
|
||||
L"dig.stone", // eSoundType_DIG_STONE
|
||||
L"dig.wood", // eSoundType_DIG_WOOD
|
||||
|
||||
// 1.6.4
|
||||
L"fireworks.launch", //eSoundType_FIREWORKS_LAUNCH,
|
||||
L"fireworks.blast", //eSoundType_FIREWORKS_BLAST,
|
||||
L"fireworks.blast_far", //eSoundType_FIREWORKS_BLAST_FAR,
|
||||
L"fireworks.large_blast", //eSoundType_FIREWORKS_LARGE_BLAST,
|
||||
L"fireworks.large_blast_far", //eSoundType_FIREWORKS_LARGE_BLAST_FAR,
|
||||
L"fireworks.twinkle", //eSoundType_FIREWORKS_TWINKLE,
|
||||
L"fireworks.twinkle_far", //eSoundType_FIREWORKS_TWINKLE_FAR,
|
||||
|
||||
L"mob.bat.idle", //eSoundType_MOB_BAT_IDLE,
|
||||
L"mob.bat.hurt", //eSoundType_MOB_BAT_HURT,
|
||||
L"mob.bat.death", //eSoundType_MOB_BAT_DEATH,
|
||||
L"mob.bat.takeoff", //eSoundType_MOB_BAT_TAKEOFF,
|
||||
|
||||
L"mob.wither.spawn", //eSoundType_MOB_WITHER_SPAWN,
|
||||
L"mob.wither.idle", //eSoundType_MOB_WITHER_IDLE,
|
||||
L"mob.wither.hurt", //eSoundType_MOB_WITHER_HURT,
|
||||
L"mob.wither.death", //eSoundType_MOB_WITHER_DEATH,
|
||||
L"mob.wither.shoot", //eSoundType_MOB_WITHER_SHOOT,
|
||||
|
||||
L"mob.cow.step", //eSoundType_MOB_COW_STEP,
|
||||
L"mob.chicken.step", //eSoundType_MOB_CHICKEN_STEP,
|
||||
L"mob.pig.step", //eSoundType_MOB_PIG_STEP,
|
||||
L"mob.enderman.stare", //eSoundType_MOB_ENDERMAN_STARE,
|
||||
L"mob.enderman.scream", //eSoundType_MOB_ENDERMAN_SCREAM,
|
||||
L"mob.sheep.shear", //eSoundType_MOB_SHEEP_SHEAR,
|
||||
L"mob.sheep.step", //eSoundType_MOB_SHEEP_STEP,
|
||||
L"mob.skeleton.death", //eSoundType_MOB_SKELETON_DEATH,
|
||||
L"mob.skeleton.step", //eSoundType_MOB_SKELETON_STEP,
|
||||
L"mob.spider.step", //eSoundType_MOB_SPIDER_STEP,
|
||||
L"mob.wolf.step", //eSoundType_MOB_WOLF_STEP,
|
||||
L"mob.zombie.step", //eSoundType_MOB_ZOMBIE_STEP,
|
||||
|
||||
L"liquid.swim", //eSoundType_LIQUID_SWIM,
|
||||
|
||||
L"mob.horse.land", //eSoundType_MOB_HORSE_LAND,
|
||||
L"mob.horse.armor", //eSoundType_MOB_HORSE_ARMOR,
|
||||
L"mob.horse.leather", //eSoundType_MOB_HORSE_LEATHER,
|
||||
L"mob.horse.zombie.death", //eSoundType_MOB_HORSE_ZOMBIE_DEATH,
|
||||
L"mob.horse.skeleton.death", //eSoundType_MOB_HORSE_SKELETON_DEATH,
|
||||
L"mob.horse.donkey.death", //eSoundType_MOB_HORSE_DONKEY_DEATH,
|
||||
L"mob.horse.death", //eSoundType_MOB_HORSE_DEATH,
|
||||
L"mob.horse.zombie.hit", //eSoundType_MOB_HORSE_ZOMBIE_HIT,
|
||||
L"mob.horse.skeleton.hit", //eSoundType_MOB_HORSE_SKELETON_HIT,
|
||||
L"mob.horse.donkey.hit", //eSoundType_MOB_HORSE_DONKEY_HIT,
|
||||
L"mob.horse.hit", //eSoundType_MOB_HORSE_HIT,
|
||||
L"mob.horse.zombie.idle", //eSoundType_MOB_HORSE_ZOMBIE_IDLE,
|
||||
L"mob.horse.skeleton.idle", //eSoundType_MOB_HORSE_SKELETON_IDLE,
|
||||
L"mob.horse.donkey.idle", //eSoundType_MOB_HORSE_DONKEY_IDLE,
|
||||
L"mob.horse.idle", //eSoundType_MOB_HORSE_IDLE,
|
||||
L"mob.horse.donkey.angry", //eSoundType_MOB_HORSE_DONKEY_ANGRY,
|
||||
L"mob.horse.angry", //eSoundType_MOB_HORSE_ANGRY,
|
||||
L"mob.horse.gallop", //eSoundType_MOB_HORSE_GALLOP,
|
||||
L"mob.horse.breathe", //eSoundType_MOB_HORSE_BREATHE,
|
||||
L"mob.horse.wood", //eSoundType_MOB_HORSE_WOOD,
|
||||
L"mob.horse.soft", //eSoundType_MOB_HORSE_SOFT,
|
||||
L"mob.horse.jump", //eSoundType_MOB_HORSE_JUMP,
|
||||
|
||||
L"mob.witch.idle", //eSoundType_MOB_WITCH_IDLE, <--- missing
|
||||
L"mob.witch.hurt", //eSoundType_MOB_WITCH_HURT, <--- missing
|
||||
L"mob.witch.death", //eSoundType_MOB_WITCH_DEATH, <--- missing
|
||||
|
||||
L"mob.slime.big", //eSoundType_MOB_SLIME_BIG,
|
||||
L"mob.slime.small", //eSoundType_MOB_SLIME_SMALL,
|
||||
|
||||
L"eating", //eSoundType_EATING <--- missing
|
||||
L"random.levelup", //eSoundType_RANDOM_LEVELUP
|
||||
|
||||
// 4J-PB - Some sounds were updated, but we can't do that for the 360 or we have to do a new sound bank
|
||||
// instead, we'll add the sounds as new ones and change the code to reference them
|
||||
L"fire.new_ignite",
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
|
||||
// This goes up with each build
|
||||
// 4J-JEV: This value is extracted with a regex so it can be placed as the version in the AppX manifest on Durango.
|
||||
#define VER_PRODUCTBUILD 495
|
||||
#define VER_PRODUCTBUILD 560
|
||||
// This goes up if there is any change to network traffic or code in a build
|
||||
#define VER_NETWORK 495
|
||||
#define VER_NETWORK 560
|
||||
#define VER_PRODUCTBUILD_QFE 0
|
||||
|
||||
#define VER_FILEVERSION_STRING "1.3"
|
||||
#define VER_FILEVERSION_STRING "1.6"
|
||||
#define VER_PRODUCTVERSION_STRING VER_FILEVERSION_STRING
|
||||
#define VER_FILEVERSION_STRING_W L"1.3"
|
||||
#define VER_FILEVERSION_STRING_W L"1.6"
|
||||
#define VER_PRODUCTVERSION_STRING_W VER_FILEVERSION_STRING_W
|
||||
#define VER_FILEBETA_STR ""
|
||||
#undef VER_FILEVERSION
|
||||
|
||||
@@ -201,6 +201,10 @@ wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] =
|
||||
L"Effect_Hunger",
|
||||
L"Effect_Weakness",
|
||||
L"Effect_Poison",
|
||||
L"Effect_Wither",
|
||||
L"Effect_HealthBoost",
|
||||
L"Effect_Absorption",
|
||||
L"Effect_Saturation",
|
||||
|
||||
L"Potion_BaseColour",
|
||||
|
||||
@@ -246,6 +250,12 @@ wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] =
|
||||
L"Mob_Ocelot_Colour2",
|
||||
L"Mob_Villager_Colour1",
|
||||
L"Mob_Villager_Colour2",
|
||||
L"Mob_Bat_Colour1",
|
||||
L"Mob_Bat_Colour2",
|
||||
L"Mob_Witch_Colour1",
|
||||
L"Mob_Witch_Colour2",
|
||||
L"Mob_Horse_Colour1",
|
||||
L"Mob_Horse_Colour2",
|
||||
|
||||
L"Armour_Default_Leather_Colour",
|
||||
L"Under_Water_Clear_Colour",
|
||||
@@ -262,6 +272,11 @@ wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] =
|
||||
|
||||
L"Sign_Text",
|
||||
L"Map_Text",
|
||||
|
||||
L"Leash_Light_Colour",
|
||||
L"Leash_Dark_Colour",
|
||||
|
||||
L"Fire_Overlay",
|
||||
|
||||
L"HTMLColor_0",
|
||||
L"HTMLColor_1",
|
||||
|
||||
@@ -12,15 +12,15 @@ enum eDebugSetting
|
||||
eDebugSetting_CraftAnything,
|
||||
eDebugSetting_UseDpadForDebug,
|
||||
eDebugSetting_MobsDontTick,
|
||||
eDebugSetting_InstantDestroy,
|
||||
eDebugSetting_ArtTools, //eDebugSetting_InstantDestroy,
|
||||
eDebugSetting_ShowUIConsole,
|
||||
eDebugSetting_DistributableSave,
|
||||
eDebugSetting_DebugLeaderboards,
|
||||
eDebugSetting_EnableHeightWaterBiomeOverride, //eDebugSetting_TipsAlwaysOn,
|
||||
eDebugSetting_EnableHeightWaterOverride, //eDebugSetting_TipsAlwaysOn,
|
||||
eDebugSetting_SuperflatNether,
|
||||
//eDebugSetting_LightDarkBackground,
|
||||
eDebugSetting_RegularLightning,
|
||||
eDebugSetting_GoToNether,
|
||||
eDebugSetting_EnableBiomeOverride, //eDebugSetting_GoToNether,
|
||||
//eDebugSetting_GoToEnd,
|
||||
eDebugSetting_GoToOverworld,
|
||||
eDebugSetting_UnlockAllDLC, // eDebugSetting_ToggleFont,
|
||||
|
||||
@@ -39,6 +39,11 @@ class Container;
|
||||
class DispenserTileEntity;
|
||||
class SignTileEntity;
|
||||
class BrewingStandTileEntity;
|
||||
class CommandBlockEntity;
|
||||
class HopperTileEntity;
|
||||
class MinecartHopper;
|
||||
class EntityHorse;
|
||||
class BeaconTileEntity;
|
||||
class LocalPlayer;
|
||||
class DLCPack;
|
||||
class LevelRuleset;
|
||||
@@ -87,9 +92,9 @@ public:
|
||||
|
||||
#ifdef _EXTENDED_ACHIEVEMENTS
|
||||
/* 4J-JEV:
|
||||
* We need more space in the profile data because of the new achievements and statistics
|
||||
* necessary for the new expanded achievement set.
|
||||
*/
|
||||
* We need more space in the profile data because of the new achievements and statistics
|
||||
* necessary for the new expanded achievement set.
|
||||
*/
|
||||
static const int GAME_DEFINED_PROFILE_DATA_BYTES = 2*972; // per user
|
||||
#else
|
||||
static const int GAME_DEFINED_PROFILE_DATA_BYTES = 972; // per user
|
||||
@@ -108,7 +113,7 @@ public:
|
||||
static const int USER_RR = 5;
|
||||
static const int USER_SR = 6;
|
||||
static const int USER_UI = 7; // 4J Stu - This also makes it appear on the UI console
|
||||
|
||||
|
||||
void HandleButtonPresses();
|
||||
bool IntroRunning() { return m_bIntroRunning;}
|
||||
void SetIntroRunning(bool bSet) {m_bIntroRunning=bSet;}
|
||||
@@ -127,23 +132,30 @@ public:
|
||||
int GetLocalPlayerCount(void);
|
||||
bool LoadInventoryMenu(int iPad,shared_ptr<LocalPlayer> player, bool bNavigateBack=false);
|
||||
bool LoadCreativeMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack=false);
|
||||
bool LoadEnchantingMenu(int iPad,shared_ptr<Inventory> inventory, int x, int y, int z, Level *level);
|
||||
bool LoadEnchantingMenu(int iPad,shared_ptr<Inventory> inventory, int x, int y, int z, Level *level, const wstring &name);
|
||||
bool LoadFurnaceMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<FurnaceTileEntity> furnace);
|
||||
bool LoadBrewingStandMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<BrewingStandTileEntity> brewingStand);
|
||||
bool LoadContainerMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<Container> container);
|
||||
bool LoadTrapMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<DispenserTileEntity> trap);
|
||||
bool LoadCrafting2x2Menu(int iPad,shared_ptr<LocalPlayer> player);
|
||||
bool LoadCrafting3x3Menu(int iPad,shared_ptr<LocalPlayer> player, int x, int y, int z);
|
||||
bool LoadFireworksMenu(int iPad,shared_ptr<LocalPlayer> player, int x, int y, int z);
|
||||
bool LoadSignEntryMenu(int iPad,shared_ptr<SignTileEntity> sign);
|
||||
bool LoadRepairingMenu(int iPad,shared_ptr<Inventory> inventory, Level *level, int x, int y, int z);
|
||||
bool LoadTradingMenu(int iPad, shared_ptr<Inventory> inventory, shared_ptr<Merchant> trader, Level *level);
|
||||
bool LoadTradingMenu(int iPad, shared_ptr<Inventory> inventory, shared_ptr<Merchant> trader, Level *level, const wstring &name);
|
||||
|
||||
bool LoadCommandBlockMenu(int iPad, shared_ptr<CommandBlockEntity> commandBlock) { return false; }
|
||||
bool LoadHopperMenu(int iPad ,shared_ptr<Inventory> inventory, shared_ptr<HopperTileEntity> hopper);
|
||||
bool LoadHopperMenu(int iPad ,shared_ptr<Inventory> inventory, shared_ptr<MinecartHopper> hopper);
|
||||
bool LoadHorseMenu(int iPad ,shared_ptr<Inventory> inventory, shared_ptr<Container> container, shared_ptr<EntityHorse> horse);
|
||||
bool LoadBeaconMenu(int iPad ,shared_ptr<Inventory> inventory, shared_ptr<BeaconTileEntity> beacon);
|
||||
|
||||
bool GetTutorialMode() { return m_bTutorialMode;}
|
||||
void SetTutorialMode(bool bSet) {m_bTutorialMode=bSet;}
|
||||
|
||||
void SetSpecialTutorialCompletionFlag(int iPad, int index);
|
||||
|
||||
static LPCWSTR GetString(int iID);
|
||||
static LPCWSTR GetString(int iID);
|
||||
|
||||
eGameMode GetGameMode() { return m_eGameMode;}
|
||||
void SetGameMode(eGameMode eMode) { m_eGameMode=eMode;}
|
||||
@@ -159,7 +171,7 @@ public:
|
||||
void SetXuiServerAction(int iPad, eXuiServerAction action, LPVOID param = NULL) {m_eXuiServerAction[iPad]=action; m_eXuiServerActionParam[iPad] = param;}
|
||||
eXuiServerAction GetGlobalXuiServerAction() {return m_eGlobalXuiServerAction;}
|
||||
void SetGlobalXuiServerAction(eXuiServerAction action) {m_eGlobalXuiServerAction=action;}
|
||||
|
||||
|
||||
DisconnectPacket::eDisconnectReason GetDisconnectReason() { return m_disconnectReason; }
|
||||
void SetDisconnectReason(DisconnectPacket::eDisconnectReason bVal) { m_disconnectReason = bVal; }
|
||||
|
||||
@@ -206,6 +218,7 @@ public:
|
||||
static int OldProfileVersionCallback(LPVOID pParam,unsigned char *pucData, const unsigned short usVersion, const int iPad);
|
||||
|
||||
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__ )
|
||||
wstring toStringOptionsStatus(const C4JStorage::eOptionsCallback &eStatus);
|
||||
static int DefaultOptionsCallback(LPVOID pParam,C4JStorage::PROFILESETTINGS *pSettings, const int iPad);
|
||||
int SetDefaultOptions(C4JStorage::PROFILESETTINGS *pSettings,const int iPad,bool bWriteProfile=true);
|
||||
#ifdef __ORBIS__
|
||||
@@ -224,7 +237,7 @@ public:
|
||||
#endif
|
||||
virtual void SetRichPresenceContext(int iPad, int contextId) = 0;
|
||||
|
||||
|
||||
|
||||
void SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucVal);
|
||||
unsigned char GetGameSettings(int iPad,eGameSetting eVal);
|
||||
unsigned char GetGameSettings(eGameSetting eVal); // for the primary pad
|
||||
@@ -247,7 +260,8 @@ public:
|
||||
// Minecraft language select
|
||||
void SetMinecraftLanguage(int iPad, unsigned char ucLanguage);
|
||||
unsigned char GetMinecraftLanguage(int iPad);
|
||||
|
||||
void SetMinecraftLocale(int iPad, unsigned char ucLanguage);
|
||||
unsigned char GetMinecraftLocale(int iPad);
|
||||
|
||||
// 4J-PB - set a timer when the user navigates the quickselect, so we can bring the opacity back to defaults for a short time
|
||||
unsigned int GetOpacityTimer(int iPad) { return m_uiOpacityCountDown[iPad]; }
|
||||
@@ -301,9 +315,11 @@ public:
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG_MENUS_ENABLED
|
||||
bool DebugSettingsOn() { return m_bDebugOptions;}
|
||||
bool DebugSettingsOn() { return m_bDebugOptions;}
|
||||
bool DebugArtToolsOn();
|
||||
#else
|
||||
bool DebugSettingsOn() { return false;}
|
||||
bool DebugSettingsOn() { return false;}
|
||||
bool DebugArtToolsOn() { return false;}
|
||||
#endif
|
||||
void SetDebugSequence(const char *pchSeq);
|
||||
static int DebugInputCallback(LPVOID pParam);
|
||||
@@ -424,10 +440,10 @@ public:
|
||||
byteArray getArchiveFile(const wstring &filename);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
static int BannedLevelDialogReturned(void *pParam,int iPad,const C4JStorage::EMessageResult);
|
||||
static int TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
|
||||
|
||||
VBANNEDLIST *m_vBannedListA[XUSER_MAX_COUNT];
|
||||
|
||||
void HandleButtonPresses(int iPad);
|
||||
@@ -440,7 +456,7 @@ private:
|
||||
|
||||
// Container scene for some menu
|
||||
|
||||
// CXuiScene debugContainerScene;
|
||||
// CXuiScene debugContainerScene;
|
||||
|
||||
|
||||
//bool m_bSplitScreenEnabled;
|
||||
@@ -482,14 +498,14 @@ public:
|
||||
|
||||
static const DWORD m_dwOfferID = 0x00000001;
|
||||
|
||||
// timer
|
||||
// timer
|
||||
void InitTime();
|
||||
void UpdateTime();
|
||||
|
||||
// trial timer
|
||||
void SetTrialTimerStart(void);
|
||||
float getTrialTimer(void);
|
||||
|
||||
|
||||
// notifications from the game for qnet
|
||||
VNOTIFICATIONS *GetNotifications() {return &m_vNotifications;}
|
||||
|
||||
@@ -599,7 +615,7 @@ public:
|
||||
unsigned int GetDLCCreditsCount();
|
||||
SCreditTextItemDef * GetDLCCredits(int iIndex);
|
||||
|
||||
// TMS
|
||||
// TMS
|
||||
void ReadDLCFileFromTMS(int iPad,eTMSAction action, bool bCallback=false);
|
||||
void ReadXuidsFileFromTMS(int iPad,eTMSAction action,bool bCallback=false);
|
||||
|
||||
@@ -633,8 +649,8 @@ private:
|
||||
static unordered_map<ULONGLONG,DLC_INFO * > DLCInfo_Full; // full offerid, dlc_info
|
||||
static unordered_map<wstring, ULONGLONG > DLCInfo_SkinName; // skin name, full offer id
|
||||
#endif
|
||||
// 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_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_bDefaultCapeInstallAttempted; // have we attempted to install the default cape from tms
|
||||
|
||||
@@ -651,13 +667,13 @@ public:
|
||||
XUSER_SIGNIN_INFO m_currentSigninInfo[XUSER_MAX_COUNT];
|
||||
|
||||
//void OverrideFontRenderer(bool set, bool immediate = true);
|
||||
// void ToggleFontRenderer() { OverrideFontRenderer(!m_bFontRendererOverridden,false); }
|
||||
// void ToggleFontRenderer() { OverrideFontRenderer(!m_bFontRendererOverridden,false); }
|
||||
BANNEDLIST BannedListA[XUSER_MAX_COUNT];
|
||||
|
||||
private:
|
||||
// XUI_FontRenderer *m_fontRenderer;
|
||||
// bool m_bFontRendererOverridden;
|
||||
// bool m_bOverrideFontRenderer;
|
||||
// XUI_FontRenderer *m_fontRenderer;
|
||||
// bool m_bFontRendererOverridden;
|
||||
// bool m_bOverrideFontRenderer;
|
||||
|
||||
|
||||
bool m_bRead_BannedListA[XUSER_MAX_COUNT];
|
||||
@@ -667,7 +683,7 @@ private:
|
||||
public:
|
||||
void SetBanListCheck(int iPad,bool bVal) {m_BanListCheck[iPad]=bVal;}
|
||||
bool GetBanListCheck(int iPad) { return m_BanListCheck[iPad];}
|
||||
// AUTOSAVE
|
||||
// AUTOSAVE
|
||||
public:
|
||||
void SetAutosaveTimerTime(void);
|
||||
bool AutosaveDue(void);
|
||||
@@ -685,6 +701,11 @@ private:
|
||||
unsigned int m_uiGameHostSettings;
|
||||
static unsigned char m_szPNG[8];
|
||||
|
||||
#ifdef _LARGE_WORLDS
|
||||
unsigned int m_GameNewWorldSize;
|
||||
bool m_bGameNewWorldSizeUseMoat;
|
||||
unsigned int m_GameNewHellScale;
|
||||
#endif
|
||||
unsigned int FromBigEndian(unsigned int uiValue);
|
||||
|
||||
public:
|
||||
@@ -695,6 +716,13 @@ public:
|
||||
unsigned int GetGameHostOption(eGameHostOption eVal);
|
||||
unsigned int GetGameHostOption(unsigned int uiHostSettings, eGameHostOption eVal);
|
||||
|
||||
#ifdef _LARGE_WORLDS
|
||||
void SetGameNewWorldSize(unsigned int newSize, bool useMoat) { m_GameNewWorldSize = newSize; m_bGameNewWorldSizeUseMoat = useMoat; }
|
||||
unsigned int GetGameNewWorldSize() { return m_GameNewWorldSize; }
|
||||
unsigned int GetGameNewWorldSizeUseMoat() { return m_bGameNewWorldSizeUseMoat; }
|
||||
void SetGameNewHellScale(unsigned int newScale) { m_GameNewHellScale = newScale; }
|
||||
unsigned int GetGameNewHellScale() { return m_GameNewHellScale; }
|
||||
#endif
|
||||
void SetResetNether(bool bResetNether) {m_bResetNether=bResetNether;}
|
||||
bool GetResetNether() {return m_bResetNether;}
|
||||
bool CanRecordStatsAndAchievements();
|
||||
@@ -808,9 +836,9 @@ public:
|
||||
DWORD m_dwDLCFileSize;
|
||||
BYTE *m_pDLCFileBuffer;
|
||||
|
||||
// static int CallbackReadXuidsFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction);
|
||||
// static int CallbackDLCFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction);
|
||||
// static int CallbackBannedListFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction);
|
||||
// static int CallbackReadXuidsFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction);
|
||||
// static int CallbackDLCFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction);
|
||||
// static int CallbackBannedListFileFromTMS(LPVOID lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction);
|
||||
|
||||
// Storing additional model parts per skin texture
|
||||
void SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, DWORD dwSkinBoxC);
|
||||
@@ -875,27 +903,27 @@ public:
|
||||
|
||||
void SetTickTMSDLCFiles(bool bVal);
|
||||
|
||||
wstring getFilePath(DWORD packId, wstring filename, bool bAddDataFolder);
|
||||
wstring getFilePath(DWORD packId, wstring filename, bool bAddDataFolder, wstring mountPoint = L"TPACK:");
|
||||
|
||||
private:
|
||||
unordered_map<int, wstring>m_localeA;
|
||||
unordered_map<wstring, int>m_eMCLangA;
|
||||
unordered_map<wstring, int>m_xcLangA;
|
||||
wstring getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder);
|
||||
unordered_map<int, wstring>m_localeA;
|
||||
unordered_map<wstring, int>m_eMCLangA;
|
||||
unordered_map<wstring, int>m_xcLangA;
|
||||
wstring getRootPath(DWORD packId, bool allowOverride, bool bAddDataFolder, wstring mountPoint);
|
||||
public:
|
||||
|
||||
#ifdef _XBOX
|
||||
// bool m_bTransferSavesToXboxOne;
|
||||
// unsigned int m_uiTransferSlotC;
|
||||
|
||||
// bool m_bTransferSavesToXboxOne;
|
||||
// unsigned int m_uiTransferSlotC;
|
||||
|
||||
#elif defined (__PS3__)
|
||||
|
||||
|
||||
#elif defined _DURANGO
|
||||
|
||||
|
||||
#elif defined _WINDOWS64
|
||||
//CMinecraftAudio audio;
|
||||
#else // PS4
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _XBOX_ONE
|
||||
|
||||
@@ -91,6 +91,28 @@ void DLCManager::removePack(DLCPack *pack)
|
||||
}
|
||||
}
|
||||
|
||||
void DLCManager::removeAllPacks(void)
|
||||
{
|
||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||
{
|
||||
DLCPack *pack = (DLCPack *)*it;
|
||||
delete pack;
|
||||
}
|
||||
|
||||
m_packs.clear();
|
||||
}
|
||||
|
||||
void DLCManager::LanguageChanged(void)
|
||||
{
|
||||
for(AUTO_VAR(it, m_packs.begin()); it != m_packs.end(); ++it)
|
||||
{
|
||||
DLCPack *pack = (DLCPack *)*it;
|
||||
// update the language
|
||||
pack->UpdateLanguage();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DLCPack *DLCManager::getPack(const wstring &name)
|
||||
{
|
||||
DLCPack *pack = NULL;
|
||||
@@ -292,12 +314,12 @@ DWORD DLCManager::checkForCorruptDLCAndAlert(bool showMessage /*= true*/)
|
||||
WCHAR wchFormat[132];
|
||||
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.RequestErrorMessage( IDS_CORRUPT_DLC_TITLE, IDS_CORRUPT_DLC, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL,wchFormat);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
C4JStorage::EMessageResult result = ui.RequestMessageBox( IDS_CORRUPT_DLC_TITLE, IDS_CORRUPT_DLC_MULTIPLE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable());
|
||||
C4JStorage::EMessageResult result = ui.RequestErrorMessage( IDS_CORRUPT_DLC_TITLE, IDS_CORRUPT_DLC_MULTIPLE, uiIDA,1,ProfileManager.GetPrimaryPad());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,6 +74,8 @@ public:
|
||||
|
||||
void addPack(DLCPack *pack);
|
||||
void removePack(DLCPack *pack);
|
||||
void removeAllPacks(void);
|
||||
void LanguageChanged(void);
|
||||
|
||||
DLCPack *getPack(const wstring &name);
|
||||
#ifdef _XBOX_ONE
|
||||
|
||||
@@ -191,7 +191,8 @@ DLCFile *DLCPack::addFile(DLCManager::EDLCType type, const wstring &path)
|
||||
{
|
||||
case DLCManager::e_DLCType_Skin:
|
||||
{
|
||||
std::vector<std::wstring> splitPath = stringSplit(path,L'/');
|
||||
wstring newPath = replaceAll(path, L"\\", L"/");
|
||||
std::vector<std::wstring> splitPath = stringSplit(newPath,L'/');
|
||||
wstring strippedPath = splitPath.back();
|
||||
|
||||
newFile = new DLCSkinFile(strippedPath);
|
||||
@@ -211,7 +212,8 @@ DLCFile *DLCPack::addFile(DLCManager::EDLCType type, const wstring &path)
|
||||
break;
|
||||
case DLCManager::e_DLCType_Cape:
|
||||
{
|
||||
std::vector<std::wstring> splitPath = stringSplit(path,L'/');
|
||||
wstring newPath = replaceAll(path, L"\\", L"/");
|
||||
std::vector<std::wstring> splitPath = stringSplit(newPath,L'/');
|
||||
wstring strippedPath = splitPath.back();
|
||||
newFile = new DLCCapeFile(strippedPath);
|
||||
}
|
||||
@@ -411,3 +413,19 @@ bool DLCPack::hasPurchasedFile(DLCManager::EDLCType type, const wstring &path)
|
||||
return true;
|
||||
}*/
|
||||
}
|
||||
|
||||
void DLCPack::UpdateLanguage()
|
||||
{
|
||||
// find the language file
|
||||
DLCManager::e_DLCType_LocalisationData;
|
||||
DLCFile *file = NULL;
|
||||
|
||||
if(m_files[DLCManager::e_DLCType_LocalisationData].size() > 0)
|
||||
{
|
||||
file = m_files[DLCManager::e_DLCType_LocalisationData][0];
|
||||
DLCLocalisationFile *localisationFile = (DLCLocalisationFile *)getFile(DLCManager::e_DLCType_LocalisationData, L"languages.loc");
|
||||
StringTable *strTable = localisationFile->getStringTable();
|
||||
strTable->ReloadStringTable();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -68,6 +68,8 @@ public:
|
||||
DWORD getLicenseMask( ) { return m_dwLicenseMask; }
|
||||
|
||||
wstring getName() { return m_packName; }
|
||||
|
||||
void UpdateLanguage();
|
||||
#ifdef _XBOX_ONE
|
||||
wstring getPurchaseOfferId() { return m_wsProductId; }
|
||||
#else
|
||||
|
||||
@@ -30,6 +30,7 @@ void DLCTextureFile::addParameter(DLCManager::EDLCParameterType type, const wstr
|
||||
{
|
||||
case DLCManager::e_DLCParamType_Anim:
|
||||
m_animString = value;
|
||||
if(m_animString.empty()) m_animString = L",";
|
||||
m_bIsAnim = true;
|
||||
|
||||
break;
|
||||
|
||||
@@ -35,4 +35,8 @@ public:
|
||||
bool checkIntersects(int x0, int y0, int z0, int x1, int y1, int z1);
|
||||
|
||||
virtual int getMinY();
|
||||
|
||||
EStructurePiece GetType() { return (EStructurePiece)0; }
|
||||
void addAdditonalSaveData(CompoundTag *tag) {}
|
||||
void readAdditonalSaveData(CompoundTag *tag) {}
|
||||
};
|
||||
@@ -278,7 +278,7 @@ __int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB
|
||||
//{
|
||||
// if(blockData[i] == Tile::sand_Id || blockData[i] == Tile::sandStone_Id)
|
||||
// {
|
||||
// blockData[i] = Tile::whiteStone_Id;
|
||||
// blockData[i] = Tile::endStone_Id;
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -706,15 +706,19 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
||||
shared_ptr<Entity> e = *it;
|
||||
|
||||
bool mobCanBeSaved = false;
|
||||
if(bSaveMobs)
|
||||
if (bSaveMobs)
|
||||
{
|
||||
if( ( e->GetType() & eTYPE_MONSTER ) || ( e->GetType() & eTYPE_WATERANIMAL ) || ( e->GetType() & eTYPE_ANIMAL ) ||
|
||||
( e->GetType() == eTYPE_CHICKEN ) || ( e->GetType() == eTYPE_WOLF ) || ( e->GetType() == eTYPE_VILLAGER) || ( e->GetType() == eTYPE_MUSHROOMCOW ) )
|
||||
if ( e->instanceof(eTYPE_MONSTER) || e->instanceof(eTYPE_WATERANIMAL) || e->instanceof(eTYPE_ANIMAL) || (e->GetType() == eTYPE_VILLAGER) )
|
||||
|
||||
// 4J-JEV: All these are derived from eTYPE_ANIMAL and true implicitly.
|
||||
//|| ( e->GetType() == eTYPE_CHICKEN ) || ( e->GetType() == eTYPE_WOLF ) || ( e->GetType() == eTYPE_MUSHROOMCOW ) )
|
||||
{
|
||||
mobCanBeSaved = true;
|
||||
}
|
||||
}
|
||||
if(mobCanBeSaved || e->GetType() == eTYPE_MINECART || e->GetType() == eTYPE_BOAT || e->GetType() == eTYPE_PAINTING || e->GetType() == eTYPE_ITEM_FRAME)
|
||||
|
||||
// 4J-JEV: Changed to check for instances of minecarts and hangingEntities instead of just eTYPE_PAINTING, eTYPE_ITEM_FRAME and eTYPE_MINECART
|
||||
if (mobCanBeSaved || e->instanceof(eTYPE_MINECART) || e->GetType() == eTYPE_BOAT || e->instanceof(eTYPE_HANGING_ENTITY))
|
||||
{
|
||||
CompoundTag *eTag = new CompoundTag();
|
||||
if( e->save(eTag) )
|
||||
@@ -725,7 +729,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
||||
pos->get(1)->data -= yStart;
|
||||
pos->get(2)->data -= zStart;
|
||||
|
||||
if( e->GetType() == eTYPE_PAINTING || e->GetType() == eTYPE_ITEM_FRAME )
|
||||
if( e->instanceof(eTYPE_HANGING_ENTITY) )
|
||||
{
|
||||
((IntTag *) eTag->get(L"TileX") )->data -= xStart;
|
||||
((IntTag *) eTag->get(L"TileY") )->data -= yStart;
|
||||
|
||||
@@ -106,17 +106,14 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
|
||||
DWORD dSize;
|
||||
byte *dData = dlcHeader->getData(dSize);
|
||||
|
||||
LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions();
|
||||
LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions(pack);
|
||||
// = loadGameRules(dData, dSize); //, strings);
|
||||
|
||||
createdLevelGenerationOptions->setGrSource( dlcHeader );
|
||||
createdLevelGenerationOptions->setSrc( LevelGenerationOptions::eSrc_fromDLC );
|
||||
|
||||
readRuleFile(createdLevelGenerationOptions, dData, dSize, strings);
|
||||
|
||||
createdLevelGenerationOptions->setSrc( LevelGenerationOptions::eSrc_fromDLC );
|
||||
|
||||
|
||||
//createdLevelGenerationOptions->setSrc( LevelGenerationOptions::eSrc_fromDLC );
|
||||
dlcHeader->lgo = createdLevelGenerationOptions;
|
||||
}
|
||||
|
||||
@@ -128,15 +125,13 @@ void GameRuleManager::loadGameRules(DLCPack *pack)
|
||||
DWORD dSize;
|
||||
byte *dData = dlcFile->getData(dSize);
|
||||
|
||||
LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions();
|
||||
LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions(pack);
|
||||
// = loadGameRules(dData, dSize); //, strings);
|
||||
|
||||
createdLevelGenerationOptions->setGrSource( new JustGrSource() );
|
||||
readRuleFile(createdLevelGenerationOptions, dData, dSize, strings);
|
||||
|
||||
createdLevelGenerationOptions->setSrc( LevelGenerationOptions::eSrc_tutorial );
|
||||
|
||||
//createdLevelGenerationOptions->set_DLCGameRulesFile( dlcFile );
|
||||
|
||||
readRuleFile(createdLevelGenerationOptions, dData, dSize, strings);
|
||||
|
||||
createdLevelGenerationOptions->setLoadedData();
|
||||
}
|
||||
@@ -659,6 +654,25 @@ void GameRuleManager::loadDefaultGameRules()
|
||||
|
||||
#else // _XBOX
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
File packedTutorialFile(L"Windows64Media\\Tutorial\\Tutorial.pck");
|
||||
if(!packedTutorialFile.exists()) packedTutorialFile = File(L"Windows64\\Tutorial\\Tutorial.pck");
|
||||
#elif defined(__ORBIS__)
|
||||
File packedTutorialFile(L"/app0/orbis/Tutorial/Tutorial.pck");
|
||||
#elif defined(__PSVITA__)
|
||||
File packedTutorialFile(L"PSVita/Tutorial/Tutorial.pck");
|
||||
#elif defined(__PS3__)
|
||||
File packedTutorialFile(L"PS3/Tutorial/Tutorial.pck");
|
||||
#else
|
||||
File packedTutorialFile(L"Tutorial\\Tutorial.pck");
|
||||
#endif
|
||||
if(loadGameRulesPack(&packedTutorialFile))
|
||||
{
|
||||
m_levelGenerators.getLevelGenerators()->at(0)->setWorldName(app.GetString(IDS_PLAY_TUTORIAL));
|
||||
//m_levelGenerators.getLevelGenerators()->at(0)->setDefaultSaveName(L"Tutorial");
|
||||
m_levelGenerators.getLevelGenerators()->at(0)->setDefaultSaveName(app.GetString(IDS_TUTORIALSAVENAME));
|
||||
}
|
||||
#if 0
|
||||
wstring fpTutorial = L"Tutorial.pck";
|
||||
if(app.getArchiveFileSize(fpTutorial) >= 0)
|
||||
{
|
||||
@@ -667,25 +681,18 @@ void GameRuleManager::loadDefaultGameRules()
|
||||
if ( app.m_dlcManager.readDLCDataFile(dwFilesProcessed,fpTutorial,pack,true) )
|
||||
{
|
||||
app.m_dlcManager.addPack(pack);
|
||||
m_levelGenerators.getLevelGenerators()->at(0)->setWorldName(app.GetString(IDS_PLAY_TUTORIAL));
|
||||
m_levelGenerators.getLevelGenerators()->at(0)->setDefaultSaveName(app.GetString(IDS_TUTORIALSAVENAME));
|
||||
//m_levelGenerators.getLevelGenerators()->at(0)->setWorldName(app.GetString(IDS_PLAY_TUTORIAL));
|
||||
//m_levelGenerators.getLevelGenerators()->at(0)->setDefaultSaveName(app.GetString(IDS_TUTORIALSAVENAME));
|
||||
}
|
||||
else delete pack;
|
||||
}
|
||||
/*StringTable *strings = new StringTable(baStrings.data, baStrings.length);
|
||||
LevelGenerationOptions *lgo = new LevelGenerationOptions();
|
||||
lgo->setGrSource( new JustGrSource() );
|
||||
lgo->setSrc( LevelGenerationOptions::eSrc_tutorial );
|
||||
readRuleFile(lgo, tutorial.data, tutorial.length, strings);
|
||||
lgo->setLoadedData();*/
|
||||
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GameRuleManager::loadGameRulesPack(File *path)
|
||||
{
|
||||
bool success = false;
|
||||
#ifdef _XBOX
|
||||
if(path->exists())
|
||||
{
|
||||
DLCPack *pack = new DLCPack(L"",0xffffffff);
|
||||
@@ -700,12 +707,13 @@ bool GameRuleManager::loadGameRulesPack(File *path)
|
||||
delete pack;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return success;
|
||||
}
|
||||
|
||||
void GameRuleManager::setLevelGenerationOptions(LevelGenerationOptions *levelGen)
|
||||
{
|
||||
unloadCurrentGameRules();
|
||||
|
||||
m_currentGameRuleDefinitions = NULL;
|
||||
m_currentLevelGenerationOptions = levelGen;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.phys.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.level.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.level.chunk.h"
|
||||
#include "Common\DLC\DLCGameRulesHeader.h"
|
||||
#include "..\..\StringTable.h"
|
||||
#include "LevelGenerationOptions.h"
|
||||
#include "ConsoleGameRules.h"
|
||||
@@ -41,7 +42,7 @@ void JustGrSource::setBaseSavePath(const wstring &x) { m_baseSavePath = x; m_bRe
|
||||
|
||||
bool JustGrSource::ready() { return true; }
|
||||
|
||||
LevelGenerationOptions::LevelGenerationOptions()
|
||||
LevelGenerationOptions::LevelGenerationOptions(DLCPack *parentPack)
|
||||
{
|
||||
m_spawnPos = NULL;
|
||||
m_stringTable = NULL;
|
||||
@@ -49,6 +50,7 @@ LevelGenerationOptions::LevelGenerationOptions()
|
||||
m_hasLoadedData = false;
|
||||
|
||||
m_seed = 0;
|
||||
m_bHasBeenInCreative = true;
|
||||
m_useFlatWorld = false;
|
||||
m_bHaveMinY = false;
|
||||
m_minY = INT_MAX;
|
||||
@@ -56,6 +58,9 @@ LevelGenerationOptions::LevelGenerationOptions()
|
||||
|
||||
m_pbBaseSaveData = NULL;
|
||||
m_dwBaseSaveSize = 0;
|
||||
|
||||
m_parentDLCPack = parentPack;
|
||||
m_bLoadingData = false;
|
||||
}
|
||||
|
||||
LevelGenerationOptions::~LevelGenerationOptions()
|
||||
@@ -70,17 +75,17 @@ LevelGenerationOptions::~LevelGenerationOptions()
|
||||
{
|
||||
delete *it;
|
||||
}
|
||||
|
||||
|
||||
for(AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); ++it)
|
||||
{
|
||||
delete *it;
|
||||
}
|
||||
|
||||
|
||||
for(AUTO_VAR(it, m_features.begin()); it != m_features.end(); ++it)
|
||||
{
|
||||
delete *it;
|
||||
}
|
||||
|
||||
|
||||
if (m_stringTable)
|
||||
if (!isTutorial())
|
||||
delete m_stringTable;
|
||||
@@ -93,7 +98,7 @@ ConsoleGameRules::EGameRuleType LevelGenerationOptions::getActionType() { return
|
||||
void LevelGenerationOptions::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
||||
{
|
||||
GameRuleDefinition::writeAttributes(dos, numAttrs + 5);
|
||||
|
||||
|
||||
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_spawnX);
|
||||
dos->writeUTF(_toString(m_spawnPos->x));
|
||||
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_spawnY);
|
||||
@@ -110,12 +115,12 @@ void LevelGenerationOptions::writeAttributes(DataOutputStream *dos, UINT numAttr
|
||||
void LevelGenerationOptions::getChildren(vector<GameRuleDefinition *> *children)
|
||||
{
|
||||
GameRuleDefinition::getChildren(children);
|
||||
|
||||
|
||||
vector<ApplySchematicRuleDefinition *> used_schematics;
|
||||
for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); it++)
|
||||
if ( !(*it)->isComplete() )
|
||||
used_schematics.push_back( *it );
|
||||
|
||||
|
||||
for(AUTO_VAR(it, m_structureRules.begin()); it!=m_structureRules.end(); it++)
|
||||
children->push_back( *it );
|
||||
for(AUTO_VAR(it, used_schematics.begin()); it!=used_schematics.end(); it++)
|
||||
@@ -190,24 +195,24 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws
|
||||
{
|
||||
if(attributeValue.compare(L"true") == 0) m_useFlatWorld = true;
|
||||
app.DebugPrintf("LevelGenerationOptions: Adding parameter flatworld=%s\n",m_useFlatWorld?"TRUE":"FALSE");
|
||||
}
|
||||
}
|
||||
else if(attributeName.compare(L"saveName") == 0)
|
||||
{
|
||||
wstring string(getString(attributeValue));
|
||||
wstring string(attributeValue);
|
||||
if(!string.empty()) setDefaultSaveName( string );
|
||||
else setDefaultSaveName( attributeValue );
|
||||
app.DebugPrintf("LevelGenerationOptions: Adding parameter saveName=%ls\n", getDefaultSaveName().c_str());
|
||||
}
|
||||
else if(attributeName.compare(L"worldName") == 0)
|
||||
{
|
||||
wstring string(getString(attributeValue));
|
||||
wstring string(attributeValue);
|
||||
if(!string.empty()) setWorldName( string );
|
||||
else setWorldName( attributeValue );
|
||||
app.DebugPrintf("LevelGenerationOptions: Adding parameter worldName=%ls\n", getWorldName());
|
||||
}
|
||||
else if(attributeName.compare(L"displayName") == 0)
|
||||
{
|
||||
wstring string(getString(attributeValue));
|
||||
wstring string(attributeValue);
|
||||
if(!string.empty()) setDisplayName( string );
|
||||
else setDisplayName( attributeValue );
|
||||
app.DebugPrintf("LevelGenerationOptions: Adding parameter displayName=%ls\n", getDisplayName());
|
||||
@@ -228,6 +233,12 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws
|
||||
setBaseSavePath( attributeValue );
|
||||
app.DebugPrintf("LevelGenerationOptions: Adding parameter baseSaveName=%ls\n", getBaseSavePath().c_str());
|
||||
}
|
||||
else if(attributeName.compare(L"hasBeenInCreative") == 0)
|
||||
{
|
||||
bool value = _fromString<bool>(attributeValue);
|
||||
m_bHasBeenInCreative = value;
|
||||
app.DebugPrintf("LevelGenerationOptions: Adding parameter gameMode=%d\n", m_bHasBeenInCreative);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameRuleDefinition::addAttribute(attributeName, attributeValue);
|
||||
@@ -297,7 +308,7 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1, int
|
||||
|
||||
m_bHaveMinY = true;
|
||||
}
|
||||
|
||||
|
||||
// 4J Stu - We DO NOT intersect if our upper bound is below the lower bound for all schematics
|
||||
if( y1 < m_minY ) return false;
|
||||
|
||||
@@ -413,14 +424,14 @@ void LevelGenerationOptions::getBiomeOverride(int biomeId, BYTE &tile, BYTE &top
|
||||
}
|
||||
}
|
||||
|
||||
bool LevelGenerationOptions::isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature)
|
||||
bool LevelGenerationOptions::isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature, int *orientation)
|
||||
{
|
||||
bool isFeature = false;
|
||||
|
||||
for(AUTO_VAR(it, m_features.begin()); it != m_features.end(); ++it)
|
||||
{
|
||||
StartFeature *sf = *it;
|
||||
if(sf->isFeatureChunk(chunkX, chunkZ, feature))
|
||||
if(sf->isFeatureChunk(chunkX, chunkZ, feature, orientation))
|
||||
{
|
||||
isFeature = true;
|
||||
break;
|
||||
@@ -442,15 +453,175 @@ unordered_map<wstring, ConsoleSchematicFile *> *LevelGenerationOptions::getUnfin
|
||||
= new unordered_map<wstring, ConsoleSchematicFile *>();
|
||||
for (AUTO_VAR(it, usedFiles.begin()); it!=usedFiles.end(); it++)
|
||||
out->insert( pair<wstring, ConsoleSchematicFile *>(*it, getSchematicFile(*it)) );
|
||||
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
void LevelGenerationOptions::loadBaseSaveData()
|
||||
{
|
||||
int mountIndex = -1;
|
||||
if(m_parentDLCPack != NULL) mountIndex = m_parentDLCPack->GetDLCMountIndex();
|
||||
|
||||
if(mountIndex > -1)
|
||||
{
|
||||
#ifdef _DURANGO
|
||||
if(StorageManager.MountInstalledDLC(ProfileManager.GetPrimaryPad(),mountIndex,&LevelGenerationOptions::packMounted,this,L"WPACK")!=ERROR_IO_PENDING)
|
||||
#else
|
||||
if(StorageManager.MountInstalledDLC(ProfileManager.GetPrimaryPad(),mountIndex,&LevelGenerationOptions::packMounted,this,"WPACK")!=ERROR_IO_PENDING)
|
||||
#endif
|
||||
{
|
||||
// corrupt DLC
|
||||
setLoadedData();
|
||||
app.DebugPrintf("Failed to mount LGO DLC %d for pad %d\n",mountIndex,ProfileManager.GetPrimaryPad());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bLoadingData = true;
|
||||
app.DebugPrintf("Attempted to mount DLC data for LGO %d\n", mountIndex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setLoadedData();
|
||||
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ReloadTexturePack);
|
||||
}
|
||||
}
|
||||
|
||||
int LevelGenerationOptions::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask)
|
||||
{
|
||||
LevelGenerationOptions *lgo = (LevelGenerationOptions *)pParam;
|
||||
lgo->m_bLoadingData = false;
|
||||
if(dwErr!=ERROR_SUCCESS)
|
||||
{
|
||||
// corrupt DLC
|
||||
app.DebugPrintf("Failed to mount LGO DLC for pad %d: %d\n",iPad,dwErr);
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Mounted DLC for LGO, attempting to load data\n");
|
||||
DWORD dwFilesProcessed = 0;
|
||||
int gameRulesCount = lgo->m_parentDLCPack->getDLCItemsCount(DLCManager::e_DLCType_GameRulesHeader);
|
||||
for(int i = 0; i < gameRulesCount; ++i)
|
||||
{
|
||||
DLCGameRulesHeader *dlcFile = (DLCGameRulesHeader *) lgo->m_parentDLCPack->getFile(DLCManager::e_DLCType_GameRulesHeader, i);
|
||||
|
||||
if (!dlcFile->getGrfPath().empty())
|
||||
{
|
||||
File grf( app.getFilePath(lgo->m_parentDLCPack->GetPackID(), dlcFile->getGrfPath(),true, L"WPACK:" ) );
|
||||
if (grf.exists())
|
||||
{
|
||||
#ifdef _UNICODE
|
||||
wstring path = grf.getPath();
|
||||
const WCHAR *pchFilename=path.c_str();
|
||||
HANDLE fileHandle = CreateFile(
|
||||
pchFilename, // file name
|
||||
GENERIC_READ, // access mode
|
||||
0, // share mode // TODO 4J Stu - Will we need to share file? Probably not but...
|
||||
NULL, // Unused
|
||||
OPEN_EXISTING , // how to create // TODO 4J Stu - Assuming that the file already exists if we are opening to read from it
|
||||
FILE_FLAG_SEQUENTIAL_SCAN, // file attributes
|
||||
NULL // Unsupported
|
||||
);
|
||||
#else
|
||||
const char *pchFilename=wstringtofilename(grf.getPath());
|
||||
HANDLE fileHandle = CreateFile(
|
||||
pchFilename, // file name
|
||||
GENERIC_READ, // access mode
|
||||
0, // share mode // TODO 4J Stu - Will we need to share file? Probably not but...
|
||||
NULL, // Unused
|
||||
OPEN_EXISTING , // how to create // TODO 4J Stu - Assuming that the file already exists if we are opening to read from it
|
||||
FILE_FLAG_SEQUENTIAL_SCAN, // file attributes
|
||||
NULL // Unsupported
|
||||
);
|
||||
#endif
|
||||
|
||||
if( fileHandle != INVALID_HANDLE_VALUE )
|
||||
{
|
||||
DWORD dwFileSize = grf.length();
|
||||
DWORD bytesRead;
|
||||
PBYTE pbData = (PBYTE) new BYTE[dwFileSize];
|
||||
BOOL bSuccess = ReadFile(fileHandle,pbData,dwFileSize,&bytesRead,NULL);
|
||||
if(bSuccess==FALSE)
|
||||
{
|
||||
app.FatalLoadError();
|
||||
}
|
||||
CloseHandle(fileHandle);
|
||||
|
||||
// 4J-PB - is it possible that we can get here after a read fail and it's not an error?
|
||||
dlcFile->setGrfData(pbData, dwFileSize, lgo->m_stringTable);
|
||||
|
||||
delete [] pbData;
|
||||
|
||||
app.m_gameRules.setLevelGenerationOptions( dlcFile->lgo );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(lgo->requiresBaseSave() && !lgo->getBaseSavePath().empty() )
|
||||
{
|
||||
File save(app.getFilePath(lgo->m_parentDLCPack->GetPackID(), lgo->getBaseSavePath(),true, L"WPACK:" ));
|
||||
if (save.exists())
|
||||
{
|
||||
#ifdef _UNICODE
|
||||
wstring path = save.getPath();
|
||||
const WCHAR *pchFilename=path.c_str();
|
||||
HANDLE fileHandle = CreateFile(
|
||||
pchFilename, // file name
|
||||
GENERIC_READ, // access mode
|
||||
0, // share mode // TODO 4J Stu - Will we need to share file? Probably not but...
|
||||
NULL, // Unused
|
||||
OPEN_EXISTING , // how to create // TODO 4J Stu - Assuming that the file already exists if we are opening to read from it
|
||||
FILE_FLAG_SEQUENTIAL_SCAN, // file attributes
|
||||
NULL // Unsupported
|
||||
);
|
||||
#else
|
||||
const char *pchFilename=wstringtofilename(save.getPath());
|
||||
HANDLE fileHandle = CreateFile(
|
||||
pchFilename, // file name
|
||||
GENERIC_READ, // access mode
|
||||
0, // share mode // TODO 4J Stu - Will we need to share file? Probably not but...
|
||||
NULL, // Unused
|
||||
OPEN_EXISTING , // how to create // TODO 4J Stu - Assuming that the file already exists if we are opening to read from it
|
||||
FILE_FLAG_SEQUENTIAL_SCAN, // file attributes
|
||||
NULL // Unsupported
|
||||
);
|
||||
#endif
|
||||
|
||||
if( fileHandle != INVALID_HANDLE_VALUE )
|
||||
{
|
||||
DWORD bytesRead,dwFileSize = GetFileSize(fileHandle,NULL);
|
||||
PBYTE pbData = (PBYTE) new BYTE[dwFileSize];
|
||||
BOOL bSuccess = ReadFile(fileHandle,pbData,dwFileSize,&bytesRead,NULL);
|
||||
if(bSuccess==FALSE)
|
||||
{
|
||||
app.FatalLoadError();
|
||||
}
|
||||
CloseHandle(fileHandle);
|
||||
|
||||
// 4J-PB - is it possible that we can get here after a read fail and it's not an error?
|
||||
lgo->setBaseSaveData(pbData, dwFileSize);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#ifdef _DURANGO
|
||||
DWORD result = StorageManager.UnmountInstalledDLC(L"WPACK");
|
||||
#else
|
||||
DWORD result = StorageManager.UnmountInstalledDLC("WPACK");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
lgo->setLoadedData();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void LevelGenerationOptions::reset_start()
|
||||
{
|
||||
for ( AUTO_VAR( it, m_schematicRules.begin());
|
||||
it != m_schematicRules.end();
|
||||
it++ )
|
||||
it != m_schematicRules.end();
|
||||
it++ )
|
||||
{
|
||||
(*it)->reset();
|
||||
}
|
||||
@@ -478,9 +649,38 @@ bool LevelGenerationOptions::isFromDLC() { return getSrc() == eSrc_fromDLC; }
|
||||
|
||||
bool LevelGenerationOptions::requiresTexturePack() { return info()->requiresTexturePack(); }
|
||||
UINT LevelGenerationOptions::getRequiredTexturePackId() { return info()->getRequiredTexturePackId(); }
|
||||
wstring LevelGenerationOptions::getDefaultSaveName() { return info()->getDefaultSaveName(); }
|
||||
LPCWSTR LevelGenerationOptions::getWorldName() { return info()->getWorldName(); }
|
||||
LPCWSTR LevelGenerationOptions::getDisplayName() { return info()->getDisplayName(); }
|
||||
|
||||
wstring LevelGenerationOptions::getDefaultSaveName()
|
||||
{
|
||||
switch (getSrc())
|
||||
{
|
||||
case eSrc_fromSave: return getString( info()->getDefaultSaveName() );
|
||||
case eSrc_fromDLC: return getString( info()->getDefaultSaveName() );
|
||||
case eSrc_tutorial: return app.GetString(IDS_TUTORIALSAVENAME);
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
LPCWSTR LevelGenerationOptions::getWorldName()
|
||||
{
|
||||
switch (getSrc())
|
||||
{
|
||||
case eSrc_fromSave: return getString( info()->getWorldName() );
|
||||
case eSrc_fromDLC: return getString( info()->getWorldName() );
|
||||
case eSrc_tutorial: return app.GetString(IDS_PLAY_TUTORIAL);
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
LPCWSTR LevelGenerationOptions::getDisplayName()
|
||||
{
|
||||
switch (getSrc())
|
||||
{
|
||||
case eSrc_fromSave: return getString( info()->getDisplayName() );
|
||||
case eSrc_fromDLC: return getString( info()->getDisplayName() );
|
||||
case eSrc_tutorial: return L"";
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
wstring LevelGenerationOptions::getGrfPath() { return info()->getGrfPath(); }
|
||||
bool LevelGenerationOptions::requiresBaseSave() { return info()->requiresBaseSave(); }
|
||||
wstring LevelGenerationOptions::getBaseSavePath() { return info()->getBaseSavePath(); }
|
||||
@@ -506,6 +706,7 @@ bool LevelGenerationOptions::hasLoadedData() { return m_hasLoadedData; }
|
||||
void LevelGenerationOptions::setLoadedData() { m_hasLoadedData = true; }
|
||||
|
||||
__int64 LevelGenerationOptions::getLevelSeed() { return m_seed; }
|
||||
int LevelGenerationOptions::getLevelHasBeenInCreative() { return m_bHasBeenInCreative; }
|
||||
Pos *LevelGenerationOptions::getSpawnPos() { return m_spawnPos; }
|
||||
bool LevelGenerationOptions::getuseFlatWorld() { return m_useFlatWorld; }
|
||||
|
||||
|
||||
@@ -149,6 +149,7 @@ private:
|
||||
__int64 m_seed;
|
||||
bool m_useFlatWorld;
|
||||
Pos *m_spawnPos;
|
||||
int m_bHasBeenInCreative;
|
||||
vector<ApplySchematicRuleDefinition *> m_schematicRules;
|
||||
vector<ConsoleGenerateStructure *> m_structureRules;
|
||||
bool m_bHaveMinY;
|
||||
@@ -162,8 +163,11 @@ private:
|
||||
|
||||
StringTable *m_stringTable;
|
||||
|
||||
DLCPack *m_parentDLCPack;
|
||||
bool m_bLoadingData;
|
||||
|
||||
public:
|
||||
LevelGenerationOptions();
|
||||
LevelGenerationOptions(DLCPack *parentPack = NULL);
|
||||
~LevelGenerationOptions();
|
||||
|
||||
virtual ConsoleGameRules::EGameRuleType getActionType();
|
||||
@@ -174,6 +178,7 @@ public:
|
||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||
|
||||
__int64 getLevelSeed();
|
||||
int getLevelHasBeenInCreative();
|
||||
Pos *getSpawnPos();
|
||||
bool getuseFlatWorld();
|
||||
|
||||
@@ -197,12 +202,15 @@ public:
|
||||
LevelRuleset *getRequiredGameRules();
|
||||
|
||||
void getBiomeOverride(int biomeId, BYTE &tile, BYTE &topTile);
|
||||
bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature);
|
||||
bool isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature, int *orientation = NULL);
|
||||
|
||||
void loadStringTable(StringTable *table);
|
||||
LPCWSTR getString(const wstring &key);
|
||||
|
||||
unordered_map<wstring, ConsoleSchematicFile *> *getUnfinishedSchematicFiles();
|
||||
|
||||
void loadBaseSaveData();
|
||||
static int packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask);
|
||||
|
||||
// 4J-JEV:
|
||||
// ApplySchematicRules contain limited state
|
||||
|
||||
@@ -6,12 +6,13 @@ StartFeature::StartFeature()
|
||||
{
|
||||
m_chunkX = 0;
|
||||
m_chunkZ = 0;
|
||||
m_orientation = 0;
|
||||
m_feature = StructureFeature::eFeature_Temples;
|
||||
}
|
||||
|
||||
void StartFeature::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
||||
{
|
||||
GameRuleDefinition::writeAttributes(dos, numAttrs + 3);
|
||||
GameRuleDefinition::writeAttributes(dos, numAttrs + 4);
|
||||
|
||||
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_chunkX);
|
||||
dos->writeUTF(_toString(m_chunkX));
|
||||
@@ -19,6 +20,8 @@ void StartFeature::writeAttributes(DataOutputStream *dos, UINT numAttrs)
|
||||
dos->writeUTF(_toString(m_chunkZ));
|
||||
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_feature);
|
||||
dos->writeUTF(_toString((int)m_feature));
|
||||
ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_orientation);
|
||||
dos->writeUTF(_toString(m_orientation));
|
||||
}
|
||||
|
||||
void StartFeature::addAttribute(const wstring &attributeName, const wstring &attributeValue)
|
||||
@@ -35,6 +38,12 @@ void StartFeature::addAttribute(const wstring &attributeName, const wstring &att
|
||||
m_chunkZ = value;
|
||||
app.DebugPrintf("StartFeature: Adding parameter chunkZ=%d\n",m_chunkZ);
|
||||
}
|
||||
else if(attributeName.compare(L"orientation") == 0)
|
||||
{
|
||||
int value = _fromString<int>(attributeValue);
|
||||
m_orientation = value;
|
||||
app.DebugPrintf("StartFeature: Adding parameter orientation=%d\n",m_orientation);
|
||||
}
|
||||
else if(attributeName.compare(L"feature") == 0)
|
||||
{
|
||||
int value = _fromString<int>(attributeValue);
|
||||
@@ -47,7 +56,8 @@ void StartFeature::addAttribute(const wstring &attributeName, const wstring &att
|
||||
}
|
||||
}
|
||||
|
||||
bool StartFeature::isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature)
|
||||
bool StartFeature::isFeatureChunk(int chunkX, int chunkZ, StructureFeature::EFeatureTypes feature, int *orientation)
|
||||
{
|
||||
if(orientation != NULL) *orientation = m_orientation;
|
||||
return chunkX == m_chunkX && chunkZ == m_chunkZ && feature == m_feature;
|
||||
}
|
||||
@@ -7,7 +7,7 @@ using namespace std;
|
||||
class StartFeature : public GameRuleDefinition
|
||||
{
|
||||
private:
|
||||
int m_chunkX, m_chunkZ;
|
||||
int m_chunkX, m_chunkZ, m_orientation;
|
||||
StructureFeature::EFeatureTypes m_feature;
|
||||
|
||||
public:
|
||||
@@ -18,5 +18,5 @@ public:
|
||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs);
|
||||
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, int *orientation);
|
||||
};
|
||||
@@ -74,16 +74,16 @@ bool XboxStructureActionPlaceContainer::placeContainerInLevel(StructurePiece *st
|
||||
{
|
||||
// Remove the current tile entity
|
||||
level->removeTileEntity( worldX, worldY, worldZ );
|
||||
level->setTile( worldX, worldY, worldZ, 0 );
|
||||
level->setTileAndData( worldX, worldY, worldZ, 0, 0, Tile::UPDATE_ALL );
|
||||
}
|
||||
|
||||
level->setTile( worldX, worldY, worldZ, m_tile );
|
||||
level->setTileAndData( worldX, worldY, worldZ, m_tile, 0, Tile::UPDATE_ALL );
|
||||
shared_ptr<Container> container = dynamic_pointer_cast<Container>(level->getTileEntity( worldX, worldY, worldZ ));
|
||||
|
||||
app.DebugPrintf("XboxStructureActionPlaceContainer - placing a container at (%d,%d,%d)\n", worldX, worldY, worldZ);
|
||||
if ( container != NULL )
|
||||
{
|
||||
level->setData( worldX, worldY, worldZ, m_data);
|
||||
level->setData( worldX, worldY, worldZ, m_data, Tile::UPDATE_CLIENTS);
|
||||
// Add items
|
||||
int slotId = 0;
|
||||
for(AUTO_VAR(it, m_items.begin()); it != m_items.end() && (slotId < container->getContainerSize()); ++it, ++slotId )
|
||||
|
||||
@@ -50,10 +50,10 @@ bool XboxStructureActionPlaceSpawner::placeSpawnerInLevel(StructurePiece *struct
|
||||
{
|
||||
// Remove the current tile entity
|
||||
level->removeTileEntity( worldX, worldY, worldZ );
|
||||
level->setTile( worldX, worldY, worldZ, 0 );
|
||||
level->setTileAndData( worldX, worldY, worldZ, 0, 0, Tile::UPDATE_ALL );
|
||||
}
|
||||
|
||||
level->setTile( worldX, worldY, worldZ, m_tile );
|
||||
level->setTileAndData( worldX, worldY, worldZ, m_tile, 0, Tile::UPDATE_ALL );
|
||||
shared_ptr<MobSpawnerTileEntity> entity = dynamic_pointer_cast<MobSpawnerTileEntity>(level->getTileEntity( worldX, worldY, worldZ ));
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
#include "stdafx.h"
|
||||
#include "LeaderboardInterface.h"
|
||||
|
||||
LeaderboardInterface::LeaderboardInterface(LeaderboardManager *man)
|
||||
{
|
||||
m_manager = man;
|
||||
m_pending = false;
|
||||
|
||||
m_filter = (LeaderboardManager::EFilterMode) -1;
|
||||
m_callback = NULL;
|
||||
m_difficulty = 0;
|
||||
m_type = LeaderboardManager::eStatsType_UNDEFINED;
|
||||
m_startIndex = 0;
|
||||
m_readCount = 0;
|
||||
|
||||
m_manager->OpenSession();
|
||||
}
|
||||
|
||||
LeaderboardInterface::~LeaderboardInterface()
|
||||
{
|
||||
m_manager->CancelOperation();
|
||||
m_manager->CloseSession();
|
||||
}
|
||||
|
||||
void LeaderboardInterface::ReadStats_Friends(LeaderboardReadListener *callback, int difficulty, LeaderboardManager::EStatsType type, PlayerUID myUID, unsigned int startIndex, unsigned int readCount)
|
||||
{
|
||||
m_filter = LeaderboardManager::eFM_Friends;
|
||||
m_pending = true;
|
||||
|
||||
m_callback = callback;
|
||||
m_difficulty = difficulty;
|
||||
m_type = type;
|
||||
m_myUID = myUID;
|
||||
m_startIndex = startIndex;
|
||||
m_readCount = readCount;
|
||||
|
||||
tick();
|
||||
}
|
||||
|
||||
void LeaderboardInterface::ReadStats_MyScore(LeaderboardReadListener *callback, int difficulty, LeaderboardManager::EStatsType type, PlayerUID myUID, unsigned int readCount)
|
||||
{
|
||||
m_filter = LeaderboardManager::eFM_MyScore;
|
||||
m_pending = true;
|
||||
|
||||
m_callback = callback;
|
||||
m_difficulty = difficulty;
|
||||
m_type = type;
|
||||
m_myUID = myUID;
|
||||
m_readCount = readCount;
|
||||
|
||||
tick();
|
||||
}
|
||||
|
||||
void LeaderboardInterface::ReadStats_TopRank(LeaderboardReadListener *callback, int difficulty, LeaderboardManager::EStatsType type, unsigned int startIndex, unsigned int readCount)
|
||||
{
|
||||
m_filter = LeaderboardManager::eFM_TopRank;
|
||||
m_pending = true;
|
||||
|
||||
m_callback = callback;
|
||||
m_difficulty = difficulty;
|
||||
m_type = type;
|
||||
m_startIndex = startIndex;
|
||||
m_readCount = readCount;
|
||||
|
||||
tick();
|
||||
}
|
||||
|
||||
void LeaderboardInterface::CancelOperation()
|
||||
{
|
||||
m_manager->CancelOperation();
|
||||
m_pending = false;
|
||||
}
|
||||
|
||||
void LeaderboardInterface::tick()
|
||||
{
|
||||
if (m_pending) m_pending = !callManager();
|
||||
}
|
||||
|
||||
bool LeaderboardInterface::callManager()
|
||||
{
|
||||
switch (m_filter)
|
||||
{
|
||||
case LeaderboardManager::eFM_Friends: return m_manager->ReadStats_Friends(m_callback, m_difficulty, m_type, m_myUID, m_startIndex, m_readCount);
|
||||
case LeaderboardManager::eFM_MyScore: return m_manager->ReadStats_MyScore(m_callback, m_difficulty, m_type, m_myUID, m_readCount);
|
||||
case LeaderboardManager::eFM_TopRank: return m_manager->ReadStats_TopRank(m_callback, m_difficulty, m_type, m_startIndex, m_readCount);
|
||||
default: assert(false); return true;
|
||||
}
|
||||
}
|
||||
35
Minecraft.Client/Common/Leaderboards/LeaderboardInterface.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "LeaderboardManager.h"
|
||||
|
||||
// 4J-JEV: Simple interface for handling ReadStat failures.
|
||||
class LeaderboardInterface
|
||||
{
|
||||
private:
|
||||
LeaderboardManager *m_manager;
|
||||
bool m_pending;
|
||||
|
||||
// Arguments.
|
||||
LeaderboardManager::EFilterMode m_filter;
|
||||
LeaderboardReadListener *m_callback;
|
||||
int m_difficulty;
|
||||
LeaderboardManager::EStatsType m_type;
|
||||
PlayerUID m_myUID;
|
||||
unsigned int m_startIndex;
|
||||
unsigned int m_readCount;
|
||||
|
||||
public:
|
||||
LeaderboardInterface(LeaderboardManager *man);
|
||||
~LeaderboardInterface();
|
||||
|
||||
void ReadStats_Friends(LeaderboardReadListener *callback, int difficulty, LeaderboardManager::EStatsType type, PlayerUID myUID, unsigned int startIndex, unsigned int readCount);
|
||||
void ReadStats_MyScore(LeaderboardReadListener *callback, int difficulty, LeaderboardManager::EStatsType type, PlayerUID myUID, unsigned int readCount);
|
||||
void ReadStats_TopRank(LeaderboardReadListener *callback, int difficulty, LeaderboardManager::EStatsType type, unsigned int startIndex, unsigned int readCount);
|
||||
|
||||
void CancelOperation();
|
||||
|
||||
void tick();
|
||||
|
||||
private:
|
||||
bool callManager();
|
||||
};
|
||||
1131
Minecraft.Client/Common/Leaderboards/SonyLeaderboardManager.cpp
Normal file
133
Minecraft.Client/Common/Leaderboards/SonyLeaderboardManager.h
Normal file
@@ -0,0 +1,133 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common\Leaderboards\LeaderboardManager.h"
|
||||
|
||||
#ifdef __PS3__
|
||||
typedef CellRtcTick SonyRtcTick;
|
||||
#else
|
||||
typedef SceRtcTick SonyRtcTick;
|
||||
#endif
|
||||
|
||||
class SonyLeaderboardManager : public LeaderboardManager
|
||||
{
|
||||
protected:
|
||||
enum EStatsState
|
||||
{
|
||||
eStatsState_Idle,
|
||||
eStatsState_Getting,
|
||||
eStatsState_Failed,
|
||||
eStatsState_Ready,
|
||||
eStatsState_Canceled,
|
||||
eStatsState_Max
|
||||
};
|
||||
|
||||
public:
|
||||
SonyLeaderboardManager();
|
||||
virtual ~SonyLeaderboardManager();
|
||||
|
||||
protected:
|
||||
unsigned short m_openSessions;
|
||||
|
||||
C4JThread *m_threadScoreboard;
|
||||
bool m_running;
|
||||
|
||||
int m_titleContext;
|
||||
int32_t m_requestId;
|
||||
|
||||
//SceNpId m_myNpId;
|
||||
|
||||
static int scoreboardThreadEntry(LPVOID lpParam);
|
||||
void scoreboardThreadInternal();
|
||||
|
||||
virtual bool getScoreByIds();
|
||||
virtual bool getScoreByRange();
|
||||
|
||||
virtual bool setScore();
|
||||
|
||||
queue<RegisterScore> m_views;
|
||||
|
||||
CRITICAL_SECTION m_csViewsLock;
|
||||
|
||||
EStatsState m_eStatsState; //State of the stats read
|
||||
// EFilterMode m_eFilterMode;
|
||||
|
||||
ReadScore *m_scores;
|
||||
unsigned int m_maxRank;
|
||||
//SceNpScoreRankData *m_stats;
|
||||
|
||||
public:
|
||||
virtual void Tick();
|
||||
|
||||
//Open a session
|
||||
virtual bool OpenSession();
|
||||
|
||||
//Close a session
|
||||
virtual void CloseSession();
|
||||
|
||||
//Delete a session
|
||||
virtual void DeleteSession();
|
||||
|
||||
//Write the given stats
|
||||
//This is called synchronously and will not free any memory allocated for views when it is done
|
||||
|
||||
virtual bool WriteStats(unsigned int viewCount, ViewIn views);
|
||||
|
||||
virtual bool ReadStats_Friends(LeaderboardReadListener *callback, int difficulty, EStatsType type, PlayerUID myUID, unsigned int startIndex, unsigned int readCount);
|
||||
virtual bool ReadStats_MyScore(LeaderboardReadListener *callback, int difficulty, EStatsType type, PlayerUID myUID, unsigned int readCount);
|
||||
virtual bool ReadStats_TopRank(LeaderboardReadListener *callback, int difficulty, EStatsType type, unsigned int startIndex, unsigned int readCount);
|
||||
|
||||
//Perform a flush of the stats
|
||||
virtual void FlushStats();
|
||||
|
||||
//Cancel the current operation
|
||||
virtual void CancelOperation();
|
||||
|
||||
//Is the leaderboard manager idle.
|
||||
virtual bool isIdle();
|
||||
|
||||
protected:
|
||||
int getBoardId(int difficulty, EStatsType);
|
||||
|
||||
SceNpScorePlayerRankData *addPadding(unsigned int num, SceNpScoreRankData *rankData);
|
||||
|
||||
void convertToOutput(unsigned int &num, ReadScore *out, SceNpScorePlayerRankData *rankData, SceNpScoreComment *comm);
|
||||
|
||||
void toBinary(void *out, SceNpScoreComment *in);
|
||||
void fromBinary(SceNpScoreComment **out, void *in);
|
||||
|
||||
void toBase32(SceNpScoreComment *out, void *in);
|
||||
void fromBase32(void *out, SceNpScoreComment *in);
|
||||
|
||||
void toSymbols(char *);
|
||||
void fromSymbols(char *);
|
||||
|
||||
bool test_string(string);
|
||||
|
||||
void initReadScoreStruct(ReadScore &out, SceNpScoreRankData &);
|
||||
void fillReadScoreStruct(ReadScore &out, SceNpScoreComment &comment);
|
||||
|
||||
static bool SortByRank(const ReadScore &lhs, const ReadScore &rhs);
|
||||
|
||||
|
||||
protected:
|
||||
// 4J-JEV: Interface differences:
|
||||
|
||||
// Sce NP score library function redirects.
|
||||
virtual HRESULT initialiseScoreUtility() { return ERROR_SUCCESS; }
|
||||
virtual bool scoreUtilityAlreadyInitialised(HRESULT hr) { return false; }
|
||||
|
||||
virtual HRESULT createTitleContext(const SceNpId &npId) = 0;
|
||||
virtual HRESULT destroyTitleContext(int titleContext) = 0;
|
||||
|
||||
virtual HRESULT createTransactionContext(int titleContext) = 0;
|
||||
virtual HRESULT abortTransactionContext(int transactionContext) = 0;
|
||||
virtual HRESULT destroyTransactionContext(int transactionContext) = 0;
|
||||
|
||||
virtual HRESULT fillByIdsQuery(const SceNpId &myNpId, SceNpId* &npIds, uint32_t &len);
|
||||
|
||||
#if (defined __ORBIS__) || (defined __PSVITA__)
|
||||
virtual HRESULT getFriendsList(sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::FriendsList> &friendsList) = 0;
|
||||
#endif
|
||||
|
||||
virtual char * getComment(SceNpScoreComment *comment) = 0;
|
||||
};
|
||||
131
Minecraft.Client/Common/Leaderboards/base64.cpp
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
base64.cpp and base64.h
|
||||
|
||||
Copyright (C) 2004-2008 Ren<65> Nyffenegger
|
||||
|
||||
This source code is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the author be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this source code must not be misrepresented; you must not
|
||||
claim that you wrote the original source code. If you use this source code
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original source code.
|
||||
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Ren<65> Nyffenegger rene.nyffenegger@adp-gmbh.ch
|
||||
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "base64.h"
|
||||
#include <iostream>
|
||||
|
||||
static const std::string base64_chars =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"0123456789+/";
|
||||
|
||||
|
||||
static inline bool is_base64(unsigned char c) {
|
||||
return (isalnum(c) || (c == '+') || (c == '/'));
|
||||
}
|
||||
|
||||
// 4J ADDED,
|
||||
std::string base64_encode(std::string str)
|
||||
{
|
||||
return base64_encode( reinterpret_cast<const unsigned char*>(str.c_str()), str.length() );
|
||||
}
|
||||
|
||||
std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {
|
||||
std::string ret;
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
unsigned char char_array_3[3];
|
||||
unsigned char char_array_4[4];
|
||||
|
||||
while (in_len--) {
|
||||
char_array_3[i++] = *(bytes_to_encode++);
|
||||
if (i == 3) {
|
||||
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
|
||||
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
|
||||
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
|
||||
char_array_4[3] = char_array_3[2] & 0x3f;
|
||||
|
||||
for(int ii = 0; (ii <4) ; ii++)
|
||||
ret += base64_chars[char_array_4[ii]];
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (i)
|
||||
{
|
||||
for(j = i; j < 3; j++)
|
||||
char_array_3[j] = '\0';
|
||||
|
||||
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
|
||||
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
|
||||
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
|
||||
char_array_4[3] = char_array_3[2] & 0x3f;
|
||||
|
||||
for (j = 0; (j < i + 1); j++)
|
||||
ret += base64_chars[char_array_4[j]];
|
||||
|
||||
while((i++ < 3))
|
||||
ret += '=';
|
||||
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
std::string base64_decode(std::string const& encoded_string) {
|
||||
int in_len = encoded_string.size();
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int in_ = 0;
|
||||
unsigned char char_array_4[4], char_array_3[3];
|
||||
std::string ret;
|
||||
|
||||
while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) {
|
||||
char_array_4[i++] = encoded_string[in_]; in_++;
|
||||
if (i ==4) {
|
||||
for (i = 0; i <4; i++)
|
||||
char_array_4[i] = base64_chars.find(char_array_4[i]);
|
||||
|
||||
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
|
||||
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
|
||||
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
|
||||
|
||||
for (i = 0; (i < 3); i++)
|
||||
ret += char_array_3[i];
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (i) {
|
||||
for (j = i; j <4; j++)
|
||||
char_array_4[j] = 0;
|
||||
|
||||
for (j = 0; j <4; j++)
|
||||
char_array_4[j] = base64_chars.find(char_array_4[j]);
|
||||
|
||||
char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
|
||||
char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
|
||||
char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
|
||||
|
||||
for (j = 0; (j < i - 1); j++) ret += char_array_3[j];
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
7
Minecraft.Client/Common/Leaderboards/base64.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
std::string base64_encode(std::string str);
|
||||
std::string base64_encode(unsigned char const* , unsigned int len);
|
||||
std::string base64_decode(std::string const& s);
|
||||
BIN
Minecraft.Client/Common/Media/BeaconMenu1080.swf
Normal file
BIN
Minecraft.Client/Common/Media/BeaconMenu480.swf
Normal file
BIN
Minecraft.Client/Common/Media/BeaconMenu720.swf
Normal file
BIN
Minecraft.Client/Common/Media/BeaconMenuSplit1080.swf
Normal file
BIN
Minecraft.Client/Common/Media/BeaconMenuSplit720.swf
Normal file
BIN
Minecraft.Client/Common/Media/BeaconMenuVita.swf
Normal file
BIN
Minecraft.Client/Common/Media/FireworksMenu1080.swf
Normal file
BIN
Minecraft.Client/Common/Media/FireworksMenu480.swf
Normal file
BIN
Minecraft.Client/Common/Media/FireworksMenu720.swf
Normal file
BIN
Minecraft.Client/Common/Media/FireworksMenuSplit1080.swf
Normal file
BIN
Minecraft.Client/Common/Media/FireworksMenuSplit720.swf
Normal file
BIN
Minecraft.Client/Common/Media/FireworksMenuVita.swf
Normal file
BIN
Minecraft.Client/Common/Media/Graphics/Beacon_1.png
Normal file
|
After Width: | Height: | Size: 326 B |
BIN
Minecraft.Client/Common/Media/Graphics/Beacon_2.png
Normal file
|
After Width: | Height: | Size: 364 B |
BIN
Minecraft.Client/Common/Media/Graphics/Beacon_3.png
Normal file
|
After Width: | Height: | Size: 379 B |
BIN
Minecraft.Client/Common/Media/Graphics/Beacon_4.png
Normal file
|
After Width: | Height: | Size: 331 B |
BIN
Minecraft.Client/Common/Media/Graphics/Beacon_Button_Cross.png
Normal file
|
After Width: | Height: | Size: 305 B |
|
After Width: | Height: | Size: 138 B |
BIN
Minecraft.Client/Common/Media/Graphics/Beacon_Button_Hover.png
Normal file
|
After Width: | Height: | Size: 142 B |
BIN
Minecraft.Client/Common/Media/Graphics/Beacon_Button_Normal.png
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
Minecraft.Client/Common/Media/Graphics/Beacon_Button_Pressed.png
Normal file
|
After Width: | Height: | Size: 139 B |
BIN
Minecraft.Client/Common/Media/Graphics/Beacon_Button_Tick.png
Normal file
|
After Width: | Height: | Size: 241 B |
|
After Width: | Height: | Size: 193 B |
|
After Width: | Height: | Size: 248 B |
|
After Width: | Height: | Size: 197 B |
|
After Width: | Height: | Size: 177 B |
|
After Width: | Height: | Size: 216 B |
|
After Width: | Height: | Size: 194 B |
BIN
Minecraft.Client/Common/Media/Graphics/HUD/HorseHealth_Full.png
Normal file
|
After Width: | Height: | Size: 224 B |
|
After Width: | Height: | Size: 230 B |
BIN
Minecraft.Client/Common/Media/Graphics/HUD/HorseHealth_Half.png
Normal file
|
After Width: | Height: | Size: 204 B |
|
After Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 339 B |
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Minecraft.Client/Common/Media/Graphics/Horse_Armor_Slot.png
Normal file
|
After Width: | Height: | Size: 198 B |
BIN
Minecraft.Client/Common/Media/Graphics/Horse_Saddle_Slot.png
Normal file
|
After Width: | Height: | Size: 219 B |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 678 B |
|
After Width: | Height: | Size: 367 B |
|
After Width: | Height: | Size: 678 B |
|
After Width: | Height: | Size: 349 B |
|
After Width: | Height: | Size: 675 B |
|
After Width: | Height: | Size: 367 B |
|
After Width: | Height: | Size: 418 B |
|
After Width: | Height: | Size: 771 B |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
@@ -7,14 +7,14 @@
|
||||
<!-- Used by: End Poem (first character) -->
|
||||
<colour name="HTMLColor_3" value="109e9e" />
|
||||
<colour name="HTMLColor_4" value="aa0000" />
|
||||
<colour name="HTMLColor_5" value="aa00aa" />
|
||||
<colour name="HTMLColor_5" value="DE5BD9" />
|
||||
<colour name="HTMLColor_6" value="ffaa00" />
|
||||
<!-- Used by: Potion effects -->
|
||||
<colour name="HTMLColor_7" value="aaaaaa" />
|
||||
<!-- Used by: End Poem random text -->
|
||||
<colour name="HTMLColor_8" value="555555" />
|
||||
<!-- Used by: End Poem random text -->
|
||||
<colour name="HTMLColor_9" value="5555ff" />
|
||||
<colour name="HTMLColor_9" value="7878FF" />
|
||||
<!-- Used by: End Poem random text -->
|
||||
<colour name="HTMLColor_a" value="55ff55" />
|
||||
<!-- Used by: Rare items (golden apple, enchanted items, music discs) -->
|
||||
|
||||