MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

25Dec95 Core upgrade for 1.8.0alpha6



: ... This script will take the 25Dec95 LambdaCore available from PARC and 
: ... make it compatible with the 1.8.0alpha6 server.  Further
: ... core adjustments will undoubtedly be necessary to fix as-yet-undiscovered
: ... bugs.  Please feel free to advise of any (dave@ipac.caltech.edu).

"Don't forget how to do numeric verbnames (or the verb editor etc will LOSE!):
@property $server_options.support_numeric_verbnames 1


"$frand_class:moveto walks the callers() list in a now-bogus way, so we fix it:
@program $frand_class:moveto
"'moveto (<destination>)', 'accept (<object>)' - Check whether this :moveto or :accept is allowed or refused. If it is allowed, do it. This code is slightly modified from an original verb by Grump.  Upgraded by Bits to account for forthcoming 1.8.0 behavior of callers().";
by = callers();
"Ignore all the verbs on this.";
while ((y = by[1])[1] == this && y[2] == verb)
  by = listdelete(by, 1);
endwhile
act = verb == "moveto" ? "move" | "accept";
if (player != this && this:refuses_action(player, act, args[1]))
  "check player";
  return 0;
endif
last = #-1;
for k in (by)
  if ((perms = k[3]) == #-1 && k[2] != "" && k[1] == #-1)
  elseif (!perms.wizard && perms != this)
    if (perms != last)
      "check for possible malicious programmer";
      if (this:refuses_action(perms, act, args[1]))
        return 0;
      endif
      last = perms;
    endif
  endif
endfor
return pass(@args);
.


"This next change actually is not required, but takes advantage of the new callers()' optional argument to return more information ($perm_utils:caller):
@program $perm_utils:caller
stage = 1;
if (args && args[1] == 1)
  callers(1);
else
  c = callers();
endif
while ((stage = stage + 1) < length(c) && c[stage][1] == c[1][1])
endwhile
return c[stage];
.


"$player:gag_p took liberties with callers() that are no longer true, so we correct its misconceptions:

@program $player:gag_p
if (player in this.gaglist)
  return 1;
elseif (gag = this.gaglist)
  for x in (callers())
    if (x[1] == #-1 && x[3] == #-1 && x[2] != "")
    elseif (x[1] in gag || x[4] in gag)
      return 1;
    endif
  endfor
endif
return 0;
"--- old definition --";
if (player in this.gaglist)
  return 1;
elseif (this.gaglist)
  for x in (callers())
    if (valid(x[1]))
      if (x[1] in this.gaglist)
        return 1;
      endif
    endif
  endfor
endif
return 0;
.


"$player:confunc needs to split off the mail handling stuff to $mail_receiving class, so here's the first part of that - taking it out of $player:confunc:

@program $player:confunc
if (((valid(cp = caller_perms()) && (caller != this)) && (!$perm_utils:controls(cp, this))) && (caller != #0))
  return E_PERM;
endif
this:("@last-connection")();
$news:check();
.


"And now we put the mail stuff where it belongs, on the mail player class's confunc:

@verb $mail_recipient_class:confunc tnt rxd #2
@program $mail_recipient_class:confunc
if (valid(cp = caller_perms()) && caller != this && !$perm_utils:controls(cp,
this) && caller != #0)
  return E_PERM;
endif
nm = this:length_all_msgs() -
this:length_date_le(this:get_current_message()[2]);
if (nm)
  this:notify(tostr("You have new mail (", nm, " message", nm == 1 ? "" | "s", ").", this:mail_option("expert") ? "" | "  Type 'help mail' for info on reading it."));
endif
this:mail_catch_up();
this:check_mail_lists();
pass(@args);
.


"If you find additional necessary changes, please post fixup scripts to moo-cows.



Home | Subject Index | Thread Index