![]() ![]() Response = "Current server date is " $ DateFormatted Response = "Current server time is " $ TimeFormatted ĭateFormatted = class'Utils.LevelUtils'.static.FormatTime( TimeFormatted = class'Utils.LevelUtils'.static.FormatTime(Ĭlass'Utils.LevelUtils'.sttaic.GetTime(self.Level), A command handler is always passed the lowercase version of a registered command Local string TimeFormatted, DateFormatted, Response ().Bind("date", self, "!date", "Displays the current server date.") ().Bind("time", self, "!time", "Displays the current server time.") providing dispatcher with detailed usage information register self as the "time" command handler Suppose you wanted to implement !time and !date that would display the current server time and date respectively: class MyExtension extends Julia.Extension implements InterestedInCommandDispatched Id is a unique command identifier that is generated upon the moment a client command is placed into the dispatcher queue. ![]() Dispatcher provides a plain and simple public API for handling command output:ĭispatcher.Respond public function Respond(string Id, string Response)ĭispatcher.ThrowError public function ThrowError(string Id, string Error)ĭispatcher.ThrowUsageError public function ThrowUsageError(string Id)ĭispatcher.ThrowPermissionError public function ThrowPermissionError(string Id)Īll of the response methods expect an Id argument. Once a client command is dispatched, the dispatcher expects a response from the instance that has pledged to handle the command. To unregister all commands that have been tied to a particular instance. Unregister commands before the object gets dealloacated: Dispatcher.Unbind("mycommand", self) ĭispatcher.Unbind("myothercommand", self) Register commands: Dispatcher.Bind("mycommand", self, "!mycommand argument1 argument2", "This command does something") ĭispatcher.Bind("myothercommand", self, "!myothercommand argument", "This command does something as well") Obtain the Dispatcher instance invoking GetDispatcher() on the Core object: local Julia.Dispatcher Dispatcher Public function OnCommandDispatched(Julia.Dispatcher Dispatcher, string Name, string Id, array Args, Julia.Player Player) Implement the Julia.InterestedInCommandDispatched interface: class MyExtension extends Julia.Extension implements InterestedInCommandDispatched To register a command you have to the following: The builtin commands !version and !help serve as an example to the dispatcher protocol. A client command is a typical chat/teamchat message that begins with a ! (exclamation sign). To configure global cache expiration time alter the TTL value of the section in Swat4DedicatedServer.ini: ĭispatcher is a Core asset that provides an ability to register client commands. To obtain the Cache instance you must invoke GetCache() on the Core object: local Julia.Cache Cache īy default all cache entries are stored for 86400 seconds (24 hours). Return an array of values stored under the same key ``Key``. GetArray public function array GetArray(string Key) Return value of the first entry matching key ``Key``. GetValue public function string GetValue(string Key) ![]() Store an array of values ``Array`` under same key ``Key``. SetArray public function SetArray(string Key, array Array) Store a value ``Value`` under a key ``Key``. SetValue public function SetValue(string Key, string Value) DependenciesĬache is a temporary data manager that makes cached data to persist through levels. Julia is a simple yet powerful UnrealScript framework that helps you to develop SWAT 4 mods easily. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |