From 14c65f90a81d294265052423913927c9e848c21d Mon Sep 17 00:00:00 2001 From: "psyc://psyced.org/~lynX" <@> Date: Thu, 29 Jan 2009 17:08:56 +0100 Subject: [PATCH] introducing PERSON2UNIFORM and SERVER_UNIFORM --- world/net/include/net.h | 11 +++++++++++ world/net/usercmd.i | 12 ++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/world/net/include/net.h b/world/net/include/net.h index 168701e..8d75dab 100644 --- a/world/net/include/net.h +++ b/world/net/include/net.h @@ -127,6 +127,12 @@ # endif #endif +#ifdef _uniform_node +# define SERVER_UNIFORM _uniform_node +#else +# define SERVER_UNIFORM query_server_unl() +#endif + #ifdef MUD # define NO_NEWBIES #endif @@ -167,6 +173,11 @@ // pick the psyc: uniform for objects, otherwise keep what we have #define UNIFORM(x) (objectp(x)? psyc_name(x): x) +// convert a plain nickname to a local uniform when necessary +#define PERSON2UNIFORM(x) (is_formal(x) ? x : (SERVER_UNIFORM +"~"+ x)) +// here's a variant that summons an appropriate object.. unused however +//#define MAKEPERSON2UNIFORM(x) \ +// (is_formal(t) ? t : psyc_name(summon_person(t, load_name()))) // we currently make no distinction // now we do. diff --git a/world/net/usercmd.i b/world/net/usercmd.i index 57656d1..6588d23 100644 --- a/world/net/usercmd.i +++ b/world/net/usercmd.i @@ -3018,17 +3018,17 @@ listAcq(ppltype, pplvalue) { // Acq(uaintance) to be renamed into Peer // "_level_expose": PPLDEC(prof[PPL_EXPOSE]), // "_level_display": PPLDEC(prof[PPL_DISPLAY]), // "_level_notification": PPLDEC(prof[PPL_NOTIFY]), - "[_nick] ([_acquaintance]): D[_type_display], N[_type_notification], T[_degree_trust], E[_degree_expose].", ([ + "[_acquaintance] ([_nick]): D[_type_display], N[_type_notification], T[_degree_trust], E[_degree_expose].", ([ "_degree_trust" : PPLDEC(prof[PPL_TRUST]), "_degree_expose": PPLDEC(prof[PPL_EXPOSE]), "_type_display" : share["_display"][prof[PPL_DISPLAY]], "_type_notification": share["_notification"][prof[PPL_NOTIFY]], - // should we always deliver a uniform? - "_acquaintance": person, - "_nick": pdisp ]) ); + // should we call _acquaintance _person instead? + "_acquaintance": PERSON2UNIFORM(person), + "_nick": pdisp ]) ); else if (ppltype == PPL_JSON) { - // should we always deliver a uniform? - mapping m = ([ "_contact": person ]); + // should we call _contact _person instead? + mapping m = ([ "_contact": PERSON2UNIFORM(person) ]); #ifdef ALIASES if (pdisp != person) m["_nick_alias"] = pdisp; #endif