wiki:EventSocket

Version 2 (modified by xwang, 13 years ago) (diff)

--

EventSocket

The event socket is used for event-based data that has nothing to do with any particular command on the command channel. To establish a connection, connect to port 6001 while URCS Quagents3 is running. Next, issue an "identity X" (where X is the entitynum of the quagent) command to create an event socket for that quagent.

Messages:

All messages on the event socket start with "ev".

  • sy - "Say"
    • returns X M where X is the entityid of the speaking quagent, and M is the message, terminated by a newline.
  • dt - "Death"
    • returns the quagent's own entityid when it dies

Example:

  • Quagent 3 sends: "n sy 512 600 Hello, I am a quagent."
  • On the EventSocket of all bots within 600 units that have line-of-sight, the message "ev sy 3 Hello, I am a quagent." arrives (terminated by a newline).
  • Quagent 1 is killed.
  • On quagent 1's event socket, the message "ev dt 1" arrives.