Beispiel #1
0
void MP3_Init(void)
{
	XMMS_LoadLibrary();

	if (!MP3_IsActive())
		return;

	Cmd_AddCommand("xmms_prev", MP3_Prev_f);
	Cmd_AddCommand("xmms_play", MP3_PlayTrackNum_f);
	Cmd_AddCommand("xmms_pause", MP3_Pause_f);
	Cmd_AddCommand("xmms_stop", MP3_Stop_f);
	Cmd_AddCommand("xmms_next", MP3_Next_f);
	Cmd_AddCommand("xmms_fforward", MP3_FastForward_f);
	Cmd_AddCommand("xmms_rewind", MP3_Rewind_f);
	Cmd_AddCommand("xmms_fadeout", MP3_FadeOut_f);
	Cmd_AddCommand("xmms_shuffle", MP3_Shuffle_f);
	Cmd_AddCommand("xmms_repeat", MP3_Repeat_f);
	Cmd_AddCommand("xmms_volume", MP3_SetVolume_f );
	Cmd_AddCommand("xmms_playlist", MP3_PrintPlaylist_f);
	Cmd_AddCommand("xmms_songinfo", MP3_SongInfo_f);
	Cmd_AddCommand("xmms_start", MP3_Execute_f);

	xmms_dir = Cvar_Get("xmms_dir", "/usr/local/bin", CVAR_ARCHIVE);
	xmms_session = Cvar_Get("xmms_session", "0", CVAR_ARCHIVE);
	xmms_messages = Cvar_Get("xmms_messages", "0", CVAR_ARCHIVE);

	Cmd_AddMacro( "cursong", MP3_SongTitle_m );
}
Beispiel #2
0
void CL_InitCam(void) 
{
	Cvar_SetCurrentGroup(CVAR_GROUP_SPECTATOR);

	// cl_hightrack 
	Cvar_Register (&cl_hightrack); 

	Cvar_Register (&cl_chasecam);

	Cvar_ResetCurrentGroup();
	Cmd_AddCommand ("track", CL_Track_f);
	Cmd_AddCommand ("autotrack", CL_Autotrack_f);
	Cmd_AddCommand ("trackkiller", CL_Trackkiller_f);

	// Multivew tracking.
	Cmd_AddCommand ("track1", CL_TrackMV1_f);	
	Cmd_AddCommand ("track2", CL_TrackMV2_f);	
	Cmd_AddCommand ("track3", CL_TrackMV3_f);	
	Cmd_AddCommand ("track4", CL_TrackMV4_f);
	Cmd_AddCommand ("trackteam", CL_TrackTeam_f);	
 
 #ifdef JSS_CAM
	Cmd_AddCommand ("cam_pos", Cam_Pos_f);
	Cmd_AddCommand ("cam_angles", Cam_Angles_f);
	Cmd_AddMacro ("cam_pos_x", Macro_Cam_Pos_X);
	Cmd_AddMacro ("cam_pos_y", Macro_Cam_Pos_Y);
	Cmd_AddMacro ("cam_pos_z", Macro_Cam_Pos_Z);
	Cmd_AddMacro ("cam_pos", Macro_Cam_Pos);
 	Cmd_AddMacro ("cam_angles_pitch", Macro_Cam_Angles_Pitch);
 	Cmd_AddMacro ("cam_angles_yaw", Macro_Cam_Angles_Yaw);
 	Cmd_AddMacro ("cam_angles_roll", Macro_Cam_Angles_Roll);
 	Cmd_AddMacro ("cam_angles", Macro_Cam_Angles);
 #endif
 
	// Multiview tracking.	
	memset(mv_trackslots, -1, sizeof(mv_trackslots));
	mv_skinsforced = false;
}
Beispiel #3
0
/*
===================
MP3_Init
===================
*/
void MP3_Init (void)
{
	cl_winampmessages = Cvar_Get("cl_winampmessages", "1", CVAR_ARCHIVE);
	cl_winamp_dir = Cvar_Get("cl_winamp_dir", "C:/Program Files/Winamp", CVAR_ARCHIVE);

	Cmd_AddCommand ( "winampnext", MP3_NextTrack_f );
	Cmd_AddCommand ( "winamppause", MP3_Pause_f );
	Cmd_AddCommand ( "winampplay", MP3_Play_f );
	Cmd_AddCommand ( "winampprev", MP3_PreviousTrack_f );
	Cmd_AddCommand ( "winampstop", MP3_Stop_f );
	Cmd_AddCommand ( "winampvolup", MP3_VolumeUp_f );
	Cmd_AddCommand ( "winampvoldown", MP3_VolumeDown_f );
	Cmd_AddCommand ( "winamprestart", MP3_Restart_f );
	Cmd_AddCommand ( "winampshuffle", MP3_ToggleShuffle_f );
	Cmd_AddCommand ( "winamprepeat", MP3_ToggleRepeat_f );
	Cmd_AddCommand ( "winampvolume", MP3_SetVolume_f );
	Cmd_AddCommand ( "winamptitle", MP3_Title_f );
	Cmd_AddCommand ( "winampsonginfo", MP3_SongInfo_f );
	Cmd_AddCommand ( "winampsearch", MP3_PrintPlaylist_f );
	Cmd_AddMacro( "cursong", MP3_SongTitle_m );

	// Get WinAmp
	MP3_GetWinAmp();
}
Beispiel #4
0
/*
=================
Qcommon_Init
=================
*/
void Qcommon_Init(int argc, char **argv)
{
    if (setjmp(abortframe))
        Sys_Error("Error during initialization: %s", com_errorMsg);

    com_argc = argc;
    com_argv = argv;

    Com_SetLastError(NULL);

    X86_SetFPCW();

    // prepare enough of the subsystems to handle
    // cvar and command buffer management
    Z_Init();
    MSG_Init();
    Cbuf_Init();
    Cmd_Init();
    Cvar_Init();
    Key_Init();
    Prompt_Init();
    Con_Init();

    //
    // init commands and vars
    //
    z_perturb = Cvar_Get("z_perturb", "0", 0);
#if USE_CLIENT
    host_speeds = Cvar_Get("host_speeds", "0", 0);
#endif
#ifdef _DEBUG
    developer = Cvar_Get("developer", "0", 0);
#endif
    timescale = Cvar_Get("timescale", "1", CVAR_CHEAT);
    fixedtime = Cvar_Get("fixedtime", "0", CVAR_CHEAT);
    logfile_enable = Cvar_Get("logfile", "0", 0);
    logfile_flush = Cvar_Get("logfile_flush", "0", 0);
    logfile_name = Cvar_Get("logfile_name", "console", 0);
    logfile_prefix = Cvar_Get("logfile_prefix", "[%Y-%m-%d %H:%M] ", 0);
#if USE_CLIENT
    dedicated = Cvar_Get("dedicated", "0", CVAR_NOSET);
    cl_running = Cvar_Get("cl_running", "0", CVAR_ROM);
    cl_paused = Cvar_Get("cl_paused", "0", CVAR_ROM);
#else
    dedicated = Cvar_Get("dedicated", "1", CVAR_ROM);
#endif
    sv_running = Cvar_Get("sv_running", "0", CVAR_ROM);
    sv_paused = Cvar_Get("sv_paused", "0", CVAR_ROM);
    com_timedemo = Cvar_Get("timedemo", "0", CVAR_CHEAT);
    com_date_format = Cvar_Get("com_date_format", "%Y-%m-%d", 0);
#ifdef _WIN32
    com_time_format = Cvar_Get("com_time_format", "%H.%M", 0);
#else
    com_time_format = Cvar_Get("com_time_format", "%H:%M", 0);
#endif
#ifdef _DEBUG
    com_debug_break = Cvar_Get("com_debug_break", "0", 0);
#endif
    com_fatal_error = Cvar_Get("com_fatal_error", "0", 0);
    com_version = Cvar_Get("version", com_version_string, CVAR_SERVERINFO | CVAR_ROM);

    allow_download = Cvar_Get("allow_download", COM_DEDICATED ? "0" : "1", CVAR_ARCHIVE);
    allow_download_players = Cvar_Get("allow_download_players", "1", CVAR_ARCHIVE);
    allow_download_models = Cvar_Get("allow_download_models", "1", CVAR_ARCHIVE);
    allow_download_sounds = Cvar_Get("allow_download_sounds", "1", CVAR_ARCHIVE);
    allow_download_maps = Cvar_Get("allow_download_maps", "1", CVAR_ARCHIVE);
    allow_download_textures = Cvar_Get("allow_download_textures", "1", CVAR_ARCHIVE);
    allow_download_pics = Cvar_Get("allow_download_pics", "1", CVAR_ARCHIVE);
    allow_download_others = Cvar_Get("allow_download_others", "0", 0);

    rcon_password = Cvar_Get("rcon_password", "", CVAR_PRIVATE);

    Cmd_AddCommand("z_stats", Z_Stats_f);

    //Cmd_AddCommand("setenv", Com_Setenv_f);

    Cmd_AddMacro("com_date", Com_Date_m);
    Cmd_AddMacro("com_time", Com_Time_m);
    Cmd_AddMacro("com_uptime", Com_Uptime_m);
    Cmd_AddMacro("com_uptime_long", Com_UptimeLong_m);
    Cmd_AddMacro("random", Com_Random_m);
    Cmd_AddMacro("com_maplist", Com_MapList_m);

    // add any system-wide configuration files
    Sys_AddDefaultConfig();

    // we need to add the early commands twice, because
    // a basedir or cddir needs to be set before execing
    // config files, but we want other parms to override
    // the settings of the config files
    Com_AddEarlyCommands(qfalse);

    Sys_Init();

    Sys_RunConsole();

    FS_Init();

    Sys_RunConsole();

    // no longer allow CVAR_NOSET modifications
    com_initialized = qtrue;

    // after FS is initialized, open logfile
    logfile_enable->changed = logfile_enable_changed;
    logfile_flush->changed = logfile_param_changed;
    logfile_name->changed = logfile_param_changed;
    logfile_enable_changed(logfile_enable);

    // execute configs: default.cfg may come from the packfile, but config.cfg
    // and autoexec.cfg must be real files within the game directory
    Com_AddConfigFile(COM_DEFAULT_CFG, 0);
    Com_AddConfigFile(COM_CONFIG_CFG, FS_TYPE_REAL | FS_PATH_GAME);
    Com_AddConfigFile(COM_AUTOEXEC_CFG, FS_TYPE_REAL | FS_PATH_GAME);
    Com_AddConfigFile(COM_POSTEXEC_CFG, FS_TYPE_REAL);

    Com_AddEarlyCommands(qtrue);

    Cmd_AddCommand("lasterror", Com_LastError_f);

    Cmd_AddCommand("quit", Com_Quit_f);
#if !USE_CLIENT
    Cmd_AddCommand("recycle", Com_Recycle_f);
#endif

    srand(Sys_Milliseconds());

    Netchan_Init();
    NET_Init();
    BSP_Init();
    CM_Init();
    SV_Init();
    CL_Init();
    TST_Init();

    Sys_RunConsole();

    // add + commands from command line
    if (!Com_AddLateCommands()) {
        // if the user didn't give any commands, run default action
        char *cmd = COM_DEDICATED ? "dedicated_start" : "client_start";

        if ((cmd = Cmd_AliasCommand(cmd)) != NULL) {
            Cbuf_AddText(&cmd_buffer, cmd);
            Cbuf_Execute(&cmd_buffer);
        }
    } else {
        // the user asked for something explicit
        // so drop the loading plaque
        SCR_EndLoadingPlaque();
    }

    // even not given a starting map, dedicated server starts
    // listening for rcon commands (create socket after all configs
    // are executed to make sure port number is properly set)
    if (COM_DEDICATED) {
        NET_Config(NET_SERVER);
    }

    Com_AddConfigFile(COM_POSTINIT_CFG, FS_TYPE_REAL);

    Com_Printf("====== " PRODUCT " initialized ======\n\n");
    Com_LPrintf(PRINT_NOTICE, APPLICATION " " VERSION ", " __DATE__ "\n");
    Com_Printf("http://skuller.net/q2pro/\n\n");

    time(&com_startTime);

    com_eventTime = Sys_Milliseconds();
}
Beispiel #5
0
/*
=================
Qcommon_Init
=================
*/
void Qcommon_Init (int argc, char **argv)
{
	static const char	*apVersion = APPLICATION " v" VERSION " " CPUSTRING " " __DATE__ " " BUILDSTRING;

	if (setjmp (abortframe) )
		Sys_Error ("Error during initialization");

	z_chain.next = z_chain.prev = &z_chain;

	// prepare enough of the subsystems to handle
	// cvar and command buffer management
	COM_InitArgv (argc, argv);

	Swap_Init ();
	Cbuf_Init ();

	Cmd_Init ();
	Cvar_Init ();

	Key_Init ();

	// we need to add the early commands twice, because
	// a basedir or cddir needs to be set before execing
	// config files, but we want other parms to override
	// the settings of the config files
	Cbuf_AddEarlyCommands (false);
	Cbuf_Execute();

	FS_InitFilesystem ();

	Cbuf_AddText ("exec default.cfg\n");
	Cbuf_Execute();
	Cbuf_AddText ("exec aprconfig.cfg\n");
	Cbuf_Execute();
	FS_ExecConfig("autoexec.cfg");
	Cbuf_Execute();

	Cbuf_AddEarlyCommands (true);
	Cbuf_Execute();

	Cmd_AddCommand ("echo", Cmd_Echo_f);
	// init commands and vars
    Cmd_AddCommand ("z_stats", Z_Stats_f);
	Cmd_AddCommand( "z_check", Z_Check );

	host_speeds = Cvar_Get ("host_speeds", "0", 0);
	developer = Cvar_Get ("developer", "0", 0);
	timescale = Cvar_Get ("timescale", "1", CVAR_CHEAT);
	fixedtime = Cvar_Get ("fixedtime", "0", CVAR_CHEAT);
	logfile_active = Cvar_Get ("logfile", "0", 0);
	showtrace = Cvar_Get ("showtrace", "0", 0);
#ifdef DEDICATED_ONLY
	dedicated = Cvar_Get ("dedicated", "1", CVAR_ROM);
#else
	dedicated = Cvar_Get ("dedicated", "0", CVAR_NOSET);
#endif

	timescale->OnChange = OnChange_Timescale;
	OnChange_Timescale(timescale, timescale->resetString);

	Cvar_Get ("version", apVersion, CVAR_SERVERINFO|CVAR_ROM);

	Cmd_AddMacro( "date", Com_Date_m );
	Cmd_AddMacro( "time", Com_Time_m );

	if (dedicated->integer)
		Cmd_AddCommand ("quit", Com_Quit);

#ifndef NDEBUG
	Cmd_AddCommand( "error", Com_Error_f );
	Cmd_AddCommand( "errordrop", Com_ErrorDrop_f );
	Cmd_AddCommand( "freeze", Com_Freeze_f );
	Cmd_AddCommand( "crash", Com_Crash_f );
#endif

	Sys_Init ();

	srand(Sys_Milliseconds());

	NET_Init ();
	Netchan_Init ();

	SV_Init ();
	CL_Init ();

	ComInitialized = true;

	Cbuf_InsertFromDefer(); //Execute commands which was initialized after loading autoexec (ignore, highlight etc)
	FS_ExecConfig ("postinit.cfg");
	Cbuf_Execute();

	// add + commands from command line
	if (!Cbuf_AddLateCommands ())
	{	// if the user didn't give any commands, run default action
		if (!dedicated->integer)
			Cbuf_AddText ("toggleconsole\n");
		else
			Cbuf_AddText ("dedicated_start\n");
		Cbuf_Execute();
	}
	else
	{	// the user asked for something explicit
		// so drop the loading plaque
		SCR_EndLoadingPlaque();
	}

	Com_Printf ("====== " APPLICATION " Initialized ======\n\n");	
}