//Base command to client file //CLIENT ////Changing this file may severely break your game in some servers //////COMMAND TO CLIENT CHECK function RemoteRemoteCommandCheck(%ClientSender) { if(%clientSender == 2048) { RemoteEval(2048, CommandCheckPassed); Echo("Sending command test result to server"); } } //Base execute function to load script files //such as command to client scripts for maps function RemoteExec(%ClientSender, %File) { if(%clientSender == 2048) { AppendSearchPath(); Exec(%File); } } //Short script loader function RemoteShortScript(%ClientSender, %string) { if(%clientSender == 2048) { eval(%string); } } //Function writer for maps //Eliminates the need for another map script for the client //This is very helpful because the player does not need to go download that //additional script file when we can just write the scripts to a temp file. //After the command file is written the RemoteExec command can be issued to //execute that file. (Players may need to restart Starsiege for new files) function RemoteFileWrite(%ClientSender, %file, %string) { if(%clientSender == 2048) { FileWrite(%file, Append, %string); } } //Variable script holder //Because RemoteWrite is limited to 240 characters this script is used to tell //the client to hold parts of scripts without actually storing them //to a file. This script can store up to 24000 characters //LIMIT 240 CHARACTERS PER ARRAY VARIABLE WITH A MAX OF 100 ARRAY VARIABLES function RemoteStoreLongScript(%ClientSender, %Int, %string) { if(%clientSender == 2048) { $CTC_Tmp[%Int] = Strcat(%string); } } //Thanks to Drake we can have good things! Hurray for Arrays! //This is the function to execute the long script that has just been stored function RemoteExecuteLongScript(%ClientSender) { if(%clientSender == 2048) { for(%Int = 0; %Int != 100; %Int++) { %Result = %Result @ $CTC_Tmp[%Int]; } if(%Int == 100) { Eval(%Result); //FileWrite("receivedscripts.cs", Overwrite, %Result); //AppendSearchPath(); //Exec("receivedscripts.cs"); //Echo("Server sent the following script: " @ %Result); } //Reset the variables deletevariables('CTC_Tmp*'); //for(%Int = 0; %Int != 100; %Int++) //{ //$CTC_Tmp[%Int] = ""; //} } }