예제 #1
0
// Read our settings from a file.
static void ReadSettings(const char *Filename)
{
	GetPrivateProfileStringA("Steam", "Username", "redacted", Global::Steam_Username, 16, Filename);
	GetPrivateProfileStringA("Steam", "Language", "english", Global::Steam_Language, 16, Filename);
	
	Global::Steam_Offline = GetPrivateProfileIntA("System", "OfflineMode", 1, Filename) == TRUE;
	Global::Steam_Dedicated = GetPrivateProfileIntA("System", "DedicatedMode", 0, Filename) == TRUE;
}
예제 #2
0
파일: Criticals.cpp 프로젝트: Ytfarc/sfall2
void CritLoad() {
 if(!Inited) return;
 CritStruct* defaultTable=(CritStruct*)_crit_succ_eff;
 if(mode==1) {
  char section[16];
  dlogr("Setting up critical hit table using CriticalOverrides.ini", DL_CRITICALS);
  memset(critTable, 0, CritTableSize*sizeof(CritStruct));
  for(DWORD critter=0;critter<20;critter++) {
   for(DWORD part=0;part<9;part++) {
    for(DWORD crit=0;crit<6;crit++) {
     sprintf_s(section, "c_%02d_%d_%d", critter, part, crit);
     int slot1=crit+part*6+critter*9*6;
     int slot2=crit+part*6+((critter==19)?38:critter)*9*6;
     for(int i=0;i<7;i++) {
      critTable[slot2].values[i]=GetPrivateProfileIntA(section, CritNames[i], defaultTable[slot1].values[i], ".\\CriticalOverrides.ini");
#ifdef TRACE
      char logmsg[256];
      if(critTable[slot2].values[i]!=defaultTable[slot1].values[i]) {
       sprintf_s(logmsg, "Entry %s value %d changed from %d to %d", section, i, defaultTable[slot1].values[i], critTable[slot2].values[i]);
       dlogr(logmsg, DL_CRITICALS);
      }
#endif
     }
    }
   }
  }
 } else {
  dlogr("Setting up critical hit table using RP fixes", DL_CRITICALS);
  memcpy(critTable, defaultTable, 6*9*19*sizeof(CritStruct));
  memset(&critTable[6*9*19], 0, 6*9*19*sizeof(CritStruct));
  memcpy(playerCrit, (void*)_pc_crit_succ_eff, 6*9*sizeof(CritStruct));

  if(mode==3) {
   char buf[32], buf2[32], buf3[32];
   for(int critter=0;critter<CritTableCount;critter++) {
    sprintf_s(buf, "c_%02d", critter);
    int all;
    if(!(all=GetPrivateProfileIntA(buf, "Enabled", 0, ".\\CriticalOverrides.ini"))) continue;
    for(int part=0;part<9;part++) {
     if(all<2) {
      sprintf_s(buf2, "Part_%d", part);
      if(!GetPrivateProfileIntA(buf, buf2, 0, ".\\CriticalOverrides.ini")) continue;
     }

     sprintf_s(buf2, "c_%02d_%d", critter, part);
     for(int crit=0;crit<6;crit++) {
      int slot=crit+part*6+critter*9*6;
      for(int i=0;i<7;i++) {
       sprintf_s(buf3, "e%d_%s", crit, CritNames[i]);
       critTable[slot].values[i]=GetPrivateProfileIntA(buf2, buf3, critTable[slot].values[i], ".\\CriticalOverrides.ini");
      }
     }
    }
   }
  }
 }
 dlogr("Completed critical hit table", DL_CRITICALS);
}
예제 #3
0
void FixPatsPriceSource::ReadIniConfig()
{ // 登录需要的参数 HeartBeatInterval,username,password
	m_HeartBeatInterval = 30;
	m_useSimEngine = 0;
	memset(m_szUsername,   0, sizeof(m_szUsername));
	memset(m_szPassword,   0, sizeof(m_szPassword));

	GetPrivateProfileStringA("FIXPATSGW", "LOGON_UID", "patsusername", m_szUsername, 16, ".\\AIB.ini");
	GetPrivateProfileStringA("FIXPATSGW", "LOGON_PWD", "patspassword", m_szPassword, 16, ".\\AIB.ini");
	m_HeartBeatInterval = GetPrivateProfileIntA("FIXPATSGW","LOGON_HBINT",30,".\\AIB.ini");
	m_useSimEngine = GetPrivateProfileIntA("FIXPATSGW","SIMENGINE_PS",0,".\\AIB.ini");
	TRACE_LOG("FixPatsPriceSource ReadIniConfig UID:%s,PWD:%s,HeartBeatInt:%d,UseSimEngine:%d.",m_szUsername,m_szPassword,m_HeartBeatInterval,m_useSimEngine);
}
예제 #4
0
	int Load_Config(const char* filename)
	{
		if(!filename)
			filename = defaultConfigFilename;
		char Conf_File[1024];

		if(*filename && filename[1] == ':')
			strcpy(Conf_File, filename);
		else
			sprintf(Conf_File, "%s\\%s", thisprocessPath, filename);

		GetPrivateProfileStringA("General", "Exe path", exefilename, exefilename, MAX_PATH, Conf_File);
		GetPrivateProfileStringA("General", "Movie path", moviefilename, moviefilename, MAX_PATH, Conf_File);
		GetPrivateProfileStringA("General", "Command line", commandline, commandline, ARRAYSIZE(commandline), Conf_File);

		nextLoadRecords = 0!=GetPrivateProfileIntA("General", "Movie Read Only", nextLoadRecords, Conf_File);
		//localTASflags.forceWindowed = GetPrivateProfileIntA("Graphics", "Force Windowed", localTASflags.forceWindowed, Conf_File);
		localTASflags.fastForwardFlags = GetPrivateProfileIntA("Tools", "Fast Forward Flags", localTASflags.fastForwardFlags, Conf_File);
		advancePastNonVideoFrames = GetPrivateProfileIntA("Input", "Skip Lag Frames", advancePastNonVideoFrames, Conf_File);
		advancePastNonVideoFramesConfigured = 0!=GetPrivateProfileIntA("Input", "Skip Lag Frames", 0, Conf_File);
		inputFocusFlags = GetPrivateProfileIntA("Input", "Background Input Focus Flags", inputFocusFlags, Conf_File);
		hotkeysFocusFlags = GetPrivateProfileIntA("Input", "Background Hotkeys Focus Flags", hotkeysFocusFlags, Conf_File);

		traceEnabled = 0!=GetPrivateProfileIntA("Debug", "Load Debug Tracing", traceEnabled, Conf_File);

		if (RWSaveWindowPos)
		{
			ramw_x = GetPrivateProfileIntA ("Watches", "Ramwatch_X", 0, Conf_File);
			ramw_y = GetPrivateProfileIntA ("Watches", "Ramwatch_Y", 0, Conf_File);
		}

		for(int i = 0; i < MAX_RECENT_WATCHES; i++)
		{
			char str[256];
			sprintf(str, "Recent Watch %d", i+1);
			GetPrivateProfileStringA("Watches", str, "", &rw_recent_files[i][0], 1024, Conf_File);
		}

		// TODO: Load hotkeys.
		//LoadHotkeys(Conf_File, true);
		//LoadHotkeys(Conf_File, false);

		// done loading

		//UpdateReverseLookup(true);
		//UpdateReverseLookup(false);

		// Reeeeeeeeeeeeally weird code...
		static bool first = true;
		if(first)
			first = false;
		else
			debugprintf(L"loaded config from \"%S\".\n", Conf_File);

		return 1;
	}
