PK O8scripts/PK O8scripts/autoexec/PK ¢T8´T\Š‹ ‹ scripts/autoexec/tcms.cs// #name = TCMS (The-Construct Master Serv) // #version = A.2 // #date = 19th November 2007 // #description = A script to query servers off (and add servers to) the TC list. // #category = Support // #author = Krash123 // #warrior = Krash123 // #email = krash@raptorhideout.com // #web = http://www.the-construct.net/forums/ //================================================================ // This file should contain pretty much everything that's needed. // For now it's just the basics; Here are some prefs to be defaulted. if ($Host::TCbeat == "") $Host::TCbeat = 15; //Time between beats in minutes. if ($Host::TCecho == "") $Host::TCecho = 0; //Enable the MS echoes. if ($Host::TConln == "") $Host::TConln = 1; //Enable the MS queries in online mode. package MasTC { //================================================================ function CreateServer(%mission, %missionType) { Parent::CreateServer(%mission, %missionType); if (!$PlayingOnline) TCHeartbeat($Host::Port,$Host::TCbeat); } function TCHeartBeat(%port,%timeinmin) { if ($PlayingOnline) return; if(isEventPending($TCBeat)) cancel($TCBeat); %server = "www.the-construct.net:80"; %path = "/tc/list/add/" @ %port @"/"; if (!isObject(AuthTCbite)) %bite = new HTTPObject(AuthTCbite){}; else %bite = AuthTCbite; %bite.get(%server, %path); if ($Host::TCecho) echo("-- Sent heartbeat to TC Master. ("@%server@")"); %timer = $Host::TCbeat * 60000; $TCBeat = schedule(%timer,0,"TCHeartbeat",$Host::Port,$Host::TCbeat); } function queryTCServers() { %filename = "/tc/list/TC-ServerList.cs"; %server = "www.the-construct.net:80"; if (!isObject(TCbite)) %bite = new HTTPObject(TCbite){}; else %bite = TCbite; %bite.get(%server, %filename); } function TCbite::onLine(%this, %line) { // GMJ_FilterText.setValue( "Querying TC Servers" ); if ((strpos(%line,"$pref::GameServerCount") != -1)) { //Nothing for now. Maybe later. } else if ((strpos(%line,"//EOF") != -1)) { //Also removed, not really necessary. // GMJ_FilterText.setText( "LAN / TC Servers" ); } else { %server = getSubStr(getWord(%line,2), 1, strlen(getWord(%line,2))-3 ); querySingleServer( %server ); } } function TCbite::onConnectFailed() { echo("Could not connect to master server. Blast!"); } function TCbite::onDisconnect(%this) { %this.delete(); } function GMJ_Browser::clearList( %this ) { Parent::clearList( %this ); if ( %this.lastQuery $= "LanServers" || $Host::TConln) queryTCServers(); } }; if (!isActivePackage(MasTC)) activatepackage (MasTC); PK O8scripts/PK O8&scripts/autoexec/PK ¢T8´T\Š‹ ‹  Uscripts/autoexec/tcms.csPK»