From 05cf1aba70b4d9b583c5619001f2d78c2af80ebc Mon Sep 17 00:00:00 2001 From: Ari Johnson Date: Fri, 20 Sep 2019 10:22:13 -0400 Subject: [PATCH] Add lwhop() function --- game/txt/changes/0.73p4 | 1 + game/txt/hlp/cobra_func.hlp | 5 ++++- src/bsd.c | 4 ++++ src/function.c | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/game/txt/changes/0.73p4 b/game/txt/changes/0.73p4 index b4d1714..fc7362d 100644 --- a/game/txt/changes/0.73p4 +++ b/game/txt/changes/0.73p4 @@ -9,6 +9,7 @@ CobraMUSH Version 0.73p4 Improvements: * lports() [AEJ] + * lwhop() [AEJ] Fixes: * Compiler warning when RPMODE_SYS enabled [AEJ] diff --git a/game/txt/hlp/cobra_func.hlp b/game/txt/hlp/cobra_func.hlp index be7e045..0437fb3 100644 --- a/game/txt/hlp/cobra_func.hlp +++ b/game/txt/hlp/cobra_func.hlp @@ -2267,6 +2267,7 @@ for an object named "Test", preferring a thing over other types. lwho() lwho() lwhoid() + lwhop() lwho() returns a list of the dbref numbers for all currently-connected players. When mortals use this function, the dbref numbers of DARK @@ -2278,7 +2279,9 @@ for an object named "Test", preferring a thing over other types. lwohid() returns a list of objid's instead. -See also: mwho(), xwho() + lwhop() returns a list of dbrefs and ports separated by colons. + +See also: mwho(), xwho(), lports() & MAP() map([/],[,][, ]) diff --git a/src/bsd.c b/src/bsd.c index 53a4f39..49ea6a4 100644 --- a/src/bsd.c +++ b/src/bsd.c @@ -4137,6 +4137,7 @@ FUNCTION(fun_lwho) int powered = !(strchr(called_as, 'M') != NULL) && Priv_Who(executor); int xwho = *called_as == 'X'; int objid = strchr(called_as, 'D') != NULL; + int port = strchr(called_as, 'P') != NULL; first = 1; if(!xwho && nargs && args[0] && *args[0]) { @@ -4190,6 +4191,9 @@ FUNCTION(fun_lwho) if(objid) { safe_chr(':', buff, bp); safe_integer(CreTime(d->player), buff, bp); + } else if (port) { + safe_chr(':', buff, bp); + safe_integer(d->descriptor, buff, bp); } } } diff --git a/src/function.c b/src/function.c index e5db4ed..eb4d8e0 100644 --- a/src/function.c +++ b/src/function.c @@ -475,6 +475,7 @@ FUNTAB flist[] = { {"LVTHINGS", fun_dbwalker, 1, 1, FN_REG}, {"LWHO", fun_lwho, 0, 1, FN_REG}, {"LWHOID", fun_lwho, 0, 1, FN_REG}, + {"LWHOP", fun_lwho, 0, 1, FN_REG}, #ifdef USE_MAILER {"MAIL", fun_mail, 0, 2, FN_REG}, {"MAILFROM", fun_mailfrom, 1, 2, FN_REG}, -- 2.30.2