Articles > Internal docs > Services > Echo
Echo
The echo service is the bridge between in-game chat and IRC chat. The IRC side of echo is implemented as an Anna^ mod.
Echo runs on ports 7767
(IRC) and 7768
(In-game).
Packet spec
byte 0: F byte 1: L byte 2: Y byte 3: packet id
Packet 2: Hello
A Hello
packet is sent to the other side when the echo service comes
online. Upon receiving, the other side should send an I'm there
packet back.
byte 4-7: random value (values 0 and 1 are forbidden)
Note: IRC should also send a Status packet when sending this packet. Game doesn't need to do this since nobody will be online when the game echo bridge starts.
Packet 3: I'm there
An I'm there
packet is sent as a response to a Hello packet.
byte 4-7: same as bytes 4-7 as received from the Hello packet
Note: A Status packet should also be sent when sending this packet.
Packet 4: Bye
Sent when an echo service is shutting down (either side).
Packet 5: Ping
Simple ping packet. Upon receiving, the other side should send an Pong packet back with the same random value.
byte 4-7: random value (values 0 and 1 are forbidden)
Currently, pings are only sent from IRC to game at a specified interval. IRC knows if game is down if they don't receive pongs, and game will know when IRC is down when it hasn't received a ping packet in the designated interval.
Packet 6: Pong
Response to a Ping packet.
byte 4-7: same as bytes 4-7 as received from the Ping packet
Packet 7: Status request
Request a Status packet. Usually this request is made when a user connects. The payload of the response is then sent to the user, so they can be informed about the Echo connection.
Packet 8: Status
Sent to respond to a Status request packet, or accompanying either a Hello or I'm there packet.
byte 4: 1 if this is sent as a response to a status request packet byte 5: lo byte of length of the status message byte 6: hi byte of length of the status message byte 7 - 7+[byte5/6]: status message total len: 7+[byte5/6]
The status message usually contains the connected IRC channel/network (if sent from IRC to game), the amount of users, and the names of some of the users.
Packet 10: Chat
A simple packet saying someone sent a message. This packet can be sent from either side.
byte 4: lo byte of player id as WORD (0 when IRC to game) byte 5: hi byte of player id as WORD (0 when IRC to game) byte 6: length of the nickname (must be less than 50) byte 7: lo byte of length of the message as WORD (must be less than 512) byte 8: hi byte of length of the message as WORD (must be less than 512) byte 9 - 8+[byte6]: nickname byte 9+[byte6] - 8+[byte6]+[byte7/8]: message total len: 9+[byte6]+[byte7/8]
Packet 11: Action
Basically a copy of the Chat packet, but for an action (/me
command).
Packet 12: Generic message
Packet with a type and a message. See types below.
byte 4: message type byte 5: lo byte of length of the message (max 450) byte 6: hi byte of length of the message (max 450) byte 7 - 6+[byte5/6]: message total len: 7+[byte5/6]
Types:
0: flight message, sent from game to irc when a player finishes a flight 1: trac, sent from web to game and irc when a trac ticket/comment was made 2: login message, sent from game to irc 3: IRC mode change message, sent from irc to game 4: IRC topic change message, sent from irc to game 5: IRC nick change message, sent from irc to game 6: protip, sent from game to irc 7: metar weather report, sent from game to irc 8: radio message, sent from game to irc
Packet 30: Player connection
Packet notifying a player has either connected or disconnected.
byte 4: lo byte of player id as WORD (0 when IRC to game) byte 5: hi byte of player id as WORD (0 when IRC to game) byte 6: reason (see below) byte 7: length of the nickname (must be less than 25) byte 8 - 7+[byte6]: nickname total len: 8+[byte6]
Reasons:
Game: 0: timeout 1: quit 2: kick 3: connected IRC: 6: quit 7: part 8: kick 9: join
Note: connection messages coming from the game are just that: connection messages. The player may not be the person registered to the account under the name they currently have. A login message will be sent from game to irc when the player actually logs in (see generic message type 2).
Category: Services | |
---|---|
Echo • Flighttracker |
This article has been accessed 670 time(s).
Main page Article index