hedgewars/uCommands.pas
changeset 7805 2a249a4faf5b
parent 7426 55b49cc1f33a
child 7806 c27713b5e052
--- a/hedgewars/uCommands.pas	Wed Oct 24 00:35:27 2012 +0400
+++ b/hedgewars/uCommands.pas	Tue Oct 23 16:52:13 2012 -0400
@@ -23,13 +23,15 @@
 interface
 
 var isDeveloperMode: boolean;
+var isExternalSource: boolean;
 type TCommandHandler = procedure (var params: shortstring);
 
 procedure initModule;
 procedure freeModule;
 procedure RegisterVariable(Name: shortstring; p: TCommandHandler; Trusted: boolean; Rand: boolean);
 procedure RegisterVariable(Name: shortstring; p: TCommandHandler; Trusted: boolean);
-procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean);
+procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean); inline;
+procedure ParseCommand(CmdStr: shortstring; TrustedSource, ExternalSource: boolean);
 procedure ParseTeamCommand(s: shortstring);
 procedure StopMessages(Message: Longword);
 
@@ -73,11 +75,17 @@
 end;
 
 
-procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean);
+procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean); inline;
+begin
+    ParseCommand(CmdStr, TrustedSource, false)
+end;
+
+procedure ParseCommand(CmdStr: shortstring; TrustedSource, ExternalSource: boolean);
 var s: shortstring;
     t: PVariable;
     c: char;
 begin
+isExternalSource:= ExternalSource or CurrentTeam^.ExtDriven;
 //WriteLnToConsole(CmdStr);
 if CmdStr[0]=#0 then
     exit;