@create __PACKAGE__ named dns-com-vmoo-client:dns-com-vmoo-client @prop __CLIENT__."client_info" {} "" ;;__CLIENT__.("client_info") = {} ;;__CLIENT__.("messages_in") = {{"screensize", {"cols", "rows"}}, {"info", {"name", "text-version", "internal-version"}}} ;;__CLIENT__.("messages_out") = {{"disconnect", {"reason"}}} ;;__CLIENT__.("aliases") = {"dns-com-vmoo-client"} ;;__CLIENT__.("object_size") = {5823, 964289442} @verb __CLIENT__:"handle_info" this none this @program __CLIENT__:handle_info if (caller != this) return E_PERM; endif {session, @stats} = args; who = session.connection; if (i = who in $list_utils:slice(this.client_info, 2)) this.client_info = listset(this.client_info, {time(), who, stats}, i); else this.client_info = {@this.client_info, {time(), who, stats}}; endif . @verb __CLIENT__:"handle_screensize" this none this @program __CLIENT__:handle_screensize {session, linelen, @args} = args; if (caller != this) return E_PERM; endif ((ll = toint(linelen)) > 0) && this:adjust_linelen(who = session.connection, (who.linelen > 0) ? ll | (-1 * ll)); . @verb __CLIENT__:"init_for_core" this none this @program __CLIENT__:init_for_core if ($perm_utils:controls(caller_perms(), this)) this.client_info = {}; endif . @verb __CLIENT__:"send_disconnect" this none this @program __CLIENT__:send_disconnect {who, @args} = args; if ($perm_utils:controls(caller_perms(), who)) if (valid(session = $mcp:session_for(who)) && session:handles_package(this)) return pass(session, @args); else return E_INVIND; endif endif . @verb __CLIENT__:"adjust_linelen" this none this rxd __WIZARD__ @program __CLIENT__:adjust_linelen {who, linelen} = args; if (caller != this) return E_PERM; endif who.linelen = linelen; . @verb __CLIENT__:"get_client_info" this none this @program __CLIENT__:get_client_info if (!$perm_utils:controls(caller_perms(), this)) return E_PERM; else info = {}; for dude in (args) if (i = $list_utils:iassoc(dude, this.client_info, 2)) (ticks_left() < 4000) && suspend(0); dudeinf = this.client_info[i]; session = $mcp:session_for(dudeinf[2]); if ((valid(session) && session:handles_package(this)) && `dudeinf[1] >= (dude.last_connect_time - 3) ! ANY') info = {@info, dudeinf[2..3]}; endif endif endfor return info; endif . "***finished***