예제 #5
0
void GameShop::Load()	//-> Complete
{
	char * OptionFile	= gDirPath.GetNewPath("GameShop\\GameShop.ini");
	// ----
	this->OptionData.ActiveGameShop	= GetPrivateProfileIntA("Main", "Active", 1, OptionFile);
	this->OptionData.AddGPBonus		= GetPrivateProfileIntA("GoblinPointBonus", "AddBonus", 0, OptionFile);
	// ----
	this->OptionData.ScriptMajor	= GetPrivateProfileIntA("ScriptVersion", "Major", 512, OptionFile);
	this->OptionData.ScriptMinor	= GetPrivateProfileIntA("ScriptVersion", "Minor", 2012, OptionFile);
	this->OptionData.ScriptRevision	= GetPrivateProfileIntA("ScriptVersion", "Revision", 10, OptionFile);
	this->OptionData.BannerMajor	= GetPrivateProfileIntA("BannerVersion", "Major", 512, OptionFile);
	this->OptionData.BannerMinor	= GetPrivateProfileIntA("BannerVersion", "Minor", 2010, OptionFile);
	this->OptionData.BannerRevision	= GetPrivateProfileIntA("BannerVersion", "Revision", 5, OptionFile);
	// ----
	if( !this->OptionData.ActiveGameShop )
	{
		LogAdd("[GameShop] GameShop is disabled");
		return;
	}
	// ----
	this->ItemList.clear();
	this->PackageList.clear();
	ZeroMemory(this->PointCategory, sizeof(this->PointCategory));
	// ----
	this->ReadCategoryList(gDirPath.GetNewPath("GameShop\\GameShopCategory.txt"));
	this->ReadItemList(gDirPath.GetNewPath("GameShop\\GameShopItem.txt"));
	this->ReadPackageList(gDirPath.GetNewPath("GameShop\\GameShopPackage.txt"));
}
예제 #6
0
void CToxProto::BootstrapNodesFromIni(bool isIPv6)
{
	if (IsFileExists((TCHAR*)VARST(_T(TOX_INI_PATH))))
	{
		char fileName[MAX_PATH];
		mir_strcpy(fileName, VARS(TOX_INI_PATH));

		char *section, sections[MAX_PATH], value[MAX_PATH];
		GetPrivateProfileSectionNamesA(sections, _countof(sections), fileName);
		section = sections;
		while (*section != NULL)
		{
			if (strstr(section, TOX_SETTINGS_NODE_PREFIX) == section)
			{
				GetPrivateProfileStringA(section, "IPv4", NULL, value, _countof(value), fileName);
				ptrA address(mir_strdup(value));
				int port = GetPrivateProfileIntA(section, "Port", 33445, fileName);
				GetPrivateProfileStringA(section, "PubKey", NULL, value, _countof(value), fileName);
				ptrA pubKey(mir_strdup(value));
				BootstrapNode(address, port, pubKey);
				if (isIPv6)
				{
					GetPrivateProfileStringA(section, "IPv6", NULL, value, _countof(value), fileName);
					address = mir_strdup(value);
					BootstrapNode(address, port, pubKey);
				}
			}
			section += mir_strlen(section) + 1;
		}
	}
}
예제 #7
0
	int IniReadInt(char *inifile, char *section, char *param, int def)
	{
		char curdir[MAX_PATH];
		GetModuleFileNameA(g_hModule, curdir, sizeof(curdir));
		std::string fname = GetPathFromFilename(curdir) + inifile;
		return GetPrivateProfileIntA(section, param, def, fname.c_str());
	}
