2015-12-12 10:10:23 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
|
|
|
|
namespace MultiTheftAuto
|
|
|
|
|
{
|
2015-12-12 19:50:24 +00:00
|
|
|
|
public delegate void CommandHandler( Player player, string command, string[] args );
|
|
|
|
|
|
|
|
|
|
public static class Server
|
2015-12-12 10:10:23 +00:00
|
|
|
|
{
|
2016-01-06 18:06:22 +00:00
|
|
|
|
[MethodImpl( MethodImplOptions.InternalCall )]
|
2016-01-06 22:01:37 +00:00
|
|
|
|
public static extern uint GetMaxPlayers();
|
|
|
|
|
|
|
|
|
|
[MethodImpl( MethodImplOptions.InternalCall )]
|
|
|
|
|
public static extern bool SetMaxPlayers( uint maxPlayers );
|
|
|
|
|
|
|
|
|
|
[MethodImpl( MethodImplOptions.InternalCall )]
|
|
|
|
|
public static extern bool OutputChatBox( string text, Element element, Color color, bool colorCoded );
|
|
|
|
|
|
|
|
|
|
// [MethodImpl( MethodImplOptions.InternalCall )]
|
|
|
|
|
// public static extern bool OutputLog( string text );
|
|
|
|
|
|
|
|
|
|
[MethodImpl( MethodImplOptions.InternalCall )]
|
|
|
|
|
public static extern bool SetPassword( string password, bool bSave );
|
|
|
|
|
|
|
|
|
|
[MethodImpl( MethodImplOptions.InternalCall )]
|
|
|
|
|
public static extern ServerVersion GetVersion();
|
2015-12-12 19:50:24 +00:00
|
|
|
|
|
2016-01-06 18:06:22 +00:00
|
|
|
|
[MethodImpl( MethodImplOptions.InternalCall )]
|
|
|
|
|
public extern static bool AddCommandHandler( string name, CommandHandler handler, bool restricted = false, bool caseSensitive = true );
|
2015-12-12 19:50:24 +00:00
|
|
|
|
|
2016-01-06 18:06:22 +00:00
|
|
|
|
[MethodImpl( MethodImplOptions.InternalCall )]
|
|
|
|
|
public extern static bool ExecuteCommandHandler( string name, Player player, string args );
|
2015-12-12 19:50:24 +00:00
|
|
|
|
|
2016-01-06 18:06:22 +00:00
|
|
|
|
[MethodImpl( MethodImplOptions.InternalCall )]
|
|
|
|
|
public extern static bool RemoveCommandHandler( string name, CommandHandler handler = null );
|
2015-12-12 10:10:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|