Editing Mod Hooks
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 64: | Line 64: | ||
* Server_GameCustomMessage (Server_GameCustomMessage.lua) | * Server_GameCustomMessage (Server_GameCustomMessage.lua) | ||
** Called whenever your mod calls [[Mod API Reference:ClientGame|ClientGame]].SendGameCustomMessage. This gives mods a way to communicate between the client and server outside of a turn advancing. Note that if a mod changes Mod.PublicGameData or Mod.PlayerGameData, the clients that can see those changes and have the game open will automatically receive a refresh event with the updated data, so this message can also be used to push data from the server to clients. | ** Called whenever your mod calls [[Mod API Reference:ClientGame|ClientGame]].SendGameCustomMessage. This gives mods a way to communicate between the client and server outside of a turn advancing. Note that if a mod changes Mod.PublicGameData or Mod.PlayerGameData, the clients that can see those changes and have the game open will automatically receive a refresh event with the updated data, so this message can also be used to push data from the server to clients. | ||
− | |||
** Arguments: | ** Arguments: | ||
# [[Mod API Reference:Game|Game]]: Provides read-only information about the game. | # [[Mod API Reference:Game|Game]]: Provides read-only information about the game. | ||
Line 70: | Line 69: | ||
# payload: The data passed as the ''payload'' parameter to SendGameCustomMessage. Must be a lua table. | # payload: The data passed as the ''payload'' parameter to SendGameCustomMessage. Must be a lua table. | ||
# setReturn: Optionally, a function that sets what data will be returned back to the client. If you wish to return data, pass a table as the sole argument to this function. Not calling this function will result in an empty table being returned. | # setReturn: Optionally, a function that sets what data will be returned back to the client. If you wish to return data, pass a table as the sole argument to this function. Not calling this function will result in an empty table being returned. | ||
+ | **[[Mod_Security|Mod security]] should be applied when working with this Hook | ||
== Client Hooks == | == Client Hooks == |