Update readme
This commit is contained in:
10
README.md
10
README.md
@ -2,14 +2,14 @@
|
||||
# CSMH
|
||||
|
||||
### What is CSMH?
|
||||
CSMH is a Client and Server Message Handler framework for communication between Eluna and the WoW interface. It has been tested on Mangos and TrinityCore 3.3.5a, but it will probably work for other versions as well.
|
||||
CSMH is a **C**lient and **S**erver **M**essage **H**andler framework for communication between Eluna and the WoW client interface. It has been tested on Mangos and TrinityCore 3.3.5a, but it will probably work for other versions as well.
|
||||
|
||||
CSMH consists of two parts, the Client Message Handler and the Server Message Handler respectively.
|
||||
|
||||
### How does this compare to AIO?
|
||||
While AIO is the most used solution of this kind, it has its drawbacks as well. While it allows you to write all your code server-side, it also limits you to the Lua API only. AIO also sends the full addon code to the client on startup and reload, which is fairly network intensive. Upside of AIO is its ease of distribution compared to dedicated client-side addons.
|
||||
While AIO is the most used solution of this kind, it has its drawbacks as well. While it allows you to write all your code server-side, it also limits you to the Lua API only. AIO also sends the full addon code to the client on startup and reload, which is relatively bandwidth intensive compared to communication only. Upside of AIO is its ease of distribution compared to dedicated client-side addons.
|
||||
|
||||
CSMH is only meant to transport data between the client and the server, and is therefore not as network intensive as AIO. You write your server-side code on the server, and you distribute your client-side code either as an addon, or in a patch. This allows you to use XML and templates, as well as the full Lua API.
|
||||
CSMH is only meant to transport data between the client and the server, and is therefore not as bandwidth intensive as AIO. You write your server-side code on the server, and you distribute your client-side code either as an addon, or in a patch. This allows you to use XML and templates, as well as the full Lua API.
|
||||
|
||||
Both AIO and CSMH uses smallfolk for serialization, and is compatible with each other. You can use both AIO and CSMH in the same project.
|
||||
|
||||
@ -45,14 +45,14 @@ The CMH can be distributed either as a stand-alone addon, or through a patch. Fi
|
||||
- **RegisterServerResponses** takes a config table (see Both section for structure) and registers functionId's to corresponding client side functions. You then use these functionId's in SendServerResponse.
|
||||
|
||||
`SendClientRequest(prefix, functionId, ...)`
|
||||
- **SendClientRequest** sends a Client Request to the Server, with *prefix* and *functionId* defined in your server config table. Takes any amount of string, integer, table or boolean variables and sends to the corresponding function.
|
||||
- **SendClientRequest** sends a Client Request to the Server, with *prefix* and *functionId* defined in your server config table. Takes any amount of string, integer, table or boolean variables and sends to the corresponding function. Nil variables are not supported. This is default Lua behavior.
|
||||
|
||||
### Server:
|
||||
`RegisterClientRequests(config table)`
|
||||
- **RegisterClientRequests** takes a config table (see Both section for structure) and registers functionId's to corresponding server side functions. You then use these functionId's in SendClientRequest.
|
||||
|
||||
`Player:SendServerResponse(prefix, functionId, ...)`
|
||||
- **SendServerResponse** sends a Server Response to the Client, with *prefix* and *functionId* defined in your client config table. Takes any amount of string, integer, table or boolean variables and sends to the corresponding function. Requires *player* object.
|
||||
- **SendServerResponse** sends a Server Response to the Client, with *prefix* and *functionId* defined in your client config table. Takes any amount of string, integer, table or boolean variables and sends to the corresponding function. Nil variables are not supported. This is default Lua behavior. Requires *player* object.
|
||||
|
||||
### Both:
|
||||
local config = {
|
||||
|
||||
Reference in New Issue
Block a user