Skip to content

Commit b802c1d

Browse files
committed
Only allow AntiBan in dev builds
1 parent 3eeef45 commit b802c1d

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

‎gtav_console/Commands/CommandParser.cs‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,16 @@ public object Eval {
299299
case CommandTokenKind.Word:
300300
bool res;
301301
if (bool.TryParse(String, out res)) return res;
302-
break;
302+
if (String == "on" || String == "enable") return true;
303+
if (String == "off" || String == "disable") return false;
304+
return String;
303305
case CommandTokenKind.CodeBlock:
304-
return CSharpEval(String);
306+
try {
307+
return CSharpEval(String);
308+
}
309+
catch (Exception e) {
310+
return null;
311+
}
305312
case CommandTokenKind.Number:
306313
return Convert.ToDouble(String);
307314
}

‎gtav_console/Commands/DefaultCommands.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private void OnConsoleAttached(DeveloperConsole dc) {
2929

3030
RegisterDefaultCommands();
3131

32-
//dc.PrintDebug("DefaultCommands loaded successfully.");
32+
dc.PrintDebug("DefaultCommands loaded successfully.");
3333
}
3434

3535
private void OnTick(object sender, EventArgs e) {
@@ -102,7 +102,7 @@ private void OnTick(object sender, EventArgs e) {
102102
GTAFuncs.SetEntityCollision(Game.Player.Character, true, true);
103103
}
104104

105-
GTAFuncs.AntiBan();
105+
if(_developerConsole.Debug && ConsoleSettings.IsDevBuild) GTAFuncs.AntiBan();
106106
}
107107

108108
private void RegisterDefaultCommands() {

‎gtav_console/Console/ConsoleSettings.cs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,11 @@ public class ConsoleSettings {
2929
public static int TextAlpha = 200;
3030
public static Color DefaultBgColor = Color.FromArgb(Alpha, 52, 35, 120);
3131
public static Color DefaultTextColor = Color.FromArgb(TextAlpha, 255, 255, 255);
32+
33+
public static bool IsDevBuild {
34+
get {
35+
return Version == "DEV";
36+
}
37+
}
3238
}
3339
}

0 commit comments

Comments
 (0)