Esempio n. 1
0
// called instead of InitAI() on load if IsLoadSupported() returns 1
void CGlobalAI::Load(IGlobalAICallback* callback, std::istream* ifs) {
    ai = new AIClasses;
    ai->cb = callback->GetAICallback();
    ai->cheat = callback->GetCheatInterface();

    // initialize log filename
    string mapname = string(callback->GetAICallback()->GetMapName());
    mapname.resize(mapname.size() - 4);

    time_t now1;
    time(&now1);
    struct tm* now2 = localtime(&now1);

    int team = ai->cb->GetMyTeam();

    sprintf(c, "%s%s %2.2d-%2.2d-%4.4d %2.2d%2.2d (%d).log",
            string(LOGFOLDER).c_str(), mapname.c_str(), now2->tm_mon + 1, now2->tm_mday, now2->tm_year + 1900, now2->tm_hour, now2->tm_min, team);

    char cfgFolder[256];
    sprintf(cfgFolder, "%s", CFGFOLDER);

    ai->cb->GetValue(AIVAL_LOCATE_FILE_W, this->c);
    ai->cb->GetValue(AIVAL_LOCATE_FILE_W, cfgFolder);
    ai->LOGGER = new std::ofstream(this->c);

    CREX_SC_LOAD(KAIK, ifs);
}
Esempio n. 2
0
// called instead of InitAI() on load if IsLoadSupported() returns 1
void CKAIK::Load(IGlobalAICallback* callback, std::istream* ifs) {
	ai = new AIClasses();
	ai->cb = callback->GetAICallback();
	ai->cheat = callback->GetCheatInterface();
	ai->logger = new CLogger(ai->cb);

	CREX_SC_LOAD(KAIK, ifs);
}
Esempio n. 3
0
void CGroupAI::Load(IGroupAICallback* callback,std::istream *ifs)
{
	this->callback=callback;
	aicb=callback->GetAICallback();
	CREX_SC_LOAD(MexUpgraderAI,ifs);
}
Esempio n. 4
0
// called instead of InitAI() on load if IsLoadSupported() returns 1
void CKAIK::Load(IGlobalAICallback* callback, std::istream* ifs) {
	CREX_SC_LOAD(KAIK, ifs);
}