Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Tue Jan 21, 2003 5:16 pm Post subject: Protocol Outline |
|
|
|
|
Some servers may allow a Client to connect via the chat protocol on the same port shown when right clicking a zone. Below is the current outlines for each type of message sent back and forth between the client and the server. All messages are sent as ASCII, with a CR (0x0A), LF (0x10), or any combination of those two at the end.
When writing your own clients that use this protocol, do not just use a Split function to divide all :'s, since the last message at the end of any of these may contain more :'s, such as the LOGIN's password could be "jl1:d:$h".
Login - Client to Server
LOGIN:version:name:password |
This should be the first message sent to the server after you open the TCP/IP connection. The version contains which protocol this is for (currently only accepts protocol version 1). It should be of the form "1;client name and version". for example, "1;ccc 1.2, by grelminar". The name and password are plain text, without any encryption place on them.
Login Responce - Server to Client
LOGINBAD:message
LOGINOK:name |
If you get a LOGINBAD, either your username is unknown (cannot create new names under this protocol), or the password does not match your username. Other possible errors maybe that you are not allowed to log into this protocol (so zones may only allow staff to connect), or your banned. In any case, the message will tell you why, and your connect to the server is now treated as disconnected, so your client should close the socket.
LOGINOK means your username and password are accepted. This packet contains your name to be used. Some zones may add extra characters to chat clients (such as a ^ in front), so remember the name the server sends to you, since that will be what you are called in the game.
Changing Arenas - Client to Server
Whenever you want to change arenas, do not send a public message of ?go arena. You will need to issue this command instead. If you want to enter a random public arena, leave the name blank (ie: "GO:").
Entering Arena - Server to Client
INARENA:arenaname:freq
PLAYER:name:ship:freq |
Whenever you receive the INARENA packet, forget all previous information you know of who is currently in the arena. The server will soon follow with player information packets about who is currently in this arena. Please note that you may receive this without issuing a GO command.
The PLAYER packet it sent for everyone already in this arena before you got here. It tells their names, ships, and freqs. The freq may NOT be their real freq, since some zones may have a hash enabled on private freqs, so you can't just lame it up and tell everyone who it really is.
Players entering/leaving arena - Server to Client
ENTERING:name:ship:freq
LEAVING:name |
Whenever someone new enters this arena, it will tell your their name, ship type, and freq. Whenever someone leaves, you'll get told their name so you can remove it from your local database of who is currently in the arena.
Change Freq - Client to Server
Whenever you want to join a new freq, send this command. This should be the actual freq you wish to join. As noted above, some zones may have private freqs hashed, and if you attempt to join the freq that the server tells you, you might be all alone on your team. Also, if you issue this command, you may not change to that freq (ie: might be full or invalid), so do not update your local information yet.
Player Ship/Freq change - Server to Client
SHIPFREQCHANGE:name:ship:freq |
Whenever someone changes their ship, freq, or both at once, the server will send this out.
Kills - Server to Client
KILL:killername:killedname:bounty:flagscarried |
When someone dies, the server sends this to you. If you toggle kills to chat in a game client (?kill), it displays like this 'name(bounty:flags) killed by: name'.
Client Chat Messages - Client to Server
SEND:PUB:message
SEND:PUBM:msg
SEND:PRIV:name:message
SEND:FREQ:freq:message
SEND:CHAT:message
SEND:MOD:message
SEND:CMD:command
SEND:PRIVCMD:name:message
SEND:SQUAD:squad:message
|
This should be able to explain itself. Replace the name with who your trying to message, the freq with whatever freq your trying to message (NOTE: if server hashes freq, used the hashed freq it sent you), and the message with what you want said.
SEND:PUBM is a public macro added at revision 1.5.
For the SEND:CMD, what follows is a command you wish to execute. These will differ with each server, and you should check the actual source code for what you can use in here since there will be many different things you can or cannot do. You can send things like ?cheater in here, but that will also work if sent as PUB.
With the SEND:CHAT, you can do it in the following ways:
- Hi guys - Will act the same as if you typed ;Hi guys in Continuum
- 4;Hi guys - This is how you should do ;4;Hi guys messages. Do not put the beginning ;, otherwise all your chat messages will be sent to your first channel.
Server Chat Messages - Server to Client
MSG:ARENA:msg
MSG:CMD:msg
MSG:PUB:name:msg
MSG:PUBM:name:msg
MSG:PRIV:name:msg
MSG:FREQ:name:msg
MSG:CHAT:channelnum:msg
MSG:MOD:name:msg
MSG:SYSOP:msg
MSG:SQUAD:squad:sender:msg |
ARENA means those green messages the server does to send back information (ie: how ?lag info is responded back). PUB means public messages (PUBM is public macro and can be treated the same as PUB), PRIV is a private message from a player, your client should maintain a list of who is in the current arena, if the sender is not on it, it was a remote private message, FREQ is sent to your whole team, done via "Hi guys in Continuum, CHAT is from the chat channel, MOD is a moderator message (mod chat), and SYSOP is the messages usually only sent to sysops which contain useful information (also used in *warn messages). SQUAD is a squad message.
Miscellaneous
NOOP can be sent both ways. It can be used to keep connections alive if they are behind naff routers, only send this if the user needs it.
Thats about it. Whenever you want to leave, just close the socket, since TCP/IP handles everything else.
Latest version always at http://sscx.net/asss/simple-chat.txt.
UPDATED April 12, 2003: REMOTEPRIV is now formated like PRIV, where you get both the name and message seperate, instead of like normal SS, where you get the name built into the message with a (blah)> formating. This update is because ASSS will work with a new billing which will send names seperate of the message, so you don't have to worry about )> in names anymore.
UPDATED February 19, 2004: REMOTEPRIV is no longer used. Check your internal player list to see if the PRIV came from someone in the current arena or not. KILL has been added. SQUAD has been added. MSG:CHAT is now MSG:CHAT:channelnum:msg (probably for clarity). Note, if you receive a MOD message, it may not have a 'message' part, fx: MSG:MOD:cheater {0} foo> bar is teamkillin meh! Beware of the possibility that the server could send you messages with a different number of tokens than specified here.
UPDATED November 20, 2004: Added PUBM and NOOP. |
|