mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Remove AdventureManager::Load since it doesn't do anything
This commit is contained in:
parent
4241fba7e2
commit
e1408ede6b
@ -2119,102 +2119,3 @@ void AdventureManager::Save()
|
||||
}
|
||||
}
|
||||
|
||||
void AdventureManager::Load()
|
||||
{
|
||||
//disabled for now
|
||||
return;
|
||||
|
||||
char *data = nullptr;
|
||||
FILE *f = fopen("adventure_state.dat", "r");
|
||||
if(f)
|
||||
{
|
||||
fseek(f, 0, SEEK_END);
|
||||
long length = ftell(f);
|
||||
if(length > 0)
|
||||
{
|
||||
data = new char[length];
|
||||
fseek(f, 0, SEEK_SET);
|
||||
fread(data, length, 1, f);
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
if(data)
|
||||
{
|
||||
char *ptr = data;
|
||||
|
||||
int number_of_adventures = *((int*)ptr);
|
||||
ptr += sizeof(int);
|
||||
|
||||
for(int i = 0; i < number_of_adventures; ++i)
|
||||
{
|
||||
int count = *((int*)ptr);
|
||||
ptr += sizeof(int);
|
||||
|
||||
int a_count = *((int*)ptr);
|
||||
ptr += sizeof(int);
|
||||
|
||||
int template_id = *((int*)ptr);
|
||||
ptr += sizeof(int);
|
||||
|
||||
int status = *((int*)ptr);
|
||||
ptr += sizeof(int);
|
||||
|
||||
int instance_id = *((int*)ptr);
|
||||
ptr += sizeof(int);
|
||||
|
||||
int rem_time = *((int*)ptr);
|
||||
ptr += sizeof(int);
|
||||
|
||||
int num_players = *((int*)ptr);
|
||||
ptr += sizeof(int);
|
||||
|
||||
AdventureTemplate *t = GetAdventureTemplate(template_id);
|
||||
if(t)
|
||||
{
|
||||
auto adv =
|
||||
new Adventure(t, count, a_count, (AdventureStatus)status, instance_id, rem_time);
|
||||
for(int j = 0; j < num_players; ++j)
|
||||
{
|
||||
adv->AddPlayer((const char*)ptr, false);
|
||||
ptr += strlen((const char*)ptr);
|
||||
ptr += 1;
|
||||
}
|
||||
adventure_list.push_back(adv);
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int j = 0; j < num_players; ++j)
|
||||
{
|
||||
ptr += strlen((const char*)ptr);
|
||||
ptr += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int number_of_finished = *((int*)ptr);
|
||||
ptr += sizeof(int);
|
||||
|
||||
for(int k = 0; k < number_of_finished; ++k)
|
||||
{
|
||||
AdventureFinishEvent afe;
|
||||
afe.win = *((bool*)ptr);
|
||||
ptr += sizeof(bool);
|
||||
|
||||
afe.points = *((int*)ptr);
|
||||
ptr += sizeof(int);
|
||||
|
||||
afe.theme = *((int*)ptr);
|
||||
ptr += sizeof(int);
|
||||
|
||||
afe.name = (const char*)ptr;
|
||||
ptr += strlen((const char*)ptr);
|
||||
ptr += 1;
|
||||
|
||||
finished_list.push_back(afe);
|
||||
}
|
||||
|
||||
safe_delete_array(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,7 +34,6 @@ public:
|
||||
void AddFinishedEvent(AdventureFinishEvent fe) { finished_list.push_back(fe); Save(); }
|
||||
bool PopFinishedEvent(const char *name, AdventureFinishEvent &fe);
|
||||
void Save();
|
||||
void Load();
|
||||
|
||||
Adventure **GetFinishedAdventures(const char *player, int &count);
|
||||
Adventure *GetActiveAdventure(const char *player);
|
||||
|
||||
@ -396,7 +396,6 @@ int main(int argc, char** argv) {
|
||||
LogInfo("Unable to load adventure templates");
|
||||
}
|
||||
|
||||
adventure_manager.Load();
|
||||
adventure_manager.LoadLeaderboardInfo();
|
||||
|
||||
LogInfo("Purging expired instances");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user