[Half-Life AMXX] / content_server.sma Repository:
ViewVC logotype

View of /content_server.sma

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25 - (download) (annotate)
Tue Nov 20 22:36:56 2007 UTC (16 years, 4 months ago) by ian
File size: 1651 byte(s)
Applied AGPLv3 license.
/*
Content Server Util v0.2
Copyright (C) 2007 Ian (Juan) Cammarata

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------
http://ian.cammarata.us
*/
#include <amxmodx>
#include <amxmisc>

#define VERSION "0.2"

new p_baseurl, p_sid //, p_dlurl

public plugin_init( )
{
	register_plugin( "Content Server", VERSION, "Ian Cammarata" )
	register_cvar( "content_server_version", VERSION, FCVAR_SERVER )
	
	p_baseurl = register_cvar( "sv_downloadbaseurl", "", FCVAR_PROTECTED )
	p_sid = register_cvar( "sv_downloadserverid", "", FCVAR_PROTECTED )
	//p_dlurl = 
	get_cvar_pointer( "sv_downloadurl" )
	
	new urlstr[100],map[36]
	get_pcvar_string( p_baseurl, urlstr, 99 )
	if( strlen( urlstr ) )
	{
		new sid[20]
		get_pcvar_string( p_sid, sid, 10 )
		if( strlen( sid ) ) format( sid, 19, "&sid=%s", sid )
		
		get_mapname( map, 35 )
		format( urlstr, 99, "%s?map=%s%s&res=", urlstr, map, sid )
		
		set_cvar_string( "sv_downloadurl", urlstr )
	}
}

Contact
ViewVC Help
Powered by ViewVC 1.0.4