예제 #8
0
void ReputationsInit() {
	int count;
	if(count=GetPrivateProfileIntA("Misc", "CityRepsCount", 0, ini)) {
		repList=new CityRep[count];
		char buf[512];
		GetPrivateProfileStringA("Misc", "CityRepsList", "", buf, 512, ini);
		char* end;
		char* start=buf;
		for(int i=0;i<count;i++) {
			end=strchr(start,':');
			*end='\0';
			repList[i].cityID=atoi(start);
			start=end+1;
			if(i==count-1) {
				repList[i].globalID=atoi(start);
			} else {
				end=strchr(start,',');
				*end='\0';
				repList[i].globalID=atoi(start);
				start=end+1;
			}
		}

		SafeWrite32(0x43BEA5, (DWORD)&repList[0].cityID);
		SafeWrite32(0x43BF3C, (DWORD)&repList[0].cityID);
		SafeWrite32(0x43BF4C, (DWORD)&repList[0].globalID);
		SafeWrite32(0x43C03E, count*8);
	}
}
예제 #9
0
파일: main.cpp 프로젝트: RElesgoe/Obsmode
BOOL APIENTRY DllMain(HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved) {
	char szSettingsPath[MAX_PATH];

	switch (ul_reason_for_call) {
	case DLL_THREAD_ATTACH:
		break;
	case DLL_PROCESS_ATTACH:
		DisableThreadLibraryCalls(hModule);
		GetModuleFileNameA(hModule, szSettingsPath, MAX_PATH);
		sprintf(strrchr(szSettingsPath, '.'), "%s", ".inj");
		TheSettings.DeadAlive = GetPrivateProfileIntA("Settings", "deadalive", 0, szSettingsPath);
		hMainThread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)mainThread, 0, 0, &mainThreadID);
		return TRUE;

	case DLL_PROCESS_DETACH:
		//SetWindowLong(FindWindow("SWarClass", 0), GWL_WNDPROC, oldWinProc);
		TerminateThread(hMainThread, 0);
		// ufruma dude
		break;
	case DLL_THREAD_DETACH:
		break;
	default:
		break;
	}

	return TRUE;
}
예제 #10
0
파일: Dlg5.cpp 프로젝트: gnleaf/Keybor
void CDlg5::HideMainWnd()
{
	if (GetPrivateProfileIntA(_T("System"),_T("BeginHide"),0,CAfx::filepath))
	{
		AfxGetMainWnd()->ShowWindow(SW_HIDE);
	}
}
예제 #11
0
void SQLClass::Init()
{

	bool bResult = false;
	char SQLConnect[]="..\\OptionsData\\Options.ini";

	if( GetPrivateProfileIntA("SQL", "SQLVersion", 2000, SQLConnect) == 2000 ) {
		strcpy_s(m_SqlConn.sDriver, "{SQL Server}");
	} 
	else {
		strcpy_s(m_SqlConn.sDriver, "{SQL Native Client}");
	}
	

	GetPrivateProfileStringA("SQL", "Host",	"",m_SqlConn.sServer,	sizeof(m_SqlConn.sServer),	SQLConnect);
	GetPrivateProfileStringA("SQL", "Database",		"",m_SqlConn.sDatabase,	sizeof(m_SqlConn.sDatabase),SQLConnect);
	GetPrivateProfileStringA("SQL", "User",	"",m_SqlConn.sUID,		sizeof(m_SqlConn.sUID),		SQLConnect);
	GetPrivateProfileStringA("SQL", "Password",	"",m_SqlConn.sPwd,		sizeof(m_SqlConn.sPwd),		SQLConnect);

	if( PointsSql.Connect(&m_SqlConn) == false ) 
	{
		MessageBoxA(NULL, "g_SQL::Init() Connect to SQL Server false \n chek your setting !", "SQL Error!", MB_OK|MB_ICONERROR);
		ExitProcess(0);
	} 
	else 
	{
		bResult = true;
	}

	if( bResult == true )
	{
		//Log.outInfo("SQL Manager Initialized");
	}
}
예제 #12
0
void cConfigs::LoadFixes()
{
#ifdef _GS
	//BloodCasle Time
	int bloodtime = 200 * GetPrivateProfileInt("Events","BCTimeRemain", 60, RZEvents);            *(unsigned int *) GS_BLOODREMAIN = bloodtime;                
	*(unsigned int *) GS_BLOODREMAIN2 = bloodtime;                    
	*(unsigned int *) GS_BLOODREMAIN3 = bloodtime; 
	//remain ChaosCastle:
	int iCcT = 70000 * (GetPrivateProfileIntA("Events","CCTimeRemain",30,RZEvents));
	DWORD dCcT = iCcT;
	*(unsigned int *) GS_CCTimeRemain = dCcT;
	//
	*(unsigned char*) oCcMinPlayers = GetInt(0, 6, 6,"Events","CcMinPlayers",RZEvents);
#else
//	disablecslogs		= GetInt(0, 1, 0,"Common", "DisableCSlogs", RZCGS);
#endif 
	PersonalIDFix		= GetInt(0, 1, 1, "Bypasseres", "PersonalIDBypasser", RZCommon);
	GuildIDFix			= GetInt(0, 1, 1, "Bypasseres", "GuildIDBypasser", RZCommon);
	AllowExeAnc			= GetInt(0, 1, 1, "SpecialItem", "AllowExeAnc", RZItems);	
	AllowJohAnc			= GetInt(0, 1, 1, "SpecialItem", "AllowJohAnc", RZItems);
	AllowExeSock		= GetInt(0, 1, 1, "SpecialItem", "AllowExeSock", RZItems);
	MaxLifeOpt			= GetInt(0, 1, 1, "SpecialItem", "MaxLifeOpt", RZItems);
	FixPotionsMax		= GetInt(0, 1, 1, "Common", "Use255potions", RZItems);

	*(unsigned char*) GS_SOUL_RATE_NORMAL = GetChar(0,100,60,"JewelRates","SoulSuccessRateNormal",RZItems);
	*(unsigned char*) GS_SOUL_RATE_SPECIAL = GetChar(0,100,50,"JewelRates","SoulSuccessRateSpecial",RZItems);
	*(unsigned char*) GS_SOUL_RATE_SOCKET = GetChar(0,100,40,"JewelRates","SoulSuccessRateSocket",RZItems);
	*(unsigned char*) GS_SOUL_LUCK_ADD = GetChar(0,100,20,"JewelRates","SoulSuccessRateLuck",RZItems);
	*(unsigned char*) GS_JOL_FAIL_RATE = GetChar(0,100,50,"JewelRates","LifeFailRate",RZItems);

}
BOOL config_load_a(HMODULE module,CONFIG_BINDING_A* binding){
	char path[MAX_PATH];
	GetModuleFileNameA(module,path,MAX_PATH);
	for(int i=strlen(path)-1;i>=0;i--){
		if(path[i]=='\\'){
			path[i]='\0';
			break;
		}
	}
	strcat(path,"\\config.ini");
	PCONFIG_BINDING_A b;
	int i=0;
	char buffer[32767];
	int l;
	while((b=binding+(i++))->section){
		switch(b->type){
			case CONFIG_TYPE_STRING:
				l = GetPrivateProfileStringA(b->section,b->key,b->def.asString,buffer,32767,path);
				if(buffer[0]==0&&b->def.asString==NULL){
					*(b->val.asString)=NULL;
				}else{
					*(b->val.asString)=(char*)malloc(sizeof(char)*(strlen(buffer)+1));
					strcpy(*(b->val.asString),buffer);
				}
				break;
			case CONFIG_TYPE_INT:
				*(b->val.asInt) = GetPrivateProfileIntA(b->section,b->key,b->def.asInt,path);
				break;
		}
	}
	return TRUE;
}
예제 #14
0
파일: shlexec.c 프로젝트: howard5888/wineT
static int _okChildInt(const char* file, int line, const char* key, int expected)
{
    INT result;
    result=GetPrivateProfileIntA("Arguments", key, expected, child_file);
    return ok_(file, line)(result == expected,
               "%s expected %d, but got %d\n", key, expected, result);
}
예제 #15
0
파일: file.c 프로젝트: bilboed/wine
/***********************************************************************
 *           GetPrivateProfileInt   (KERNEL.127)
 */
