How does the server work?
The whole action is very simple:
1.A client named, for example, client1 sends a message to the server destined to a client named client2. The message is in a certain shape, for example
<protocol>
<userMsg sendTo="client2">
<data game="27"></data>
</userMsg>
</protocol>
2.The server resends the message to the client2 in the shape of:
<protocol>
<received action="userMsg" sentFrom="test">
<data game="27"></data>
</received>
</protocol>
3.The server confirms to the sender sending of the message. Client1 then receives the message
<protocol>
<response action="userMsg" errorCode="0"/>
</protocol>
Common information about work with the server
1. In all requests sent to the server we can use the attribute sid. This attribute is optional and is returned to the client that used it. The attribute sid is to identify precisely request-answer. If a client does not use this attribute it is not returned. The attribute has to be of a unique value within the requests of the same type to be able to use it to distinguish separate requests. This is very important when sending quick requests.
2. If we send a message to the client, it is always received in the shape of
<protocol>
<received action="userMsg">....</received>
</protocol>
action identifies type of the received message.
3. If the server replies to the client the reply is in the shape of
<protocol>
<response action="userMsg" errorCode="0" ..... />
</protocol>
Action identifies type of the request and errorCode is a return code. If errorCode="0" is returned, it means everything has been done well. In the opposite case an error occured. The following table shows a list of common errors, that the socket server returns to the client.
| errorCode |
|
Error description |
| 0 |
|
The required operation has passed without any error |
| -1 |
|
Incoorect XML format of the sent dates |
| -2 |
|
No attribute has been used in the request |
| -3 |
|
The client is not logged in to any domain |
| -4 |
|
The client is not logged in to any room |
|
-1000 |
|
The client is not logged in as an administrator |
Other errors will be defined separately for the appropriate function.
Note: Attrributes marked with [ ] are optional, so they don`t have to be used in the XML protocol.
Protocol for using of the XML server
The XML Socket Multiuser Server uses the following commands
| login |
|
Logging in of a client to the server. |
| roomLogin |
|
Logging in of the client to a room. |
| userMsg |
|
Sending of a private message to a chosen client. |
| roomMsg |
|
Sending of a message to all clients logged in the room. |
| userList |
|
List of clients logged in the room. |
| roomList |
|
List of available rooms. |
| myRoom |
|
Information about the room that the client is logged in. |
| addRoom |
|
Addition of a room to the domain. |
| addRoomGame |
|
Addition of a game room to the domain. |
| delRoom |
|
Closure of the room. |
| variableList |
|
Obtention of names and values of all variables in the room. |
| getVariable |
|
Obtention of the value of the variable in the room. |
| setVariable |
|
Setting of the variable in the room to a certain value. |
| addVariable |
|
Addition of a variable to the room. |
| delVariable |
|
Deletion of the variable in the room. |
| echo |
|
Test of response of the server. |
| serverInfo |
|
Information about the XML Socket Multiuser Server. |
| disconnect |
|
Logging out of the client. |
| xtra |
|
Use of the XML Socket Multiuser Server extension. |
| adminLogin |
|
A login of the administrator to the server. |
| adminMsg |
|
Sending of a message from the administrator to other clients. |
|
adminBan |
|
Disconnection of client from the server by the administrator. |
|
adminInfo |
|
Detailed information about the XML Socket Multiuser Server. |
|
adminRestart |
|
Restart of the XML Socket Multiuser Server. |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
login - Logging in of a client to the server
Logging a client to the server means acceding a certain domain, where they then work, use its rooms and variables. One user can only be logged in one domain only.
XML request, sent by the client to the server
<protocol>
<login nickName="client3" domainName="demo1" domainPassword="pass1" [sid="1"]/>
</protocol>
| Attribute |
Meaning |
| nickName |
Nickname under which you want to log in the server. This nickname must be unique on the server and it must contain more than 2 sign. If the nickname is already in use, the server notifies the user. |
| domainName |
A name of the domain to which we want to log. |
| domainPassword |
The user must use a password to be logged in. List of the used passwords is defined by administrator in the file eClever.config. |
Note: The command login must be sent to the server within certain time after the connection. If the time limit runs out the client is disconnected from the server. This limit is defined in eClever.config in the parameter loginTimeOut.
If several different client applications use one domain they have the same parametres domainName and domainPassword. For short: To an application of one developer we log in the same way if their application uses one domain section.
XML response of the server to the client
<protocol>
<response action="login" clientId="5F1A8894-EF25-41E0-BAF3-0DFC7675B252" errorCode="0" [sid="1"]/>
</protocol>
|
Attribute |
Meaning |
|
clientId |
Identificator unambiguously identifying each user. |
| errorCode |
Error description |
| 11 |
Incorrect password for logging in. |
| 12 |
The inserted nickname already exists. |
| 13 |
Nickname contains less than 4 signs or more then 25 signs. |
| 14 |
Unsuccessful attempt to log in the domain due to exceeded limit of logged clients. |
|
15 |
The client is already logged in the server. If he wants to log in to another domain
he has to get disconnected first. |
XML message of the server to other clients
Other logged in clients do not get any message.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
roomLogin - Logging in of the client to a room
XML request, sent by the client to the server
<protocol>
<roomLogin room="room1" [password="a1"] [sid="2"]/>
</protocol>
| Attribute |
Meaning |
| room |
Name of the room we want to log in. List of all available rooms can be acquired using the request roomList. |
| password |
In order to enter a room the user has to use a password,under the condition it is required. List of rooms and passwords are defined by administrator in the configuration file for every domain. |
XML response of the server to the client
<protocol>
<response action="roomLogin" errorCode="0" [sid="2"] />
</protocol>
| errorCode |
Error description |
| 21 |
Incorrect room access information. |
| 22 |
Unsuccessful attempt to log in the room due to exceeded limit of logged clients. |
| 23 |
The attempt to send information to all logged clients in the room was unsuccessful. |
XML message of the server to other clients
<protocol>
<received action="roomLogin" sentFrom="client1"><data room="room1"/></received>
</protocol>
| Attribute |
Meaning |
| sentFrom |
Name of the client that has been logged in the room. |
| room |
Name of the room where the client has been logged in. |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
userMsg - Sending of a private message to a chosen client
XML request, sent by the client to the server
<protocol>
<userMsg sendTo="test2" type="message" [sid="3"]>
<data><game position="27" time="12"/></data>
</userMsg>
</protocol>
| Attribute |
Meaning |
| sendTo |
Name of the client you want to send a private message to. |
| type |
A type of a private message. The serve is now using the following values:
1. type="message", is used when sending a simple private message.
2. type="challenge", is used for an invitation appeal for a game.
3. type= "answer", is used to reply to the invitation appeal for a game. |
| data |
Everything you will put to the section <data ... ></data> , will be sent to the client. The section dates must, of course, be in a valid XML format. |
XML response of the server to the client
<protocol>
<response action="userMsg" type="message" errorCode="0" [sid="3"]/>
</protocol>
| errorCode |
Error description |
| 31 |
No receiver of the message has been inserted. |
| 32 |
The message didn't contain the section dates. |
| 33 |
There is no client with this name. |
| 34 |
The message couldn't be sent. |
XML message of the server to other clients
<protocol>
<received action="userMsg" sentFrom="test3" type="message">
<data><game position="27" time="12"/></data>
</received>
</protocol>
| Attribute |
Meaning |
| sentFrom |
Name of the client that sent the message. |
| type |
A type of a private message. |
| data |
In this section the information, that are sent by the client, are included. |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
roomMsg - Sending of a message to all clients logged in the room
XML request, sent by the client to the server
<protocol>
<roomMsg [sid="4"]>
<data><game position="27" time="12"/></data>
</roomMsg>
</protocol>
| Attribute |
Meaning |
| data |
Everything you will put to the section <data ... ></data> , will be sent to all the clients logged in the room. The section dates must, of course, be in a valid XML format. |
Note: The client can only communicate with clients logged in the same room.
XML response of the server to the client
<protocol>
<response action="roomMsg" errorCode="0" [sid="4"]/>
</protocol>
| errorCode |
Error description |
| 41 |
The message didn't contain the section dates. |
| 42 |
There are no clients in the room you are logged in. |
| 43 |
The message couldn't be sent to all clients logged in the room. |
XML message of the server to other clients
<protocol>
<received action="roomMsg" sentFrom="test3">
<data><game position="27" time="12"/></data>
</received>
</protocol>
| Attribute |
Meaning |
| sentFrom |
Name of the client that sent the message. |
| data |
In this section the information, that are sent by the client to other clients in the room, are included. |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
userList - List of clients logged in the room
XML request, sent by the client to the server
<protocol>
<userList [sid="5"]/>
</protocol>
Note:The client can acquire list of clients logged in the same room only.
XML response of the server to the client
<protocol>
<response action="userList" errorCode="0" [sid="5"]>
<data userCount="2">
<nickName>client1></nickName>
<nickName>client2</nickName>
</data>
</response>
</protocol>
| Attribute |
Meaning |
| userCount |
Number of clients logged in the room. |
| data |
In this section there is a list of clients logged in the room. |
XML message of the server to other clients
Other logged in clients do not get any message.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
roomList - List of available rooms
XML request, sent by the client to the server
<protocol>
<roomList [sid="6"]/>
</protocol>
Note: Only visible rooms (in the configuration file in the section room isPrivate=false is set) are included in the list.
XML response of the server to the client
<protocol>
<response action="roomList" errorCode="0" [sid="6"]>
<data roomCount="3">
<room name="room1" category="cinema" content="new movies" language="en"/>
<room name="room2" category="literature" content="new titles" language="en"/>
<room name="room3" category="science" content="science news" language="en"/>
</data>
</response>
</protocol>
| Attribute |
Meaning |
| roomCount |
Number of visible rooms. |
| data |
In this section there is a list of visible rooms and their parametres. |
XML message of the server to other clients
Other logged in clients do not get any message.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
myRoom - Information about the room that the client is logged in
XML request, sent by the client to the server
<protocol>
<myRoom [sid="7"]/>
</protocol>
XML response of the server to the client
<protocol>
<response action="myRoom" errorCode="0" [sid="7"]>
<data roomName="room1"/>
</response>
</protocol>
| Attribute |
Meaning |
| roomName |
Name of the room, the client is logged in. |
XML message of the server to other clients
Other logged in clients do not get any message.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
addRoom - Addition of a room to the domain
XML request, sent by the client to the server
<protocol>
<addRoom name="d25"
password="a22"
isPrivate="true"
isPermanent="true"
maxUsers="10"
category="a"
content="b"
languages="en"
[sid="2"] />
</protocol>
| Atribut |
Meaning |
| name |
Name of the room we want to add to the domain. |
| password |
Password for entry to the room. |
| isPrivate |
Option distinguishing visible and hidden room. |
|
isPermanent |
Selection whether the room will be deleted after the client that created it has
left. If we insert isPermanent="true", the room will not be deleted. If the room
has the feature isPermanent="true", the variables created by the user will be deleted
neither. However, if the founder of the room wants to delete the room, he, of course,
can do so using the function delRoom. |
| maxUsers |
The maximal number of clients that can be logged in the room. The adjustable value ranges from 2 to 50. |
| category |
The category to which you can link this room. This attribute is only informative and for the XML Socket Multiuser Server is not any important. |
| content |
A brief description of the room. This attribute is only informative and for the XML Socket Multiuser Server is not any important. |
| language |
Language to be used in this room. This attribute is only informative and for the XML Socket Multiuser Server is not any important. |
Note: Rooms can only be added to the domains where this action is enabled. Such a domain has to have
maxRoomsPerUser>0 and maxRooms>0.
XML response of the server to the client
<protocol>
<response action="addRoom" errorCode="0" [sid="2"]/>
</protocol>
| errorCode |
Error description |
| 101 |
To create new rooms is not allowed in the domain. |
| 102 |
The value of maxRoomsPerUser or maxRooms was exceeded. |
| 103 |
The variable name is not defined. |
| 104 |
A room with this name already exists in the domain. |
| 105 |
The message about creation of the room could not be sent to all clients. |
XML message of the server to other clients
<protocol>
<received action="addRoom" name="d27" sentFrom="test"/>
</protocol>
| Attribute |
Meaning |
| name |
Name of a new room. |
| sentFrom |
Name of the client founding the room. |
Note: Other clients logged in the domaine will only receive the message in case the new room is public, it means isPrivate=false.
If the newly founded room is not public, other clients will not receive any message.
----------------------------------------------------------------------------------------------------------------------------------------------------------
addRoomGame - Addition of a game room to the domain
When defining a game room, a new room is created, as in addRoom with the difference that it is private, it means isPrivate=true. Together with the room creation variables used during a game are defined. The game room is always created by the user who sends an invitation appeal for the game.
XML request, sent by the client to the server
<protocol>
<addRoomGame name="d25" password="a22" userMax="0" sid="2">
<variables>
<a>27</a>
<b>179</b>
<c>John</c>
</variables>
</addRoomGame>
</protocol>
| Atribut |
Meaning |
| name |
Name of the game room we want to add to the domain. |
| password |
Password for entry to the game room. |
| maxUsers |
Number of players playing the game. |
| variables |
In the section variables we define the variables used for the game. They are defined in the shape for example <a>27</a>. |
Note: Rooms can only be added to the domains where this action is enabled. Such a domain has to have
maxRoomsPerUser>0 and maxRooms>0.
XML response of the server to the client
<protocol>
<response action="addRoomGame" errorCode="0" [sid="2"]/>
</protocol>
| errorCode |
Error description |
| 101 |
To create new rooms is not allowed in the domain. |
| 102 |
The value of maxRoomsPerUser or maxRooms was exceeded. |
| 103 |
The variable name is not defined. |
| 104 |
A room with this name already exists in the domain. |
| 231 |
To create new variables is not allowed in the room. |
| 232 |
The value of maxVariablesPerUser or maxVariables was exceeded. |
| 233 |
The variable name is not defined. |
| 234 |
A variable with this name already exists in the room. |
XML message of the server to other clients
Other logged in clients do not get any message.
----------------------------------------------------------------------------------------------------------------------------------------------------------
delRoom - Closure of the room
XML request, sent by the client to the server
<protocol>
<delRoom name="d22" [sid="2"]/>
</protocol>
| Atribut |
Meaning |
| name |
Name of the room we want to close. |
Note: The room can only be closed by the same client that created it. If the client is logged off from the XML Socket Multiuser Server all the rooms that were created, are closed. Other clients are informed about that using the XML function delRoom.
XML response of the server to the client
<protocol>
<response action="delRoom" errorCode="0" [sid="2"]/>
</protocol>
| errorCode |
Error description |
| 111 |
A room with this name does not exist in the domain. |
| 112 |
You don't have the right to close this room. |
| 113 |
The message about cancellation of the room could not be sent to all clients. |
XML message of the server to other clients
<protocol>
<received action="delRoom" name="d27"/>
</protocol>
| Atribut |
Meaning |
| name |
Name of the cancelled room. |
Note: If the deleted room is non-public, only clients logged in this room will receive the message. Other clients will not receive it.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
variableList - Obtention of names and values of all variables in the room
XML request, sent by the client to the server
<protocol>
<variableList [sid="2"]/>
</protocol>
Note: The function variableList returns only those variables whose attribute isPrivate is set to false.
XML response of the server to the client
<protocol>
<response action="variableList" errorCode="0" [sid="2"]>
<data variableCount="3">
<a>18</a>
<b>118</b>
<c>28</c>
</data>
</response>
</protocol>
| Attribute |
Meaning |
| variableCount |
Number of variables in the room |
| data |
In the section data, information about the variables is returned |
| errorCode |
Error description |
| 201 |
There are no variables in the room |
XML message of the server to other clients
Other logged in clients do not get any message.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
getVariable - Obtention of the value of the variable in the room
XML request, sent by the client to the server
<protocol>
<getVariable name="a" [sid="2"]/>
</protocol>
| Attribute |
Meaning |
| name |
Name of the room which value we want to obtain. |
XML response of the server to the client
<protocol>
<response action="getVariable" errorCode="0" [sid="2"]>
<data><a>18</a></data>
</response>
</protocol>
| Attribute |
Meaning |
| data |
In the section data information about the variable is returned. |
| errorCode |
Error description |
| 211 |
Such a variable does not exist in the room. |
XML message of the server to other clients
Other logged in clients do not get any message.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
setVariable - Setting of the variable in the room to a certain value
XML request, sent by the client to the server
<protocol>
<setVariable [sid="2"]>
<data name="a">67</data>
</setVariable>
</protocol>
| Atribut |
Meaning |
| name |
Name of the variable in the room, whose value we want to change. |
| value |
Value of the variable. |
XML response of the server to the client
<protocol>
<response action="setVariable" errorCode="0" [sid="2"]/>
</protocol>
| errorCode |
Error description |
| 221 |
Such a variable does not exist in the room. |
| 222 |
The message to your clients about change of the variable could not be sent. |
XML message of the server to other clients
<protocol>
<received action="setVariable" sentFrom="test">
<data><a></a></data>
</received>
</protocol>
| Atribut |
Meaning |
| sentFrom |
Name of the client who changed the variable. |
| data |
In the section data the name of the changed variable and its value are defined. |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
addVariable - Addition of a variable to the room
XML request, sent by the client to the server
<protocol>
<addVariable sid="2">
<data name="abc" isPrivate="false">27</data>
</addVariable>
</protocol>
| Atribut | Meaning |
| name | Name of the variable we want to add to the room. |
| isPrivate | Option distinguishing visible and hidden variable. |
| value | Value of the variable. |
Note: Variables can only be added to the rooms where this action is enabled. Such a domain has to have
maxVariablesPerUser>0 and maxVariables>0.
XML response of the server to the client
<protocol>
<response action="addVariable" errorCode="0" [sid="2"]/>
</protocol>
| errorCode | Error description |
| 231 | To create new variables is not allowed in the room. |
| 232 | The value of maxVariablesPerUser or maxVariables was exceeded. |
| 233 | The variable name is not defined. |
| 234 | A variable with this name already exists in the room. |
| 235 | The message about creation of the variable could not be sent to all clients. |
XML message of the server to other clients
<protocol>
<received action="addVariable" sentFrom="test">
<data><abc>27</abc></data>
</received>
</protocol>
| Atribut | Meaning |
| sentFrom | Name of the client founding the variable. |
| data | In the section data there is name of the new variable and its value. |
Note: Other clients logged in the room will only receive the message in case the new variable is public, it means isPrivate=false.
If the newly founded variable is not public, other clients will not receive any message.
----------------------------------------------------------------------------------------------------------------------------------------------------------
delVariable - Deletion of the variable in the room
XML request, sent by the client to the server
<protocol>
<delVariable name="abc" [sid="2"]/>
</protocol>
| Atribut | Meaning |
| name | Name of the variable we want to close. |
Note: The variable can only be closed by the same client that created it. If the client is logged off from the XML Socket Multiuser Server all the variables that were created, are closed. Other clients are informed about that using the XML function delVariable.
XML response of the server to the client
<protocol>
<response action="delVariable" errorCode="0" [sid="2"]/>
</protocol>
| errorCode | Error description |
| 241 | A variable with this name does not exist in the room. |
| 242 | You don't have the right to close this variable. |
| 243 | The message about cancellation of the variable could not be sent to all clients. |
XML message of the server to other clients
<protocol>
<received action="delVariable" name="abc"/>
</protocol>
| Atribut | Meaning |
| name | Name of the cancelled variable. |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
echo - Test of response of the server
XML request, sent by the client to the server
<protocol>
<echo [sid="8"]>
<data>test</data>
</echo>
</protocol>
| Attribute | Meaning |
| data | The function sends contents of the section data to the server. |
XML response of the server to the client
<protocol>
<response action="echo" errorCode="0" [sid="8"]>
<data>test</data>
</response>
</protocol>
| Attribute | Meaning |
| data | The server returns the section data. If the section data sent and returned are not alike the server does not work well. |
XML message of the server to other clients
Other logged in clients do not get any message.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
serverInfo - Information about the XML Socket Multiuser Server
XML request, sent by the client to the server
<protocol>
<serverInfo [sid="9"]/>
</protocol>
XML response of the server to the client
<protocol>
<response action="serverInfo" errorCode="0" [sid="9"]>
<data productName="XML Socket Server - Basic"
fileVersion="1.0.4.17"
protocolVersion="1.1"
serverDate="2005-09-13"
serverTime="08:00:49"
startServerDate="2005-09-13"
startServerTime="08:00:10"
maxMsgLength="16"/>
</response>
</protocol>
| Attribute | Meaning |
| productName | Name of the XML Socket Multiuser Server that is being run. |
| fileVersion | Number defining the version of the file of the XML Socket Multiuser Server. |
| protocolVersion | Number defining the version of the protocol of the XML Socket Multiuser Server. |
| serverDate | The actual date on the computer where the XML Socket Multiuser Server is run. |
| serverTime | The actual time on the computer where the XML Socket Multiuser Server is run. |
| startServerDate | Date of launching the XML Socket Multiuser Server. |
| startServerTime | Time of launching the XML Socket Multiuser Server. |
| maxMsgLength | The maximal size of the message sent to the XML Socket Multiuser Server. |
XML message of the server to other clients
Other logged in clients do not get any message.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
disconnect - Logging out of the client
XML request, sent by the client to the server
<protocol>
<disconnect [sid="10"]/>
</protocol>
XML response of the server to the client
<protocol>
<response action="disconnect" errorCode="0" [sid="10"]/>
</protocol>
XML message of the server to other clients
<protocol>
<received action="disconnect" sentFrom="client1"/>
</protocol>
Note: Only the clients logged in the same room get the message as the unlogging client.
| Attribute | Meaning |
| sentFrom | Name of the client that logged out of the room. |
Disconnection of the client from the server
XML message of the server to other clients
<protocol>
<received action="disconnect" code="1" sentFrom="server"/>
</protocol>
If the client has been disconnected from the server, in the attribute sentFrom "server" is returned.
The attribute is then returned in the shape sentFrom="server".
| code | Error description |
| 1 | Disconnection of the client from the server in the case the XML Socket Multiuser Server is stopped or restarted. |
| 2 | Disconnection of the client from the server in the case the number of logged users overpasses the allowed limit. |
| 3 | Disconnection of the client in the case the memory used by the XML Socket Multiuser Server exceeds the value maxMemory. |
| 4 | The client has been disconnected because of excessive size of the message sent to the XML Socket Multiuser Server. It was longer than the maximal allowed value maxMsgLength. |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
xtra - Use of the XML Socket Multiuser Server extension
The XML Socket Multiuser Server can be extended using special ecs libraries. Using such extensions we can, for example, send mails from the XML Socket Multiuser Server or connect to various databases, save results of measurements or connect to applications CGI, ISAPI, PHP ASP.NET etc.
How to use the extension:
1. We have to create our own ecs library or to use an already created one.
2. We copy this library to the folder xtras.
3. In the file eClever.config we add to the section socket-server / xtras name of such ecs library and name under which we will call this extension from our applications.
4. In the domains where we want to allow using of the extension we have to insert in the file eClever.config and section domain names of all the extensions to the atribute xtras, for example xtras="test1#test2".
XML request, sent by the client to the server
<protocol>
<xtra [sid="10"]>
<data name="test1" function="abc">a=20</data>
</xtra>
</protocol>
| Attribute | Meaning |
| name | Name of the extension we are going to call. It has to be defined in eClever.config in the section socket-server / xtras and atribute name. |
| function | Name of the function to be called. |
| data | In the section data we set parameter of the function. A function can only have one parameter and it can, for example, be a chain in the XML format. |
XML response of the server to the client
<protocol>
<response action="xtra" errorCode="0" sid="10"/><data name="test1" function="abc">2747</data>
</protocol>
| Attribute | Meaning |
| name | Name of the called XTRA. |
| function | The called function. |
| data | In the section data the value of the function is returned. Most often this value is in the XML format again. |
| errorCode | Error description |
| 501 | The extension is not allowed in the section socket-server / xtras. |
| 502 | The extension is not allowed in the section domain. |
| 503 | You don’ t have the necessary rights to use the XTRA. |
| 504 | En error occuring when initializing the ecs library. It can be caused by the followings, for example: a) The atribut name that you call in section socket-server / xtras, is not defined. b) The ecs library defined in section socket-server / xtras in the atribute file does not exists or is not placed in the XML Socket Multiuser Server root. c) The error is caused by an internal error regarding the initialization of the ecs library. |
| 505 | The function you are calling is not declared in the ecs library. |
XML message of the server to other clients
Other logged in clients do not get any message.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
adminLogin - A login of the administrator to the server
The administrator logged to the server can send messages to all other clients of the server, no matter the domain or room they are logged to. The list of administrators is inserted in admin.config in the section admins.
XML request, sent by the client to the server
<protocol>
<adminLogin user="John" password="abc" sid="1"/>
</protocol>
| Attribute | Meaning |
|
user | The name used for the administrator to log in to the XML Socket Multiuser Server. |
| password | The password used for the administrator to log in to the XML Socket Multiuser Server. |
XML response of the server to the client
<protocol>
<response action="adminLogin" clientId="5F1A84-EF25-41E0-BAF3-0DFC7B252" errorCode="0" [sid="1"]/>
</protocol>
| Attribute | Meaning |
| clientId | Identificator unambiguously identifying each user. |
| errorCode | Error description |
| 1001 | Incorrect name or password to get connected to the Server. |
| 1002 | The password contains less than 7 characters. |
| 1003 | No name or password is inserted. |
| 1004 | The number of allowed attempts to connect to the server was exceeded. |
| 1005 | The client is already logged in the server. If he wants to log in again using another administrator’ s account, he has to get disconnected first. |
XML message of the server to other clients
Other logged in clients do not get any message.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
adminMsg - Sending of a message from the administrator to other clients
The function can only be used by those connected as administrators.
XML request, sent by the client to the server
<protocol>
<adminMsg who="domain" sendTo="demo1" sid="3">
<data game="27" time="12">Hello</data>
</adminMsg>
</protocol>
| Attribute | Meaning |
| who | Name of the group to which we want to send the message. It can reach the values all, domain, room or user. |
| sendTo | Name of the target group. - If we enter the value who="all"the message is sent to all clients on the server. In this case the parameter sendTo has no meaning.
- If we enter who="domain", then we define in the parameter sendTo the name of the domain we want to send the message to. The message will be received by all the clients logged to the domain.
- If we enter who="room", then we define in the parameter sendTo the name of the room. The message will be sent to all users in the room.
- If we enter who="user,then we define in the parameter sendTo the name of the client. The message will be sent to one client only.
|
| data | Everything you will put to the section <data ... ></data> , will be sent to the client. The section dates must, of course, be in a valid XML format. |
XML response of the server to the client
<protocol>
<response action="adminMsg" errorCode="0" [sid="3"]/>
</protocol>
| errorCode | Error description |
| 1010 | Parameter "who" is not defined. |
| 1011 | Parameter "sendTo" is not defined. |
| 1012 | The message did not contain the section data. |
| 1013 | The message could not be sent. |
| 1014 | No clients are logged in the server. |
XML message of the server to other clients
<protocol>
<received action="adminMsg">
<data game="27" time="12">Hello</data>
</received>
</protocol>
| Attribute | Meaning |
| data | In this section the information, that are sent by the administrator, are included. |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
adminBan - Disconnection of client
from the server by the administrator
This function disconnects the user from the XML Socket MUltiuser Server – eClever
prohibiting him to connect again from the same IP address. The function can only
be used by those connected as administrators.
Note: If XML Socket Multiuser Server – eClever is restarted the function adminBan
loses its functionality. If you want to prevent somebody from connecting definitively
you have to put their IP number in the section black-list of eClever.config.
XML request, sent by the client to the server
<protocol>
<adminBan sendTo="test2" [sid="3"]>
<data>message</data>
</adminBan>
</protocol>
| Attribute | Meaning |
| sendTo | Name of the client that we want to disconnect from the XML Socket Multiuser Server - eClever. |
| data | In the section data we can send a message to the disconnected client explaining why we had done so. |
XML response of the server to the client
<protocol>
<response action="adminBan" errorCode="0" [sid="3"]/>
</protocol>
| errorCode | Error description |
| 1021 | There is no client with this name on the server. |
| 1022 | The message couldn't be sent. |
XML message of the server to other clients<protocol>
<received action="adminBan" sentFrom="admin">
<data>message</data>
</received>
</protocol>
<protocol>
<received action="disconnect" sentFrom="test3"/>
</protocol>
| Attribute | Meaning |
| sentFrom | Name of the client that sent the message. |
| data | In this section the informations, that are sent by the admin, are included. |
-----------------------------------------------------------------------------------------------------------------------------------------------------------
adminInfo - Detailed information about
the XML Socket Multiuser Server
The function can only be used by those connected as administrators.
XML request, sent by the client to the server
<protocol>
<adminInfo [sid="9"]/>
</protocol>
XML response of the server to the client
<protocol>
<response action="adminInfo" errorCode="0" [sid="9"]>
<data thread="27"
memory="5227" />
</response>
</protocol>
| Attribute | Meaning |
| thread | Number of fibres being actually used by the XML Socket Multiuser Server - eClever. |
| memory | Memory in kB being actually used by the XML Socket Multiuser Server - eClever. |
XML message of the server to other clients
Other logged in clients do not get any message.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
adminRestart - Restart of the XML Socket Multiuser Server.
This function restarts the XML Socket Multiuser Server. The function can only be
used by those connected as administrators.
XML request, sent by the client to the server
<protocol>
<adminRestart time="10" [sid="3"]/>
</protocol>
|
Attribute |
Meaning |
|
time |
Time in seconds, in which the restart will be done after having received the request
to do so. |
XML response of the server to the client
<protocol>
<response action="adminRestart" errorCode="0" [sid="3"]/>
</protocol>
XML message of the server to other clients
<protocol>
<received action="disconnect" code="1" sentFrom="server"/>
</protocol>
-----------------------------------------------------------------------------------------------------------------------------------------------------------