/
LIB3/
LIB3/D/ADMIN/
LIB3/D/ADMIN/OBJ/
LIB3/D/ADMIN/ROOM/W/
LIB3/D/HOME/
LIB3/D/HOME/CITY/ARENA/
LIB3/D/HOME/CITY/ITEMS/
LIB3/D/HOME/CITY/POSTOFFI/
LIB3/DOC/
LIB3/GLOBAL/SPECIAL/
LIB3/GLOBAL/VIRTUAL/
LIB3/NET/
LIB3/NET/CONFIG/
LIB3/NET/DAEMON/CHARS/
LIB3/NET/GOPHER/
LIB3/NET/INHERIT/
LIB3/NET/OBJ/
LIB3/NET/SAVE/
LIB3/NET/VIRTUAL/
LIB3/OBJ/B_DAY/
LIB3/OBJ/HANDLERS/TERM_TYP/
LIB3/PLAYERS/B/
LIB3/PLAYERS/N/
LIB3/ROOM/
LIB3/SAVE/
LIB3/SAVE/BOARDS/
LIB3/SAVE/ENVIRON/
LIB3/SAVE/POST/
LIB3/STD/COMMANDS/SHADOWS/
LIB3/STD/CREATOR/
LIB3/STD/DOM/
LIB3/STD/EFFECTS/
LIB3/STD/EFFECTS/HEALING/
LIB3/STD/EFFECTS/OTHER/
LIB3/STD/EFFECTS/POISONS/
LIB3/STD/ENVIRON/
LIB3/STD/GUILDS/
LIB3/STD/LIQUIDS/
LIB3/STD/ROOM/
LIB3/STD/TRIGGER/SHADOW/
LIB3/W/
LIB3/W/BANNOR/
LIB3/W/NEWSTYLE/
#include "path.h"
inherit "std/room";
string ban;
static string message, apply_dom, *doms;
static int in_use;

string query_cap_name() { return "A wandering spirit"; }

setup()
{
set_short("The mud room");
set_long("This is a very official room where you can "
  +"come to do official things, like open new "
+"hospitals.\n");
set_zone("town hall");
set_light(80);
add_exit("north", "corridor2", "door");
}
 
void init() {
  ::init();
  add_action("banish", "banish");
  add_action("start", "start");
  add_action("vote", "vote");
  add_action("apply", "apply");
  add_action("complain", "complain");
}

int banish(string str) {
  string str1, temp1;

  if(!this_player()->query_creator())
    return 0;
  notify_fail("Usage : banish <name> <reason>\n");
  if(!str)
    return 0;
  if(sscanf(str, "%s %s", str, str1) != 2)
    return 0;
  str = lower_case(str);
  if(sscanf(str,"%s.",temp1))
    return 0;
  if(sscanf(str, "%s/", temp1))
    return 0;
  if(file_size("/banish/"+str+".o") >= 0) {
    notify_fail("That name is already banished.\n");
    return 0;
  }
  if("secure/login"->test_user(str)) {
    notify_fail("That is a player.  You must rm or mv the player file first.\n");
    return 0;
  }
  ban = "Banished by : "+(string)this_player()->query_name()+"\n";
  ban += ctime(time())+"\n";
  ban += "Banish Reason : " + str1 + "\n";
  seteuid((string)"secure/master"->get_root_uid());
  write_file("/banish/"+str+".o", ban);
  seteuid("Room");
  write(str + " banished.\n");
  return 1;
}

int start() {
  if(!this_player()->query_property("guest")) {
    return 0;
  }
  this_player()->remove_property("guest");
  this_player()->save_me();
  write("You are no longer a guest.  Happy adventuring.\n");
  write("Please set your password too using password.\n");
  this_player()->do_force_on_me("password");
  return 1;
}

int complain() {
  if(this_player()->query_property("guest")) {
    return 0;
  }
  if(in_use) {
    write("Sorry, a complaint is currently being posted.\n"+
          "Please try again soon or fetch a creator if nobody is here.\n");
    return 1;
  }
  message = this_player()->query_cap_name() + " " + ctime(time()) + "\n";
  in_use = 1;
  write("You are lodging an official complaint about something or someone.\n"+
        "Do not take this action lightly.\n"+
        "Please provide as much information as possible and a Lord or God "+
        "will mail you regarding the problem as soon as possible.  Only "+
        "problems that you feel affect the entire mud should be complained "+
        "about.  Feedback for the general populous will probably end up on "+
        "bulletin boards around the place.\n");
  write("Enter complaint.  ** to end or ~q to abort.\n");
  write("] ");
  input_to("get_complaint");
  return 1;
}

void get_complaint(string str) {
  if(str == "~q") {
    write("Complaint aborted.\n");
    in_use = 0;
    message = "";
    return;
  }
  if(str == "**") {
    write("Complaint Posted\n");
    message += "\n\n";
    log_file("COMPLAINTS", message);
    message = "";
    in_use = 0;
    return;
  }
  message += str + "\n";
  write("] ");
  input_to("get_complaint");
}

int apply() {
  if(this_player()->query_property("guest")) {
    return 0;
  }
  if(this_player()->query_creator()) {
    notify_fail("You are a creator already stupid.\n");
    return 0;
  }
  if(!"secure/master"->eligible_creator(this_player())) {
    notify_fail("You have not fulfilled the requirements yet.\n");
    return 0;
  }
  write("To which domain would you like to apply (? for list) : ");
  input_to("apply2");
  return 1;
}

void apply3();

void apply2(string str) {
  doms = get_dir("/d/*");
  doms = delete(doms,0,2);
  if(str == "?") {
    int loop;

    for(loop = 0; loop < sizeof(doms); loop++) {
      write(doms[loop] + "\n");
    }
    apply();
    return;
  }
  if(member_array(str, doms) == -1) {
    write("That domain does not exist.\n");
    return;
  }
  apply_dom = str;
  apply3();
}

void apply3() {
  write("The lord of that domain will get back to you at the earliest "+
        "convenience to discuss the details with you.\n");
  log_file("APPLICATIONS", this_player()->query_name() + " " + 
           ctime(time()) + apply_dom + "\n\n");
}

int vote() {
  write("No issues up for vote.\n");
  return 1;
}