UINT16 WINAPI GetPrivateProfileInt16( LPCSTR section, LPCSTR entry,
                                      INT16 def_val, LPCSTR filename )
{
    /* we used to have some elaborate return value limitation (<= -32768 etc.)
     * here, but Win98SE doesn't care about this at all, so I deleted it.
     * AFAIR versions prior to Win9x had these limits, though. */
    return (INT16)GetPrivateProfileIntA(section,entry,def_val,filename);
}
예제 #16
0
void PatsApiDealer::ReadIniConfig()
{ // 登录需要的参数
	m_useSimEngine = 0;
	memset(m_szTraderAccount,   0, sizeof(m_szTraderAccount));
	m_useSimEngine = GetPrivateProfileIntA("PATSAPIDEALER","SIMENGINE_DEALER",0,".\\AIB.ini");
	GetPrivateProfileStringA("PATSAPIDEALER", "TRADER_ACCOUNT", "", m_szTraderAccount, 21, ".\\AIB.ini");
	TRACE_LOG("PatsApiDealer ReadIniConfig UseSimEngine:%d, TraderAccount:%s.",m_useSimEngine,m_szTraderAccount);
}
예제 #17
0
	bool ToBool()
	{
		if( m_ParentPath.size() )
		{
			return GetPrivateProfileIntA(m_ParentPath.c_str(), m_obj->m_name.c_str(), 0, m_pPath->c_str()) != 0;
		}
		return false;
	}
