Update large includes for transitional syntax #1 (#510)

This commit is contained in:
ErikMinekus
2016-05-21 08:52:43 -04:00
committed by Nicholas Hastings
parent 7451257578
commit f91d659c6f
8 changed files with 439 additions and 557 deletions
+53 -74
View File
@@ -111,9 +111,8 @@ enum ReplySource
*
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @noreturn
*/
native ServerCommand(const String:format[], any:...);
native void ServerCommand(const char[] format, any ...);
/**
* Executes a server command as if it were on the server console (or RCON)
@@ -128,25 +127,21 @@ native ServerCommand(const String:format[], any:...);
* @param maxlen Length of buffer.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @noreturn
*/
native ServerCommandEx(String:buffer[], maxlen, const String:format[], any:...);
native void ServerCommandEx(char[] buffer, int maxlen, const char[] format, any ...);
/**
* Inserts a server command at the beginning of the server command buffer.
*
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @noreturn
*/
native InsertServerCommand(const String:format[], any:...);
native void InsertServerCommand(const char[] format, any ...);
/**
* Executes every command in the server's command buffer, rather than once per frame.
*
* @noreturn
*/
native ServerExecute();
native void ServerExecute();
/**
* Executes a client command. Note that this will not work on clients unless
@@ -155,10 +150,9 @@ native ServerExecute();
* @param client Index of the client.
* @param fmt Format of the client command.
* @param ... Format parameters
* @noreturn
* @error Invalid client index, or client not connected.
*/
native ClientCommand(client, const String:fmt[], any:...);
native void ClientCommand(int client, const char[] fmt, any ...);
/**
* Executes a client command on the server without being networked.
@@ -172,10 +166,9 @@ native ClientCommand(client, const String:fmt[], any:...);
* @param client Index of the client.
* @param fmt Format of the client command.
* @param ... Format parameters
* @noreturn
* @error Invalid client index, or client not connected.
*/
native FakeClientCommand(client, const String:fmt[], any:...);
native void FakeClientCommand(int client, const char[] fmt, any ...);
/**
* Executes a client command on the server without being networked. The
@@ -185,17 +178,15 @@ native FakeClientCommand(client, const String:fmt[], any:...);
* @param client Index of the client.
* @param fmt Format of the client command.
* @param ... Format parameters
* @noreturn
* @error Invalid client index, or client not connected.
*/
native FakeClientCommandEx(client, const String:fmt[], any:...);
native void FakeClientCommandEx(int client, const char[] fmt, any ...);
/**
* Executes a KeyValues client command on the server without being networked.
*
* @param client Index of the client.
* @param kv KeyValues data to be sent.
* @noreturn
* @error Invalid client index, client not connected,
* or unsupported on current game.
*/
@@ -206,9 +197,8 @@ native void FakeClientCommandKeyValues(int client, KeyValues kv);
*
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @noreturn
*/
native PrintToServer(const String:format[], any:...);
native void PrintToServer(const char[] format, any ...);
/**
* Sends a message to a client's console.
@@ -216,10 +206,9 @@ native PrintToServer(const String:format[], any:...);
* @param client Client index.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @noreturn
* @error If the client is not connected an error will be thrown.
*/
native PrintToConsole(client, const String:format[], any:...);
native void PrintToConsole(int client, const char[] format, any ...);
/**
* Reples to a message in a command.
@@ -231,17 +220,16 @@ native PrintToConsole(client, const String:format[], any:...);
* @param client Client index, or 0 for server.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @noreturn
* @error If the client is not connected or invalid.
*/
native ReplyToCommand(client, const String:format[], any:...);
native void ReplyToCommand(int client, const char[] format, any ...);
/**
* Returns the current reply source of a command.
*
* @return ReplySource value.
*/
native ReplySource:GetCmdReplySource();
native ReplySource GetCmdReplySource();
/**
* Sets the current reply source of a command.
@@ -252,7 +240,7 @@ native ReplySource:GetCmdReplySource();
* @param source New ReplySource value.
* @return Old ReplySource value.
*/
native ReplySource:SetCmdReplySource(ReplySource:source);
native ReplySource SetCmdReplySource(ReplySource source);
/**
* Returns whether the current say hook is a chat trigger.
@@ -261,7 +249,7 @@ native ReplySource:SetCmdReplySource(ReplySource:source);
*
* @return True if a chat trigger, false otherwise.
*/
native bool:IsChatTrigger();
native bool IsChatTrigger();
/**
* Displays usage of an admin command to users depending on the
@@ -273,10 +261,9 @@ native bool:IsChatTrigger();
* @param tag Tag to prepend to the message.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @noreturn
* @error
*/
native ShowActivity2(client, const String:tag[], const String:format[], any:...);
native void ShowActivity2(int client, const char[] tag, const char[] format, any ...);
/**
* Displays usage of an admin command to users depending on the
@@ -290,10 +277,9 @@ native ShowActivity2(client, const String:tag[], const String:format[], any:...)
* @param client Client index doing the action, or 0 for server.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @noreturn
* @error
*/
native ShowActivity(client, const String:format[], any:...);
native void ShowActivity(int client, const char[] format, any ...);
/**
* Same as ShowActivity(), except the tag parameter is used instead of
@@ -303,10 +289,9 @@ native ShowActivity(client, const String:format[], any:...);
* @param tag Tag to display with.
* @param format Formatting rules.
* @param ... Variable number of format parameters.
* @noreturn
* @error
*/
native ShowActivityEx(client, const String:tag[], const String:format[], any:...);
native void ShowActivityEx(int client, const char[] tag, const char[] format, any ...);
/**
* Given an originating client and a target client, returns the string
@@ -324,7 +309,7 @@ native ShowActivityEx(client, const String:tag[], const String:format[], any:...
* sm_show_activity filters.
* @error Invalid client index or client not connected.
*/
native FormatActivitySource(client, target, const String:namebuf[], maxlength);
native bool FormatActivitySource(int client, int target, const char[] namebuf, int maxlength);
/**
* Called when a server-only command is invoked.
@@ -344,10 +329,9 @@ typedef SrvCmd = function Action (int args);
* @param callback A function to use as a callback for when the command is invoked.
* @param description Optional description to use for command creation.
* @param flags Optional flags to use for command creation.
* @noreturn
* @error Command name is the same as an existing convar.
*/
native RegServerCmd(const String:cmd[], SrvCmd:callback, const String:description[]="", flags=0);
native void RegServerCmd(const char[] cmd, SrvCmd callback, const char[] description="", int flags=0);
/**
* Called when a generic console command is invoked.
@@ -370,10 +354,9 @@ typedef ConCmd = function Action (int client, int args);
* @param callback A function to use as a callback for when the command is invoked.
* @param description Optional description to use for command creation.
* @param flags Optional flags to use for command creation.
* @noreturn
* @error Command name is the same as an existing convar.
*/
native RegConsoleCmd(const String:cmd[], ConCmd:callback, const String:description[]="", flags=0);
native void RegConsoleCmd(const char[] cmd, ConCmd callback, const char[] description="", int flags=0);
/**
* Creates a console command as an administrative command. If the command does not exist,
@@ -389,15 +372,14 @@ native RegConsoleCmd(const String:cmd[], ConCmd:callback, const String:descripti
* @param group String containing the command group to use. If empty,
* the plugin's filename will be used instead.
* @param flags Optional console flags.
* @noreturn
* @error Command name is the same as an existing convar.
*/
native RegAdminCmd(const String:cmd[],
ConCmd:callback,
adminflags,
const String:description[]="",
const String:group[]="",
flags=0);
native void RegAdminCmd(const char[] cmd,
ConCmd callback,
int adminflags,
const char[] description="",
const char[] group="",
int flags=0);
/**
* Returns the number of arguments from the current console or server command.
@@ -405,7 +387,7 @@ native RegAdminCmd(const String:cmd[],
*
* @return Number of arguments to the current command.
*/
native GetCmdArgs();
native int GetCmdArgs();
/**
* Retrieves a command argument given its index, from the current console or
@@ -417,7 +399,7 @@ native GetCmdArgs();
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native GetCmdArg(argnum, String:buffer[], maxlength);
native int GetCmdArg(int argnum, char[] buffer, int maxlength);
/**
* Retrieves the entire command argument string in one lump from the current
@@ -427,14 +409,14 @@ native GetCmdArg(argnum, String:buffer[], maxlength);
* @param maxlength Maximum length of the buffer.
* @return Length of string written to buffer.
*/
native GetCmdArgString(String:buffer[], maxlength);
native int GetCmdArgString(char[] buffer, int maxlength);
/**
* Gets a command iterator. Must be freed with CloseHandle().
*
* @return A new command iterator.
*/
native Handle:GetCommandIterator();
native Handle GetCommandIterator();
/**
* Reads a command iterator, then advances to the next command if any.
@@ -448,12 +430,12 @@ native Handle:GetCommandIterator();
* @param descLen Command description buffer size.
* @return True on success, false if there are no more commands.
*/
native bool:ReadCommandIterator(Handle:iter,
String:name[],
nameLen,
&eflags=0,
String:desc[]="",
descLen=0);
native bool ReadCommandIterator(Handle iter,
char[] name,
int nameLen,
int &eflags=0,
char[] desc="",
int descLen=0);
/**
* Returns whether a client has access to a given command string. The string
@@ -472,10 +454,10 @@ native bool:ReadCommandIterator(Handle:iter,
* there is a matching admin command.
* @return True if the client has access, false otherwise.
*/
native bool:CheckCommandAccess(client,
const String:command[],
flags,
bool:override_only=false);
native bool CheckCommandAccess(int client,
const char[] command,
int flags,
bool override_only=false);
/**
* Returns whether an admin has access to a given command string. The string
@@ -494,10 +476,10 @@ native bool:CheckCommandAccess(client,
* there is a matching admin command.
* @return True if the admin has access, false otherwise.
*/
native bool:CheckAccess(AdminId:id,
const String:command[],
flags,
bool:override_only=false);
native bool CheckAccess(AdminId id,
const char[] command,
int flags,
bool override_only=false);
/**
* Returns the bitstring of flags of a command.
@@ -506,7 +488,7 @@ native bool:CheckAccess(AdminId:id,
* @return A bitstring containing the FCVAR_* flags that are enabled
* or INVALID_FCVAR_FLAGS if command not found.
*/
native GetCommandFlags(const String:name[]);
native int GetCommandFlags(const char[] name);
/**
* Sets the bitstring of flags of a command.
@@ -515,7 +497,7 @@ native GetCommandFlags(const String:name[]);
* @param flags A bitstring containing the FCVAR_* flags to enable.
* @return True on success, otherwise false.
*/
native bool:SetCommandFlags(const String:name[], flags);
native bool SetCommandFlags(const char[] name, int flags);
/**
* Starts a ConCommandBase search, traversing the list of ConVars and
@@ -537,7 +519,7 @@ native bool:SetCommandFlags(const String:name[], flags);
* On failure, INVALID_HANDLE is returned, and the
* contents of outputs is undefined.
*/
native Handle:FindFirstConCommand(String:buffer[], max_size, &bool:isCommand, &flags=0, String:description[]="", descrmax_size=0);
native Handle FindFirstConCommand(char[] buffer, int max_size, bool &isCommand, int &flags=0, char[] description="", int descrmax_size=0);
/**
* Reads the next entry in a ConCommandBase iterator.
@@ -555,7 +537,7 @@ native Handle:FindFirstConCommand(String:buffer[], max_size, &bool:isCommand, &f
* If no more entries exist, false is returned, and the
* contents of outputs is undefined.
*/
native bool:FindNextConCommand(Handle:search, String:buffer[], max_size, &bool:isCommand, &flags=0, String:description[]="", descrmax_size=0);
native bool FindNextConCommand(Handle search, char[] buffer, int max_size, bool &isCommand, int &flags=0, char[] description="", int descrmax_size=0);
/**
* Adds an informational string to the server's public "tags".
@@ -565,17 +547,15 @@ native bool:FindNextConCommand(Handle:search, String:buffer[], max_size, &bool:i
* Note: Currently, this function does nothing because of bugs in the Valve master.
*
* @param tag Tag string to append.
* @noreturn
*/
native AddServerTag(const String:tag[]);
native void AddServerTag(const char[] tag);
/**
* Removes a tag previously added by the calling plugin.
*
* @param tag Tag string to remove.
* @noreturn
*/
native RemoveServerTag(const String:tag[]);
native void RemoveServerTag(const char[] tag);
/**
* Callback for command listeners. This is invoked whenever any command
@@ -622,7 +602,7 @@ typedef CommandListener = function Action (int client, const char[] command, int
* @return True if this feature is available on the current game,
* false otherwise.
*/
native bool:AddCommandListener(CommandListener:callback, const String:command[]="");
native bool AddCommandListener(CommandListener callback, const char[] command="");
/**
* Removes a previously added command listener, in reverse order of being added.
@@ -632,7 +612,7 @@ native bool:AddCommandListener(CommandListener:callback, const String:command[]=
* The command is case insensitive.
* @error Callback has no active listeners.
*/
native RemoveCommandListener(CommandListener:callback, const String:command[]="");
native void RemoveCommandListener(CommandListener callback, const char[] command="");
/**
* Returns true if the supplied command exists.
@@ -640,7 +620,7 @@ native RemoveCommandListener(CommandListener:callback, const String:command[]=""
* @param command Command to find.
* @return True if command is found, false otherwise.
*/
stock bool:CommandExists(const String:command[])
stock bool CommandExists(const char[] command)
{
return (GetCommandFlags(command) != INVALID_FCVAR_FLAGS);
}
@@ -654,7 +634,7 @@ stock bool:CommandExists(const String:command[])
* @return An Action value. Returning Plugin_Handled bypasses the game function call.
Returning Plugin_Stop bypasses the post hook as well as the game function.
*/
forward Action:OnClientSayCommand(client, const String:command[], const String:sArgs[]);
forward Action OnClientSayCommand(int client, const char[] command, const char[] sArgs);
/**
* Global post listener for the chat commands.
@@ -662,6 +642,5 @@ forward Action:OnClientSayCommand(client, const String:command[], const String:s
* @param client Client index.
* @param command Command name.
* @param sArgs Chat argument string.
*
*/
forward void OnClientSayCommand_Post(int client, const char[] command, const char[] sArgs);