int cmd_sponsor(string str) { object who; if(!str) { notify_fail("Sponsor whom?\n"); return 0; } who = find_living(str); if(!who) { notify_fail("No "+capitalize(str)+" on the mud.\n"); return 0; } if((string)who->query_position() != "new immortal") { notify_fail(capitalize(str)+" is still a mortal!\n"); return 0; } if(!archp(this_player()) && (string)this_player()->query_position() != "mentor") { notify_fail("You are not allowed to sponsor anyone!\n"); return 0; } who->set_level(1); seteuid(UID_ADVANCE); who->set_position("immortal"); seteuid(UID_ARCHSAVE); write_file("/adm/etc/sponsor", str+" ("+(string)this_player()->query_name()+ ":"+ctime(time())+")\n"); seteuid(getuid()); message("info", sprintf("You are now a full immortal!\nYour home " "directory is %s.", user_path(str)), who); message("info", sprintf("%s is now a full immortal!", capitalize(str)), users(), ({ who }));
int cmd(string arg) { if(!archp(previous_object())) return 0; dump_file_descriptors(); return 1; }
mixed do_look_at_obj_word_obj(object target, object storage, mixed arg) { if(target->GetInvis(0) && !archp(this_player()) && base_name(target) != LIB_BASE_DUMMY && !inherits(LIB_BASE_DUMMY,target) ){ return write("There is no "+arg+" here."); } return (mixed)target->eventShow(this_player()); }
int cmd_totalban(string str) { string *ips; int x; if (!archp(previous_object())) return 0; if (!str || str=="") { write("Banish what site?\n For example: totalban 127.0.0.*"); return 1; } seteuid(UID_BANISH); ips = BANISH_D->query_total_bans(); x = sizeof(ips); while (x--) { if (ips[x]==str) { write("IP: ("+str+") has already been totalbanned."); return 1; } } BANISH_D->total_ban_ip(str); seteuid(geteuid()); write("IP: ("+str+") has been banned."); return 1; }
int cmd(string arg) { if(!archp(previous_object())) return 0; dumpallobj("/tmp/objects"); return 1; }
mixed cmd(string args) { object tp = this_player(); string tmpfile; string ret = ""; int massacre, survivors = 0; object *obs; if(!tp || !archp(tp)) return "No."; if(args) args = replace_string(args,"\"",""); if(!args) return "Try: help vaarsuvius"; else obs = findobs(args); if(!massacre = sizeof(obs)) { write("No such objects found."); return 1; } foreach(object ob in obs){ ob->eventDestruct(); if(ob) destruct(ob); if(ob){ survivors++; write(identify(ob)+" survived the purge."); } }
int cmd_economy(string str) { string type, key; float rate, infl, wt; if(!str) { message("info", "Currency what?", this_player()); return 1; } if(!archp(this_player())) return 0; if(member_group(geteuid(previous_object()), "approval") == 0) { message("info", "You do not have access to this..",this_player()); return 1; } seteuid(UID_LOG); log_file("economy", geteuid(previous_object())+": "+str+" ("+ctime(time())+")\n"); seteuid(getuid()); if(sscanf(str, "add %s %f %f %f", type, rate, infl, wt) == 4) { seteuid(UID_APPROVAL); ECONOMY_D->add_currency(type, rate, infl, wt); seteuid(getuid()); message("info", "Currency "+type+" added!", this_player()); } else if(sscanf(str, "change %s for %s to %f", key, type, wt) == 3) { seteuid(UID_APPROVAL); ECONOMY_D->change_currency(type, key, wt); seteuid(getuid()); message("info", "Changed: "+key+" for "+type+" to "+wt, this_player()); } else return 0; return 1; }
mixed do_look_inside_obj(object ob,mixed arg) { if(ob->GetInvis(0) && !archp(this_player()) && base_name(ob) != LIB_BASE_DUMMY && !inherits(LIB_BASE_DUMMY,ob) ){ return write("There is no "+arg+" here."); } return (mixed)ob->eventShowInterior(this_player()); }
mixed cmd(string str) { object target; if(!str || str == "") str = "me"; if(str == "me") str = this_player()->GetKeyName(); if(!target = present(str, environment(this_player()))){ write("They're not here."); return 1; } if(!living(target)) { write("That's not a living thing."); return 1; } if(creatorp(target) && !archp(this_player()) && target != this_player()){ write("That's impolite."); tell_player(target,capitalize(this_player()->GetKeyName())+ " just tried to anglicize you."); return 1; } target->SetNativeLanguage("English"); if(target == this_player()) str = "yourself"; else str = capitalize(str); write("You anglicize "+str+"."); if(target != this_player()) tell_object(target, capitalize(this_player()->GetKeyName())+" anglicizes you."); return 1; }
void init() { ::init(); add_action("vote", "vote"); add_action("read", "read"); add_action("abstain", "abstain"); if(wizardp(this_player())) add_action("check", "check"); if(archp(this_player())) add_action("clear", "clear"); }
varargs mixed do_look_at_obj(object ob, mixed arg) { if(ob->GetInvis(0) && !archp(this_player()) && base_name(ob) != LIB_BASE_DUMMY && !inherits(LIB_BASE_DUMMY,ob) ){ write("There is no "+arg+" here."); return 1; } return ob->eventShow(this_player()); }
int CanReceive(object ob) { if( !archp(ob) ){ message("info","The catch tell room is available only to "+ "admins, sorry.",ob); return 0; } return 1; }
int cmd_setenv(string str) { string cle, val; if(!str || sscanf(str, "%s %s", cle, val) != 2) return notify_fail("Usage <setenv [variable] [value]>\n"); switch(cle) { case "TITLE": if (archp(this_player())) { this_player()->setenv("TITLE", val); } else return notify_fail("Invalid varible: "+cle+"\n"); break; case "BOAT_DESC": switch(val) { case "0": this_player()->setenv("BOAT_DESC", 0); break; case "1": this_player()->setenv("BOAT_DESC", 1); break; default: write("Use 0 to turn off boat descriptions, and 1 to turn it on.\n"); return 1; break; } break; case "CENSOR_PRIVATE": this_player()->setenv(cle, atoi(val)); break; case "ASK_ADVANCE": this_player()->setenv(cle, atoi(val)); break; case "SKILL_SHOW": this_player()->setenv("SKILL_SHOW", val); break; case "SCREEN": case "LINES": if(!atoi(val)) return notify_fail("Enter in a number.\n"); if (atoi(val) < 1 || atoi(val) > 1000) return notify_fail("Enter a number 1 - 1000\n"); else this_player()->setenv(cle, val); break; case "TZONE": this_player()->setenv(cle, val); break; case "TERM": if(!TERMINAL_D->query_term_support(val)) { message("info", "Unknown terminal type.", this_player()); val = "unknown"; } this_player()->setenv("TERM", val); this_player()->reset_terminal(); break; default: return notify_fail("Invalid variable: "+cle+"\n"); } message("info",sprintf("Variable %s set to %s.", cle, val),this_player()); return 1; }
int cmd(string str) { string opt, who, channel; object ob; if(!str) return 0; if(!archp(previous_object())) return 0; // Attempt to remove or add a players line rights. if(sscanf(str, "%s %s %s", opt, who, channel) == 3) { if(!(ob = find_player(lower_case(who)))) return notify_fail("No such player online.\n"); if(opt == "remove") { if(member_array(channel, ob->GetChannels()) == -1) { this_player()->eventPrint(ob->GetName() + " is not currently subscribed to the " + channel + " line."); return 1; } ob->RestrictChannel(channel); this_player()->eventPrint("%^RED%^You restrict " + ob->GetName() + " from the " + channel + " line.%^RESET%^"); ob->eventPrint("%^RED%^You have lost your " + channel + " line rights.%^RESET%^"); return 1; } else if(opt == "add") { if(member_array(channel, ob->GetRestrictedChannels()) == -1) { message("system", ob->GetName() + " is not currently restricted from the " + channel + " line.", this_player()); return 1; } ob->UnrestrictChannel(channel); this_player()->eventPrint("%^RED%^You unrestrict " + ob->GetName() + " from the " + channel + " line.%^RESET%^"); ob->eventPrint("%^RED%^You have regained your " + channel + " line rights.%^RESET%^"); return 1; } } // Otherwise, return restriction information, if it is requested. else if(str) { string *channels; string tmp; int size; if(!(ob = find_player(lower_case(str)))) return notify_fail("No such player online.\n"); channels = ob->GetRestrictedChannels(); size = sizeof(channels); tmp = ob->GetName() + " is currently restricted from "; if(size) tmp += "the " + conjunction(channels); else tmp += "no"; if(size == 1) tmp += " line."; else tmp += " lines."; this_player()->eventPrint(tmp); return 1; } else return 0; }
int set_privacy(int i) { if(environment(this_player()) != this_object() && !archp(this_player())) { write("You lack the adequate privileges to do that."); say(this_player()->GetName()+" is trying to mess around with the privacy shield system."); return 1; } privacy=i; return 1; }
int cmd(string str) { string *guests; if(!archp(previous_object())) return 0; if(str) { notify_fail("Correct syntax: whoguests\n"); return 0; } catch(guests = BANISH_D->query_guests());
int haha() { if (archp(this_player())) { write("Your archhood just saved you from blindness."); this_object()->remove(); return 0; } write("The light of the world is hidden from your eyes."); return 1; }
mixed cmd(string args) { int x; if(!archp(previous_object())) return 0; if( !args || args == "" ) return "You must specify a delay in minutes."; if( !(x = to_int(args)) ) return "You must specify a delay in minutes."; if( x < 2 ) return "The delay must be at least 2 minutes."; EVENTS_D->eventReboot(x); message("system", "Reboot sequence initiated.", this_player()); return 1; }
mixed cmd(string args) { object ob; if( !args || args == "" ) return "Trans whom?"; if( !(ob = find_player(convert_name(args))) && !(ob = find_living(args)) ) return "No such being exists anywhere presently."; if( environment(ob) == environment(this_player()) ) return ob->GetCapName() + " is right here."; if(archp(ob) && !archp(this_player())){ write("You can't trans an admin."); tell_player(ob, this_player()->GetName()+" just tried to trans you."); return 1; } ob->SetProperty("ReturnSite",base_name(environment(ob))); message("system", "You have been summoned by " + this_player()->GetName() + ".", ob); if( !(ob->eventMoveLiving(environment(this_player()))) ) return "Failed to move " + ob->GetCapName() + "."; else message("system", "You trans " + ob->GetCapName() + " to you.", this_player()); return 1; }
mixed cmd(string str) { mapping info; string *cles; string ret; float x, fraction; if(!archp(previous_object())) return 0; info = rusage(); cles = keys(info); foreach(string schlussel in cles){ write(schlussel + ": "+info[schlussel]); }
int cmd(string str) { string *guests; int i; if(!archp(previous_object())) return 0; if(!str) { notify_fail("Correct syntax: removeguest [guestlist]\n"); return 0; } i = sizeof(guests = explode(str, " ")); while(i--) BANISH_D->remove_guest(guests[i]); message("info", "Guests removed.", this_player()); return 1; }
mixed do_dest_obj(object ob){ string name; if(base_name(ob) == LIB_DUMMY) { write(capitalize(ob->GetShort())+" isn't a normal destable item. It remains in place."); return 1; } if(archp(ob) && !archp(this_player())){ write("You can't dest an admin."); tell_player(ob, this_player()->GetName()+" just tried to dest you."); return 1; } if(!creatorp(this_player()) && strsrch(base_name(ob), homedir(this_player()))){ write("As a builder, you can only dest items that you created."); return 1; } if(!living(ob)) name = ob->GetShort(); else name = ob->GetName(); write("You dest "+name+"."); say( this_player()->GetMessage( "dest", ob ) ); ob->eventDestruct(); if(ob) destruct(ob); return 1; }
int CanReceive(object ob){ int ret, level; level = ob->GetLevel(); if((creatorp(ob) && !archp(ob)) || (userp(ob) && level > 20)){ write("Sorry. This area is for normal players."); return 0; } ret = room::CanReceive(ob); if(ret){ object *inv = deep_inventory(ob); foreach(object element in inv){ string name = base_name(element); level = element->GetLevel(); if(creatorp(element) && !archp(element) || (userp(element) && level > 20)){ write("Sorry. This is a player-only area."); return 0; } if(!strsrch(name,"/realms/") || !strsrch(name,"/open/")){ element->eventMove(ROOM_FURNACE); } } }
mixed cmd(string args) { if(!archp(previous_object())) { write("No."); return 1; } if(!args || !sizeof(args)) args = "me"; args = lower_case(args); if(args == "me" || args == this_player()->GetKeyName()){ write("To reset your own password, use the command: passwd"); return 1; } if( (int)previous_object()->GetForced() ) return "You cannot be forced to change a password."; if( previous_object() != this_player() ) return "You're being sploited to reset someone's password."; if(!user_exists(args)){ write("That person does not exist on this mud."); return 1; } if(find_player(args)){ write("That player is currently logged on. Please use " "the passwd command to reset their password."); return 1; } savefile = DIR_CRES + "/" + args[0..0] + "/" + args + ".o"; if(!file_exists(savefile)) { write("Couldn't find "+savefile+". Looking for alternate."); savefile = DIR_PLAYERS + "/" + args[0..0] + "/"+ args + ".o"; } if(!file_exists(savefile)){ write("Save file could not be found. Exiting."); return 1; } write("Found "+savefile+"."); previous_object()->eventPrint("New password: ", MSG_PROMPT); input_to( (: NewPass :), I_NOECHO | I_NOESC, previous_object() || args); return 1; }
int CanReceive(object ob) { if(privacy) { if(!interactive(ob)) { message("info","\n\nPRIVACY WARNING: "+ob->GetName()+" has entered the room.\n\n",this_object() ); } else if(!archp(ob)) { message("info","You bounce off the conference room privacy shield.", ob); message("info",ob->GetName()+" bounced off the privacy shield.",this_object()); if(!environment(ob)) ob->eventMoveLiving(ROOM_START); return 0; } } return room::CanReceive(); }
int cmd_register(string str) { string which, why, res; if(!str) return 0; if(!archp(this_player())) return 0; if(sscanf(str, "%s %s", which, why) != 2) { notify_fail("Syntax: <register [site] [reason]>\n\n"); return 0; } write(which+" is now on register.\n"); seteuid(UID_BANISH); if(res = catch(call_other(BANISH_D, "register_site", which))) write("Error in registering site: "+res+"\n"); seteuid(UID_LOG); log_file("watch/register", which+" by "+(string)this_player()->query_name()+"\n"); log_file("watch/register", why+"\n"); return 1; }
int cmd(string str) { string which, nom; if(!archp(previous_object())) return 0; if(!str) { notify_fail("Watch which name or site?\n"); return 1; } if(sscanf(str, "%s %s", which, nom) != 2) { notify_fail("Correct syntax: <watch [name|site] [ip or name]>\n"); return 1; } if(which == "name") BANISH_D->watch_name(nom); else if(which == "site") BANISH_D->watch_site(nom); else { notify_fail("Undefined watch type: "+str+"\n"); return 1; } message("info", nom+" is now an watched "+which, this_player()); return 1; }
int privacy(string str) { if(environment(this_player()) != this_object() && !archp(this_player())) { write("You lack the adequate privileges to do that."); say(this_player()->GetName()+" is trying to muck around with the privacy shield system."); return 1; } if(str=="on" || str == "1") { this_object()->set_privacy(1); write("You enable the privacy shield.\n"); say(this_player()->GetName()+" enables a privacy force field around the room."); timer = time(); return 1; } if(str=="off" || str == "0") { this_object()->set_privacy(0); write("You disable the privacy shield.\n"); say(this_player()->GetName()+" disables a privacy force field around the room."); timer = 0; return 1; } }
int cmd_mudstatus() { int utime=uptime(), mem=memory_info(), i=0, ct=0; object *o; if(!archp(this_player())) return 0; write("%^BLUE%^+=+=+=+( %^BOLD%^%^WHITE%^Mud Status%^RESET%^%^BLUE%^ )+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=%^RESET%^"); write(" The mud has been online for "+query_time(uptime())+""); write(" The mud will reboot in "+query_time((EVENTS_D->query_next_reboot())-time())+""); write(" Number of Objects Loaded: "+i=sizeof(o=objects())); write(" "+add_commas(mem)+" bytes of memory is loaded."); while(i--) if(query_heart_beat(o[i])) ct++; write(" Number of objects with heartbeats: "+ct+"."); write(" Number of callouts: "+sizeof(call_out_info())+"."); write(" Processing "+query_load_average()+"."); if(find_object("/d/nopk/standard/freezer")) write(" Number of link-dead players: "+ sizeof( all_inventory( find_object( "/d/nopk/standard/freezer" ) ) ) ); write(" Number of players online: "+(string)sizeof(users())); write("%^BLUE%^+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+%^RESET%^\n"); return 1; }
mixed cmd(string str) { int i; mixed justvars, tmp; string cmd, what, ret = "";; if(!this_player() || !archp(this_player())){ write("Sorry, this is an arch command."); return 1; } if(!str || str == ""){ return GetHelp(); } tmp = DEFINES_D->GetDefine(str); if(tmp) str = tmp; what = str; ob = to_object(what); if(!ob){ string path = this_player()->query_cwd()+"/"; if(last(what,2) != ".c") what += ".c"; if(file_exists(what)) ob = load_object(what); else if(file_exists(path+what)) ob = load_object(path+what); } if(!ob){ write(truncate(what,2)+" not found."); return 1; } justvars = variables(ob); foreach(ele in justvars){ i = catch( tmp = evaluate(bind( (: fetch_variable($(ele)) :), ob)) ); if(!i) write(ele + " " + identify(tmp)); }