MSDP, the Mud Server Data Protocol, is used to supplement the normal
text-mode interaction between server and client. MSDP consists of a small
set of commands operating on a wide range of variables.
The syntax is /MSDP <COMMAND> =VALUE [=VALUE …]
Example:
/msdp LIST =REPORTABLE_VARIABLES
/echo %MSDP__REPORTABLE_VARIABLES
% MSDP__REPORTABLE_VARIABLES=A B C…
MSDP responses from the server activate the MSDP trigger: For
example:
/def -F -mglob -t'MSDP *' msdp_report = /echo Server set: %*
/msdp LIST =REPORTABLE_VARIABLES
Server set: MSDP REPORTABLE_VARIABLES A B C
The trigger is called before the variable is updated,
allowing you to track changes.
For instance, the following trigger:
/def -mglob -t'MSDP HEALTH *' msdp_health_update = \
/let _hchange=$[ %3 - %MSDP__HEALTH ]%;\
/echo Health changed: %_hchange to %3
The standard commands are:
LIST, SEND, REPORT, UNREPORT, RESET
/msdp LIST =NAME - sends a list from the server. Suggested list names:
LISTS - Request the list of listable things
COMMANDS - Request a list of commands supported by the server.
CONFIGURABLE_VARIABLES - Variables the client can set on the server.
REPORTABLE_VARIABLES - Variables that the server can update you on change
REPORTED_VARIABLES - The current list of variables the client has
requested to be reported.
SENDABLE_VARIABLES - All possible variables.
/MSDP SEND =NAME [ =NAME … ]
Send the current value of a variable
/MSDP REPORT =NAME [ =NAME … ]
Send the current value, and additionally send the value when it is updated.
/MSDP UNREPORT =NAME [ =NAME …]
stop reporting a variable.
/MSDP RESET =NAME [ =NAME …]
Set the variable to it's default state.
Most commonly used to clear the set of REPORTABLE_VARIABLES, but there may
be other server-specific things to reset.
Example is below of usage:
tf5 now auto-negotiates MSDP if the server offers it, and has a new
/msdp command to access it.
It's all completely low level, so some examples:
(Paste the support code first)
/def -i vv = /result $(/_echo %%{%{1}})
/def -mregexp -p0 -t'^MSDP ([^ ]*) ' msdp_trig = \
/echo MSDP::%P1=%PR (was $(/vv MSDP__%P1))
/def -i -t'MSDP HEALTH' msdp_health = \
/let tmp=$[%MSDP__HEALTH - %hp]%;\
/set hp=%MSDP__HEALTH%;\
/if (%tmp != 0) \
/echo Health: %tmp%;\
/endif
And some examples:
/msdp LIST =REPORTABLE_VARIABLES
/msdp SEND =HEALTH
/msdp REPORT =HEALTH
/msdp REPORT =ROOM_NAME =ROOM_VNUM