예제 #18
0
파일: profile.c 프로젝트: Barrell/wine
static void test_profile_refresh(void)
{
    static CHAR testfile[] = ".\\winetest4.ini";
    HANDLE h;
    DWORD size, res;
    static const char contents1[] = "[" SECTION "]\n" KEY "=123\n";
    static const char contents2[] = "[" SECTION "]\n" KEY "=124\n";

    h = CreateFileA(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL,
                    CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL);
    res = WriteFile( h, contents1, sizeof contents1 - 1, &size, NULL );
    ok( res, "Cannot write test file: %x\n", GetLastError() );
    ok( size == sizeof contents1 - 1, "Test file: partial write\n");

    SetLastError(0xdeadbeef);
    res = GetPrivateProfileIntA(SECTION, KEY, 0, testfile);
    ok( res == 123 ||
        broken(res == 0 && GetLastError() == ERROR_SHARING_VIOLATION), /* Win9x, WinME */
        "Got %d instead of 123\n", res);

    CloseHandle(h);

    /* Test proper invalidation of wine's profile file cache */

    h = CreateFileA(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL,
                    CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL);
    res = WriteFile( h, contents2, sizeof contents2 - 1, &size, NULL );
    ok( res, "Cannot write test file: %x\n", GetLastError() );
    ok( size == sizeof contents2 - 1, "Test file: partial write\n");

    SetLastError(0xdeadbeef);
    res = GetPrivateProfileIntA(SECTION, KEY, 0, testfile);
    ok( res == 124 ||
        broken(res == 0 && GetLastError() == 0xdeadbeef), /* Win9x, WinME */
        "Got %d instead of 124\n", res);

    /* This also deletes the file */
    CloseHandle(h);

    /* Cache must be invalidated if file no longer exists and default must be returned */
    SetLastError(0xdeadbeef);
    res = GetPrivateProfileIntA(SECTION, KEY, 421, testfile);
    ok( res == 421 ||
        broken(res == 0 && GetLastError() == 0xdeadbeef), /* Win9x, WinME */
        "Got %d instead of 421\n", res);
}
예제 #19
0
	size_t ToSize()
	{
		if( m_ParentPath.size() )
		{
			return GetPrivateProfileIntA(m_ParentPath.c_str(), m_obj->m_name.c_str(), 0, m_pPath->c_str());
		}
		return 0;
	}
