Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions htmldoc/topics/hooks.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ <h1>hooks</h1>
(Called if you send the server's disconnect
command (e.g., "QUIT") or <a href="../topics/sockets.html">socket</a> closes, but
not if you use <a href="../commands/dc.html">/dc</a>.)
<a name="GMCP_LOGIN"></a><!--
---- --> GMCP_LOGIN world (GMCP subnegotiation after connecting. Useful
for sending Char.Login message to server.)
<a name="KILL"></a><!--
---- --> KILL pid (<a href="../topics/processes.html">process</a> ends)
<a name="LOAD"></a><!--
Expand Down
3 changes: 3 additions & 0 deletions lib/tf/tf-help
Original file line number Diff line number Diff line change
Expand Up @@ -5833,6 +5833,9 @@ hooks
(Called if you send the server's disconnect
command (e.g., "QUIT") or socket closes, but
not if you use /dc.)
#GMCP_LOGIN
GMCP_LOGIN world (GMCP subnegotiation after connecting. Useful
for sending Char.Login message to server.)
#KILL
KILL pid (process ends)
#LOAD
Expand Down
1 change: 1 addition & 0 deletions src/hooklist.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ gencode(CONNECT, HT_WORLD | HT_XSOCK),
gencode(DISCONNECT, HT_WORLD | HT_XSOCK),
#if ENABLE_GMCP
gencode(GMCP, 0),
gencode(GMCP_LOGIN, 0),
#endif
gencode(ICONFAIL, HT_WORLD | HT_XSOCK),
gencode(KILL, 0),
Expand Down
5 changes: 5 additions & 0 deletions src/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -3632,6 +3632,11 @@ static int handle_socket_input(const char *simbuffer, int simlen, const char *en
CLR_TELOPT(xsock, them_tog, rawchar); /* done */
} else {
DO(rawchar); /* acknowledge their request */
#if ENABLE_GMCP
if (rawchar == TN_GMCP && gmcp) {
do_hook(H_GMCP_LOGIN, NULL, "%s", xsock->world->name);
}
#endif
}
} else {
DONT(rawchar); /* refuse their request */
Expand Down
Loading