From 7c2fcae4d3c6336dbcecef31cc0e2d9ef4046e97 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Mon, 16 Mar 2009 09:51:14 +0100 Subject: [PATCH 01/15] _host_IP und alias ggred --- CHANGESTODO | 13 ++++++++++++- bin/psyconf | 2 +- config/versioncontrol.tcsh | 7 +++++++ install.sh | 2 +- place/ircgate.c | 7 ++++--- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/CHANGESTODO b/CHANGESTODO index bcf1d43..b58d1d5 100644 --- a/CHANGESTODO +++ b/CHANGESTODO @@ -8,11 +8,16 @@ ________________________________________________________________________ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ? support tls multiplexing on all suitable ports +? bugs in psyced install procedure + - pointless to keep gentoo files in this git, if they can't be updated separately ________________________________________________________________________ == currently being inspected =========================================== ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +- jabber logout isn't announced or offline avail isn't processed + ... apparently other side did not logout properly, as it doesn't happen always + - neither USE_THE_NICK or USE_AUTOALIAS work flawlessly. in the case of the latter, _nick either displays without uniform for remote people, or it occasionally shows a room's nick instead of the user's nick. @@ -22,6 +27,11 @@ ________________________________________________________________________ templates and removing _nick vars. during this tradition we keep the USE_THE_NICK code running. several "invite issues" should be solved once nicks are gone. + +- psyced.org tells me: Ungültige Route nach psyc://psyced.org + im psyc://psyced.org/~lynx Context festgestellt. + +? who's gonna clean up the mess of having too many websites ? ________________________________________________________________________ == psyced 1.0 ========================================================== ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ @@ -3870,4 +3880,5 @@ psyctext entity nicknames (experimental). allows to remove nicks from protocol. spyc/* psyc/* + should a _date type run on unixtime minus PSYC_EPOCH? - +install.sh ++ don't leave _host_IP uncommented diff --git a/bin/psyconf b/bin/psyconf index 3625e4b..7b4d5ab 100755 --- a/bin/psyconf +++ b/bin/psyconf @@ -361,7 +361,7 @@ X my $hc = 0; ## ldmud bug number one: you have to provide hostname AFTER hostaddr - if ($c{_basic_host_IP}) { + if ($c{_basic_host_IP} =~ /^[0-9\.]+$/) { $psyced .= " --hostaddr $c{_basic_host_IP}"; $hc = 1; # problem? } diff --git a/config/versioncontrol.tcsh b/config/versioncontrol.tcsh index e16e5ea..4304350 100644 --- a/config/versioncontrol.tcsh +++ b/config/versioncontrol.tcsh @@ -36,3 +36,10 @@ alias ctoc '(cd $CVSHOME;cvs diff -bur HEAD CHANGESTODO|& difvu -' alias ctodo '(cd $PSYCEDHOME;cvs update CHANGESTODO;$EDITOR CHANGESTODO;cvs ci -m + CHANGESTODO)' alias todo '(cd $PSYCEDHOME;$EDITOR CHANGESTODO)' +# edit all files that contain a certain keyword +# uses the +/searchstring syntax supported by vi and other smart editors +alias gred '$EDITOR "+/\!*" `grep -swIrl \!* .`' +# grep -r is a bit stupid: it follows symlinks, then shows us files twice +# so using the git full text index may be smarter and faster +alias ggred '$EDITOR "+/\!*" `git grep -w -l \!*`' + diff --git a/install.sh b/install.sh index fdc9378..4187754 100755 --- a/install.sh +++ b/install.sh @@ -974,7 +974,7 @@ _host_domain = $DOMAIN_NAME ; Would you like to bind the server to a specific IP address? ; If you do you MUST also provide _host_name and _host_domain -;_host_IP = $HOST_IP +_host_IP = $HOST_IP ; Nickname for the chatserver. Appears in login message, telnet prompt, ; IRC gateways and some web pages. Will use _host_name if unspecified. diff --git a/place/ircgate.c b/place/ircgate.c index bc64167..c06e1ec 100644 --- a/place/ircgate.c +++ b/place/ircgate.c @@ -6,7 +6,8 @@ // // to make this work you need to add the following to local.h: // -// #define RELAY "ircgate" +// #define RELAY "ircgate" // name of ircnet (?) +// #define RELAY_OBJECT "place/ircgate" // this class // // do not use in existing psyced communities in the current set up // as currently all incoming traffic is presumed to be meant for the @@ -39,13 +40,13 @@ #define IRCGATE_LOCAL "pw" #define NAME "IRCgate" -#define ON_CONNECT login(); +#define ON_CONNECT onConnect(); #define CONNECT_IRC "localhost", 7000 #define EMULATE_SERVER // don't be a bot #include -login() { +onConnect() { PT(("ircgate serving into "+query_ip_number()+"\n")) // login procedure may vary with different flavors of ircd, // that's why we keep it entirely here From 67c41bde14382f099a39d190b61768797cb4b024 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Tue, 17 Mar 2009 16:30:38 +0100 Subject: [PATCH 02/15] those _echo methods are semantically wrong --- world/net/place/archetype.gen | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/world/net/place/archetype.gen b/world/net/place/archetype.gen index ee3b50e..bf47afc 100644 --- a/world/net/place/archetype.gen +++ b/world/net/place/archetype.gen @@ -1521,21 +1521,13 @@ reboot(reason, restart) { // not so sure about this mc ;) "_warning_unavailable_temporary_shutdown", #else -#ifndef ECHOES "_notice_place_leave_temporary_shutdown", -#else /* ECHOES */ - "_echo_place_leave_temporary_shutdown", -#endif /* ECHOES */ #endif // used to output _source here, but when a UNI relays // the message to a UNL, the UNI is shown instead of ME "Server for [_nick_place] is being restarted: [_reason]", ([ "_reason": reason ]) ); -#ifndef ECHOES else castmsg(ME, "_notice_place_leave_shutdown", // _permanent ? -#else /* ECHOES */ - else castmsg(ME, "_echo_place_leave_shutdown", // _permanent ? -#endif /* ECHOES */ "Server for [_nick_place] is shutting down: [_reason]", ([ "_reason": reason ]) ); #ifndef PERSISTENT_MASTERS @@ -1552,11 +1544,7 @@ reboot(reason, restart) { quit() { save(); #ifndef PERSISTENT_MASTERS -#ifndef ECHOES castmsg(ME, "_notice_place_leave_temporary", -#else /* ECHOES */ - castmsg(ME, "_echo_place_leave_temporary", -#endif /* ECHOES */ "[_nick_place] is temporarily being shut down for reload.", ([ "_nick_place" : MYNICK ]) ); #endif From 18aa0276d13a752545fcc6f53cbed97d3769572c Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Tue, 17 Mar 2009 16:47:27 +0100 Subject: [PATCH 03/15] spec conformant leave (EXPERIMENTAL) --- world/net/place/archetype.gen | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/world/net/place/archetype.gen b/world/net/place/archetype.gen index bf47afc..2194cf2 100644 --- a/world/net/place/archetype.gen +++ b/world/net/place/archetype.gen @@ -935,6 +935,14 @@ private leaveMsg(ni, isError, source, mc, data, vars) { // optimize away the echo isn't really pragmatic.. TODO. // we may also simplify the context specification then, huh? // +#ifdef EXPERIMENTAL + // first send tagged echo to the person leaving + unless(isError) sendmsg(source, mc, data, vars+ ([ "_source_relay" : source ])); + // remove her from the context + remove_member(source, vars["_INTERNAL_origin"]); + // let everybody else know about the loss + unless(isError || v("_filter_presence")) castmsg(source, mc, data, vars); +#else unless(isError) { if (v("_filter_presence")) { // arent you a little heavy on the relays here? i dont get it @@ -943,6 +951,7 @@ private leaveMsg(ni, isError, source, mc, data, vars) { else castmsg(source, mc, data, vars); } remove_member(source, vars["_INTERNAL_origin"]); +#endif // it's probably safer to call this hook _after_ removing // the candidate to avoid risking loops leave(source, mc, data, vars); // hook here.. hardly ever used From 836709492ff86e99b72e66f022a2e66425527b11 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Fri, 20 Mar 2009 11:47:20 +0100 Subject: [PATCH 04/15] linkCleanUp() --- CHANGESTODO | 4 +++ world/net/irc/common.c | 5 ++++ world/net/person.c | 68 +++++++++++++++++++++++++++--------------- world/net/psyc/user.c | 2 +- world/net/user.c | 21 +++++++++---- 5 files changed, 69 insertions(+), 31 deletions(-) diff --git a/CHANGESTODO b/CHANGESTODO index b58d1d5..a3ff028 100644 --- a/CHANGESTODO +++ b/CHANGESTODO @@ -1779,6 +1779,10 @@ see also: http://about.psyc.eu/SPAM evtl nicht alle im richtigen channel, um den enter zu sehen..) == IRC ISSUES 1.0 ====================================================== +- according to rfc and ircd source IRC parser should accept when the last + argument is just a word instead of a phrase prefixed by : + this is unusual, but legal: "PRIVMSG #blah hello" + + some irc clients do not implement their own pinging, and some NATs really kill your irc session if it is too quiet too long. we need optional server side pings diff --git a/world/net/irc/common.c b/world/net/irc/common.c index 7b5aa8c..061b705 100644 --- a/world/net/irc/common.c +++ b/world/net/irc/common.c @@ -44,6 +44,11 @@ parse(a) { if (a == "") return; // don't let " \n" execute "/s" unless (sscanf(a, ":%s %s", from, t)) t = a; sscanf(t, "%s :%s", t, text); + // when 'text' is not present, the last argument could be a single + // word text according to rfc. this has never seemed to hurt, but + // we are not exactly compliant in that sense. we could copy the + // last arg over into text, but that requires to change the api + // into explode()-based. WONTFIX unless (sscanf(t, "%s %s", cmd, args)) cmd = t; if (cmd) ircMsg(from, lower_case(cmd), args, text, a); return 1; diff --git a/world/net/person.c b/world/net/person.c index 475c091..74b9397 100644 --- a/world/net/person.c +++ b/world/net/person.c @@ -476,10 +476,15 @@ qLocation(string service) { return v("locations")[service]; } -// returns 0 if that was just an update -// 1 on success +// returns 0 if that was just an update. 1 on success. +// this was originally used by sip/udp only, then slowly +// integrated into existing code sLocation(string service, mixed data) { ASSERT("sLocation", v("locations"), v("locations")) + // should this function also call register_location ? + // yes because a delivery error should remove clients + // from the location table, too.. not just proper + // unlink requests FIXME if (v("locations")[service] == data) return 0; unless (data) { string retval = v("locations")[service]; @@ -526,7 +531,8 @@ static linkSet(service, location, source) { } #endif #ifdef NEW_UNLINK -static linkDel(service, source) { +static linkDel(service, source, variant) { + string mc = "_notice_unlink"; string candidate = v("locations")[service]; unless (candidate) { P3(("linkDel(%O, %O) called in %O: no such candidate!\n", @@ -536,19 +542,42 @@ static linkDel(service, source) { P1(("linkDel(%O, %O) called in %O: unlinking %O.\n", service, source, ME, candidate)); unless (source) source = candidate; + // sLocation? register_location(candidate, 0); + // maybe actual deletion would need to be delayed after + // letting locations know. they might still be sending + // stuff to us, right? m_delete(v("locations"), service || 0); - if (service) sendmsg(source, "_notice_unlink_service", 0, + if (variant) mc += variant; + if (service) sendmsg(source, mc, 0, ([ "_service" : service, "_location_service" : candidate, "_identification" : v("_source") ])); - else sendmsg(source, "_notice_unlink", 0, + else sendmsg(source, mc, 0, ([ "_location" : candidate, "_identification" : v("_source") ])); return candidate; } #endif +static linkCleanUp(variant) { + mixed type, loc; + + foreach (type, loc : v("locations")) { + P2(("linkCleanUp(%O) to %O's ex-%O-client %O\n", + variant, ME, type, loc)) +#ifdef NEW_UNLINK + linkDel(type, 0, variant); +#else + // no clue if the UNL is still out there.. + // lets send a ping so it can reconnect + // but first we have to delete it from our structures! + m_delete(v("locations"), 0); + sendmsg(loc, "_status_unlinked", 0, ([])); +#endif + } +} + // extend sName() from name.c sName2(a) { int e; @@ -615,7 +644,9 @@ sName2(a) { availability = v("availability"); #endif // _flag_disable_module_presence - unless (v("locations")) vSet("locations", ([ ])); + if (v("locations")) linkCleanUp("_crash"); + else vSet("locations", ([ ])); + // protection against file read errors if (IS_NEWBIE) { if (boss(a)) { @@ -630,7 +661,7 @@ sName2(a) { destruct(ME); return 0; } -#ifndef RELAY +#ifdef _flag_enable_administrator_by_nick else if (strstr(lower_case(a), "admin") != -1) { this_player()->w("_failure_object_create_admin", "This nickname is available to administrators only."); @@ -647,20 +678,6 @@ sName2(a) { // maybe use v("identification") here? vSet("_source", psyc_name(ME)); - - // TODO: needs to be foreached for all types of locations? - if (e = v("locations")[0]) { -#ifdef NEW_UNLINK - linkDel(0); -#else - P2(("sending _status_unlinked to ex-client %O\n", e)) - // no clue if the UNL is still out there.. - // lets send a ping so it can reconnect - // but first we have to delete it from our structures! - m_delete(v("locations"), 0); - sendmsg(e, "_status_unlinked", 0, ([])); -#endif - } return MYNICK; // means new name accepted } @@ -2640,9 +2657,12 @@ quit(immediate, variant) { int rc; P3(("person:QUIT(%O,%O) in %O\n", immediate,variant, ME)) -#ifdef NEW_UNLINK - linkDel(0); -#endif + // keeping services running while logging out should be possible.. but + //linkDel(0); + if (v("locations")) { + linkCleanUp(); + vDel("locations"); + } if (immediate == 1 || (immediate && find_call_out(#'quit) != -1)) { rc = save(); if (sizeof(places)) { diff --git a/world/net/psyc/user.c b/world/net/psyc/user.c index 6ff48dc..e0b3005 100644 --- a/world/net/psyc/user.c +++ b/world/net/psyc/user.c @@ -10,7 +10,7 @@ qHasCurrentPlace() { return 0; } logon() { #ifdef NO_EXTERNAL_LOGINS - return destruct(ME); + return destruct(ME); #endif // psyc users dont have their own socket, so the driver // does not call disconnected() for them - this enables the diff --git a/world/net/user.c b/world/net/user.c index e95d7fb..cfcbcb7 100644 --- a/world/net/user.c +++ b/world/net/user.c @@ -896,19 +896,27 @@ case "_status_presence": case "_notice_person_absent_netburp": if (vars["_context"] != place) return 1; break; -#if 1 case "_failure_unsuccessful_delivery": case "_failure_network_connect_invalid_port": // is this the right place to do this? i have seen a recursion where // person.c was never asked for opinion, so i'm putting this into user.c +#ifdef ALPHA + string loc; + foreach (t, loc : v("locations")) + if (vars["_source_relay"] == loc) { + P1(("%O in %O talking to its %O location at %O.", + mc, ME, t, loc)) + sLocation(t, 0); + } +#else // TODO: walk thru entire locations mapping! if (vars["_source_relay"] == v("locations")[0]) { - P0(("%O got %O, deleting 0 from %O\n", ME, - mc, v("locations"))) - m_delete(v("locations"), 0); + P0(("%O got %O, deleting 0 from %O\n", ME, + mc, v("locations"))) + m_delete(v("locations"), 0); } - // fall thru - not strictly necessary but adds a feature #endif + // fall thru - not strictly necessary but adds a feature case "_failure_redirect_permanent": // we currently have no implementation for permanent changes case "_failure_redirect_temporary": @@ -1271,7 +1279,8 @@ w(string mc, string data, mapping vars, mixed source, int showingLog) { if (!loc) { // oh.. happens on beta? P1(("%O late deletion of a %O zero location - should never happen\n", ME, type)) - m_delete(v("locations"), type); + //m_delete(v("locations"), type); + sLocation(type, 0); continue; } #endif From 69a4918637111374f897775891f50ed167af3404 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Fri, 20 Mar 2009 12:21:00 +0100 Subject: [PATCH 05/15] inspecting skipped announces --- world/net/person.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/world/net/person.c b/world/net/person.c index 475c091..dbc53d9 100644 --- a/world/net/person.c +++ b/world/net/person.c @@ -2658,8 +2658,13 @@ quit(immediate, variant) { P1(("intercepted recursive QUIT %O\n", ME || MYNICK )) return 0; } + P1(("** QUITTING %O: av %O, sc %O\n", ME, availability, v("scheme"))) #ifndef _flag_disable_module_presence switch(v("scheme")) { + case 0: + // scheme is 0 when a user entity has never been logged + // in, like friends in a roster that get incarnated + break; // jabber/user:quit() is called on @type 'unavailable' // so it relies on quit() to announce offline status //case "jabber": @@ -2683,15 +2688,20 @@ quit(immediate, variant) { // fall thru in case of _disconnect // which indicates, we died an irregular death default: -# ifdef CACHE_PRESENCE - //announce(AVAILABILITY_OFFLINE, 0, ask4upd8s == 0); +# ifdef ALPHA + if (availability > AVAILABILITY_OFFLINE) { +# if 0 //def CACHE_PRESENCE + announce(AVAILABILITY_OFFLINE, 0, ask4upd8s == 0); +# else + announce(AVAILABILITY_OFFLINE); +# endif + } # else - //announce(AVAILABILITY_OFFLINE); -# endif if (availability) { announce(AVAILABILITY_OFFLINE); availability = 0; } +# endif } #endif // _flag_disable_module_presence // TODO: here we need to leave all our friends cslaves @@ -2792,8 +2802,21 @@ announce(level, manual, verbose, text) { text = text ? (MYNICK +" "+ text +".") : ""; // fun: "Reclaim your chat. Use PSYC. PSYC delivers."; } - // can this "optimization" cause async presence effects..? - if (!changed && availability == level) return 0; + if (!changed && availability == level) { + // this check ensures that we do not send "fake" announces + // for user entities which are being deallocated but + // were never actually logged in (absent friends of users) + // ... maybe this stops now that i added 'case 0:' + // + // we also get here when user objects are force quitted + // by keepUserObject() even if they were created just now + // ... see irc/server.. it's a FIXME + // + // unfortunately it seems to also affect other scenarios + P3(("**SKIP %O announce %O(%O,%O) %O changed: %d, av: %O\n", + ME, level, manual, verbose, text, changed, availability)) + return 0; + } if (level) vSet("availability", availability = level); else level = availability; // sending EXPIRED not permitted here P2(("%O announce %O(%O,%O) %O changed: %d, mood: %O\n", ME, From 6c914208e699d64b3fa3547c0866af69a5083268 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Sat, 21 Mar 2009 07:17:28 +0100 Subject: [PATCH 06/15] - --- world/net/person.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/world/net/person.c b/world/net/person.c index e732ac1..655ab8f 100644 --- a/world/net/person.c +++ b/world/net/person.c @@ -2661,6 +2661,7 @@ quit(immediate, variant) { //linkDel(0); if (v("locations")) { linkCleanUp(); + // so the if should only trigger at first pass vDel("locations"); } if (immediate == 1 || (immediate && find_call_out(#'quit) != -1)) { @@ -2704,7 +2705,11 @@ quit(immediate, variant) { // value would be nice. and we should have a delayed unavailability // automation feature here to avoid frequent relogin announcements. case "psyc": - if (variant != "_disconnect") break; + if (variant != "_disconnect") { + P3(("++SKIP psyc client %O %O. announce yourself!\n", + variant, ME)) + break; + } // fall thru in case of _disconnect // which indicates, we died an irregular death default: @@ -2833,7 +2838,7 @@ announce(level, manual, verbose, text) { // ... see irc/server.. it's a FIXME // // unfortunately it seems to also affect other scenarios - P3(("**SKIP %O announce %O(%O,%O) %O changed: %d, av: %O\n", + P3(("++SKIP %O announce %O(%O,%O) %O changed: %d, av: %O\n", ME, level, manual, verbose, text, changed, availability)) return 0; } From c5325aedafc6386371d7834b427fd6ef2a462243 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Sat, 21 Mar 2009 07:27:08 +0100 Subject: [PATCH 07/15] remove old linking code --- CHANGESTODO | 2 +- world/net/include/net.h | 2 - world/net/irc/server.c | 4 +- world/net/person.c | 114 ++-------------------------------------- 4 files changed, 7 insertions(+), 115 deletions(-) diff --git a/CHANGESTODO b/CHANGESTODO index a3ff028..78b3c99 100644 --- a/CHANGESTODO +++ b/CHANGESTODO @@ -1488,7 +1488,7 @@ ________________________________________________________________________ is not accepted by the UNI and thus does not make it into _list_places - _do_leave does not forward the echo from remote places back to the client -- NEW_UNLINK: place and v("place") aren't in sync (new changes for psyc clients) +- place and v("place") aren't in sync (new changes for psyc clients) + if newbie: directly show register dialog (lynx should add _status_unregistered or so) diff --git a/world/net/include/net.h b/world/net/include/net.h index 0903830..92918c1 100644 --- a/world/net/include/net.h +++ b/world/net/include/net.h @@ -216,8 +216,6 @@ # define WANT_S2S_SASL # define ENTER_MEMBERS # define PERSISTENT_MASTERS -# define NEW_LINK -# define NEW_UNLINK # define NEW_RENDER # define MUCSUC #endif diff --git a/world/net/irc/server.c b/world/net/irc/server.c index 238ef2f..a1efe60 100644 --- a/world/net/irc/server.c +++ b/world/net/irc/server.c @@ -19,7 +19,9 @@ volatile string pass; // for now it's a bit complicated to re-issue all joins and i'm not // even sure if it would be enough for the irc clients.. so better -// just quit the old object and start anew. +// just quit the old object and start anew. a bit silly when user +// objects have just been incarnated and never actually logged in - +// for each ircer we thus incarnate twice. FIXME keepUserObject(user) { return 0; } qScheme() { return "irc"; } diff --git a/world/net/person.c b/world/net/person.c index 655ab8f..ebd019b 100644 --- a/world/net/person.c +++ b/world/net/person.c @@ -494,7 +494,6 @@ sLocation(string service, mixed data) { return v("locations")[service] = data; } -#ifdef NEW_LINK static linkSet(service, location, source) { P1(("linkSet(%O, %O, %O) called in %O: linking.\n", service, location, source, ME)); @@ -529,8 +528,6 @@ static linkSet(service, location, source) { // for simple clients on link when a place is set } } -#endif -#ifdef NEW_UNLINK static linkDel(service, source, variant) { string mc = "_notice_unlink"; string candidate = v("locations")[service]; @@ -558,23 +555,13 @@ static linkDel(service, source, variant) { "_identification" : v("_source") ])); return candidate; } -#endif - static linkCleanUp(variant) { mixed type, loc; foreach (type, loc : v("locations")) { P2(("linkCleanUp(%O) to %O's ex-%O-client %O\n", variant, ME, type, loc)) -#ifdef NEW_UNLINK linkDel(type, 0, variant); -#else - // no clue if the UNL is still out there.. - // lets send a ping so it can reconnect - // but first we have to delete it from our structures! - m_delete(v("locations"), 0); - sendmsg(loc, "_status_unlinked", 0, ([])); -#endif } } @@ -891,41 +878,6 @@ msg(mixed source, mc, data, mapping vars, showingLog) { if (showingLog) return display; // logView() in action // btw, when reviewing log, all users are displayed equal size -#if 0 - // hack that permits us to use same mapping across - // all user objects in a room. really should be using - // copies of the mapping for each user - or forbid to - // write into the mapping. this statement in particular - // also protects us from "intruder" _display settings, - // so it's useful anyway. - // - m_delete(vars, "_display"); -#endif -#if 0 //ndef NEW_UNLINK - if (abbrev("_request_link_", mc)) { - vars["_service"] = mc[14..]; - mc = "_set_password"; - } else if (abbrev("_request_unlink_", mc)) { - vars["_service"] = mc[16..]; - mc = "_request_unlink"; - } else if (abbrev("_request_location_", mc)) { - vars["_service"] = mc[18..]; - mc = "_request_location"; - // diese kette an abbrevs ist schrecklich ineffizient und zudem - // nicht für jede nachricht nötig.. unlink und diese failure können - // doch nur von eigenen locations kommen, also tiefergelegt werden - // in einen if (itsme) block hinein..!? im switch ist es nicht so - // tragisch, wenn methoden für bestimmte fälle gar nicht eintreten - // können, aber abbrevs die jedes mal durchgelaufen werden müssen, - // die geben mir zu denken ob das überhaupt eine gute idee war - // zusatzinformation hinten an die methode dranzuhängen. vielleicht - // ist das ja der eigentliche fehler und man sollte _method und - // _service lieber gutheissen und pflegen.. whatchathink? TODO -// } else if (abbrev("_failure_unsuccessful_delivery_", mc)) { -// vars["_method"] = mc[31..]; -// mc = "_failure_unsuccessful_delivery"; - } -#endif #ifdef RELAY remotesource = 0; #endif @@ -1062,21 +1014,8 @@ case "_set_password": // oh. we let it suggest a *different* location? // interesting. why don't we also do this for clients? // and who is using this code anyway? -#ifdef NEW_UNLINK linkDel(vars["_service"]); -#endif -#ifdef NEW_LINK linkSet(vars["_service"], vars["_location"], source); -#else - if (vars["_location"]) { - v("locations")[vars["_service"]] = vars["_location"]; - } else v("locations")[vars["_service"]] = source; - sendmsg(source, "_notice_link_"+ vars["_service"], - "You have been linked to [_service].", ([ - "_service" : vars["_service"], - ])); - register_location(source, ME); -#endif return 0; } #if 0 @@ -1115,11 +1054,7 @@ case "_set_password": } // we are a legitimate new client. // lets inform the old one -#ifdef NEW_UNLINK linkDel(0, t); -#else - sendmsg(t, "_notice_unlink"); -#endif // now we leave the old client circuit // to die off.. let's hope that's safe } @@ -1160,11 +1095,7 @@ case "_set_password": object o; save(); if (interactive(ME)) { -#ifdef NEW_UNLINK linkDel(); -#else - ME->w("_notice_unlink"); -#endif remove_interactive(ME); } o = named_clone(PSYC_PATH "user", MYNICK); @@ -1176,10 +1107,6 @@ case "_set_password": o->msg(source, mc, data, vars); return destruct(ME); } -#endif -#ifndef NEW_LINK - v("locations")[0] = source; - register_location(source, ME); #endif // used by _request_authentication if (u = parse_uniform(source)) vSet("ip", u[UHost]); @@ -1230,22 +1157,7 @@ case "_set_password": #endif // yeah right.. //unless (interactive()) vSet("host", source); -#ifdef NEW_LINK linkSet(0, vars["_location"], source); -#else - sendmsg(source, "_notice_link", 0, ([ - "_tag_reply": vars["_tag"], - "_nick" : MYNICK ])); - // PSYCion users dont have queries. - // until there are more clients this will - // be enough TODO - vDel("query"); - // clients either use _request_input - // and thus support current place and query, - // or otherwise _message to places and people - // and never use _request_input, therefore - // not get into trouble with query & place....? -#endif // moved logon after _notice_linked // which is more appropriate for most clients // lets see if theres any problem with that @@ -1317,16 +1229,11 @@ case "_set_password": :)); // dont display, dont log, it is handled async #endif return 0; +// _request_do_exit currently logs out clients anyway +// don't use this: case "_request_exit": if (itsme && source == v("locations")[0]) { -#ifdef NEW_UNLINK linkDel(0, source); -#else - sendmsg(source, "_notice_unlink_exit", - 0, ([])); - register_location(source); - m_delete(v("locations"), 0); -#endif quit(); return 0; } else { @@ -1341,15 +1248,7 @@ case "_request_unlink": member(v("locations"), vars["_service"])) { if (source == v("locations")[vars["_service"]] || checkPassword(vars["_password"])) { -#ifdef NEW_UNLINK linkDel(vars["_service"]); -#else - m_delete(v("locations"), vars["_service"]); - sendmsg(source, "_notice_unlink_"+ - vars["_service"], - "You have been unlinked from [_service].", - ([ "_service" : vars["_service"] ])); -#endif return 0; } else { // report? @@ -1358,14 +1257,7 @@ case "_request_unlink": } } else if (member(v("locations"), 0) && source == v("locations")[0]) { -#ifdef NEW_UNLINK linkDel(0); -#else - m_delete(v("locations"), 0); - register_location(source, 0); - sendmsg(source, "_notice_unlink", - 0, ([])); -#endif if (mc == "_request_unlink_disconnect" && !ONLINE) { // manually calling disconnected() .. hmmm disconnected(); @@ -2679,7 +2571,7 @@ quit(immediate, variant) { P1(("intercepted recursive QUIT %O\n", ME || MYNICK )) return 0; } - P1(("** QUITTING %O: av %O, sc %O\n", ME, availability, v("scheme"))) + P4(("** QUITTING %O: av %O, sc %O\n", ME, availability, v("scheme"))) #ifndef _flag_disable_module_presence switch(v("scheme")) { case 0: From 349a7e92e306df0fefdcb63253d8576b96ccaf96 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Sat, 21 Mar 2009 10:52:05 +0100 Subject: [PATCH 08/15] don't error when iq set comes without item --- install.sh | 65 ++++++++++++++++++++++++----------------- world/net/include/net.h | 2 +- world/net/jabber/user.c | 9 +++++- 3 files changed, 47 insertions(+), 29 deletions(-) diff --git a/install.sh b/install.sh index 4187754..eec2df8 100755 --- a/install.sh +++ b/install.sh @@ -39,24 +39,32 @@ lo="" if test -d "/etc/portage" then - cat < /dev/null @@ -164,10 +172,12 @@ echo "${hi}PSYCED INSTALLATION WIZARD${lo}" if ! test -e data.tar then - echo "This installation script is designed to work with an image of the" - echo "current development tree in a file called data.tar. Obtain a" - echo "psyced release tar from http://www.psyced.org, which contains" - echo "both this script and its data.tar" + cat < Date: Sat, 21 Mar 2009 12:22:45 +0100 Subject: [PATCH 09/15] don't err on jabber iq requests --- world/net/jabber/user.c | 10 ++++------ world/net/user.c | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/world/net/jabber/user.c b/world/net/jabber/user.c index 088ccf2..3f91137 100644 --- a/world/net/jabber/user.c +++ b/world/net/jabber/user.c @@ -571,17 +571,14 @@ iq(XMLNode node) { P3(("%O IQ node %O\n", ME, node)) firstchild = getfirstchild(node); - unless(firstchild) { - switch(node["@type"]) { + unless(firstchild) switch(node["@type"]) { case "get": - break; case "set": - break; case "result": - break; case "error": break; - } + default: + P1(("%O got invalid iq %O\n", ME, node)) return; } helper = firstchild; @@ -1016,6 +1013,7 @@ iq(XMLNode node) { break; #endif default: + P1(("%O got IQ with unknown namespace: %O\n", ME, node)) switch(node["@type"]) { case "get": if (node["@to"]) { diff --git a/world/net/user.c b/world/net/user.c index cfcbcb7..f18fce2 100644 --- a/world/net/user.c +++ b/world/net/user.c @@ -598,6 +598,7 @@ msg(source, mc, data, mapping vars, showingLog) { P3(("%O time %O data %O from %O\n", ME, t, data, vars)) } PSYC_TRY(mc) { +#ifndef ALPHA case "_jabber_iq_error": // DONT reply P2(("%O got %O", ME, mc)) break; @@ -610,6 +611,7 @@ case "_jabber_iq_set": sendmsg(source, "_error_unsupported_method", 0, ([ "_tag_reply" : vars["_tag"] ])); break; +#endif case "_jabber": P1(("%O got %O", ME, mc)) break; From de6cf786f39412e2f9f83f29fdb20225bb62796d Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Mon, 23 Mar 2009 14:12:39 +0100 Subject: [PATCH 10/15] create log and data dirs --- install.sh | 6 +++++- world/net/usercmd.i | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index eec2df8..19dc788 100755 --- a/install.sh +++ b/install.sh @@ -1077,7 +1077,11 @@ then echo "Creating $BASE_DIR..." if mkdir -m $BASE_PERM -p $BASE_DIR 2> /dev/null then - : + mkdir -m $BASE_PERM -p $LOG_DIR 2> /dev/null + mkdir -m $BASE_PERM -p $LOG_DIR/place 2> /dev/null + mkdir -m $BASE_PERM -p $DATA_DIR 2> /dev/null + mkdir -m $BASE_PERM -p $DATA_DIR/person 2> /dev/null + mkdir -m $BASE_PERM -p $DATA_DIR/place 2> /dev/null else if test "x$userid" = "xroot" then diff --git a/world/net/usercmd.i b/world/net/usercmd.i index 6249eec..fd5e22a 100644 --- a/world/net/usercmd.i +++ b/world/net/usercmd.i @@ -1771,6 +1771,9 @@ case "_unlink": unlink(vars["_service"]); return 1; case "_exit": + // so this is some kind of ugly hack not to be used.. huh? + announce(AVAILABILITY_OFFLINE); + // fall thru case "_quit": // bye(vars["_reason"]); quit(); From 577b7e41877e4432b26cfa538ae2f5985823e737 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Mon, 23 Mar 2009 16:00:48 +0100 Subject: [PATCH 11/15] the symlinks that cvs could not to provide --- world/local | 1 + world/log | 1 + 2 files changed, 2 insertions(+) create mode 120000 world/local create mode 120000 world/log diff --git a/world/local b/world/local new file mode 120000 index 0000000..c820590 --- /dev/null +++ b/world/local @@ -0,0 +1 @@ +../local \ No newline at end of file diff --git a/world/log b/world/log new file mode 120000 index 0000000..033579f --- /dev/null +++ b/world/log @@ -0,0 +1 @@ +../log \ No newline at end of file From fd086c22a77bb46a284e4ac922412cbc487a08dd Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 2 Apr 2009 09:57:05 +0200 Subject: [PATCH 12/15] + --- CHANGESTODO | 9 +++++++++ world/default/en/jabber.textdb | 6 ++++++ world/net/include/place.gen | 2 +- world/net/person.c | 4 ++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGESTODO b/CHANGESTODO index 78b3c99..d294745 100644 --- a/CHANGESTODO +++ b/CHANGESTODO @@ -12,6 +12,9 @@ ________________________________________________________________________ - pointless to keep gentoo files in this git, if they can't be updated separately + ++ teach net/smtp to trust localhost etc. ++ teach net/smtp to ask recipient object if spam rules are to be applied ________________________________________________________________________ == currently being inspected =========================================== ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ @@ -1377,6 +1380,11 @@ ________________________________________________________________________ ! When the /topic command makes funny errors, then your room has a custom cmd() and doesn't pass vars over. It should use ON_COMMAND instead! +________________________________________________________________________ +* PSYC FUTURES see also http://about.psyc.eu/Category:Vapor +¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ++ http://about.psyc.eu/Hashtags ++ http://about.psyc.eu/Follower ________________________________________________________________________ * TOYS IN THE ATTIC ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ @@ -3886,3 +3894,4 @@ spyc/* psyc/* + should a _date type run on unixtime minus PSYC_EPOCH? install.sh + don't leave _host_IP uncommented ++ mkdir data/* log/* diff --git a/world/default/en/jabber.textdb b/world/default/en/jabber.textdb index e8b32c9..5d8dd52 100644 --- a/world/default/en/jabber.textdb +++ b/world/default/en/jabber.textdb @@ -1,6 +1,12 @@ ## vim:syntax=mail ## Check utf-8: Praise Atatürk! +_notice_add_alias_temporary +|## shouldn't be sent to jabber clients + +_failure_unavailable_alias +|## shouldn't be sent to jabber clients + _MISC_character_command |## since several clients started catching / commands.. |+ diff --git a/world/net/include/place.gen b/world/net/include/place.gen index 373ed3d..d03b00d 100644 --- a/world/net/include/place.gen +++ b/world/net/include/place.gen @@ -146,7 +146,7 @@ inherit NET_PATH "place/mailcast"; # ifdef PUBLIC inherit NET_PATH "place/public"; # else - // special case in the archetype options logic, see also the .pl + // special case in the archetype options logic, see also psyconf # ifndef PLACE_HISTORY # ifdef PLACE_HISTORY_EXPORT # define PLACE_HISTORY diff --git a/world/net/person.c b/world/net/person.c index ebd019b..959f23c 100644 --- a/world/net/person.c +++ b/world/net/person.c @@ -2515,6 +2515,10 @@ reboot(reason, restart, pass) { //unless (clonep(ME)) return; if (blueprint(ME) == ME) return; P2(("%O shutting down\n", ME)) + + // temporary, please remove after 2009-04 + if (!v("locations")) vSet("locations", ([])); + #if !defined(SLAVE) && !defined(_flag_disable_info_session) if (ONLINE) { // same in net/psyc/circuit.c From 4dbfd9a0f48aa3f00d626008bd0094cf38800ab8 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Fri, 3 Apr 2009 16:12:38 +0200 Subject: [PATCH 13/15] =?UTF-8?q?sonderfall=20f=FCr=20y0shi..=20basedir=20?= =?UTF-8?q?existiert=20bereits,=20subdirs=20m=FCssen=20trotzdem=20angelegt?= =?UTF-8?q?=20werden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/install.sh b/install.sh index 19dc788..04861b1 100755 --- a/install.sh +++ b/install.sh @@ -1,18 +1,20 @@ #!/bin/sh +# # new age sh (SUSv2 etc) are supposed to handle our syntax # but if that's not true, try a bash or ksh here. # -# psyced installation script -# $Id: install.sh,v 1.165 2008/10/16 13:07:13 lynx Exp $ -# -# original version by oswald!osw@ld.pages.de on IRCnet, 22aug00 -# heavy improvements by heldensaga and psyc://psyced.org/~lynX -# switched from function foo to foo() syntax as suggested by cebewee -# # we could also use a strategy for finding the best bash or ksh # on this system and re-execing ourselves because an old bourne # shell will not be able to deal with this script completely +####### psyced installation script ####### +# +# original version 2000-08-22 by Kai 'Oswald' Seidler (oswaldism.de) +# heavy improvements by heldensaga and psyc://psyced.org/~lynX +# switched from function foo to foo() syntax as suggested by cebewee +# +####### + # Use 'ldmud' here if you want to use an ldmud rather than a psyclpc' #driver="ldmud" #zip="gz" @@ -1077,11 +1079,7 @@ then echo "Creating $BASE_DIR..." if mkdir -m $BASE_PERM -p $BASE_DIR 2> /dev/null then - mkdir -m $BASE_PERM -p $LOG_DIR 2> /dev/null - mkdir -m $BASE_PERM -p $LOG_DIR/place 2> /dev/null - mkdir -m $BASE_PERM -p $DATA_DIR 2> /dev/null - mkdir -m $BASE_PERM -p $DATA_DIR/person 2> /dev/null - mkdir -m $BASE_PERM -p $DATA_DIR/place 2> /dev/null + ; else if test "x$userid" = "xroot" then @@ -1122,7 +1120,16 @@ else $exit fi +# we need to be completely sure these directories exist, +# so we just go ahead with brute force :) +# +mkdir -m $BASE_PERM -p $LOG_DIR 2> /dev/null +mkdir -m $BASE_PERM -p $LOG_DIR/place 2> /dev/null +mkdir -m $BASE_PERM -p $DATA_DIR 2> /dev/null +mkdir -m $BASE_PERM -p $DATA_DIR/person 2> /dev/null +mkdir -m $BASE_PERM -p $DATA_DIR/place 2> /dev/null mkdir -p $ARCH_DIR 2>/dev/null + if test -d $ARCH_DIR then if test ! -w $ARCH_DIR @@ -1208,11 +1215,10 @@ EOF # # TODO: don't say this if either $driver or erq failed to compile! # echo "${hi}COMPILATION DONE${lo}" echo "" - fi - # i have a feeling i should be using ARCH_DIR here - if test -d bin-$arch - then + # i have a feeling i should be using ARCH_DIR here + if test -d bin-$arch + then cd bin-$arch for i in * do @@ -1224,9 +1230,10 @@ EOF done cd .. - else + else echo "${hi}WARNING:${lo} Couldn't install architecture dependent binaries because I can't find them!" echo "" + fi fi else echo "Hmm.. couldn't create $ARCH_DIR! Aborting." From c8ff29e4d277889e1f90414b0f0aa7c0da2fd795 Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Sun, 5 Apr 2009 12:57:11 +0200 Subject: [PATCH 14/15] oops, the vDel was still in there --- world/net/person.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/world/net/person.c b/world/net/person.c index 959f23c..1aca33f 100644 --- a/world/net/person.c +++ b/world/net/person.c @@ -2555,10 +2555,9 @@ quit(immediate, variant) { P3(("person:QUIT(%O,%O) in %O\n", immediate,variant, ME)) // keeping services running while logging out should be possible.. but //linkDel(0); - if (v("locations")) { + if (sizeof(v("locations"))) { + // the if should only trigger at first pass linkCleanUp(); - // so the if should only trigger at first pass - vDel("locations"); } if (immediate == 1 || (immediate && find_call_out(#'quit) != -1)) { rc = save(); From d8afc4e598ba44ebc075c0385f44503137e59f0f Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Wed, 8 Apr 2009 09:52:09 +0200 Subject: [PATCH 15/15] fix for _flag_enable_unauthenticated_message_private, thx tg --- world/net/person.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/world/net/person.c b/world/net/person.c index 1aca33f..9647889 100644 --- a/world/net/person.c +++ b/world/net/person.c @@ -1638,8 +1638,12 @@ case "_notice_invitation": case "_message_private_question": case "_message_private": // same filtering code as couple lines above - if (( IS_NEWBIE || !itsme && FILTERED(source)) && - (!profile || profile[PPL_NOTIFY] <= PPL_NOTIFY_PENDING)) { + if (( +#ifndef _flag_enable_unauthenticated_message_private + IS_NEWBIE || +#endif + (!itsme && FILTERED(source)) && + (!profile || profile[PPL_NOTIFY] <= PPL_NOTIFY_PENDING))) { PT(("_failure_filter_strangers to %O from %O\n", source, ME)) sendmsg(source, "_failure_filter_strangers", 0, ([ "_nick" : MYNICK ]) );