예제 #20
0
파일: Config.cpp 프로젝트: Maiven/bwapi
int LoadConfigInt(const char *pszKey, const char *pszItem, const int iDefault)
{
  std::string envKey = envKeyName(pszKey, pszItem);
  if (char* v = std::getenv(envKey.c_str()))
    return std::stoi(v);
  else
    return GetPrivateProfileIntA(pszKey, pszItem, iDefault, configPath().c_str());
}
예제 #21
0
bool LoadConfig( const char file[], Config *cfg )
{
	bool succ = true;

	if( GetPrivateProfileStringA( kMainSec, kAdapterKey, kDefAdapter, cfg->adapter, sizeof( cfg->adapter ), file ) == 0
		|| !TestAdapterName( cfg->adapter ) )
		{
		cfg->adapter[0] = '\0';
		succ = false;
		}//end if
	cfg->dst_port = GetPrivateProfileIntA( kMainSec, kPortKey, kDefPort, file );
	cfg->filter = GetPrivateProfileIntA( kMainSec, kFilterKey, kDefFilter, file );
	GetPrivateProfileStringA( kMainSec, kFilterWordsKey, kDefFilterWords, cfg->filterwords, sizeof( cfg->filterwords ), file );
	cfg->filteridurl = GetPrivateProfileIntA( kMainSec, kFilterIdURLKey, kDefFilterIdURL, file );
	cfg->checkupdate = GetPrivateProfileIntA( kMainSec, kCheckUpdateKey, kDefCheckUpdate, file );

	return succ;
}//end LoadConfig
예제 #22
0
파일: Criticals.cpp 프로젝트: Ytfarc/sfall2
void _stdcall ResetCriticalTable(DWORD critter, DWORD bodypart, DWORD slot, DWORD element) {
 if(!Inited) return;
 if(critter>=CritTableCount||bodypart>=9||slot>=6||element>=7) return;
 //It's been a long time since we worried about win9x compatibility, so just sprintf it for goodness sake...
 char section[16];
 sprintf_s(section, "c_%02d_%d_%d", critter, bodypart, slot);
 CritStruct* defaultTable=(CritStruct*)_crit_succ_eff;
 critTable[slot].values[element]=critTable[slot].DamageMultiplier=GetPrivateProfileIntA(section, CritNames[element], defaultTable[slot].values[element], ".\\CriticalOverrides.ini");
}
예제 #23
0
// address: 0x40bbdc
void _start(int param1) {
    __size32 eax; 		// r24

    eax = IsWindow();
    if (eax == 0) {
        GetPrivateProfileIntA();
        proc1(param1);
    }
    return;
}
예제 #24
0
uint32_t RedactedApps::GetDLCCount()
{
	PrintCurrentFunction();

#ifdef NO_PIRACY
	return SteamProxy::GetDLCCount();
#else
	return GetPrivateProfileIntA("DLC", "DLCCount", 0, hString::va("%s.ini", Global::Game_BinaryName));
#endif
}
예제 #25
0
bool SFUDPNetwork::Start()
{
	GetPrivateProfileStringA("UDPInfo", "IP", NULL, m_IP, 20, "./Connection.ini");
	m_Port = GetPrivateProfileIntA("UDPInfo", "PORT", 0, "./Connection.ini");

	if(m_P2PModule)
		m_P2PModule->RunP2P(m_IP, m_Port);

	return true;
}
예제 #26
0
파일: ls_ini.c 프로젝트: asmloverX/ls-log
int ls_iniGetInt(struct ls_Ini* self, char* app, char* key, int* outValue)
{
  if (NULL != self && NULL != app && NULL != key && NULL != outValue)
  {
    *outValue = GetPrivateProfileIntA(app, key, 0, self->file);

    return LS_Success;
  }
  return LS_Failed_InvalidParameters;
}
예제 #27
0
uint32_t PreInit()
{
	Global::Listen_Port = GetPrivateProfileIntA("Node", "ListenUDPPort", 31337, "./HedgeNode.ini");
	GetPrivateProfileStringA("Node", "DatabaseName", "./Node.db", Global::Database_name, 16, "./HedgeNode.ini");

	Network::SocketManager::InitializeManager();
	//we can be only snodes as of now
	Nodes::SNode::InitializeNode();

	return 1;
}
예제 #28
0
/* Reads program settings from INI file. */
int read_ini(const char *dll_dir)
{
	char ini_path[MAX_PATH];

	/* Get full path to INI file */
	strcpy(ini_path, dll_dir);
	strcat(ini_path, "\\"INI_FILE);

	/* Read INI values */
	memset(&caIni, 0, sizeof(caIni));
	GetPrivateProfileStringA(INI_SECT, "caDir", caIniDef.caDir, caIni.caDir, sizeof(caIni.caDir), ini_path);
	GetPrivateProfileStringA(INI_SECT, "caCertFile", caIniDef.caCertFile, caIni.caCertFile, sizeof(caIni.caCertFile), ini_path);
	GetPrivateProfileStringA(INI_SECT, "caKeyFile", caIniDef.caKeyFile, caIni.caKeyFile, sizeof(caIni.caKeyFile), ini_path);
	GetPrivateProfileStringA(INI_SECT, "caKeyPasswd", caIniDef.caKeyPasswd, caIni.caKeyPasswd, sizeof(caIni.caKeyPasswd), ini_path);
	GetPrivateProfileStringA(INI_SECT, "raCertFile", caIniDef.raCertFile, caIni.raCertFile, sizeof(caIni.raCertFile), ini_path);
	GetPrivateProfileStringA(INI_SECT, "raKeyFile", caIniDef.raKeyFile, caIni.raKeyFile, sizeof(caIni.raKeyFile), ini_path);
	GetPrivateProfileStringA(INI_SECT, "raKeyPasswd", caIniDef.raKeyPasswd, caIni.raKeyPasswd, sizeof(caIni.raKeyPasswd), ini_path);
	caIni.daysTillExpire = GetPrivateProfileIntA(INI_SECT, "daysTillExpire", caIniDef.daysTillExpire, ini_path);
	GetPrivateProfileStringA(INI_SECT, "nsComment", caIniDef.nsComment, caIni.nsComment, sizeof(caIni.nsComment), ini_path);
	GetPrivateProfileStringA(INI_SECT, "keyUsage", caIniDef.keyUsage, caIni.keyUsage, sizeof(caIni.keyUsage), ini_path);
	GetPrivateProfileStringA(INI_SECT, "newCertsDir", caIniDef.newCertsDir, caIni.newCertsDir, sizeof(caIni.newCertsDir), ini_path);
	GetPrivateProfileStringA(INI_SECT, "newCertsExt", caIniDef.newCertsExt, caIni.newCertsExt, sizeof(caIni.newCertsExt), ini_path);
	GetPrivateProfileStringA(INI_SECT, "serialFile", caIniDef.serialFile, caIni.serialFile, sizeof(caIni.serialFile), ini_path);
	GetPrivateProfileStringA(INI_SECT, "indexFile", caIniDef.indexFile, caIni.indexFile, sizeof(caIni.indexFile), ini_path);
	caIni.signRequests = GetPrivateProfileIntA(INI_SECT, "signRequests", caIniDef.signRequests, ini_path);
	caIni.verifyRequests = GetPrivateProfileIntA(INI_SECT, "verifyRequests", caIniDef.verifyRequests, ini_path);
	caIni.verifyAfterSign = GetPrivateProfileIntA(INI_SECT, "verifyAfterSign", caIniDef.verifyAfterSign, ini_path);
	caIni.addToIndex = GetPrivateProfileIntA(INI_SECT, "addToIndex", caIniDef.addToIndex, ini_path);
	caIni.addToNewCerts = GetPrivateProfileIntA(INI_SECT, "addToNewCerts", caIniDef.addToNewCerts, ini_path);
#ifdef _DEBUG
	GetPrivateProfileStringA(INI_SECT, "debugDir", caIniDef.debugDir, caIni.debugDir, sizeof(caIni.debugDir), ini_path);
#endif

	return 0;
}
예제 #29
0
void CConfigManager::ReadRouteTCPListen(int *pPorts, unsigned long *pIP)
{
	char BuffIP[16];

	*pPorts = GetPrivateProfileIntA("TCP_SOCKET", "LISTEN_LOCAL_PORT", -1, "Config\\PostofficeRoute\\PostofficeRoute.ini");
	GetPrivateProfileStringA("TCP_SOCKET", "LISTEN_LOCAL_IP", "255.255.255.255", BuffIP, 16, "Config\\PostofficeRoute\\PostofficeRoute.ini");

	*pIP = inet_addr(BuffIP);
	unsigned long L =inet_addr("255.255.255.255");

	MTVERIFY( -1!=*pPorts );
	MTVERIFY( L!=*pIP );

}
예제 #30
0
static u08 __eth_init_interface( u08 internal_id, char const * keyname )
{
	u08 result = (u08)GetPrivateProfileIntA( "interfaces", 
		keyname, 0x0ff, "../ijw-router-win32.ini" );
	if (result == 0xff)
		return 0;

	if (eth_init_interface( internal_id, result ))
	{
		num_interfaces = internal_id + 1;
		return 1;
	}

	return 0;
}