123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419 |
- #include "CStoryCore.h"
- #include "CMyProfile.h"
- #include "CFTTDateTimeUtils.h"
- #include "CFTTServerTime.h"
- #include "LOCstring.h"
- #include "CMessageBoxHandler.h"
- #include "xsnprintf.h"
- #include "CFTTFileSystem.h"
- #include "XML.h"
- #include "TStoryConfig.h"
- #include "STORY.h"
- #include "CFE.h"
- #include "CUnlockables.h"
- #include "memctrl.h"
- CStageManager CStoryCore::m_tStageManager;
- TCStoryCoreActiveStory CStoryCore::m_tActiveStory;
- CSideStoryProfile CStoryCore::m_cSideProfile;
- CStoryProfile CStoryCore::m_cProfile;
- TStoryStages CStoryCore::m_tStages;
- //---------------------------------------------------------------------------------------------------------
- //0017622C
- int CStoryCore::GetMinutes() {
- return CStoryCore::m_tStageManager.GetMinutes();
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1B78
- void CStoryCore::Init() {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1BA4
- int CStoryCore::SetupStage(int) {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1CDC
- ushort CStoryCore::GetClubTeam() {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1CEC
- ushort CStoryCore::GetNationalTeam() {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1CFC
- ushort CStoryCore::GetSeason() {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1D30
- ushort CStoryCore::GetStageIndex() {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1D64
- void CStoryCore::SetupStageX(char const *, int) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1D78
- void CStoryCore::SetupStageX(TStoryStage *) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1D88
- void CStoryCore::SetupSingleNIS(TStageOperation *) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1D9C
- void CStoryCore::SetupSingleNIS(char const *, int, int) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1DBC
- void CStoryCore::AddNISCommentary(int) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1DCC
- void CStoryCore::SetupAndEnterGame(ELoadingScreen, bool, bool) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1DF8
- void CStoryCore::PlayStage(bool, bool) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1E08
- void CStoryCore::EnterGame(ELoadingScreen, bool) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1E1C
- void CStoryCore::Process() {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1E2C
- void CStoryCore::RenderHUD() {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1E3C
- void CStoryCore::GetOppoTeam(int, int, int, int, TTeamInfo *) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1E8C
- void CStoryCore::SetupNextStage() {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1EC0 ^_^
- void CStoryCore::LoadConfigForPromoLanguages() {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1EEC 按照自己思路写了一下, 因为好多是网络云相关, 直接跳过 没弄完
- CFTTXmlReader *CStoryCore::GetCorrectConfig(bool a1) {
- CFTTXmlReader *ret = NULL;
- return ret;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E1FFC
- void CStoryCore::LoadConfigForTimeAndRepeatNotifications() {
- LOGI("CStoryCore::LoadConfigForTimeAndRepeatNotifications entry");
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2028
- void CStoryCore::FindLatestRepeatNotifications(long &d) {
- LOGI("CStoryCore::FindLatestRepeatNotifications entry %ld", d);
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2058
- void CStoryCore::FindLatestTimeNotifications(long &d) {
- LOGI("CStoryCore::FindLatestTimeNotifications entry %ld", d);
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2088
- bool CStoryCore::DownloadConfig() {
- int v1 = random();
- if (sinf(v1) > 0) {
- return true;
- } else {
- return false;
- }
- }
- //---------------------------------------------------------------------------------------------------------
- //001E20B4
- void CStoryCore::LoadConfig(bool a1) {
- LOGI("CStoryCore::LoadConfig entry");
- LOGI("CStoryCore::LoadConfig end");
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2100
- void CStoryCore::LoadAdvertsFromConfig() {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E213C ^_^
- bool CStoryCore::LoadStages() {
- return true;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E21D0
- void CStoryCore::OnFreeGameAssets() {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2208
- bool CStoryCore::GetPlayerInitialised() {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2218
- TStage* CStoryCore::GetStageInfo(int) {
- return NULL;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E226C
- void CStoryCore::GetTodaysDate(wchar_t *, int) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E229C
- const char *CStoryCore::GetTrophyModelName() {
- return "League";
- }
- //---------------------------------------------------------------------------------------------------------
- //001E231C
- void CStoryCore::UpdateEnvironment() {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E242C
- void CStoryCore::RandomiseSunPos() {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2520
- void CStoryCore::ProcessText(wchar_t *r0_wp, int r1_i, wchar_t const *r2_wp, int r3_i) {
- // int r0_size=xstrlen(r2_wp)*2;
- // int r11_i=r1_i+r0_size+0x20;
- // //check
- // wchar_t*r10_wp= new wchar_t[r11_i];
- // memset(r10_wp,0,r11_i*sizeof(wchar_t));
- // wchar_t*r5_wp=r10_wp;
- // //loc_1E2562
- // //loc_1E256C
- // while(r2_wp){
- // const wchar_t*r7_substr= xstrstr(r2_wp,L"#");
- // if(r7_substr){
- // //001E258A
- // wchar_t wp_sp10[0x40];
- // memset(wp_sp10,0,sizeof(wp_sp10));
- // //sp8=r1_i
- // switch (r7_substr[1])
- // {
- // case 'N'{
- // break;
- // }
-
- // default:
- // {
- // wp_sp10[0]=r7_substr[0];
- // break;
- // }
- // }
- // }else{
- // //loc_1E256C
- // xstrlcpy(r5_wp,r2_wp,r11_i-(r5_wp-r10_wp))
- // }
- // }
- // //loc_1E2756
- // xstrlcpy(r0_wp,r10_wp,r1_i);
- // delete [] r10_wp;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2798
- ushort CStoryCore::GetStageClubTeam(int) {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E27C8
- ushort CStoryCore::GetStageTeam(int) {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2870 //这个函数没啥用, 作用是当关卡版本不一样的时候, 去更新关卡。
- void CStoryCore::CheckStageVersions() {
- return;
- /*
- int v4=0;
- while (v4 != 2)
- {
- int v5 = 0;
- MP_cMyProfile.SetIsSideStory(v4 == 1, 0);
- if ( v5 >= *CStoryCore::m_tActiveStory.field_4 )
- {
- v4 ++;
- continue;
- }
- int v11;
- TStorySeason *pTStorySeason = &CStoryCore::m_tActiveStory.field_0[v5];
- for(int i =0; i<pTStorySeason->StageCount_d0; i++)
- {
- v11 = i;
- if ( !MP_cMyProfile.isSideStory )
- v11 = pTStorySeason->TStage_d4[i].ID_0;
- CStoryProfileStages *pCStoryProfileStages = MP_cMyProfile.GetProfileStages();
- ushort *ver = pCStoryProfileStages->GetStageVersionPointer(pTStorySeason->TStage_d4[i].ID_0, v11);
- char v31[0x80];
- bool v16;
- snprintf(v31, 0x80, "PKG:/data/hero/stages/stg_%04i.dat", pTStorySeason->TStage_d4[i].ID_0);
- if ( CFTTFileSystem::FileExists(v31, v14) )
- {
- v16 = false;
- }
- else
- {
- memset(v31, 0, 0x80);
- snprintf(v31, 0x80, "SUPPORT:stg_%04i.dat",pTStorySeason->TStage_d4[i].ID_0);
- v16 = !CFTTFileSystem::FileExists(v31);
- }
- if ( !ver || v16 || (pTStorySeason->TStage_d4[i].Version_4 == *ver) )
- {
- if ( !v16 )
- continue;
- printf("CDownloads::RequestStageDownload(v10, v15)");
- continue;
- }
- snprintf(v31, 0x80, "stg_%04i.dat", pTStorySeason->TStage_d4[i].ID_0);
- TStoryStage v22;
- v22.Photo_2bc.PhotoPost_bc.Filter_0 = 0;
- v22.Photo_2bc.PhotoPost_bc.Red_4 = 1.0;
- v22.Photo_2bc.PhotoPost_bc.Green_8 = 1.0;
- v22.Photo_2bc.PhotoPost_bc.Blue_c = 1.0;
- v22.Photo_2bc.PhotoPost_bc.Brightness_10 = 0.5;
- v22.Photo_2bc.PhotoPost_bc.Contrast_14 = 0.5;
- v22.Photo_2bc.PhotoPost_bc.Saturation_18 = 0.5;
- v22.Photo_2bc.PhotoPost_bc.Vignette_1c = 0.0;
- STORY_LoadStage(&v22, v31);
- }
- }
- MP_cMyProfile.SetIsSideStory(MP_cMyProfile.isSideStory, 0);*/
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2A40
- TStorySeason* CStoryCore::GetStageSeason(int) {
- return NULL;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2A98
- int CStoryCore::GetAreGoldenBootsEnabled() {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2A9C
- bool CStoryCore::AttemptSideStoryEntry() {
- return false;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2B20
- int CStoryCore::EnterSideStory() {
- int dr0 = 0;
- return dr0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2BA4 ^_^
- TStorySeason *CStoryCore::STORY_GetSeason(int a1) {
- TStorySeason *result;
- return result;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2BC8 ^_^
- TStorySeason *CStoryCore::GetConfigSeasonWithID(int dr0) {
- return NULL;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2C04
- void CStoryCore::PromotionCB(int, void *) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E2C1C
- int CStoryCore::ShowPromotion(int, bool, bool, EPromoTriggerType, int, int, bool) {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E3124
- int CStoryCore::CalculateCurrentStageID() {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E31D8
- int CStoryCore::CountNumValidPromos() {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E3208
- int CStoryCore::IsPromoValid(TPromo const *, bool) {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E33D4
- TPromo* CStoryCore::FindValidPromo(int, bool) {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E3418
- void CStoryCore::SetSeason(int dr1) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E3448
- int CStoryCore::GetStageUnlockTime(int, int) {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E34A6
- int CStoryCore::GetStageUnlockTime(int) {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E34FC ^_^
- uchar CStoryCore::GetShirtNumber() {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E3530
- void CStoryCore::SetStageStars(int, int) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E3570
- void CStoryCore::SetStageComplete(int, int) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E35CC
- void CStoryCore::SetLastPlayedStageID(int) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E35F4
- CStoryProfileStages* CStoryCore::GetProfileStages() {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E3620
- void CStoryCore::ApplyUserPlayer(TPlayerInfo *) {
- }
- //---------------------------------------------------------------------------------------------------------
- //001E3650
- //这个函数,没有调试完成,原因是swprintf并不是原始SO内的那个, 传参也不一样, 需要写个HOOK, 看下实际程序的返回
- int CStoryCore::GetTimeString(long a1, wchar_t *a2, bool a3) {
- return 1;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E3798
- time_t CStoryCore::GetTimeFromString(char *pcr0, int dr1) {
- return 0;
- }
- //---------------------------------------------------------------------------------------------------------
- //001E37BC
- void CStoryCore::IncrementSessionStagesComplete(bool) {
- }
- //---------------------------------------------------------------------------------------------------------
|