Ejemplo n.º 1
0
DWORD WINAPI TimerTickThread(LPVOID P)
{
	while(TRUE)
	{
		if(!v_GameInit && Myself)
			OnGameEvent(FALSE);
		else if(v_GameInit && !Myself)
			OnGameEvent(TRUE);

		if(D2Inited) 
			if(D2Delay<20)
				D2Delay++;
			else
			{
				if(GetGameInfo()->szCharName!=NULL)
				TimerTick();	
				else
				{
					Flash=false; D2Inited=false; D2Delay=0;
				}
			}
		Sleep(50);
	}
	return true;
}
Ejemplo n.º 2
0
DWORD WINAPI TimerTickThread3(LPVOID P)
{
	while(TRUE)
	{
		if(D2Inited) 
			if(D2Delay<20)
				D2Delay++;
			else
			{
				if(GetGameInfo()->szCharName!=NULL)
				CheckAntiTppk();	
			}
		Sleep(50);
	}
	return true;
}
Ejemplo n.º 3
0
void Unitsync::PopulateArchiveList()
{
	GetSpringDataPaths();
	const int numMaps = susynclib().GetMapCount();
	for (int i = 0; i < numMaps; i++) {
		std::string name, archivename;
		try {
			const int count = susynclib().GetMapArchiveCount(i);
			if (count > 0) {
				archivename = susynclib().GetMapArchiveName(0);
			}
			name = susynclib().GetMapName(i);
			//PrefetchMap( name ); // DEBUG
		} catch (...) {
			continue;
		}
		assert(!name.empty());
		if (!archivename.empty())
			m_maps_archive_name[name] = archivename;
		m_map_array.push_back(name);
		FetchUnitsyncErrors(name);
	}
	const int numMods = susynclib().GetPrimaryModCount();
	for (int i = 0; i < numMods; i++) {
		std::string name, archivename;
		try {
			const int count = susynclib().GetPrimaryModArchiveCount(i);
			if (count > 0) {
				archivename = susynclib().GetPrimaryModArchive(i);
			}
			name = GetGameInfo(i, "name");
		} catch (...) {
			continue;
		}
		assert(!name.empty());
		if (!archivename.empty())
			m_mods_archive_name[name] = archivename;
		m_mod_array.push_back(name);
		FetchUnitsyncErrors(name);
	}
	m_unsorted_mod_array = m_mod_array;
	m_unsorted_map_array = m_map_array;
	std::sort(m_map_array.begin(), m_map_array.end(), &CompareStringNoCase);
	std::sort(m_mod_array.begin(), m_mod_array.end(), &CompareStringNoCase);
}
Ejemplo n.º 4
0
/*
=================
UI_Init
=================
*/
void UI_Init( void )
{
	// register our cvars and commands
	ui_precache = CVAR_REGISTER( "ui_precache", "0", FCVAR_ARCHIVE );
	ui_showmodels = CVAR_REGISTER( "ui_showmodels", "0", FCVAR_ARCHIVE );

	Cmd_AddCommand( "menu_main", UI_Main_Menu );
	Cmd_AddCommand( "menu_newgame", UI_NewGame_Menu );
	Cmd_AddCommand( "menu_loadgame", UI_LoadGame_Menu );
	Cmd_AddCommand( "menu_savegame", UI_SaveGame_Menu );
	Cmd_AddCommand( "menu_saveload", UI_SaveLoad_Menu );
	Cmd_AddCommand( "menu_multiplayer", UI_MultiPlayer_Menu );
	Cmd_AddCommand( "menu_options", UI_Options_Menu );
	Cmd_AddCommand( "menu_langame", UI_LanGame_Menu );
	Cmd_AddCommand( "menu_intenetgames", UI_InternetGames_Menu );
	Cmd_AddCommand( "menu_playersetup", UI_PlayerSetup_Menu );
	Cmd_AddCommand( "menu_controls", UI_Controls_Menu );
	Cmd_AddCommand( "menu_advcontrols", UI_AdvControls_Menu );
	Cmd_AddCommand( "menu_gameoptions", UI_GameOptions_Menu );
	Cmd_AddCommand( "menu_creategame", UI_CreateGame_Menu );
	Cmd_AddCommand( "menu_audio", UI_Audio_Menu );
	Cmd_AddCommand( "menu_video", UI_Video_Menu );
	Cmd_AddCommand( "menu_vidoptions", UI_VidOptions_Menu );
	Cmd_AddCommand( "menu_vidmodes", UI_VidModes_Menu );
	Cmd_AddCommand( "menu_customgame", UI_CustomGame_Menu );

	CHECK_MAP_LIST( TRUE );

	memset( uiEmptyString, ' ', sizeof( uiEmptyString ));	// HACKHACK
	uiStatic.initialized = true;

	// setup game info
	GetGameInfo( &gMenu.m_gameinfo );

	// load custom strings
	UI_LoadCustomStrings();

	//CR
	UI_InitTitleAnim();
}
Ejemplo n.º 5
0
DWORD WINAPI TimerTickThread2(LPVOID P)
{
	while(TRUE)
	{
		BOOL wPlayer=false;
		BOOL wMonster=false;
		BOOL wVector=false;
		BOOL wLevelNames=false;
		BOOL wPlayerLine=false;

		if(D2Inited) 
		if(D2Delay<20)
		D2Delay++;
		else
		{
			if(GetGameInfo()->szCharName!=NULL)
			{
				TimerTick2();
			}	
			else
			{
				D2Inited=false; D2Delay=0;
			}
		}
		
		if (cfg.CleanShot)
		{
			if (GetAsyncKeyState(VK_SNAPSHOT))
			{
				if(cfg.PlayerInfo)
				{
					cfg.PlayerInfo=false;
					wPlayer=true;
				}
				if(cfg.DrawMonsters)
				{
					cfg.DrawMonsters=false;
					wMonster=true;
				}
				if(cfg.DrawVectors)
				{
					cfg.DrawVectors=false;
					wVector=true;
				}
				if(cfg.LevelNames)
				{
					cfg.LevelNames=false;
					wLevelNames=true;
				}
				if(cfg.PlayerLine)
				{
					cfg.PlayerLine=false;
					wPlayerLine=true;
				}

				while (GetAsyncKeyState(VK_SNAPSHOT))
				Sleep(500);

				if(!cfg.PlayerInfo && wPlayer) cfg.PlayerInfo=true;
				if(!cfg.DrawVectors && wVector) cfg.DrawVectors=true;
				if(!cfg.DrawMonsters && wMonster) cfg.DrawMonsters=true;
				if(!cfg.LevelNames && wLevelNames) cfg.LevelNames=true;
				if(!cfg.PlayerLine && wPlayerLine) cfg.PlayerLine=true;
			}
		}
		Sleep(50);
	}
	return true;
}