# changing the value of player

Rich Connamacher (phantom@baymoo.sfsu.edu)
Thu, 2 May 1996 21:41:21 PDT

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    Is there some mechanism through which wizards can change the value of
    'player' for the duration of the verb and all verbs it calls, as well as
    all verbs they call?  I had been able to do that before, by simply
    calling player=#xxx, but it seems to be acting very unreliably:

    37:    elseif (verb_args(this, parts[1]) == {"any", "none", "any"})
    38:      user = this:authorization(args[2]);
    39:      argstr = argstr;
    40:      dobj = dobj;
    41:      dobjstr = dobjstr;
    42:      iobj = iobj;
    43:      iobjstr = iobjstr;
    44:      prepstr = prepstr;
    45:      player = user;
    46:      #735.debugging && #735:notify(tostr("$http:get about to call
    $http:",
    parts[1], " : player=", player, " (", player.name, ")..."));
    47:      set_task_perms(player);
    48:      return this:(parts[1])(@parts[2] ? parts[2..length(parts)] | {});

    @list $http:login
    #666:"login"   any none any
     1:  for wizdude in ({#735, #81})
     2:    wizdude.debugging && wizdude:notify(tostr("$http:login called,
    player=", player, ", caller_perms()=", caller_perms(), "."));
     3:  endfor
     4:  if (caller_perms() == $no_one)
     5:    return E_PERM;
     6:  endif
     7:  return #11:_www();

    Then, when I run this, I get:

    $http:get about to call $http:login : player=#739 (Rich)...
    $http:login called, player=#-42, caller_perms()=#739.

    The wierd part is that often this hack works, and often, like here, it
    doesn't.  I can't find any difference between when it works and when it
    doesn't work.  Any idea why the value for 'player' is changing here?  Or
    how to perminantly change 'player' if this isn't the standard way?

    Phantom