diff -c -r --new-file ds2.0r19/RELEASE_NOTES ds2.0r20b/RELEASE_NOTES *** ds2.0r19/RELEASE_NOTES Thu Apr 6 22:53:15 2006 --- ds2.0r20b/RELEASE_NOTES Fri Apr 14 18:27:24 2006 *************** *** 1,4 **** ! ---- 2.0r19 (unreleased) --- - Fixed menu item bug in LIB_BARKEEP. - Fixed Ylsrim pub. - Added keepalive pinger tool to wiz chest. --- 1,45 ---- ! ---- 2.0r20 --- ! - (hopefully) Fixed rare and peculiar bug that hosed ! up logins unpredictably. ! - Added the Jonez/Brodbane stargate system. ! - Container bug fixed. It is now possible to put ! amounts of money into containers and onto surfaces. ! - Daemonized snoop system. This permits the logging ! of snoop data, unmanned snoop logs, and snooping ! multiple players at once. Still slightly buggy, so ! please report any problems with it. ! - The encre and decre of non-logged-on users now ! behaves properly. ! - Furnaces now destroy objects almost immediately. ! - Fixed voting system. ! - LIB_GUILD changed to LIB_CLAN. It works, but is ! not actually useful. Proper clan functionality ! is planned post-2.1. ! - Heal command now fixes individual limbs as well. ! - Added ENABLE_ENCUMBRANCE define to config.h to ! toggle the encumbrance combat modifier. ! - Modified combat so it's difficult to fight while ! carrying stuff. Anything worn or wielded doesn't ! affect combat capability. NPC's are unaffected by this. ! - Fixed horrendous carry-capacity leak in all containers. ! - Added "every" token to reload verb, enabling the ! reload of all loaded objects that inherit the specified ! library object, eg "reload every npc". ! - Fixed bugs in invisibility. ! - Enabled QCS to work in /domains directories for ! creators set as domain admins with the ! domainadmin command. ! - Fixed error in RACES_D that dramatically distorted stats. ! - Added sefun: domain_admin. ! - Fixed mudlist cache problem. ! - Added command: switchrouter, domainadmin. ! - Added set_heart_beat to QCS. ! - Fixed bugs in commands: banish, anglicize. ! - Integrated most packet data with network room. ! - Added router room for I3 router debugging. ! - Integrated most I3 packets with router room. ! ! ---- 2.0r19 --- - Fixed menu item bug in LIB_BARKEEP. - Fixed Ylsrim pub. - Added keepalive pinger tool to wiz chest. diff -c -r --new-file ds2.0r19/lib/cfg/timezone.cfg ds2.0r20b/lib/cfg/timezone.cfg *** ds2.0r19/lib/cfg/timezone.cfg Wed Apr 5 19:33:15 2006 --- ds2.0r20b/lib/cfg/timezone.cfg Fri Apr 14 18:27:17 2006 *************** *** 1 **** ! EDT \ No newline at end of file --- 1 ---- ! edt \ No newline at end of file diff -c -r --new-file ds2.0r19/lib/cmds/admins/gate.c ds2.0r20b/lib/cmds/admins/gate.c *** ds2.0r19/lib/cmds/admins/gate.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/cmds/admins/gate.c Thu Apr 13 21:14:09 2006 *************** *** 0 **** --- 1,52 ---- + /** + * modification of code contributed by daelas + * started 2006-04-04 + */ + #include + #include + #include + + // inherit LIB_DAEMON; + inherit LIB_STARGATE; + + mixed cmd(string str) + { + mapping network; + + if (!archp(previous_object())) return 0; + + network = STARGATE_D->getStargates(); + if (str) + { + if (network[lower_case(str)]) + { + write(str+" is part of the Stargate Network.\n"); + } + else + { + write(str+" is not currently part of the Stargate Network.\n"); + } + + } + else + { + write("These are the current Stargate locations in the Network:\n"); + if (!sizeof(network)) + { + message("info", "No locations found.", this_player()); + } + else + { + string buf = ""; + string name; + class stargate info; + + foreach (name, info in network) + { + buf += sprintf("%:-15s %:-10s %s\n", name, info->status, info->destination); + } + write(buf); + } + } + return 1; + } diff -c -r --new-file ds2.0r19/lib/cmds/creators/anglicize.c ds2.0r20b/lib/cmds/creators/anglicize.c *** ds2.0r19/lib/cmds/creators/anglicize.c Wed Apr 5 19:44:08 2006 --- ds2.0r20b/lib/cmds/creators/anglicize.c Sun Apr 9 23:49:20 2006 *************** *** 5,10 **** --- 5,13 ---- 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."); diff -c -r --new-file ds2.0r19/lib/cmds/creators/colors.c ds2.0r20b/lib/cmds/creators/colors.c *** ds2.0r19/lib/cmds/creators/colors.c Wed Dec 7 14:12:58 2005 --- ds2.0r20b/lib/cmds/creators/colors.c Thu Apr 13 21:03:19 2006 *************** *** 3,9 **** inherit LIB_DAEMON; ! void cmd() { write( "%^RED%^RED\n" --- 3,9 ---- inherit LIB_DAEMON; ! int cmd() { write( "%^RED%^RED\n" *************** *** 25,35 **** "%^B_WHITE%^B_WHITE%^RESET%^\n" "%^B_MAGENTA%^B_MAGENTA%^RESET%^\n" ); ! } string GetHelp() { ! return ("Syntax: colors\n\n" ! "Lists all available colors in the corresponding color.\n\n"); } --- 25,36 ---- "%^B_WHITE%^B_WHITE%^RESET%^\n" "%^B_MAGENTA%^B_MAGENTA%^RESET%^\n" ); ! return 1; } string GetHelp() { ! return("Syntax: colors\n\n" ! "Lists all available colors in the corresponding color." ! "\n\n"); } diff -c -r --new-file ds2.0r19/lib/cmds/players/inventory.c ds2.0r20b/lib/cmds/players/inventory.c *** ds2.0r19/lib/cmds/players/inventory.c Mon Nov 7 13:28:39 2005 --- ds2.0r20b/lib/cmds/players/inventory.c Sun Apr 9 23:49:20 2006 *************** *** 38,46 **** i = sizeof(shorts = keys(borg)); while(i--) ret += capitalize(consolidate(borg[shorts[i]], shorts[i]))+"\n"; message("look", ret, this_player()); ! message("other_action", (string)this_player()->GetName() + " checks " + ! possessive(this_player()) + " possessions.", ! environment(this_player()), ({ this_player() })); } void help() { --- 38,47 ---- i = sizeof(shorts = keys(borg)); while(i--) ret += capitalize(consolidate(borg[shorts[i]], shorts[i]))+"\n"; message("look", ret, this_player()); ! if(!this_player()->GetInvis()) ! message("other_action", (string)this_player()->GetName() + " checks " + ! possessive(this_player()) + " possessions.", ! environment(this_player()), ({ this_player() })); } void help() { diff -c -r --new-file ds2.0r19/lib/daemon/banish.c ds2.0r20b/lib/daemon/banish.c *** ds2.0r19/lib/daemon/banish.c Mon Jan 16 23:01:42 2006 --- ds2.0r20b/lib/daemon/banish.c Wed Apr 12 23:47:49 2006 *************** *** 5,10 **** --- 5,11 ---- */ #include + #include #include #include #include *************** *** 67,73 **** } static private int valid_access(object ob) { ! return (int)master()->valid_apply( ({ "LAW", "SUPERUSER" }) ); } int valid_cap_name(string cap, string nom) { --- 68,74 ---- } static private int valid_access(object ob) { ! return (int)master()->valid_apply( ({ "ASSIST" }) ); } int valid_cap_name(string cap, string nom) { diff -c -r --new-file ds2.0r19/lib/daemon/include/stargate.h ds2.0r20b/lib/daemon/include/stargate.h *** ds2.0r19/lib/daemon/include/stargate.h Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/daemon/include/stargate.h Thu Apr 13 21:14:09 2006 *************** *** 0 **** --- 1,19 ---- + #include "/include/stargate.h" + + #ifndef daemon_stargate_h + #define daemon_stargate_h + + void load(); + void save(); + int setStargate(string address, string destination); + class stargate getStargate(string address); + int delStargate(string address); + mapping getStargates(); + int setStatus(string address, string status); + string getStatus(string address); + string getDestination(string address); + string getEndpoint(string address); + int connect(string from, string to); + int disconnect(string from); + + #endif diff -c -r --new-file ds2.0r19/lib/daemon/intermud.c ds2.0r20b/lib/daemon/intermud.c *** ds2.0r19/lib/daemon/intermud.c Tue Mar 28 23:54:03 2006 --- ds2.0r20b/lib/daemon/intermud.c Wed Apr 12 23:47:49 2006 *************** *** 31,39 **** Password = 0; Tries = 0; Banned = ([]); - // There is only one known I3 router as of - // Feb 2006: us-1.i3.intermud.org - //Nameservers = ({ ({ "*gjs", "198.144.203.194 9000" }) }); Nameservers = ({ ({ "*yatmim", "149.152.218.102 23" }) }); MudList = new(class list); ChannelList = new(class list); --- 31,36 ---- *************** *** 44,49 **** --- 41,47 ---- if( file_size( SAVE_INTERMUD __SAVE_EXTENSION__ ) > 0 ) unguarded( (: restore_object, SAVE_INTERMUD, 1 :) ); SetNoClean(1); + tn("INTERMUD_D reloaded."); SetDestructOnClose(1); SetSocketType(MUD); if(DISABLE_INTERMUD == 1){ *************** *** 66,71 **** --- 64,76 ---- mudlib() + " " + mudlib_version(), version(), "LPMud", MUD_STATUS, ADMIN_EMAIL, (mapping)SERVICES_D->GetServices(), ([]) }) ); + tn("INTERMUD_D setup: "+identify( ({ + "startup-req-3", 5, mud_name(), 0, Nameservers[0][0], 0, + Password, MudList->ID, ChannelList->ID, query_host_port(), + PORT_OOB, PORT_UDP, mudlib() + " " + mudlib_version(), + mudlib() + " " + mudlib_version(), version(), "LPMud", + MUD_STATUS, ADMIN_EMAIL, + (mapping)SERVICES_D->GetServices(), ([]) }) ), "red");; } static void eventRead(mixed *packet) { *************** *** 86,93 **** //default : tc("Packet: "+identify(packet)); case "startup-reply": log_file("intermud",identify(packet)); ! if( sizeof(packet) != 8 ) return; /* should send error */ ! if( !sizeof(packet[6]) ) return; if( packet[6][0][0] == Nameservers[0][0] ) { Nameservers = packet[6]; Connected = Nameservers[0][0]; --- 91,105 ---- //default : tc("Packet: "+identify(packet)); case "startup-reply": log_file("intermud",identify(packet)); ! tn("INTERMUD_D: "+identify(packet),"red"); ! if( sizeof(packet) != 8 ) { ! tn("We don't like the mudlist packet size.","red"); ! return; ! } ! if( !sizeof(packet[6]) ) { ! tn("We don't like an absence of packet element 6.","red"); ! return; ! } if( packet[6][0][0] == Nameservers[0][0] ) { Nameservers = packet[6]; Connected = Nameservers[0][0]; *************** *** 100,110 **** } return; case "mudlist": ! if( sizeof(packet) != 8 ) return; ! if( packet[6] == MudList->ID ) return; ! if( packet[2] != Nameservers[0][0] ) return; MudList->ID = packet[6]; foreach(cle, val in packet[7]) { if( !val && MudList->List[cle] != 0 ) map_delete(MudList->List, cle); else if( val ) MudList->List[cle] = val; --- 112,137 ---- } return; case "mudlist": ! tn("INTERMUD_D mudlist received.","red"); ! log_file("mudlist_packet",identify(packet),1); ! if( sizeof(packet) != 8 ) { ! tn("We don't like the mudlist packet size.","red"); ! return; ! } ! if( packet[6] == MudList->ID ) { ! tn("We don't like packet element 6. It is: "+identify(packet[6]),"red"); ! //return; ! tn("We will continue anyway.","red"); ! } ! if( packet[2] != Nameservers[0][0] ) { ! tn("We don't like packet element 2. It is: "+identify(packet[2]),"red"); ! return; ! } ! MudList->ID = packet[6]; foreach(cle, val in packet[7]) { + if(cle) tn("Procesing cle: "+identify(cle),"cyan"); + if(val) tn("Procesing val: "+identify(val)+"\n--\n","cyan"); if( !val && MudList->List[cle] != 0 ) map_delete(MudList->List, cle); else if( val ) MudList->List[cle] = val; *************** *** 166,171 **** --- 193,199 ---- SERVICES_D->eventReceiveTell(packet); break; case "chan-user-reply": + tn("INTERMUD_D: chan-user-reply received.","red"); case "ucache-update": SERVICES_D->eventReceiveUcacheUpdate(packet); break; *************** *** 185,190 **** --- 213,219 ---- SERVICES_D->eventReceiveMailOk(packet); break; case "file": + tn("INTERMUD_D: file packet received.","red"); break; case "error": SERVICES_D->eventReceiveError(packet); *************** *** 205,210 **** --- 234,240 ---- static void eventConnectionFailure() { if( Connected ) return; + tn("INTERMUD_D: CONNECTION FAILED","red"); error("Failed to find a useful name server.\n"); } diff -c -r --new-file ds2.0r19/lib/daemon/races.c ds2.0r20b/lib/daemon/races.c *** ds2.0r19/lib/daemon/races.c Fri Mar 24 14:36:35 2006 --- ds2.0r20b/lib/daemon/races.c Sun Apr 9 23:49:20 2006 *************** *** 158,164 **** //tc("hellow"); res = new(class Race); - s = new (class Stat); res->Resistance = ([]); res->Skills = ([]); --- 158,163 ---- *************** *** 255,264 **** break; case "STATS": tmp = explode(replace_string(line, "STATS ",""), ":"); ! s->Average = to_int(tmp[1]); ! s->Class = to_int(tmp[2]); res->Stats[tmp[0]] = s; break; case "LIMB": --- 254,268 ---- break; case "STATS": + tmp = ({}); + s = new (class Stat); tmp = explode(replace_string(line, "STATS ",""), ":"); ! //tc("stat: "+identify(tmp),"yellow"); ! s->Average = copy(to_int(tmp[1])); ! s->Class = copy(to_int(tmp[2])); res->Stats[tmp[0]] = s; + //tc("ihnfcaa: "+(res->Stats[tmp[0]])->Average,"yellow"); + //tc("ihnfcaax2: "+(res->Stats[tmp[0]])->Class,"yellow"); break; case "LIMB": *************** *** 406,411 **** --- 410,417 ---- void SetCharacterRace(string race, mixed array args) { class Race res = Races[race]; mixed array tmp; + mapping StatMap; + string schluss; if( !res || !res->Complete || sizeof(args) != 5 ) return; tmp = ({}); *************** *** 413,420 **** tmp = ({ tmp..., ({ key, val }) }); args[0] = tmp; tmp = ({}); ! foreach(string key, class Stat stat in res->Stats) ! tmp = ({ tmp..., ({ key, stat->Average, stat->Class }) }); args[1] = tmp; args[2] = res->Language; //args[3] = ({ res->Sensitivity[0], res->Sensitivity[1] }); --- 419,434 ---- tmp = ({ tmp..., ({ key, val }) }); args[0] = tmp; tmp = ({}); ! //foreach(string key, class Stat stat in res->Stats){ ! StatMap = copy(res->Stats); ! schluss = ""; ! foreach(schluss in keys(StatMap)){ ! //tc("key: "+identify(StatMap[schluss]),"green"); ! //tc("Average: "+identify(StatMap[schluss]->Average),"green"); ! //tc("Class: "+identify(StatMap[schluss]->Class),"green"); ! tmp = ({ tmp..., ({ schluss, StatMap[schluss]->Average, StatMap[schluss]->Class }) }); ! //tc("SetCharacterRace: "+identify(tmp)); ! } args[1] = tmp; args[2] = res->Language; //args[3] = ({ res->Sensitivity[0], res->Sensitivity[1] }); diff -c -r --new-file ds2.0r19/lib/daemon/services/auth.c ds2.0r20b/lib/daemon/services/auth.c *** ds2.0r19/lib/daemon/services/auth.c Wed Apr 5 19:33:16 2006 --- ds2.0r20b/lib/daemon/services/auth.c Wed Apr 12 23:47:49 2006 *************** *** 34,40 **** if(!grepp(mudlist,packet[2]) || packet[2] == "DeadSoulsNew" || packet[2] == "DeadSoulsWin"){ write_file("/tmp/muds.txt",packet[2]+"\n"); ! tc("We have a new mud! "+packet[2]+" has joined intermud.","red"); tn("We have a new mud! "+packet[2]+" has joined intermud.","red"); } --- 34,40 ---- if(!grepp(mudlist,packet[2]) || packet[2] == "DeadSoulsNew" || packet[2] == "DeadSoulsWin"){ write_file("/tmp/muds.txt",packet[2]+"\n"); ! //tc("We have a new mud! "+packet[2]+" has joined intermud.","red"); tn("We have a new mud! "+packet[2]+" has joined intermud.","red"); } diff -c -r --new-file ds2.0r19/lib/daemon/services/channel.c ds2.0r20b/lib/daemon/services/channel.c *** ds2.0r19/lib/daemon/services/channel.c Wed Apr 5 19:33:16 2006 --- ds2.0r20b/lib/daemon/services/channel.c Sun Apr 9 23:49:20 2006 *************** *** 106,115 **** varargs void eventSendChannel(string who, string ch, string msg, int emote, string target, string targmsg) { mixed array packet; string targpl, where; // targpl is target keyname ! tn("eventSendChannel. ","green"); if( emote ) { if( target && targmsg ) { --- 106,116 ---- varargs void eventSendChannel(string who, string ch, string msg, int emote, string target, string targmsg) { mixed array packet; + mixed array packet_thing = ({ who, ch, msg, emote || "", target || "", targmsg || "" }); string targpl, where; // targpl is target keyname ! tn("eventSendChannel raw: "+identify( packet_thing ),"green"); if( emote ) { if( target && targmsg ) { *************** *** 136,141 **** --- 137,143 ---- else packet = ({ "channel-m", 5, mud_name(), convert_name(who), 0, 0, ch, who, msg }); INTERMUD_D->eventWrite(packet); + tn("eventSendChannel processed: "+identify(packet),"green"); } void eventSendChannelWhoRequest(string channel, string mud) { *************** *** 144,157 **** pl = (string)this_player(1)->GetKeyName(); INTERMUD_D->eventWrite(({ "chan-who-req", 5, mud_name(), pl, mud, 0, channel })); } void eventRegisterChannels(mapping list) { mixed array val; string channel, ns; - tn("eventRegisterChannels: "+identify(list),"green"); - if( file_name(previous_object()) != INTERMUD_D ) return; ns = (string)INTERMUD_D->GetNameserver(); foreach(channel, val in list) { --- 146,158 ---- pl = (string)this_player(1)->GetKeyName(); INTERMUD_D->eventWrite(({ "chan-who-req", 5, mud_name(), pl, mud, 0, channel })); + tn("eventSendChannelWhoRequest: "+identify( ({ "chan-who-req", 5, mud_name(), pl, mud, 0, channel })) , "green"); } void eventRegisterChannels(mapping list) { mixed array val; string channel, ns; if( file_name(previous_object()) != INTERMUD_D ) return; ns = (string)INTERMUD_D->GetNameserver(); foreach(channel, val in list) { *************** *** 167,172 **** --- 168,175 ---- else INTERMUD_D->eventWrite(({ "channel-listen", 5, mud_name(), 0, ns, 0, channel, 1 })); } + tn("eventRegisterChannels: "+identify(list),"green"); + } int eventAdministerChannel(string channel, string array additions, *************** *** 180,190 **** (string)this_player(1)->GetKeyName(), (string)INTERMUD_D->GetNameserver(), 0, channel, additions, subs })); return 1; } int AddChannel(string channel, int privee) { ! tn("eventAdministerChannel. ","green"); if( !((int)master()->valid_apply( ({}) )) ){ return 0; --- 183,195 ---- (string)this_player(1)->GetKeyName(), (string)INTERMUD_D->GetNameserver(), 0, channel, additions, subs })); + + tn("eventAdministerChannel: "+channel+" "+identify(additions)+" "+identify(subs),"green"); return 1; } int AddChannel(string channel, int privee) { ! tn("eventAdministerChannel: "+channel+", "+privee,"green"); if( !((int)master()->valid_apply( ({}) )) ){ return 0; diff -c -r --new-file ds2.0r19/lib/daemon/services/emoteto.c ds2.0r20b/lib/daemon/services/emoteto.c *** ds2.0r19/lib/daemon/services/emoteto.c Mon Nov 7 13:29:14 2005 --- ds2.0r20b/lib/daemon/services/emoteto.c Sun Apr 9 23:49:20 2006 *************** *** 12,17 **** --- 12,18 ---- object ob; string who; + tn("eventReceiveEmote: "+identify(packet), "green"); if( file_name(previous_object()) != INTERMUD_D ) return; who = convert_name(packet[5]); if( !(ob = find_player(who)) || (int)ob->GetInvis() ) { *************** *** 34,39 **** --- 35,41 ---- where = (string)INTERMUD_D->GetMudName(where); INTERMUD_D->eventWrite(({ "emoteto", 5, mud_name(), pl, where, convert_name(who), plc, msg })); + tn("eventSendEmote: "+identify( "emoteto", 5, mud_name(), pl, where,convert_name(who), plc, msg ),"green"); } diff -c -r --new-file ds2.0r19/lib/daemon/services/error.c ds2.0r20b/lib/daemon/services/error.c *** ds2.0r19/lib/daemon/services/error.c Mon Nov 7 13:29:14 2005 --- ds2.0r20b/lib/daemon/services/error.c Sun Apr 9 23:49:20 2006 *************** *** 8,13 **** --- 8,15 ---- object ob; string error_code, mud, target, msg; + tn("ERROR RECEIVED: "+identify(packet)); + if( packet[5] ) { target = convert_name(packet[5]); if( !(ob = find_player(target)) ) return; diff -c -r --new-file ds2.0r19/lib/daemon/services/finger.c ds2.0r20b/lib/daemon/services/finger.c *** ds2.0r19/lib/daemon/services/finger.c Sat Mar 11 11:14:53 2006 --- ds2.0r20b/lib/daemon/services/finger.c Sun Apr 9 23:49:20 2006 *************** *** 26,31 **** --- 26,32 ---- ret = ({ "finger-reply", 5, mud_name(), 0, packet[2], packet[3] }) + ret; INTERMUD_D->eventWrite(ret); tell_room(ROOM_ARCH,"The Arch Room loudspeaker announces: \"%^BOLD%^CYAN%^"+capitalize(packet[3])+" at "+packet[2]+" has requested finger information about "+capitalize(ret[6])+".%^RESET%^\""); + tn("eventReceiveFingerRequest: "+identify(packet),"cyan"); } *************** *** 52,57 **** --- 53,59 ---- fing += "Site: " + (packet[12] ? packet[12] : "Confidential") + "\n"; fing += (packet[14] ? packet[14] : "\n"); ob->eventPrint(fing, MSG_SYSTEM); + tn("eventReceiveFingerReply: "+identify(packet),"cyan"); } void eventSendFingerRequest(string who, string where) { *************** *** 60,63 **** --- 62,66 ---- if( !(pl = (string)this_player(1)->GetKeyName()) ) return; INTERMUD_D->eventWrite( ({ "finger-req", 5, mud_name(), pl, where, 0, who }) ); + tn("eventSendFingerRequest: "+identify( ({ "finger-req", 5, mud_name(), pl, where, 0,who }) ),"cyan"); } diff -c -r --new-file ds2.0r19/lib/daemon/services/locate.c ds2.0r20b/lib/daemon/services/locate.c *** ds2.0r19/lib/daemon/services/locate.c Wed Feb 22 15:29:50 2006 --- ds2.0r20b/lib/daemon/services/locate.c Sun Apr 9 23:49:20 2006 *************** *** 19,24 **** --- 19,25 ---- if( file_name(previous_object()) != INTERMUD_D ) return; tell_room(ROOM_ARCH,"The Arch Room loudspeaker announces: \"%^BOLD%^CYAN%^"+capitalize(packet[3])+" at "+packet[2]+" has issued a locate request for %^BOLD%^YELLOW%^"+capitalize(packet[6])+".%^RESET%^\""); + tn("Locate request received: "+identify(packet),"white"); if( !(ob = find_player(packet[6])) || ob->GetInvis()) return; if( interactive(ob) ) { string array tmp = ({ }); *************** *** 43,48 **** --- 44,50 ---- if( file_name(previous_object()) != INTERMUD_D ) return; if( !stringp(packet[5]) || !(ob = find_player(convert_name(packet[5]))) ) return; + tn("Locate reply received: "+identify(packet),"white"); m = packet[7] + " was just located on " + packet[6] + "."; if( (idl = (int)packet[8]) > 60 ) m += sprintf(" (idle %02d:%02d:%02d)", idl/3600, (idl/60)%60, idl%60); *************** *** 53,59 **** void eventSendLocateRequest(string who) { string pl; ! if( !(pl = (string)this_player(1)->GetKeyName()) ) return; INTERMUD_D->eventWrite( ({ "locate-req", 5, mud_name(), pl, 0, 0, who }) ); } --- 55,62 ---- void eventSendLocateRequest(string who) { string pl; ! mixed *locate_request = ({ "locate-req", 5, mud_name(), pl, 0, 0, who }); if( !(pl = (string)this_player(1)->GetKeyName()) ) return; INTERMUD_D->eventWrite( ({ "locate-req", 5, mud_name(), pl, 0, 0, who }) ); + tn("Locate request being sent: "+identify(locate_request),"white"); } diff -c -r --new-file ds2.0r19/lib/daemon/services/tell.c ds2.0r20b/lib/daemon/services/tell.c *** ds2.0r19/lib/daemon/services/tell.c Fri Mar 24 14:36:35 2006 --- ds2.0r20b/lib/daemon/services/tell.c Sun Apr 9 23:49:20 2006 *************** *** 14,19 **** --- 14,20 ---- string who; string adverb = ""; + tn("eventReceiveTell: "+identify(packet),"yellow"); if( file_name(previous_object()) != INTERMUD_D ) return; who = convert_name(packet[5]); if( !(ob = find_player(who)) || (int)ob->GetInvis() ) { *************** *** 59,64 **** --- 60,66 ---- this_player(1)->eventPrint("%^BOLD%^RED%^You tell " + capitalize(who) + "@" + where + ":%^RESET%^ " + msg, MSG_CONV); + tn("eventSendTell: "+identify( ({ "tell", 5, mud_name(), pl, where, convert_name(who), plc, msg }) ), "yellow"); } diff -c -r --new-file ds2.0r19/lib/daemon/services/who.c ds2.0r20b/lib/daemon/services/who.c *** ds2.0r19/lib/daemon/services/who.c Fri Mar 24 14:36:35 2006 --- ds2.0r20b/lib/daemon/services/who.c Sun Apr 9 23:49:20 2006 *************** *** 19,24 **** --- 19,25 ---- foreach(who in packet[6]) list += ({ who[0] + " (" + who[1] + " idle): " + who[2] }); ob->eventPage(list); + tn("eventReceiveWhoReply: "+identify(packet),"blue"); } void eventReceiveWhoRequest(mixed *packet) { *************** *** 34,40 **** ret += entry[0]+", "; } ret = truncate(ret,2); ! tell_room(ROOM_ARCH,"The Arch Room loudspeaker announces: \"%^BOLD%^CYAN%^"+capitalize(packet[3])+" at "+packet[2]+" has requested a list of users currently logged on. Replying with: %^BOLD%^YELLOW%^"+ret+".%^RESET%^\""); } --- 35,41 ---- ret += entry[0]+", "; } ret = truncate(ret,2); ! tn("eventReceiveWhoRequest: "+identify(packet),"blue"); tell_room(ROOM_ARCH,"The Arch Room loudspeaker announces: \"%^BOLD%^CYAN%^"+capitalize(packet[3])+" at "+packet[2]+" has requested a list of users currently logged on. Replying with: %^BOLD%^YELLOW%^"+ret+".%^RESET%^\""); } *************** *** 43,48 **** --- 44,50 ---- who = (string)this_player(1)->GetName(); INTERMUD_D->eventWrite(({ "who-req", 5, mud_name(), who, mud, 0 })); + tn("eventSendWhoRequest: "+identify( ({ "who-req", 5, mud_name(), who, mud, 0 })), "blue"); } diff -c -r --new-file ds2.0r19/lib/daemon/stargate.c ds2.0r20b/lib/daemon/stargate.c *** ds2.0r19/lib/daemon/stargate.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/daemon/stargate.c Thu Apr 13 21:14:09 2006 *************** *** 0 **** --- 1,185 ---- + /** + * stargate_d : stargate daemon. tracks the entire stargate network. + * started 2006-03-23 by jonez + * + * 2006-03-24, jonez + * - with help from cratylus, changed the daemon so it saves it's state + * whenever there is a change, and tries to load from disk at create + * time. + * 2006-03-28, jonez + * - gate is status is now "idle", "outbound", or "inbound". gate cannot be entered from the inbound side. + */ + + #include + #include + #include "/daemon/include/stargate.h" + + inherit LIB_DAEMON; + + private mapping stargates = ([]); + + static void create() + { + daemon::create(); + SetNoClean(1); + load(); + if (!stargates) stargates = ([]); + } + + void save() + { + unguarded( (: save_object, SAVE_STARGATE, 1 :) ); + tell_player("jonez", "stargate daemon saved itself"); + return; + } + + void load() + { + if (file_size(SAVE_STARGATE __SAVE_EXTENSION__) > 0) + { + tc("stargate save file exists"); + unguarded( (: restore_object, SAVE_STARGATE :) ); + } + tell_player("jonez", "stargate daemon loaded itself"); + return; + } + + int setStargate(string address, string destination) + { + class stargate s = new(class stargate); + + if (address == "" || destination == "") return 1; + + s->status = "idle"; + s->destination = destination; + s->endpoint = 0; + stargates[address] = s; + save(); + return 0; + } + + class stargate getStargate(string address) + { + class stargate s = stargates[address]; + if (!s) return 0; + + tell_player("jonez", sprintf("get: address=%s, status=%s destination=%s endpoint=%s", address, s->status, s->destination, s->endpoint)); + return (class stargate)stargates[address]; + } + + int delStargate(string address) + { + map_delete(stargates, address); + save(); + return 0; + } + + mapping getStargates() + { + /* + string buf = ""; + + foreach(string n, class stargate g in stargates) + { + buf += sprintf("name=%s, status=%s, destination=%s, endpoint=%s; ", n, g->status, g->destination, g->endpoint); + } + return buf; + */ + return copy(stargates); + } + + int setStatus(string address, string status) + { + class stargate s; + s = stargates[address]; + if (!s) return 1; + + s->status = status; + save(); + return 0; + } + + string getStatus(string address) + { + class stargate s = stargates[address]; + if (!s) return ""; + + return s->status; + } + + string getDestination(string address) + { + class stargate s = stargates[address]; + if (!s) return ""; + return s->destination; + } + + string getEndpoint(string address) + { + class stargate s = stargates[address]; + if (!s) return ""; + return s->endpoint; + } + + // return 1 on success, 0 on error + int connect(string from, string to) + { + class stargate t, f; + + tell_player("jonez", sprintf("stargate_d->connect(%s, %s)", from, to)); + + if (from == to) return 0; + + f = stargates[from]; + if (!f) + { + tell_player("jonez", "failed to lookup status of outbound gate"); + return 0; + } + + t = stargates[to]; + if (!t) + { + tell_player("jonez", "failed to lookup status of inbound gate"); + return 0; + } + + tell_player("jonez", sprintf("%s->status=%s, %s->status=%s", from, f->status, to, t->status)); + + if (f->status == "idle" && t->status == "idle") + { + f->endpoint = to; + f->status = "outbound"; + + t->endpoint = from; + t->status = "inbound"; + + save(); + + return 1; + } + return 0; + } + + // return 1 on success, 0 on error + int disconnect(string from) + { + class stargate f; + string endpoint; + + tell_player("jonez", sprintf("stargate_d->disconnect(%s)", from)); + + f = stargates[from]; + if (!f) return 0; + + endpoint = stargates[from]->endpoint; + if (!endpoint) return 0; + + stargates[endpoint]->endpoint = ""; + stargates[endpoint]->status = "idle"; + + stargates[from]->endpoint = ""; + stargates[from]->status = "idle"; + save(); + return 1; + } diff -c -r --new-file ds2.0r19/lib/doc/RELEASE_NOTES ds2.0r20b/lib/doc/RELEASE_NOTES *** ds2.0r19/lib/doc/RELEASE_NOTES Thu Apr 6 22:53:15 2006 --- ds2.0r20b/lib/doc/RELEASE_NOTES Fri Apr 14 18:27:24 2006 *************** *** 1,4 **** ! ---- 2.0r19 (unreleased) --- - Fixed menu item bug in LIB_BARKEEP. - Fixed Ylsrim pub. - Added keepalive pinger tool to wiz chest. --- 1,45 ---- ! ---- 2.0r20 --- ! - (hopefully) Fixed rare and peculiar bug that hosed ! up logins unpredictably. ! - Added the Jonez/Brodbane stargate system. ! - Container bug fixed. It is now possible to put ! amounts of money into containers and onto surfaces. ! - Daemonized snoop system. This permits the logging ! of snoop data, unmanned snoop logs, and snooping ! multiple players at once. Still slightly buggy, so ! please report any problems with it. ! - The encre and decre of non-logged-on users now ! behaves properly. ! - Furnaces now destroy objects almost immediately. ! - Fixed voting system. ! - LIB_GUILD changed to LIB_CLAN. It works, but is ! not actually useful. Proper clan functionality ! is planned post-2.1. ! - Heal command now fixes individual limbs as well. ! - Added ENABLE_ENCUMBRANCE define to config.h to ! toggle the encumbrance combat modifier. ! - Modified combat so it's difficult to fight while ! carrying stuff. Anything worn or wielded doesn't ! affect combat capability. NPC's are unaffected by this. ! - Fixed horrendous carry-capacity leak in all containers. ! - Added "every" token to reload verb, enabling the ! reload of all loaded objects that inherit the specified ! library object, eg "reload every npc". ! - Fixed bugs in invisibility. ! - Enabled QCS to work in /domains directories for ! creators set as domain admins with the ! domainadmin command. ! - Fixed error in RACES_D that dramatically distorted stats. ! - Added sefun: domain_admin. ! - Fixed mudlist cache problem. ! - Added command: switchrouter, domainadmin. ! - Added set_heart_beat to QCS. ! - Fixed bugs in commands: banish, anglicize. ! - Integrated most packet data with network room. ! - Added router room for I3 router debugging. ! - Integrated most I3 packets with router room. ! ! ---- 2.0r19 --- - Fixed menu item bug in LIB_BARKEEP. - Fixed Ylsrim pub. - Added keepalive pinger tool to wiz chest. diff -c -r --new-file ds2.0r19/lib/doc/RELEASE_NOTES_HTTP ds2.0r20b/lib/doc/RELEASE_NOTES_HTTP *** ds2.0r19/lib/doc/RELEASE_NOTES_HTTP Thu Apr 6 22:53:15 2006 --- ds2.0r20b/lib/doc/RELEASE_NOTES_HTTP Wed Apr 12 23:47:49 2006 *************** *** 1,4 **** ! ---- 2.0r19 (unreleased) --- - Added Brodbane's New and Improved cp command. - Added Brodbane's sefuns: wild_card, remove_dots. - Elision bug in pager.c fixed by Brodbane. --- 1,43 ---- ! ---- 2.0r20 (unreleased) --- ! - The encre and decre of non-logged-on users now ! behaves properly. ! - Furnaces now destroy objects almost immediately. ! - Fixed voting system. ! - LIB_GUILD changed to LIB_CLAN. It works, but is ! not actually useful. Proper clan functionality ! is planned post-2.1. ! - Heal command now fixes individual limbs as well. ! - Added ENABLE_ENCUMBRANCE define to config.h to ! toggle the encumbrance combat modifier. ! - Modified combat so it's difficult to fight while ! carrying stuff. Anything worn or wielded doesn't ! affect combat capability. NPC's are unaffected by this. ! - Fixed horrendous carry-capacity leak in all containers. ! - Added "every" token to reload verb, enabling the ! reload of all loaded objects that inherit the specified ! library object, eg "reload every npc". ! - Fixed bugs in invisibility. ! - Enabled QCS to work in /domains directories for ! creators set as domain admins with the ! domainadmin command. ! - Fixed error in RACES_D that dramatically distorted stats. ! - Added sefun: domain_admin. ! - Fixed mudlist cache problem. ! - Added command: switchrouter, domainadmin. ! - Added set_heart_beat to QCS. ! - Fixed bugs in commands: banish, anglicize. ! - Integrated most packet data with network room. ! - Added router room for I3 router debugging. ! - Integrated most I3 packets with router room. ! ! ---- 2.0r19 --- ! - Fixed menu item bug in LIB_BARKEEP. ! - Fixed Ylsrim pub. ! - Added keepalive pinger tool to wiz chest. ! - Added commands: anglicize, debug, expel, resetpasswd. ! - Fixed first boot problem with /secure/daemon/letters.c. ! - Driver: set heart_beat to approximately one per second. ! - Driver: added locale workaround to startmud script. - Added Brodbane's New and Improved cp command. - Added Brodbane's sefuns: wild_card, remove_dots. - Elision bug in pager.c fixed by Brodbane. diff -c -r --new-file ds2.0r19/lib/doc/efun/all/explode ds2.0r20b/lib/doc/efun/all/explode *** ds2.0r19/lib/doc/efun/all/explode Mon Jan 23 09:17:12 2006 --- ds2.0r20b/lib/doc/efun/all/explode Thu Apr 13 21:03:32 2006 *************** *** 11,16 **** --- 11,17 ---- by spaces) in the string 'str'. See also: + implode, sscanf, replace_string, strsrch diff -c -r --new-file ds2.0r19/lib/doc/efun/strings/explode ds2.0r20b/lib/doc/efun/strings/explode *** ds2.0r19/lib/doc/efun/strings/explode Mon Jan 23 09:17:12 2006 --- ds2.0r20b/lib/doc/efun/strings/explode Thu Apr 13 21:03:32 2006 *************** *** 11,16 **** --- 11,17 ---- by spaces) in the string 'str'. See also: + implode, sscanf, replace_string, strsrch diff -c -r --new-file ds2.0r19/lib/domains/Ylsrim/obj/stargate.c ds2.0r20b/lib/domains/Ylsrim/obj/stargate.c *** ds2.0r19/lib/domains/Ylsrim/obj/stargate.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/domains/Ylsrim/obj/stargate.c Thu Apr 13 21:12:48 2006 *************** *** 0 **** --- 1,28 ---- + #include + #include + #include "/lib/include/stargate.h" + + inherit LIB_STARGATE; + + int readScreen(); + + void create() + { + ::create(); + setOrigin("tower", "/domains/Ylsrim/room/tower"); + SetRead(([ ({ "screen" }) : (: readScreen :) ]) ); + SetItems(([ ({ "screen" }) : "a computer screen which shows the status of the gate network" ]) ); + } + + void init() + { + ::init(); + } + + int readScreen() + { + write("stargate network status\n"); + write("-----------------------\n"); + write("\n"); + + } diff -c -r --new-file ds2.0r19/lib/domains/Ylsrim/room/furnace.c ds2.0r20b/lib/domains/Ylsrim/room/furnace.c *** ds2.0r19/lib/domains/Ylsrim/room/furnace.c Mon Jan 23 09:15:29 2006 --- ds2.0r20b/lib/domains/Ylsrim/room/furnace.c Wed Apr 12 23:47:49 2006 *************** *** 7,24 **** room::create(); SetAmbientLight(30); SetShort("the furnace"); ! SetLong("The furnace. Things that arrive here are periodically "+ "incinerated. You probably shouldn't be here. Go down to get out."); SetProperties(([ "no attack" : 1, ])); SetExits( ([ "down" : ROOM_START ]) ); ! call_out((: reload_room :), 360, load_object(base_name(this_object()))); SetNoModify(1); } int CanReceive(object ob){ return 1; } void init(){ ::init(); } --- 7,36 ---- room::create(); SetAmbientLight(30); SetShort("the furnace"); ! SetLong("The furnace. Things that arrive here are "+ "incinerated. You probably shouldn't be here. Go down to get out."); SetProperties(([ "no attack" : 1, ])); SetExits( ([ "down" : ROOM_START ]) ); ! call_out((: reload_room :), 600, load_object(base_name(this_object()))); ! set_heart_beat(1); SetNoModify(1); } int CanReceive(object ob){ + if(interactive(ob)){ + tell_object(ob, "You fail to enter the furnace."); + return 0; + } return 1; } void init(){ ::init(); } + void heart_beat(){ + if(sizeof(all_inventory(this_object()))){ + foreach(object ob in deep_inventory(this_object())){ + ob->eventDestruct(); + } + } + } diff -c -r --new-file ds2.0r19/lib/domains/Ylsrim/room/pub.c ds2.0r20b/lib/domains/Ylsrim/room/pub.c *** ds2.0r19/lib/domains/Ylsrim/room/pub.c Thu Apr 6 22:53:15 2006 --- ds2.0r20b/lib/domains/Ylsrim/room/pub.c Sun Apr 9 23:49:20 2006 *************** *** 13,18 **** --- 13,19 ---- // the menu int readMenu(object who, string str) { + string array tmp2 = ({}); string array tmp = ({ sprintf("%:-20s %:-7s", "Drink", "Cost") }); object ob = present("lars"); *************** *** 24,29 **** --- 25,35 ---- tmp += ({ sprintf("%:-20s %d electrum", capitalize(item[0]), to_int(ob->GetCost(item))) }); } + foreach(string element in tmp){ + element = translate(element, this_player()->GetLanguageLevel("Edhellen")); + tmp2 += ({ element }); + } + tmp = tmp2; // show the menu a page at a time this_player()->eventPage(tmp, MSG_SYSTEM); // MSG_SYSTEM means ignore blocking return 1; *************** *** 40,45 **** --- 46,52 ---- "with a hodge-podge of writing in all different languages " "covering the wall. A menu of drinks is about the only " "readable thing on the wall. If you read Edhellen."); + SetLanguage("Edhellen"); SetInventory(([ "/domains/Ylsrim/npc/lars" : 1, ])); diff -c -r --new-file ds2.0r19/lib/domains/Ylsrim/room/tower.c ds2.0r20b/lib/domains/Ylsrim/room/tower.c *** ds2.0r19/lib/domains/Ylsrim/room/tower.c Mon Nov 7 13:29:44 2005 --- ds2.0r20b/lib/domains/Ylsrim/room/tower.c Thu Apr 13 21:03:39 2006 *************** *** 26,40 **** "heart of the hall." ]) ); SetObviousExits("d"); SetExits( ([ "down" : "/domains/Ylsrim/room/"+ "adv_hall" ]) ); - //AddJump("road", "/domains/Ylsrim/room/"+ "kaliid4", JUMP_INTO); - //AddJump("kaliid road", "/domains/Ylsrim/room/"+ "kaliid4", JUMP_INTO); - //AddJump("tower", "/domains/Ylsrim/room/"+ "kaliid4", JUMP_FROM); - SetJump( ([ - "road" : ({ "/domains/Ylsrim/room/kaliid4", JUMP_INTO }), - "kaliid road" : ({ "/domains/Ylsrim/room/kaliid4", JUMP_INTO }), - "tower" : ({ "/domains/Ylsrim/room/kaliid4", JUMP_FROM }), - ]) ); } void init(){ ::init(); --- 26,35 ---- "heart of the hall." ]) ); SetObviousExits("d"); SetExits( ([ "down" : "/domains/Ylsrim/room/"+ "adv_hall" ]) ); + SetInventory(([ + "/domains/Ylsrim/obj/stargate" : 1, + ])); } void init(){ ::init(); diff -c -r --new-file ds2.0r19/lib/domains/default/armor/robe.c ds2.0r20b/lib/domains/default/armor/robe.c *** ds2.0r19/lib/domains/default/armor/robe.c Wed Apr 5 19:33:16 2006 --- ds2.0r20b/lib/domains/default/armor/robe.c Sun Apr 9 23:49:20 2006 *************** *** 15,21 **** "no steal" : 1, ])); SetCanClose(1); ! SetMaxCarry(500); SetMass(200); SetBaseCost("silver",100); SetDamagePoints(100); --- 15,21 ---- "no steal" : 1, ])); SetCanClose(1); ! SetMaxCarry(5000); SetMass(200); SetBaseCost("silver",100); SetDamagePoints(100); diff -c -r --new-file ds2.0r19/lib/domains/default/room/furnace.c ds2.0r20b/lib/domains/default/room/furnace.c *** ds2.0r19/lib/domains/default/room/furnace.c Fri Mar 24 14:36:36 2006 --- ds2.0r20b/lib/domains/default/room/furnace.c Wed Apr 12 23:47:49 2006 *************** *** 7,24 **** room::create(); SetAmbientLight(30); SetShort("the furnace"); ! SetLong("The furnace. Things that arrive here are periodically "+ "incinerated. You probably shouldn't be here. Go down to get out."); SetProperties(([ "no attack" : 1, ])); SetExits( ([ "down" : ROOM_START ]) ); ! call_out((: reload_room :), 60, load_object(base_name(this_object()))); SetNoModify(1); } int CanReceive(object ob){ return 1; } void init(){ ::init(); } --- 7,36 ---- room::create(); SetAmbientLight(30); SetShort("the furnace"); ! SetLong("The furnace. Things that arrive here are "+ "incinerated. You probably shouldn't be here. Go down to get out."); SetProperties(([ "no attack" : 1, ])); SetExits( ([ "down" : ROOM_START ]) ); ! call_out((: reload_room :), 600, load_object(base_name(this_object()))); ! set_heart_beat(1); SetNoModify(1); } int CanReceive(object ob){ + if(interactive(ob)){ + tell_object(ob, "You fail to enter the furnace."); + return 0; + } return 1; } void init(){ ::init(); } + void heart_beat(){ + if(sizeof(all_inventory(this_object()))){ + foreach(object ob in deep_inventory(this_object())){ + ob->eventDestruct(); + } + } + } diff -c -r --new-file ds2.0r19/lib/domains/town/obj/fleas.c ds2.0r20b/lib/domains/town/obj/fleas.c *** ds2.0r19/lib/domains/town/obj/fleas.c Sat Mar 11 11:15:11 2006 --- ds2.0r20b/lib/domains/town/obj/fleas.c Wed Apr 12 23:47:50 2006 *************** *** 63,70 **** int eventSuffer(){ int x; x=random(500); ! if(x < 2) environment()->eventForce("sneeze"); ! else if(x < 5) damage1(); else if(x < 10) damage2(); else if(x < 15) damage3(); else if(x < 20) damage4(); --- 63,69 ---- int eventSuffer(){ int x; x=random(500); ! if(x < 5) damage1(); else if(x < 10) damage2(); else if(x < 15) damage3(); else if(x < 20) damage4(); *************** *** 94,106 **** int damage2(){ tell_object(victim,"You involuntarily start scratching at the maddening itch."); ! tell_room(environment(victim),victimname+" scratches desperately at "+objective(this_player())+"self.", ({victim}) ); return 1; } int damage3(){ ! tell_room(environment(victim),victimname+" scratches at "+objective(this_player())+"self in a frenzy, ripping "+ ! possessive(this_player())+" flesh and drawing blood.", ({victim}) ); tell_object(victim,"You scratch at yourself in a mad frenzy, ripping flesh and drawing blood."); if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(5)+4,0,"torso"); return 1; --- 93,105 ---- int damage2(){ tell_object(victim,"You involuntarily start scratching at the maddening itch."); ! tell_room(environment(victim),victimname+" scratches desperately at "+reflexive(victim)+".", ({victim}) ); return 1; } int damage3(){ ! tell_room(environment(victim),victimname+" scratches at "+reflexive(victim)+" in a frenzy, ripping "+ ! possessive(victim)+" flesh and drawing blood.", ({victim}) ); tell_object(victim,"You scratch at yourself in a mad frenzy, ripping flesh and drawing blood."); if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(5)+4,0,"torso"); return 1; diff -c -r --new-file ds2.0r19/lib/domains/town/obj/lice.c ds2.0r20b/lib/domains/town/obj/lice.c *** ds2.0r19/lib/domains/town/obj/lice.c Sat Mar 11 11:15:11 2006 --- ds2.0r20b/lib/domains/town/obj/lice.c Wed Apr 12 23:47:50 2006 *************** *** 61,68 **** int eventSuffer(){ int x; x=random(500); ! if(x < 2) environment()->eventForce("sneeze"); ! else if(x < 5) damage1(); else if(x < 10) damage2(); else if(x < 15) damage3(); else if(x < 20) damage4(); --- 61,67 ---- int eventSuffer(){ int x; x=random(500); ! if(x < 5) damage1(); else if(x < 10) damage2(); else if(x < 15) damage3(); else if(x < 20) damage4(); *************** *** 92,104 **** int damage2(){ tell_object(victim,"You involuntarily start scratching at the maddening itch."); ! tell_room(environment(victim),victimname+" scratches desperately at "+objective(this_player())+"self.", ({victim}) ); return 1; } int damage3(){ ! tell_room(environment(victim),victimname+" scratches at "+objective(this_player())+"self in a frenzy, ripping "+ ! possessive(this_player())+" flesh and drawing blood.", ({victim}) ); tell_object(victim,"You scratch at yourself in a mad frenzy, ripping flesh and drawing blood."); if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(5)+4,0,"torso"); return 1; --- 91,103 ---- int damage2(){ tell_object(victim,"You involuntarily start scratching at the maddening itch."); ! tell_room(environment(victim),victimname+" scratches desperately at "+reflexive(victim)+".", ({victim}) ); return 1; } int damage3(){ ! tell_room(environment(victim),victimname+" scratches at "+reflexive(victim)+" in a frenzy, ripping "+ ! possessive(victim)+" flesh and drawing blood.", ({victim}) ); tell_object(victim,"You scratch at yourself in a mad frenzy, ripping flesh and drawing blood."); if(DangerLevel() != 100) victim->eventReceiveDamage(this_object(),DISEASE,random(5)+4,0,"torso"); return 1; diff -c -r --new-file ds2.0r19/lib/domains/town/room/furnace.c ds2.0r20b/lib/domains/town/room/furnace.c *** ds2.0r19/lib/domains/town/room/furnace.c Fri Mar 24 14:36:38 2006 --- ds2.0r20b/lib/domains/town/room/furnace.c Wed Apr 12 23:47:50 2006 *************** *** 7,24 **** room::create(); SetAmbientLight(30); SetShort("the furnace"); ! SetLong("The furnace. Things that arrive here are periodically "+ "incinerated. You probably shouldn't be here. Go down to get out."); SetProperties(([ "no attack" : 1, ])); SetExits( ([ "down" : ROOM_START ]) ); ! call_out((: reload_room :), 60, load_object(base_name(this_object()))); SetNoModify(1); } int CanReceive(object ob){ return 1; } void init(){ ::init(); } --- 7,36 ---- room::create(); SetAmbientLight(30); SetShort("the furnace"); ! SetLong("The furnace. Things that arrive here are "+ "incinerated. You probably shouldn't be here. Go down to get out."); SetProperties(([ "no attack" : 1, ])); SetExits( ([ "down" : ROOM_START ]) ); ! call_out((: reload_room :), 600, load_object(base_name(this_object()))); ! set_heart_beat(1); SetNoModify(1); } int CanReceive(object ob){ + if(interactive(ob)){ + tell_object(ob, "You fail to enter the furnace."); + return 0; + } return 1; } void init(){ ::init(); } + void heart_beat(){ + if(sizeof(all_inventory(this_object()))){ + foreach(object ob in deep_inventory(this_object())){ + ob->eventDestruct(); + } + } + } diff -c -r --new-file ds2.0r19/lib/domains/town/room/voters.c ds2.0r20b/lib/domains/town/room/voters.c *** ds2.0r19/lib/domains/town/room/voters.c Mon Dec 12 19:51:56 2005 --- ds2.0r20b/lib/domains/town/room/voters.c Wed Apr 12 23:47:50 2006 *************** *** 28,35 **** SetInventory(([ ])); AddExit("west", "/domains/town/room/thall"); - //funs - //snuf } mixed ReadList() { --- 28,33 ---- *************** *** 47,58 **** if( VOTING_D->GetStatus() == VOTE_NOT_RUNNING ) { ! this_player()->eventPrint("\nSince the elections are not " ! "currently running, the list is blank."); return 1; } ! msg = "\n\tCandidates for Dead Souls Offices\n\n"; foreach( string sClass in CLASSES_D->GetClasses() ) { msg += capitalize( sClass ) + " : "; --- 45,56 ---- if( VOTING_D->GetStatus() == VOTE_NOT_RUNNING ) { ! this_player()->eventPrint(VOTING_D->GetCurrentCouncil()); return 1; } ! msg = VOTING_D->GetCurrentCouncil(); ! msg += "\n\tCandidates for Dead Souls Offices\n\n"; foreach( string sClass in CLASSES_D->GetClasses() ) { msg += capitalize( sClass ) + " : "; *************** *** 121,128 **** break; case VOTE_MODE_CANDIDATES : ! this_player()->eventPrint("Voting has not yet started, " ! "nominate a candidate instead."); break; case VOTE_NOT_PRIMARY : --- 119,127 ---- break; case VOTE_MODE_CANDIDATES : ! this_player()->eventPrint("Voting has not yet started. We are " ! "still nominating candidates. Please nominate a candidate " ! "instead."); break; case VOTE_NOT_PRIMARY : diff -c -r --new-file ds2.0r19/lib/domains/town/weap/gstaff.c ds2.0r20b/lib/domains/town/weap/gstaff.c *** ds2.0r19/lib/domains/town/weap/gstaff.c Mon Nov 7 13:30:39 2005 --- ds2.0r20b/lib/domains/town/weap/gstaff.c Wed Apr 12 23:47:50 2006 *************** *** 3,8 **** --- 3,9 ---- #include inherit LIB_ITEM; + inherit LIB_CLAN; static void create(){ item::create(); SetKeyName("golden staff"); diff -c -r --new-file ds2.0r19/lib/include/stargate.h ds2.0r20b/lib/include/stargate.h *** ds2.0r19/lib/include/stargate.h Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/include/stargate.h Thu Apr 13 21:14:09 2006 *************** *** 0 **** --- 1,20 ---- + /** + * + * $Id: stargate.h,v 1.1 2006/04/05 05:48:39 jam Exp $ + * + */ + + #ifndef startgate_h + #define stargate_h + + #define GATE_TIMEOUT (10+random(5)) + + // address (i.e. "sgc") is a key in a mapping in the stargate daemon so it is not included here + class stargate + { + string status; + string destination; + string endpoint; + } + + #endif diff -c -r --new-file ds2.0r19/lib/lib/blank_pile.c ds2.0r20b/lib/lib/blank_pile.c *** ds2.0r19/lib/lib/blank_pile.c Mon Nov 7 13:28:59 2005 --- ds2.0r20b/lib/lib/blank_pile.c Fri Apr 14 18:27:24 2006 *************** *** 6,12 **** --- 6,16 ---- int PileAmount = 0; static void create() { + string *saveds; item::create(); + saveds = item::GetSave(); + saveds += ({ "PileType", "PileAmount" }); + AddSave( saveds ); SetKeyName("money"); } diff -c -r --new-file ds2.0r19/lib/lib/body.c ds2.0r20b/lib/lib/body.c *** ds2.0r19/lib/lib/body.c Wed Apr 5 19:33:17 2006 --- ds2.0r20b/lib/lib/body.c Wed Apr 12 23:47:53 2006 *************** *** 8,13 **** --- 8,14 ---- */ #include + #include #include #include #include *************** *** 31,37 **** private float StaminaPoints; private string Torso, Biter; private mapping Fingers, Limbs, MissingLimbs; ! private static int Dying, LastHeal; private static function Protect; private static mapping WornItems; private static class MagicProtection *Protection; --- 32,38 ---- private float StaminaPoints; private string Torso, Biter; private mapping Fingers, Limbs, MissingLimbs; ! private static int Dying, LastHeal, Encumbrance; private static function Protect; private static mapping WornItems; private static class MagicProtection *Protection; *************** *** 66,71 **** --- 67,85 ---- ExtraChannels = ({}); } + int GetEncumbrance(){ + int encumbrance = 0; + object *stuff = filter(all_inventory(this_object()), (: !($1->GetWorn()) :) ); + + //tc("ENABLE_ENCUMBRANCE: "+ENABLE_ENCUMBRANCE,"cyan"); + if(!(ENABLE_ENCUMBRANCE) || inherits(LIB_NPC,this_object()) ) return encumbrance; + //tc("bad encumbrance","red"); + if(sizeof(stuff)) foreach(object item in stuff) + encumbrance += item->GetMass(); + if(sizeof(stuff)) encumbrance *= sizeof(stuff); + return encumbrance; + } + string SetBodyComposition(string str){ if(!str) return ""; else BodyComposition = str; *************** *** 991,996 **** --- 1005,1015 ---- return 1; } + int HealLimb(string limb){ + Limbs[limb]["health"] = GetMaxHealthPoints(limb); + return Limbs[limb]["health"]; + } + int RestoreLimb(string limb) { if( !MissingLimbs[limb] ) return 0; Limbs[limb] = MissingLimbs[limb]; diff -c -r --new-file ds2.0r19/lib/lib/clan.c ds2.0r20b/lib/lib/clan.c *** ds2.0r19/lib/lib/clan.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/lib/clan.c Wed Apr 12 23:56:45 2006 *************** *** 0 **** --- 1,162 ---- + #include + #include "include/clan.h" + + private class ClanClass Clan; + + private int isWelcomed; + + static void create() { + Clan = new(class ClanClass); + Clan->leader = 0; + Clan->name = 0; + Clan->objectName = 0; + Clan->skill = 0; + isWelcomed = 0; + } + + static void init() { + if(!present(this_object(), this_player())) return; + if((string)this_player()->GetClan() != (string)GetClanName()) return; + if((string)this_player()->GetKeyName() == (string)GetLeader()) { + add_action("eventBring", "bring"); + add_action("eventInitiate", "initiate"); + add_action("eventRetire", "retire"); + } + this_player()->eventPrint("\n"); + if(!isWelcomed) { + this_player()->AddChannel(GetClanName()); + eventWelcome(this_player()); + isWelcomed = 1; + } + } + + mixed CanJoin(object ob) { return 1; } + + string GetAffectLong(object ob) { + if(!ob || !living(ob)) return 0; + return ob->GetName() + " is a member of the " + + pluralize(GetClanName()) + "."; + } + + string SetLeader(string str) { + if(!user_exists(str)) error("No such user: " + str + + ". You must have a real leader."); + if(!stringp(Clan->leader)) + Clan->leader = str; + return Clan->leader; + } + + string GetLeader() { return Clan->leader; } + + string SetClanName(string str) { + if(!stringp(Clan->name)) Clan->name = str; + return Clan->name; + } + + string GetClanName() { return Clan->name; } + + string SetClanObject(string str) { + if(!stringp(Clan->objectName)) Clan->objectName = str; + return Clan->objectName; + } + + string GetClanObject() { return Clan->objectName; } + + string SetClanSkill(string str) { + if(!stringp(Clan->skill)) Clan->skill = str; + return Clan->skill; + } + + string GetClanSkill() { return Clan->skill; } + + int eventBring(string str) { + object who; + + if(!str) return notify_fail("Bring whom?\n"); + who = find_player(lower_case(str)); + if(!who) + return notify_fail(who->GetName() + " is nowhere to be found.\n"); + if((string)who->GetClan() != (string)GetClanName()) + return notify_fail(who->GetName() + " is not one of you!\n"); + if( environment(who)->GetProperty("no teleport") + || environment(this_player())->GetProperty("no teleport") + || environment(this_player())->GetProperty("no magic")) + return notify_fail("A magic force blocks your powers.\n"); + if(present(who, environment(this_player()))) + return notify_fail(capitalize(str) + " is here.\n"); + if((int)this_player()->GetMagicPoints() < 70) + return notify_fail("Too low on magic power.\n"); + this_player()->AddMagicPoints(-70); + who->eventPrint("%^CYAN%^Your clan leader summons you.%^RESET%^"); + who->eventMoveLiving(environment(this_player())); + if(!present(who, environment(this_player()))) + this_player()->eventPrint("%^CYAN%^" + capitalize(str) + + " is beyond your reach.%^RESET%^"); + return 1; + } + + int eventInitiate(string str) { + object initiate; + object clanObject; + mixed ret; + + if(!str) return notify_fail("Initiate whom?\n"); + initiate = present(lower_case(str), environment(this_player())); + if(!initiate || !living(initiate)) + return notify_fail("No one of that nature here.\n"); + if(stringp(ret = CanJoin(initiate))) return notify_fail(ret); + else if(!ret) return ret; + if((int)this_player()->GetMagicPoints() < 300) + return notify_fail("Too low on magic power.\n"); + if(initiate->GetClan()) + return notify_fail("You may only initiate people without clan " + + "affiliation.\n"); + initiate->SetClan((string)GetClanName()); + initiate->SetSkill(GetClanSkill(), 1, 1); + if(clanObject = new((string)GetClanObject())) + clanObject->eventMove(initiate); + this_player()->AddMagicPoints(-300); + eventJoin(initiate); + return 1; + } + + void eventJoin(object ob) { + ob->eventPrint("%^YELLOW%^You are now a member of the " + + pluralize((string)GetClanName()) + ".%^RESET%^"); + environment(ob)->eventPrint("%^YELLOW%^" +(string)ob->GetName() + + " is now a member of the " + + pluralize((string)GetClanName()) + ".%^RESET%^", ob); + } + + int eventRetire(string str) { + object retiree; + object clanObject; + + if(!str) return notify_fail("Retire whom?\n"); + retiree = present(lower_case(str), environment(this_player())); + if(!retiree || !living(retiree)) + return notify_fail("No one of that nature here.\n"); + if((string)retiree->GetClan() != (string)GetClanName()) + return notify_fail(retiree->GetName() + " is not one of us!\n"); + clanObject = present(GetClanName() + "_clan_object", retiree); + if(!clanObject) error("Problem with clan object."); + clanObject->eventDestruct(); + retiree->SetClan(0); + // retiree->SetSkill(GetClanSkill(), 1, 1); We need to remove skill here. + eventUnjoin(retiree); + return 1; + } + + void eventUnjoin(object ob) { + ob->eventPrint("%^RED%^You are no longer a member of the " + + pluralize((string)GetClanName()) + ".%^RESET%^"); + environment(ob)->eventPrint("%^RED%^" + (string)ob->GetName() + + " is no longer a member of the " + + pluralize((string)GetClanName()) + ".%^RESET%^", ob); + } + + void eventWelcome(object ob) { + ob->eventPrint("%^YELLOW%^Welcome, fellow " + (string)GetClanName() + + ".%^RESET%^"); + } + diff -c -r --new-file ds2.0r19/lib/lib/classes.c ds2.0r20b/lib/lib/classes.c *** ds2.0r19/lib/lib/classes.c Mon Jan 16 23:03:04 2006 --- ds2.0r20b/lib/lib/classes.c Wed Apr 12 23:48:35 2006 *************** *** 1,6 **** /* /lib/classes.c * from the Dead Souls LPC Library ! * classes and guild handling object * created by Descartes of Borg 950123 * Version: @(#) classes.c 1.4@(#) * Last modified: 96/12/13 --- 1,6 ---- /* /lib/classes.c * from the Dead Souls LPC Library ! * classes and clan handling object * created by Descartes of Borg 950123 * Version: @(#) classes.c 1.4@(#) * Last modified: 96/12/13 *************** *** 13,19 **** inherit LIB_ABILITIES; private int Morality; ! private string Class, Guild; private mapping SkillModifiers; private string *Religion; --- 13,19 ---- inherit LIB_ABILITIES; private int Morality; ! private string Class, Clan; private mapping SkillModifiers; private string *Religion; *************** *** 22,28 **** SkillModifiers = ([]); Religion = allocate(2); Class = 0; ! Guild = 0; Morality = 0; } --- 22,28 ---- SkillModifiers = ([]); Religion = allocate(2); Class = 0; ! Clan = 0; Morality = 0; } *************** *** 107,115 **** return (int)CLASSES_D->ClassMember(Class, class_name); } ! string SetGuild(string guild) { return (Guild = guild); } ! string GetGuild() { return Guild; } int GetBaseStatLevel(string stat) { return 0; } --- 107,115 ---- return (int)CLASSES_D->ClassMember(Class, class_name); } ! string SetClan(string clan) { return (Clan = clan); } ! string GetClan() { return Clan; } int GetBaseStatLevel(string stat) { return 0; } diff -c -r --new-file ds2.0r19/lib/lib/combat.c ds2.0r20b/lib/lib/combat.c *** ds2.0r19/lib/lib/combat.c Thu Apr 6 22:53:30 2006 --- ds2.0r20b/lib/lib/combat.c Wed Apr 12 23:48:35 2006 *************** *** 407,412 **** --- 407,413 ---- else { TargetLimb = limb; } + //tc("chance: "+chance); return chance; } *************** *** 433,438 **** --- 434,440 ---- else { TargetLimb = limb; } + //tc("chance: "+chance); return chance; } else { *************** *** 455,460 **** --- 457,463 ---- else { TargetLimb = limb; } + //tc("chance: "+chance); return chance; } } *************** *** 626,639 **** SendWeaponMessages(target, -1, weapon, TargetLimb); } else { // I hit, but how hard did I hit? ! int damage_type, damage, weapon_damage, actual_damage; eventTrainSkill(weapon_type + " attack", pro*2, con, 1, bonus); damage_type = weapon->GetDamageType(); damage = (weapon->eventStrike(target) * pro)/(GetLevel()*2); damage = GetDamage(damage, weapon_type + " attack"); actual_damage = target->eventReceiveDamage(this_object(), damage_type, damage, 0, TargetLimb); ! if( actual_damage < 1 ) { actual_damage = 0; } weapon_damage = damage - actual_damage; --- 629,650 ---- SendWeaponMessages(target, -1, weapon, TargetLimb); } else { // I hit, but how hard did I hit? ! int damage_type, damage, weapon_damage, actual_damage, encumbrance; ! encumbrance = this_object()->GetEncumbrance(); ! //tc("encumbrance: "+encumbrance,"white"); ! if(encumbrance > 30){ ! //tc("feep","yellow"); ! tell_object(this_object(),"You struggle to fight while heavily encumbered."); ! } eventTrainSkill(weapon_type + " attack", pro*2, con, 1, bonus); damage_type = weapon->GetDamageType(); damage = (weapon->eventStrike(target) * pro)/(GetLevel()*2); damage = GetDamage(damage, weapon_type + " attack"); + damage -= encumbrance; + if(damage < 0) damage = 0; actual_damage = target->eventReceiveDamage(this_object(), damage_type, damage, 0, TargetLimb); ! if( actual_damage < 0 ) { actual_damage = 0; } weapon_damage = damage - actual_damage; *************** *** 711,723 **** GetCombatBonus(target->GetLevel())); } else { ! int x; ! // I hit, how hard? eventTrainSkill("melee attack", pro, con, 1, GetCombatBonus(target->GetLevel())); if(this_object()->GetMelee()) x = GetDamage(3*chance/4, "melee attack"); else x = GetDamage(3*chance/20, "melee attack"); x = target->eventReceiveDamage(this_object(), BLUNT, x, 0, TargetLimb); if( !target->GetDying() ) { --- 722,741 ---- GetCombatBonus(target->GetLevel())); } else { ! int x, encumbrance; ! encumbrance = this_object()->GetEncumbrance(); ! //tc("encumbrance: "+encumbrance,"white"); ! if(encumbrance > 30){ ! //tc("feep","blue"); ! tell_object(this_object(),"You struggle to fight while heavily encumbered."); ! } // I hit, how hard? eventTrainSkill("melee attack", pro, con, 1, GetCombatBonus(target->GetLevel())); if(this_object()->GetMelee()) x = GetDamage(3*chance/4, "melee attack"); else x = GetDamage(3*chance/20, "melee attack"); + x -= encumbrance; + if(x < 0) x = 0; x = target->eventReceiveDamage(this_object(), BLUNT, x, 0, TargetLimb); if( !target->GetDying() ) { *************** *** 898,905 **** varargs int eventReceiveDamage(object agent, int type, int x, int internal, mixed limbs) { ! int hp; ! x = race::eventReceiveDamage(agent, type, x, internal, limbs); if( !Wimpy ) return x; if( (hp = GetHealthPoints()) < 1 ) return x; --- 916,928 ---- varargs int eventReceiveDamage(object agent, int type, int x, int internal, mixed limbs) { ! int hp,encumbrance; ! encumbrance = this_object()->GetEncumbrance(); ! //tc("encumbrance: "+encumbrance,"white"); ! if(encumbrance > 30){ ! //tc("feep","green"); ! tell_object(this_object(),"You try to dodge while weighed down."); ! } x = race::eventReceiveDamage(agent, type, x, internal, limbs); if( !Wimpy ) return x; if( (hp = GetHealthPoints()) < 1 ) return x; diff -c -r --new-file ds2.0r19/lib/lib/command.c ds2.0r20b/lib/lib/command.c *** ds2.0r19/lib/lib/command.c Tue Mar 28 23:23:41 2006 --- ds2.0r20b/lib/lib/command.c Wed Apr 12 23:48:35 2006 *************** *** 26,32 **** apostrophe_exceptions += ({"say","speak","yell","whisper","shout"}); //Fix here courtesy of Jonez apostrophe_exceptions += ({"ping", "reply"}); ! SearchPath = ({ DIR_PLAYER_CMDS, DIR_SECURE_PLAYER_CMDS, DIR_GUILD_CMDS, DIR_COMMON_CMDS, DIR_SECURE_COMMON_CMDS }); } --- 26,32 ---- apostrophe_exceptions += ({"say","speak","yell","whisper","shout"}); //Fix here courtesy of Jonez apostrophe_exceptions += ({"ping", "reply"}); ! SearchPath = ({ DIR_PLAYER_CMDS, DIR_SECURE_PLAYER_CMDS, DIR_CLAN_CMDS, DIR_COMMON_CMDS, DIR_SECURE_COMMON_CMDS }); } diff -c -r --new-file ds2.0r19/lib/lib/comp/holder.c ds2.0r20b/lib/lib/comp/holder.c *** ds2.0r19/lib/lib/comp/holder.c Mon Nov 7 13:31:06 2005 --- ds2.0r20b/lib/lib/comp/holder.c Sun Apr 9 23:49:20 2006 *************** *** 82,87 **** --- 82,88 ---- return tmp; } AddCarriedMass(ob->GetMass()); + this_object()->SetMass(this_object()->GetMass() + ob->GetMass()); parse_refresh(); return 1; } *************** *** 90,96 **** int x; x = container::eventReleaseObject(ob); ! call_out((: parse_refresh :), 0); return x; } --- 91,100 ---- int x; x = container::eventReleaseObject(ob); ! //call_out((: parse_refresh :), 0); ! AddCarriedMass(-(ob->GetMass())); ! this_object()->SetMass(this_object()->GetMass() - ob->GetMass()); ! parse_refresh(); return x; } diff -c -r --new-file ds2.0r19/lib/lib/creator.c ds2.0r20b/lib/lib/creator.c *** ds2.0r19/lib/lib/creator.c Wed Apr 5 19:33:17 2006 --- ds2.0r20b/lib/lib/creator.c Wed Apr 12 23:48:35 2006 *************** *** 178,184 **** laston = GetLoginTime(); if( !player::Setup() ) return 0; ! AddChannel(({"cre", "newbie", "gossip", "ds", "death","intergossip","intercre" })); AddChannel((string array)CLASSES_D->GetClasses()); if( archp() ) AddChannel( ({ "admin", "error" }) ); AddSearchPath( ({ DIR_CREATOR_CMDS, DIR_SECURE_CREATOR_CMDS }) ); --- 178,184 ---- laston = GetLoginTime(); if( !player::Setup() ) return 0; ! AddChannel(({"cre", "newbie", "gossip", "ds", "ds_test", "lpuni", "death","intergossip","intercre" })); AddChannel((string array)CLASSES_D->GetClasses()); if( archp() ) AddChannel( ({ "admin", "error" }) ); AddSearchPath( ({ DIR_CREATOR_CMDS, DIR_SECURE_CREATOR_CMDS }) ); diff -c -r --new-file ds2.0r19/lib/lib/donate.c ds2.0r20b/lib/lib/donate.c *** ds2.0r19/lib/lib/donate.c Thu Jan 5 00:17:58 2006 --- ds2.0r20b/lib/lib/donate.c Wed Apr 12 23:48:35 2006 *************** *** 16,22 **** static void init() { if( (string)this_player()->ClassMember((string)GetOwner()) || ! (string)this_player()->GetGuild() == (string)GetOwner() ) { add_action( (: eventDonate :) , "donate" ); } } --- 16,22 ---- static void init() { if( (string)this_player()->ClassMember((string)GetOwner()) || ! (string)this_player()->GetClan() == (string)GetOwner() ) { add_action( (: eventDonate :) , "donate" ); } } diff -c -r --new-file ds2.0r19/lib/lib/events/put.c ds2.0r20b/lib/lib/events/put.c *** ds2.0r19/lib/lib/events/put.c Wed Dec 7 14:03:05 2005 --- ds2.0r20b/lib/lib/events/put.c Thu Apr 13 21:03:52 2006 *************** *** 24,35 **** mixed tmp; if( (tmp = CanDrop(who)) != 1 ) return tmp; if( !environment() ) { destruct(this_object()); return 1; } ! if( environment() != this_player() ) return 0; if( !PreventPut ) return 1; if( stringp(PreventPut) && PreventPut == "PERMIT" ) return 1; if( intp(PreventPut) ) return 0; if( stringp(PreventPut) ) return PreventPut; if( objectp(PreventPut) ) { if( PreventPut == who ) return "You cannot put " + GetShort() + " anywhere."; --- 24,43 ---- mixed tmp; if( (tmp = CanDrop(who)) != 1 ) return tmp; + //debug("i dunno 1"); if( !environment() ) { destruct(this_object()); return 1; } ! //debug("i dunno 2"); ! if( environment() != this_player() && ! environment() != environment(this_player())) return 0; ! //debug("i dunno 3"); if( !PreventPut ) return 1; + //debug("i dunno 4"); if( stringp(PreventPut) && PreventPut == "PERMIT" ) return 1; + //debug("i dunno 5"); if( intp(PreventPut) ) return 0; + //debug("i dunno 6"); if( stringp(PreventPut) ) return PreventPut; + //debug("i dunno 7"); if( objectp(PreventPut) ) { if( PreventPut == who ) return "You cannot put " + GetShort() + " anywhere."; *************** *** 80,82 **** --- 88,94 ---- return CanPut(this_player()); } + mixed direct_put_wrd_wrd_word_obj(){ + return CanPut(this_player()); + } + diff -c -r --new-file ds2.0r19/lib/lib/genetics.c ds2.0r20b/lib/lib/genetics.c *** ds2.0r19/lib/lib/genetics.c Sat Mar 11 11:16:11 2006 --- ds2.0r20b/lib/lib/genetics.c Sun Apr 9 23:49:20 2006 *************** *** 99,111 **** varargs void AddStat(string stat, int base, int cls) { int level; ! if( userp(this_object()) ) level = 1; else level = GetLevel(); if( !stat || cls < 1 || cls > 5 ) return; base += ((5 - cls) * random(10)) + (3 * (level + 1))/(cls * 4); if( userp(this_object()) && base > 90 ) base = 90; else if( base > 100 ) base = 100; SetStat(stat, base, cls); } --- 99,112 ---- varargs void AddStat(string stat, int base, int cls) { int level; ! //tc("stat: "+stat+", base: "+base+", cls: "+cls,"red"); if( userp(this_object()) ) level = 1; else level = GetLevel(); if( !stat || cls < 1 || cls > 5 ) return; base += ((5 - cls) * random(10)) + (3 * (level + 1))/(cls * 4); if( userp(this_object()) && base > 90 ) base = 90; else if( base > 100 ) base = 100; + //tc("stat: "+stat+", base: "+base+", cls: "+cls,"green"); SetStat(stat, base, cls); } diff -c -r --new-file ds2.0r19/lib/lib/guild.c ds2.0r20b/lib/lib/guild.c *** ds2.0r19/lib/lib/guild.c Wed Dec 7 14:03:18 2005 --- ds2.0r20b/lib/lib/guild.c Wed Dec 31 19:00:00 1969 *************** *** 1,165 **** - - #include - #include "include/guild.h" - - class GuildClass Guild; - - //private static class GuildClass; - private int isWelcomed; - class Guild = new(class GuildClass); - - static void create() { - Guild = new(class GuildClass); - Guild->leader = 0; - Guild->name = 0; - Guild->objectName = 0; - Guild->skill = 0; - isWelcomed = 0; - } - - static void init() { - if(!present(this_object(), this_player())) return; - if((string)this_player()->GetGuild() != (string)GetGuildName()) return; - if((string)this_player()->GetKeyName() == (string)GetLeader()) { - add_action((:eventBring:), "bring"); - add_action((:eventInitiate:), "initiate"); - add_action((:eventRetire:), "retire"); - } - this_player()->eventPrint("\n"); - if(!isWelcomed) { - this_player()->AddChannel(GetGuildName()); - eventWelcome(this_player()); - isWelcomed = 1; - } - } - - mixed CanJoin(object ob) { return 1; } - - string GetAffectLong(object ob) { - if(!ob || !living(ob)) return 0; - return ob->GetName() + " is a member of the " - + pluralize(GetGuildName()) + "."; - } - - string SetLeader(string str) { - if(!user_exists(str)) error("No such user: " + str - + ". You must have a real leader."); - if(!stringp(Guild->leader)) - Guild->leader = str; - return Guild->leader; - } - - string GetLeader() { return Guild->leader; } - - string SetGuildName(string str) { - if(!stringp(Guild->name)) Guild->name = str; - return Guild->name; - } - - string GetGuildName() { return Guild->name; } - - string SetGuildObject(string str) { - if(!stringp(Guild->objectName)) Guild->objectName = str; - return Guild->objectName; - } - - string GetGuildObject() { return Guild->objectName; } - - string SetGuildSkill(string str) { - if(!stringp(Guild->skill)) Guild->skill = str; - return Guild->skill; - } - - string GetGuildSkill() { return Guild->skill; } - - int eventBring(string str) { - object who; - - if(!str) return notify_fail("Bring whom?\n"); - who = find_player(lower_case(str)); - if(!who) - return notify_fail(who->GetName() + " is nowhere to be found.\n"); - if((string)who->GetGuild() != (string)GetGuildName()) - return notify_fail(who->GetName() + " is not one of you!\n"); - if( environment(who)->GetProperty("no teleport") - || environment(this_player())->GetProperty("no teleport") - || environment(this_player())->GetProperty("no magic")) - return notify_fail("A magic force blocks your powers.\n"); - if(present(who, environment(this_player()))) - return notify_fail(capitalize(str) + " is here.\n"); - if((int)this_player()->GetMagicPoints() < 70) - return notify_fail("Too low on magic power.\n"); - this_player()->AddMagicPoints(-70); - who->eventPrint("%^CYAN%^Your guild leader summons you.%^RESET%^"); - who->eventMoveLiving(environment(this_player())); - if(!present(who, environment(this_player()))) - this_player()->eventPrint("%^CYAN%^" + capitalize(str) - + " is beyond your reach.%^RESET%^"); - return 1; - } - - int eventInitiate(string str) { - object initiate; - object guildObject; - mixed ret; - - if(!str) return notify_fail("Initiate whom?\n"); - initiate = present(lower_case(str), environment(this_player())); - if(!initiate || !living(initiate)) - return notify_fail("No one of that nature here.\n"); - if(stringp(ret = CanJoin(initiate))) return notify_fail(ret); - else if(!ret) return ret; - if((int)this_player()->GetMagicPoints() < 300) - return notify_fail("Too low on magic power.\n"); - if(initiate->GetGuild()) - return notify_fail("You may only initiate people without guild " - + "affiliation.\n"); - initiate->SetGuild((string)GetGuildName()); - initiate->SetSkill(GetGuildSkill(), 1, 1); - if(guildObject = new((string)GetGuildObject())) - guildObject->eventMove(initiate); - this_player()->AddMagicPoints(-300); - eventJoin(initiate); - return 1; - } - - void eventJoin(object ob) { - ob->eventPrint("%^YELLOW%^You are now a member of the " - + pluralize((string)GetGuildName()) + ".%^RESET%^"); - environment(ob)->eventPrint("%^YELLOW%^" +(string)ob->GetName() - + " is now a member of the " - + pluralize((string)GetGuildName()) + ".%^RESET%^", ob); - } - - int eventRetire(string str) { - object retiree; - object guildObject; - - if(!str) return notify_fail("Retire whom?\n"); - retiree = present(lower_case(str), environment(this_player())); - if(!retiree || !living(retiree)) - return notify_fail("No one of that nature here.\n"); - if((string)retiree->GetGuild() != (string)GetGuildName()) - return notify_fail(retiree->GetName() + " is not one of us!\n"); - guildObject = present(GetGuildName() + "_guild_object", retiree); - if(!guildObject) error("Problem with guild object."); - guildObject->eventDestruct(); - retiree->SetGuild(0); - // retiree->SetSkill(GetGuildSkill(), 1, 1); We need to remove skill here. - eventUnjoin(retiree); - return 1; - } - - void eventUnjoin(object ob) { - ob->eventPrint("%^RED%^You are no longer a member of the " - + pluralize((string)GetGuildName()) + ".%^RESET%^"); - environment(ob)->eventPrint("%^RED%^" + (string)ob->GetName() - + " is no longer a member of the " - + pluralize((string)GetGuildName()) + ".%^RESET%^", ob); - } - - void eventWelcome(object ob) { - ob->eventPrint("%^YELLOW%^Welcome, fellow " + (string)GetGuildName() - + ".%^RESET%^"); - } - --- 0 ---- diff -c -r --new-file ds2.0r19/lib/lib/include/clan.h ds2.0r20b/lib/lib/include/clan.h *** ds2.0r19/lib/lib/include/clan.h Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/lib/include/clan.h Wed Apr 12 23:56:45 2006 *************** *** 0 **** --- 1,38 ---- + + + #ifndef l_clan_h + #define l_clan_h + + + class ClanClass { + string leader; + string name; + string objectName; + string skill; + } + + static void create(); + static void init(); + + mixed CanJoin(object ob); + string GetAffectLong(object ob); + string SetLeader(string str); + string GetLeader(); + string SetClanName(string str); + string GetClanName(); + string SetClanObject(string str); + string GetClanObject(); + string SetClanSkill(string str); + string GetClanSkill(); + + int eventBring(string str); + int eventInitiate(string str); + void eventJoin(object ob); + int eventRetire(string str); + void eventUnjoin(object ob); + void eventWelcome(object ob); + + + #endif /* l_clan_h */ + + diff -c -r --new-file ds2.0r19/lib/lib/include/classes.h ds2.0r20b/lib/lib/include/classes.h *** ds2.0r19/lib/lib/include/classes.h Wed Sep 28 19:34:11 2005 --- ds2.0r20b/lib/lib/include/classes.h Wed Apr 12 23:48:44 2006 *************** *** 10,17 **** string GetSkillModifier(string skill); string SetClass(string classes); string GetClass(); ! string SetGuild(string guild); ! string GetGuild(); int GetBaseStatLevel(string stat); int SetMorality(int x); int GetMorality(); --- 10,17 ---- string GetSkillModifier(string skill); string SetClass(string classes); string GetClass(); ! string SetClan(string clan); ! string GetClan(); int GetBaseStatLevel(string stat); int SetMorality(int x); int GetMorality(); diff -c -r --new-file ds2.0r19/lib/lib/include/guild.h ds2.0r20b/lib/lib/include/guild.h *** ds2.0r19/lib/lib/include/guild.h Wed Sep 28 19:34:11 2005 --- ds2.0r20b/lib/lib/include/guild.h Wed Dec 31 19:00:00 1969 *************** *** 1,38 **** - - - #ifndef l_guild_h - #define l_guild_h - - - class GuildClass { - string leader; - string name; - string objectName; - string skill; - } - - static void create(); - static void init(); - - mixed CanJoin(object ob); - string GetAffectLong(object ob); - string SetLeader(string str); - string GetLeader(); - string SetGuildName(string str); - string GetGuildName(); - string SetGuildObject(string str); - string GetGuildObject(); - string SetGuildSkill(string str); - string GetGuildSkill(); - - int eventBring(string str); - int eventInitiate(string str); - void eventJoin(object ob); - int eventRetire(string str); - void eventUnjoin(object ob); - void eventWelcome(object ob); - - - #endif /* l_guild_h */ - - --- 0 ---- diff -c -r --new-file ds2.0r19/lib/lib/include/player.h ds2.0r20b/lib/lib/include/player.h *** ds2.0r19/lib/lib/include/player.h Wed Sep 28 19:34:11 2005 --- ds2.0r20b/lib/lib/include/player.h Wed Apr 12 23:48:52 2006 *************** *** 57,63 **** string GetCapName(); int ResetLevel(); string SetClass(string str); ! string SetGuild(string guild); varargs static int AddHealthPoints(int x, string limb, object agent); int GetLanguageLevel(string lang); int is_living(); --- 57,63 ---- string GetCapName(); int ResetLevel(); string SetClass(string str); ! string SetClan(string clan); varargs static int AddHealthPoints(int x, string limb, object agent); int GetLanguageLevel(string lang); int is_living(); diff -c -r --new-file ds2.0r19/lib/lib/include/stargate.h ds2.0r20b/lib/lib/include/stargate.h *** ds2.0r19/lib/lib/include/stargate.h Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/lib/include/stargate.h Thu Apr 13 21:14:09 2006 *************** *** 0 **** --- 1,18 ---- + /** + * + * $Id: stargate.h,v 1.1 2006/04/05 05:48:39 jam Exp $ + * + */ + + #include "/include/stargate.h" + + #ifndef lib_stargate_h + #define lib_stargate_h + + void setOrigin(string o, string d); + string getOrigin(); + void connect(string destination); + int disconnect(); + string status(); + + #endif diff -c -r --new-file ds2.0r19/lib/lib/interactive.c ds2.0r20b/lib/lib/interactive.c *** ds2.0r19/lib/lib/interactive.c Wed Apr 5 19:33:18 2006 --- ds2.0r20b/lib/lib/interactive.c Thu Apr 13 21:03:57 2006 *************** *** 152,157 **** --- 152,158 ---- get_livings(load_object("/secure/room/control"))->eventPrint("[" + GetKeyName()+ " goes net-dead]", MSG_SYSTEM); } + SNOOP_D->ReportLinkDeath(this_object()->GetKeyName()); eventMove(ROOM_FREEZER); if(query_snoop(this_object())) query_snoop(this_object())->eventPrint(GetCapName() + " has gone " *************** *** 208,216 **** if(desc && desc != "") desc = capitalize((string)env->GetShort() || "") + " [" + desc + "]\n"; ! else desc = capitalize((string)env->GetShort() || ""); } ! else desc = ""; if( i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM ) desc += (string)env->GetLong(); if(functionp(tmp = (mixed)env->GetSmell("default"))) --- 209,217 ---- if(desc && desc != "") desc = capitalize((string)env->GetShort() || "") + " [" + desc + "]\n"; ! else desc = capitalize((string)env->GetShort()+"\n" || "\n"); } ! else desc = "\n"; if( i == VISION_CLEAR || i == VISION_LIGHT || i == VISION_DIM ) desc += (string)env->GetLong(); if(functionp(tmp = (mixed)env->GetSmell("default"))) *************** *** 228,235 **** desc = (string)env->GetShort(); if( (tmp = (string)env->GetObviousExits()) && tmp != "" ) desc += " [" + tmp + "]"; } ! else desc = ""; } if( desc ) eventPrint(desc, MSG_ROOMDESC); if( smell ) eventPrint("%^GREEN%^" + smell, MSG_ROOMDESC); --- 229,237 ---- desc = (string)env->GetShort(); if( (tmp = (string)env->GetObviousExits()) && tmp != "" ) desc += " [" + tmp + "]"; + else desc += "\n"; } ! else desc = "\n"; } if( desc ) eventPrint(desc, MSG_ROOMDESC); if( smell ) eventPrint("%^GREEN%^" + smell, MSG_ROOMDESC); diff -c -r --new-file ds2.0r19/lib/lib/persist.c ds2.0r20b/lib/lib/persist.c *** ds2.0r19/lib/lib/persist.c Wed Apr 5 19:33:18 2006 --- ds2.0r20b/lib/lib/persist.c Wed Apr 12 23:48:53 2006 *************** *** 15,21 **** string *flat = ({}); mixed *tmp; ! tc("Hit eventConvertObject","red"); if( val[0] != base_name(this_object()) ) error("Invalid save string.\n"); tmp = map(Saved, (: functionp($1) ? evaluate($1, "loading") : $1 :)); foreach(mixed elem in tmp) { --- 15,21 ---- string *flat = ({}); mixed *tmp; ! //tc("Hit eventConvertObject","red"); if( val[0] != base_name(this_object()) ) error("Invalid save string.\n"); tmp = map(Saved, (: functionp($1) ? evaluate($1, "loading") : $1 :)); foreach(mixed elem in tmp) { diff -c -r --new-file ds2.0r19/lib/lib/pile.c ds2.0r20b/lib/lib/pile.c *** ds2.0r19/lib/lib/pile.c Mon Nov 7 13:29:00 2005 --- ds2.0r20b/lib/lib/pile.c Fri Apr 14 18:27:24 2006 *************** *** 14,20 **** --- 14,24 ---- private int PileAmount = 0; static void create() { + string *saveds; item::create(); + saveds = item::GetSave(); + saveds += ({ "PileType", "PileAmount" }); + AddSave( saveds ); SetKeyName("pile"); } diff -c -r --new-file ds2.0r19/lib/lib/player.c ds2.0r20b/lib/lib/player.c *** ds2.0r19/lib/lib/player.c Wed Apr 5 19:33:18 2006 --- ds2.0r20b/lib/lib/player.c Wed Apr 12 23:48:53 2006 *************** *** 438,443 **** --- 438,444 ---- object jeans, shirt, book; if(ENGLISH_ONLY) this_object()->SetNativeLanguage("English"); + PLAYERS_D->AddPlayerInfo(this_object()); jeans = new("/domains/default/armor/jeans"); shirt = new("/domains/default/armor/shirt"); diff -c -r --new-file ds2.0r19/lib/lib/props/description.c ds2.0r20b/lib/lib/props/description.c *** ds2.0r19/lib/lib/props/description.c Sat Mar 11 11:16:12 2006 --- ds2.0r20b/lib/lib/props/description.c Sun Apr 9 23:49:21 2006 *************** *** 41,46 **** --- 41,49 ---- mixed direct_reload() { return 1; } mixed indirect_reload() { return 1; } + mixed direct_reload_every_str() { return 1; } + mixed indirect_reload_every_str() { return 1; } + mixed direct_copy_obj_to_obj() { return 1; } mixed direct_copy_obj_str() { return 1; } diff -c -r --new-file ds2.0r19/lib/lib/race.c ds2.0r20b/lib/lib/race.c *** ds2.0r19/lib/lib/race.c Wed Apr 5 19:33:18 2006 --- ds2.0r20b/lib/lib/race.c Sun Apr 9 23:49:21 2006 *************** *** 103,108 **** --- 103,109 ---- } foreach(tmp in args[1]) { mixt = copy(args[1]); + //tc("mixt: "+identify(mixt),"blue"); AddStat(tmp...); } if( stringp(args[2]) ) { diff -c -r --new-file ds2.0r19/lib/lib/stargate.c ds2.0r20b/lib/lib/stargate.c *** ds2.0r19/lib/lib/stargate.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/lib/stargate.c Thu Apr 13 21:14:09 2006 *************** *** 0 **** --- 1,244 ---- + #include + #include + #include "/lib/include/stargate.h" + + /** + * 2006-03-28, jonez + * - based on a suggestion from rhk, changed so that one cannot enter the + * gate unless status is "outbound". this makes the object closer to the + * (theoretical) math and also to what happens on the show. + */ + + /** + * based on portal.c by Brodbane - March 2006 + * + * $Id: stargate.c,v 1.1 2006/04/05 05:48:39 jam Exp $ + * + * The desired functionality is much like a "star gate": users dialed + * letters or full words that lined up with destinations. A portal opens to + * that destination briefly. To define destinations you must setup a + * constant below then add it to the switch statement in the cmdDial + * function. This object is crude and basic, but gets the job done. + * + * 2006-03-22, jonez + * - original version of this file is from Daelas@Moraelinost + * 2006-03-23, jonez + * - altered so code uses existing verbs (touch, enter) where possible. last add_action is for dial command. + * - added single mapping called "database" and made the "dial" command use it. + * - dial command no longer uses switch/case, making adding a new destination simpler + * - made use of SetPreventGet() / SetPreventPut() + * - made use of new stargate daemon + * - made use of LIB_STARGATE + * - made use of STARGATE_D + * + * IDEAS: + * - create a daemon that holds the stargate network [DONE] + * - allow for stargate failure + * - add dhd object + * - change the code so that it uses a single mapping of names and + * destinations, perhaps in a database file. currently an update to the + * object requires an update for all the objects. [DONE] + * - dhd skill (thanks plato) + * - delay when dialing gate. destination dhd lights up? + * - player should not be able to dial earth if earth is already connected elsewhere (need daemon) [DONE] + * - make use of existing verbs (enter, touch) instead of doing our own thing. [DONE] + * - daemon should contain a class that maps the various gates to each other. see lib/include/door.h [DONE] + * - shout "off world activation" into the gateroom when the gate engages. + * - track status as "incoming" or "outgoing".. you can only "enter" an outgoing gate (rhk) [DONE] + * - if room is empty, shut down the gate (rhk) + * - change callout time when someone goes through the gate (rhk) + */ + + inherit LIB_ITEM; + + static private string origin; + + string displayLong(); + string displayShort(); + + void create() + { + item::create(); + + SetKeyName("stargate"); + SetId(({"stargate", "gate", "portal", "ring"})); + SetAdjectives(({"stargate"})); + SetShort( (: displayShort :) ); + + SetLong( (: displayLong :) ); + + AddItem( "inner ring", "The second ring - the inner ring - is placed " + "inside the larger ring and seems to be able to move."); + SetMass(1000); + SetBaseCost("silver",50); + SetPreventGet("The gate is pure naquadah and cannot be moved"); + SetPreventPut("The gate is pure naquadah and cannot be moved"); + SetTouch("You feel the stargate beneath your hand humming with energy."); + } + + void init() + { + ::init(); + add_action( "cmdDial", "dial" ); + add_action( "cmdEnter", "enter"); + } + + + void setOrigin(string o, string d) + { + if (o == "" || d == "") return; + origin = lower_case(o); + STARGATE_D->setStargate(origin, d); + } + + string getOrigin() + { + return origin; + } + + void connect(string destination) + { + int ret; + + destination = lower_case(destination); + + if (origin == destination) + { + write("You attempt to dial the gate, but the last chevron does not engage"); + say(this_player()->GetName() + " tries to dial the gate but the last chevron does not engage"); + return; + } + + ret = STARGATE_D->connect(origin, destination); + if (ret) + { + string d = STARGATE_D->getDestination(destination); + write("The ancient rings lock into place and a portal forms in an explosion of energy."); + say("The ancient rings lock into place and a portal forms in an explosion of energy."); + tell_room(d, "The ancient rings lock into place and a portal forms in an explosion of energy"); + call_out("disconnect", 10+random(5)); + return; + } + + write("You attempt to dial the stargate, but nothing happens."); + say(this_player()->GetName() + " tries to dial the gate but fails."); + + return; + } + + int disconnect() + { + string e = STARGATE_D->getEndpoint(origin); + string d = STARGATE_D->getDestination(e); + + debug(sprintf("stargate_lib->disconnect(%s), e=%s, d=%s", origin, e, d)); + + // FIX: does the player get a message if they come through the gate and then leave the room? + write("The chevrons on the stargate disengage and the portal disappears."); + say("The chevrons on the stargate disengage and the portal disappears."); + tell_room(d, "The chevrons on the stargate disengage and the portal disappears", ({ this_player() })); + + return STARGATE_D->disconnect(origin); + } + + string status() + { + return STARGATE_D->getStatus(origin); + } + + mixed cmdDial(string s) + { + if (s) + { + connect(s); + return 1; + } + + return 0; + + } + + int cmdEnter(string what) + { + string endpoint, destination; + object who; + + if (what != "gate" && what != "stargate") + { + return 0; + } + + if (status() != "outbound") + { + return 0; + } + + who = this_player(); + endpoint = STARGATE_D->getEndpoint(origin); + destination = STARGATE_D->getDestination(endpoint); + debug("endpoint=" + endpoint); + debug("destination=" + destination); + who->eventPrint("You step through the event horizon of the stargate."); + who->eventMoveLiving(destination, + "$N steps into the event horizon and disappears", + "$N steps out of the event horizon"); + return 1; + + } + + int eventEnter(object who) + { + string endpoint; + + if (!who) return 0; + + endpoint = STARGATE_D->getEndpoint(origin); + if (status() == "connected") + { + who->eventPrint("You step through the event horizon of the stargate."); + who->eventMoveLiving(endpoint, + "$N steps into the event horizon and disappears", + "$N steps out of the event horizon"); + } + return 1; + } + + string displayLong() + { + string buf, stat; + + buf = "This is the Stargate of legend. The Stargate was created " + "from naquadah ore, similar to black quartz. It is a perfectly " + "circular device approximately ten meters in diameter and " + "comprised of two sets of rings and nine chevrons placed " + "equidistant along its outer circumfrence."; + + stat = status(); + + if (stat == "outbound" || stat == "inbound") + { + buf += " There is an event horizon in the center of the ring that looks like shimmering water."; + } + else if (stat == "idle") + { + buf += " This gate is currently idle."; + } + return buf; + } + + string displayShort() + { + string stat; + stat = status(); + switch (stat) + { + case "inbound": + return "an inbound stargate"; + case "outbound": + return "an outbound stargate"; + case "idle": + return "an idle stargate"; + default: + return "a broken stargate"; + } + } diff -c -r --new-file ds2.0r19/lib/obj/stargate.c ds2.0r20b/lib/obj/stargate.c *** ds2.0r19/lib/obj/stargate.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/obj/stargate.c Thu Apr 13 21:14:11 2006 *************** *** 0 **** --- 1,83 ---- + #include + #include + #include "/lib/include/stargate.h" + + /** + * based on portal.c by Brodbane - March 2006 + * + * $Id: stargate.c,v 1.1 2006/04/05 05:48:39 jam Exp $ + * + * The desired functionality is much like a "star gate": users dialed + * letters or full words that lined up with destinations. A portal opens to + * that destination briefly. To define destinations you must setup a + * constant below then add it to the switch statement in the cmdDial + * function. This object is crude and basic, but gets the job done. + * + * 2006-03-22, jonez + * - original version of this file is from Daelas@Moraelinost + * 2006-03-23, jonez + * - altered so code uses existing verbs (touch, enter) where possible. last add_action is for dial command. + * - added single mapping called "database" and made the "dial" command use it. + * - dial command no longer uses switch/case, making adding a new destination simpler + * - made use of SetPreventGet() / SetPreventPut() + * - made use of new stargate daemon + * - made use of LIB_STARGATE + * - made use of STARGATE_D + * + * IDEAS: + * - create a daemon that holds the stargate network [DONE] + * - allow for stargate failure + * - add dhd object + * - change the code so that it uses a single mapping of names and + * destinations, perhaps in a database file. currently an update to the + * object requires an update for all the objects. [DONE] + * - dhd skill (thanks plato) + * - delay when dialing gate. destination dhd lights up? + * - player should not be able to dial earth if earth is already connected elsewhere (need daemon) [DONE] + * - make use of existing verbs (enter, touch) instead of doing our own thing. [DONE] + * - daemon should contain a class that maps the various gates to each other. see lib/include/door.h [DONE] + * - shout "off world activation" into the gateroom when the gate engages. + * - track status as "incoming" or "outgoing".. you can only "enter" an outgoing gate (rhk) [DONE] + * - if room is empty, shut down the gate (rhk) + * - change callout time when someone goes through the gate (rhk) + */ + + /* + Cratylus@Dead Souls but let me give you a quick outline + Cratylus@Dead Souls i type dial thing + Cratylus@Dead Souls the thing inherits LIB_DIAL + Cratylus@Dead Souls which is in /lib/events/dial.c + Cratylus@Dead Souls and all that contains is like direct_dial_ob() return 1; this kind of thing + Cratylus@Dead Souls take a look at LIB_TURN + Cratylus@Dead Souls what LIB_DIAL does is provide the object with hooks, so it *can* be dialed + Cratylus@Dead Souls so, when i type dial thing, the thing goes, yeah i + can be dialed, and then the parser enters the can_dial and do_dial funcs + in the verb + Cratylus@Dead Souls tellya what. i'd like to work with you on this one. i think it's less straightforward than it + seems, and i need to test some ideas before i can say "do it this way" + + */ + inherit LIB_STARGATE; + + int readScreen(); + + void create() + { + ::create(); + setOrigin("default", "/obj/room"); + // SetRead(([ ({ "screen" }) : (: readScreen :) ]) ); + // SetItems(([ ({ "screen" }) : "a computer screen which shows the status of the gate network" ]) ); + } + + void init() + { + ::init(); + } + + int readScreen() + { + write("stargate network status\n"); + write("-----------------------\n"); + write("\n"); + + } diff -c -r --new-file ds2.0r19/lib/secure/cfg/preload.cfg ds2.0r20b/lib/secure/cfg/preload.cfg *** ds2.0r19/lib/secure/cfg/preload.cfg Fri Mar 24 14:37:42 2006 --- ds2.0r20b/lib/secure/cfg/preload.cfg Wed Apr 12 23:49:14 2006 *************** *** 9,14 **** --- 9,15 ---- #/secure/daemon/remote #/secure/daemon/inet /secure/daemon/log + /secure/daemon/snoop /secure/room/arch /secure/room/control /secure/daemon/update diff -c -r --new-file ds2.0r19/lib/secure/cmds/admins/banish.c ds2.0r20b/lib/secure/cmds/admins/banish.c *** ds2.0r19/lib/secure/cmds/admins/banish.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/secure/cmds/admins/banish.c Sun Apr 9 23:40:55 2006 *************** *** 0 **** --- 1,36 ---- + // /bin/dev/_banish.c + // from the Dead Souls Mudlib + // prevents a name being used by a new player + // created by Descartes of Borg ??? + + #include + #include + + inherit LIB_DAEMON; + + int cmd(string str) { + if(!str || str == ""){ + write("Syntax: banish "); + return 1; + } + if(!user_exists(str = lower_case(str))) { + write(capitalize(str)+" is now banished.\n"); + catch(call_other(BANISH_D, "banish_name", str)); + } + else { + write("A player by that name already exists.\n"); + this_player()->eventPrint((string)FINGER_D->GetFinger(str)); + } + return 1; + } + + void help() { + write("Syntax: \n\n" + "Protects a name from being used by a new player.\n" + "For example, if you have created a monster named Cassandra, in order\n" + "to avoid problems with player complaining \"I typed 'kill\n" + "cassandra' meaning to kill the evil enchantress, but Cassandra\n" + "walked in and I accidentally killed her.\" It is also to be\n" + "used to keep people from using offensive names.\n" + ); + } diff -c -r --new-file ds2.0r19/lib/secure/cmds/admins/decre.c ds2.0r20b/lib/secure/cmds/admins/decre.c *** ds2.0r19/lib/secure/cmds/admins/decre.c Sat Mar 11 11:16:43 2006 --- ds2.0r20b/lib/secure/cmds/admins/decre.c Thu Apr 13 21:04:27 2006 *************** *** 6,11 **** --- 6,12 ---- #include #include + #include inherit LIB_DAEMON; *************** *** 23,35 **** --- 24,47 ---- possessive_noun(mud_name()) + " reality."; if( !strsrch(file = save_file(nom), DIR_PLAYERS) ) return "You cannot make "+capitalize(args)+" a player."; + + if(!ob = find_player(nom)){ + PLAYERS_D->RemovePendingEncre(lower_case(nom)); + PLAYERS_D->AddPendingDecre(lower_case(nom)); + write(capitalize(nom)+" will be demoted on their next login."); + return 1; + } + if( file_size(DIR_PLAYERS+"/"+nom[0..0]) != -2) mkdir(DIR_PLAYERS+"/"+nom[0..0]); if(rename(file+__SAVE_EXTENSION__, DIR_PLAYERS+"/"+nom[0..0]+"/"+nom+__SAVE_EXTENSION__)) return "You failed due to lack of write access to "+DIR_PLAYERS+"."; + PLAYERS_D->eventDecre(lower_case(nom)); + if( ob = find_player(nom) ) { PlayerName = nom; inv = deep_inventory(ob); + ob->eventMove(ROOM_FURNACE); if(sizeof(inv)) inv->eventMove(ROOM_FURNACE); catch(player_ob = (object)master()->player_object(nom)); PlayerName = 0; *************** *** 51,56 **** --- 63,69 ---- this_player()); if( file_size(file+__SAVE_EXTENSION__) > -1 ) rm(file+__SAVE_EXTENSION__); } + player_ob->eventMove(ROOM_START); return 1; } diff -c -r --new-file ds2.0r19/lib/secure/cmds/admins/domainadmin.c ds2.0r20b/lib/secure/cmds/admins/domainadmin.c *** ds2.0r19/lib/secure/cmds/admins/domainadmin.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/secure/cmds/admins/domainadmin.c Sun Apr 9 23:54:48 2006 *************** *** 0 **** --- 1,127 ---- + #include + #include + + inherit LIB_DAEMON; + + mixed cmd(string args) { + string rep, flag, domain, person; + string write_perms = read_file("/secure/cfg/write.cfg"); + string *tmp_array = explode(write_perms, "\n"); + string *admin_array = ({}); + mapping DomainsMap = ([]); + + + if(!archp(this_player()) || this_player()->GetForced()){ + return "No."; + } + + //tc("tp_array: "+identify(tmp_array),"white"); + + if(!args || args == ""){ + write(this_object()->GetHelp()); + return 1; + } + + if(sscanf(args,"%s %s %s", flag, domain, person) != 3){ + write(this_object()->GetHelp()); + return 1; + } + + person = lower_case(person); + + if(!user_exists(person)){ + write("Invalid person."); + return 1; + } + + if(!directory_exists("/domains/"+domain)){ + write("Invalid domain."); + return 1; + } + + write_perms = replace_string(write_perms, "\n",";\n"); + + foreach(string line in tmp_array){ + string where, admins; + if(sscanf(line,"(/domains/%s/) %s", where, admins)){ + DomainsMap[where] = admins; + if(sizeof(DomainsMap[domain])) admin_array = explode(DomainsMap[domain],":"); + } + } + + if(flag == "-a"){ + + if(member_array(person, admin_array) != -1){ + write("That person already administers that domain."); + return 1; + } + + else admin_array += ({ person }); + + rep = "(/domains/"+domain+"/) "+implode(admin_array, ":"); + + //tc("rep: "+rep,"blue"); + + if(grepp(write_perms, "(/domains/"+domain+"/)")){ + write_perms = replace_matching_line(write_perms, "/domains/"+domain, rep); + write_perms = replace_string(write_perms, ";\n","\n"); + //tc("write_perms: "+write_perms, "yellow"); + } + else{ + write_perms = replace_string(write_perms, ";\n","\n"); + write_perms = newline_trim(write_perms); + write_perms += "\n(/domains/"+domain+"/) "+person+"\n"; + //tc("write_perms: "+write_perms); + } + } + + else if(flag == "-d"){ + if(member_array(person, admin_array) == -1){ + write("That person does not administer that domain."); + return 1; + } + + else admin_array -= ({ person }); + //tc("admin_array: "+identify(admin_array),"cyan"); + //tc("domain: "+domain,"cyan"); + //tc("erite_terms: "+write_perms,"cyan"); + + if(!sizeof(admin_array)){ + write_perms = remove_matching_line(write_perms, "(/domains/"+domain+"/)",1); + write_perms = replace_string(write_perms, ";\n","\n"); + //tc("write_perms: "+write_perms); + } + else { + rep = "(/domains/"+domain+"/) "+implode(admin_array, ":"); + //tc("rep: "+rep,"blue"); + write_perms = replace_matching_line(write_perms, "/domains/"+domain, rep); + write_perms = replace_string(write_perms, ";\n","\n"); + //tc("write_perms: "+write_perms); + } + } + + else { + write("Invalid flag."); + return 1; + } + + //tc("write_perms: "+write_perms,"green"); + write_file("/secure/cfg/write.cfg", write_perms, 1); + update("/secure/daemon/master"); + return 1; + } + + string GetHelp(string args) { + return ("Syntax: domainadmin [-a | -d] \n\n" + "This command manages the write permissions to a specified " + "domain. For example, to give a creator named Snuffy write " + "privileges to /domains/SnuffLand, you would type: " + "\ndomainadmin -a SnuffLand snuffy\n" + "To revoke those privileges:\n" + "\domainadmin -d SnuffLand snuffy\n" + "This permits the creator to use QCS within the domain's " + "directories. " + "Write privileges are listed in /secure/cfg/write.cfg" + "\n\n" + "See also: admintool"); + } diff -c -r --new-file ds2.0r19/lib/secure/cmds/admins/encre.c ds2.0r20b/lib/secure/cmds/admins/encre.c *** ds2.0r19/lib/secure/cmds/admins/encre.c Wed Feb 22 15:33:33 2006 --- ds2.0r20b/lib/secure/cmds/admins/encre.c Thu Apr 13 21:04:27 2006 *************** *** 4,9 **** --- 4,10 ---- */ #include + #include #include inherit LIB_DAEMON; *************** *** 21,29 **** --- 22,43 ---- possessive_noun(mud_name()) + " reality."; if( !strsrch(file = save_file(nom), DIR_CRES) ) return "You cannot make "+capitalize(args)+" a creator."; + + if(!ob=find_player(nom)){ + if(member_array(nom, PLAYERS_D->GetPendingEncres()) != -1){ + write("That person is already pending creatorship."); + return 1; + } + PLAYERS_D->RemovePendingDecre(lower_case(nom)); + PLAYERS_D->AddPendingEncre(lower_case(nom)); + write(capitalize(nom)+" will be a creator next time they log in."); + return 1; + } + if( file_size(DIR_CRES+"/"+nom[0..0]) != -2) mkdir(DIR_CRES+"/"+nom[0..0]); if(rename(file+__SAVE_EXTENSION__, DIR_CRES+"/"+nom[0..0]+"/"+nom+__SAVE_EXTENSION__)) return "You failed due to lack of write access to "+DIR_CRES+"."; + PLAYERS_D->eventEncre(lower_case(nom)); if( ob = find_player(nom) ) { ob->SetProperty("brand_spanking_new",0); PlayerName = nom; *************** *** 62,67 **** --- 76,82 ---- book = new("/domains/default/obj/manual"); if(book && !present("manual",cre_ob)) book->eventMove(cre_ob); else if(book) book->eventMove(ROOM_FURNACE); + cre_ob->save_player((string)cre_ob->GetKeyName()); //message("system", "You will now be logged off.", cre_ob); //message("system", "Please log back in to use your new powers.", cre_ob); //cre_ob->eventForce("quit"); diff -c -r --new-file ds2.0r19/lib/secure/cmds/admins/switchrouter.c ds2.0r20b/lib/secure/cmds/admins/switchrouter.c *** ds2.0r19/lib/secure/cmds/admins/switchrouter.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/secure/cmds/admins/switchrouter.c Sun Apr 9 23:54:57 2006 *************** *** 0 **** --- 1,70 ---- + #include + #include + + inherit LIB_DAEMON; + + string file; + + mixed cmd(string args) { + string ip, name; + int port, octet1, octet2, octet3, octet4; + + if(!archp(this_player())) return "No."; + + find_object(INTERMUD_D)->eventDestruct(); + rm("/save/intermud.o"); + + if(!args || args == ""){ + write("No argument provided. Reloading intermud daemon."); + if( load_object(INTERMUD_D) ) write("Intermud daemon reloaded."); + else write("Failed to reload intermud daemon."); + return 1; + } + + if(sscanf(args,"%s %s %d", name, ip, port) != 3 || port > 65534 || + sscanf(ip,"%d.%d.%d.%d", octet1, octet2, octet3, octet4) != 4){ + write("Invalid router reference. \nTry: switchrouter "); + write("For example: switchrouter yatmim 149.152.218.102 23"); + if( load_object(INTERMUD_D) ) write("Intermud daemon reloaded."); + else write("Failed to reload intermud daemon."); + return 1; + } + + file = read_file(INTERMUD_D+".c"); + //write_file("/tmp/1.txt",file,1); + + file = replace_matching_line(file, "//Nameservers", ""); + + //write_file("/tmp/2.txt",file,1); + if(first(name,1) != "*") name = "*"+name; + + file = replace_matching_line(file, "Nameservers = ({", + " Nameservers = ({ ({ \""+name+"\", \""+ip+" "+port+"\" }) });", 1); + + //write_file("/tmp/3.txt",file,1); + + unguarded( (: write_file(INTERMUD_D+".c",file,1) :) ); + + if( load_object(INTERMUD_D) ) write("Intermud daemon reloaded."); + else write("Failed to reload intermud daemon."); + + write("Done."); + return 1; + } + + + string GetHelp(string args) { + return ("Syntax: switchrouter \n\n" + "Stops the intermud daemon, changes the default intermud " + "router to the ip and port you specify, wipes the previous " + "router data, and reloads INTERMUD_D. Without arguments, " + "this command will clear your intermud cache and reload " + "the daemon. Known routers are:\n" + "*gjs 198.144.203.194 9000 (The \"official\" intermud.org router)\n" + "*yatmim 149.152.218.102 23 (The \"official\" Dead Souls router)\n" + "The official current Dead Souls router's IP will always be " + "available at:\n" + "http://dead-souls.net/router.html" + "\n\n" + "See also: router, mudlist"); + } diff -c -r --new-file ds2.0r19/lib/secure/cmds/admins/unmonitor.c ds2.0r20b/lib/secure/cmds/admins/unmonitor.c *** ds2.0r19/lib/secure/cmds/admins/unmonitor.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/secure/cmds/admins/unmonitor.c Wed Apr 12 23:56:45 2006 *************** *** 0 **** --- 1,34 ---- + #include + #include + + inherit LIB_DAEMON; + + int cmd(string str) { + object ob; + + if(!archp(this_player())) { + write("Only an arch may halt a monitoring process."); + return 0; + } + if( !str || str == "" ) { + write("Unmonitor whom?\n"); + } + else if(!user_exists(str)) + write(str+": no such player.\n"); + else{ + SNOOP_D->RemoveMonitor(this_player()->GetKeyName(), str); + write("The snoop daemon has received your request."); + } + return 1; + } + + int help() + { + write( @EndText + Syntax: unmonitor + Effect: Stops the logging of a user's input and output. + See also: monitor, snoop, unsnoop + EndText + ); + return 1; + } diff -c -r --new-file ds2.0r19/lib/secure/cmds/creators/banish.c ds2.0r20b/lib/secure/cmds/creators/banish.c *** ds2.0r19/lib/secure/cmds/creators/banish.c Mon Nov 7 13:32:16 2005 --- ds2.0r20b/lib/secure/cmds/creators/banish.c Wed Dec 31 19:00:00 1969 *************** *** 1,34 **** - // /bin/dev/_banish.c - // from the Dead Souls Mudlib - // prevents a name being used by a new player - // created by Descartes of Borg ??? - - #include - #include - - inherit LIB_DAEMON; - - int cmd(string str) { - if(!user_exists(str = lower_case(str))) { - write(capitalize(str)+" is now banished.\n"); - //seteuid(UID_BANISH); - catch(call_other(BANISH_D, "banish_name", str)); - //seteuid(getuid()); - } - else { - write("A player by that name already exists.\n"); - this_player()->eventPrint((string)FINGER_D->GetFinger(str)); - } - return 1; - } - - void help() { - write("Syntax: \n\n" - "Protects a name from being used by a new player.\n" - "For example, if you have created a monster named Cassandra, in order\n" - "to avoid problems with player complaining \"I typed 'kill\n" - "cassandra' meaning to kill the evil enchantress, but Cassandra\n" - "walked in and I accidentally killed her.\" It is also to be\n" - "used to keep people from using offensive names.\n" - ); - } --- 0 ---- diff -c -r --new-file ds2.0r19/lib/secure/cmds/creators/eval.c ds2.0r20b/lib/secure/cmds/creators/eval.c *** ds2.0r19/lib/secure/cmds/creators/eval.c Fri Mar 24 14:38:48 2006 --- ds2.0r20b/lib/secure/cmds/creators/eval.c Wed Apr 12 23:49:46 2006 *************** *** 28,33 **** --- 28,34 ---- file = ""+ "#include \n"+ + "#include \n"+ "#include \n"+ "#include \n"+ "#include \n"+ diff -c -r --new-file ds2.0r19/lib/secure/cmds/creators/heal.c ds2.0r20b/lib/secure/cmds/creators/heal.c *** ds2.0r19/lib/secure/cmds/creators/heal.c Wed Dec 7 14:24:50 2005 --- ds2.0r20b/lib/secure/cmds/creators/heal.c Sun Apr 9 23:51:07 2006 *************** *** 18,23 **** --- 18,24 ---- string cmd = args; object who; mapping stumps; + string *limb_arr = ({}); int i, mhp, msp, mmp, self; if( !cmd || cmd == "" ) { *************** *** 50,55 **** --- 51,60 ---- who->AddMagicPoints(mmp); if(who->GetPoison() > 0) who->AddPoison(0 - who->GetPoison()); eventRegenerate(who); + limb_arr = who->GetLimbs(); + foreach(string limb in limb_arr) { + who->HealLimb(limb); + } return 1; } diff -c -r --new-file ds2.0r19/lib/secure/cmds/creators/monitor.c ds2.0r20b/lib/secure/cmds/creators/monitor.c *** ds2.0r19/lib/secure/cmds/creators/monitor.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/secure/cmds/creators/monitor.c Wed Apr 12 23:56:45 2006 *************** *** 0 **** --- 1,31 ---- + #include + #include + + inherit LIB_DAEMON; + + int cmd(string str) { + object ob; + + if( !str || str == "" ) { + write("Monitor whom?\n"); + } + else if(!user_exists(str)) + write(str+": no such player.\n"); + else{ + SNOOP_D->AddMonitor(this_player()->GetKeyName(), str); + write("The snoop daemon has received your request."); + } + return 1; + } + + int help() + { + write( @EndText + Syntax: monitor + Effect: Logs to a file everything sees or types. + To stop monitoring, an admin must type "unmonitor " + See also: unmonitor, snoop, unsnoop + EndText + ); + return 1; + } diff -c -r --new-file ds2.0r19/lib/secure/cmds/creators/snoop.c ds2.0r20b/lib/secure/cmds/creators/snoop.c *** ds2.0r19/lib/secure/cmds/creators/snoop.c Mon Nov 7 13:32:17 2005 --- ds2.0r20b/lib/secure/cmds/creators/snoop.c Wed Apr 12 23:49:53 2006 *************** *** 5,10 **** --- 5,11 ---- */ #include + #include inherit LIB_DAEMON; *************** *** 12,26 **** object ob; if( !str || str == "" ) { ! if(snoop(this_player())) ! write("Ok.\n"); ! else write("Couldn't stop snoop\n"); } else if(!(ob=find_player(str=lower_case(str)))) write(str+": no such player.\n"); else ! write(snoop(this_player(), ob)?"Now snooping.\n":str+": snoop failed.\n"); ! return 1; } --- 13,29 ---- object ob; if( !str || str == "" ) { ! write("Snoop whom?\n"); ! } ! else if(str == this_player()->GetKeyName()){ ! write("That would be very foolish."); ! return 1; } else if(!(ob=find_player(str=lower_case(str)))) write(str+": no such player.\n"); else ! SNOOP_D->AddWatcher(this_player()->GetKeyName(), str); ! write("The snoop daemon has received your request."); return 1; } *************** *** 28,36 **** { write( @EndText Syntax: snoop ! Effect: Echos to your screen everything sees or types. ! To stop snooping, type just "snoop" ! See also: snoopable EndText ); return 1; --- 31,39 ---- { write( @EndText Syntax: snoop ! Effect: Echoes to your screen everything sees or types. ! To stop snooping, type just "unsnoop " ! See also: unsnoop, monitor, unmonitor EndText ); return 1; diff -c -r --new-file ds2.0r19/lib/secure/cmds/creators/unsnoop.c ds2.0r20b/lib/secure/cmds/creators/unsnoop.c *** ds2.0r19/lib/secure/cmds/creators/unsnoop.c Wed Dec 31 19:00:00 1969 --- ds2.0r20b/lib/secure/cmds/creators/unsnoop.c Wed Apr 12 23:56:45 2006 *************** *** 0 **** --- 1,29 ---- + #include + #include + + inherit LIB_DAEMON; + + int cmd(string str) { + object ob; + + if( !str || str == "" ) { + write("Unsnoop whom?\n"); + } + else if(!(ob=find_player(str=lower_case(str)))) + write(str+": no such player.\n"); + else + SNOOP_D->RemoveWatcher(this_player()->GetKeyName(), str); + write("The snoop daemon has received your request."); + return 1; + } + + int help() + { + write( @EndText + Syntax: unsnoop + Effect: Stops snooping the specified user. + See also: snoop, monitor, unmonitor + EndText + ); + return 1; + } diff -c -r --new-file ds2.0r19/lib/secure/cmds/players/suicide.c ds2.0r20b/lib/secure/cmds/players/suicide.c *** ds2.0r19/lib/secure/cmds/players/suicide.c Sun Dec 18 01:59:08 2005 --- ds2.0r20b/lib/secure/cmds/players/suicide.c Fri Apr 14 19:45:32 2006 *************** *** 83,88 **** --- 83,90 ---- static private void EndSuicide(string who) { string tmp, file, newfile; object *ob; + + if(!directory_exists(DIR_TMP + "/suicide/")) mkdir (DIR_TMP + "/suicide/"); file = DIR_TMP + "/" + who; newfile = DIR_TMP + "/suicide/" + who; diff -c -r --new-file ds2.0r19/lib/secure/cmds/router.c ds2.0r20b/lib/secure/cmds/router.c *** ds2.0r19/lib/secure/cmds/router.c Wed Apr 5 19:44:19 2006 --- ds2.0r20b/lib/secure/cmds/router.c Wed Dec 31 19:00:00 1969 *************** *** 1,44 **** - #include - #include - - inherit LIB_DAEMON; - - mixed cmd(string args) { - string subcmd, arg1, arg2; - - if(find_object(ROUTER_D)) - write("I3 router daemon is loaded."); - else { - write("I3 router daemon is not loaded."); - return 1; - } - - if(!args || args == ""){ - return 1; - } - - if(args == "show"){ - write("Router config: \n"+ROUTER_D->get_info()); - return 1; - } - - if(sscanf(args,"%s %s",subcmd, arg1) != 2){ - write("Invalid router subcommand."); - return 1; - } - - if(arg1 == "mudlist"){ - mapping mudlist = ROUTER_D->query_mudinfo(); - write("Mudlist: \n"+identify(mudlist)); - } - - - write("Router command completed."); - return 1; - } - - string GetHelp(string args) { - return ("Syntax: \n\n" - "\n\n" - ""); - } --- 0 ---- diff -c -r --new-file ds2.0r19/lib/secure/daemon/chat.c ds2.0r20b/lib/secure/daemon/chat.c *** ds2.0r19/lib/secure/daemon/chat.c Wed Apr 5 19:33:19 2006 --- ds2.0r20b/lib/secure/daemon/chat.c Wed Apr 12 23:50:02 2006 *************** *** 140,159 **** object ob = 0; int emote; ! //tc("verb: "+verb); ! //tc("str: "+str); ! ! if(first(str,1) == ":"){ if(!grepp(verb,"emote")) verb += "emote"; str = trim(replace_string(str,":","",1)); } if(grepp(verb, "emote")) varb = replace_string(verb,"emote",""); ! else if(grepp(verb, ":")) varb = replace_string(verb,":",""); else varb = verb; - //tc("varb: "+varb); - if( verb == "hist" ) { if( !Channels[str] ) return 0; if( member_array(this_player(), Channels[str]) == -1 ) return 0; --- 140,154 ---- object ob = 0; int emote; ! if(first(str,1) == ":" && sizeof(str) > 3){ if(!grepp(verb,"emote")) verb += "emote"; str = trim(replace_string(str,":","",1)); } if(grepp(verb, "emote")) varb = replace_string(verb,"emote",""); ! else if(last(verb, 1) == ":") varb = replace_string(verb,":",""); else varb = verb; if( verb == "hist" ) { if( !Channels[str] ) return 0; if( member_array(this_player(), Channels[str]) == -1 ) return 0; diff -c -r --new-file ds2.0r19/lib/secure/daemon/finger.c ds2.0r20b/lib/secure/daemon/finger.c *** ds2.0r19/lib/secure/daemon/finger.c Mon Jan 16 23:04:22 2006 --- ds2.0r20b/lib/secure/daemon/finger.c Wed Apr 12 23:50:02 2006 *************** *** 17,23 **** private int LoginTime, Level, BirthTime, CreatorBirth, WhereBlock; private string CurrentUser, Short, CapName, RealName, Email; private string Town, Race, Gender, HostSite; ! private string Class, Guild, Long; private string Rank, WebPage; private string array Titles, Religion; private class marriage array Marriages; --- 17,23 ---- private int LoginTime, Level, BirthTime, CreatorBirth, WhereBlock; private string CurrentUser, Short, CapName, RealName, Email; private string Town, Race, Gender, HostSite; ! private string Class, Clan, Long; private string Rank, WebPage; private string array Titles, Religion; private class marriage array Marriages; *************** *** 100,106 **** int yr; ret += CapName+" the "+Gender+" "+Race+" "+(Class || "drifter"); ! if( Guild ) ret += " of the " + pluralize(Guild); if( creatorp(this_player()) && Level ) ret += " ("+Level+")"; ret += " is a " + Rank+" of " + Town + ".%^BR%^\n"; BirthTime = BirthTime - (18 * YEAR); --- 100,106 ---- int yr; ret += CapName+" the "+Gender+" "+Race+" "+(Class || "drifter"); ! if( Clan ) ret += " of the " + pluralize(Clan); if( creatorp(this_player()) && Level ) ret += " ("+Level+")"; ret += " is a " + Rank+" of " + Town + ".%^BR%^\n"; BirthTime = BirthTime - (18 * YEAR); diff -c -r --new-file ds2.0r19/lib/secure/daemon/i3router/broadcast_chanlist.h ds2.0r20b/lib/secure/daemon/i3router/broadcast_chanlist.h *** ds2.0r19/lib/secure/daemon/i3router/broadcast_chanlist.h Wed Apr 5 18:44:57 2006 --- ds2.0r20b/lib/secure/daemon/i3router/broadcast_chanlist.h Sun Apr 9 23:51:25 2006 *************** *** 5,13 **** string name; // channel name in first loop, then mud name in later loop #ifdef SEND_WHOLE_CHANLIST mapping out=([]); // only used if whole chanlist is sent ! #endif ! Debug("broadcasting chanlist to let them know about "+channame); ! #ifdef SEND_WHOLE_CHANLIST foreach(name in keys(channel_updates)){ if(!channels[channame]) out[name]=0; --- 5,11 ---- string name; // channel name in first loop, then mud name in later loop #ifdef SEND_WHOLE_CHANLIST mapping out=([]); // only used if whole chanlist is sent ! trr("broadcasting chanlist to let them know about "+channame); foreach(name in keys(channel_updates)){ if(!channels[channame]) out[name]=0; *************** *** 21,33 **** out = ([ channame:({ channels[channame][1], channels[channame][0] }) ]); #endif foreach(name in keys(connected_muds)){ ! Debug("inside loop with "+name); if(member_array("channel", keys(mudinfo[name]["services"]))!=-1){ // only tell muds that have the "channel" service... write_data(connected_muds[name], ({ "chanlist-reply",5,router_name,0,name,0,channel_update_counter,out })); } ! Debug("done with: "+name); } } --- 19,31 ---- out = ([ channame:({ channels[channame][1], channels[channame][0] }) ]); #endif foreach(name in keys(connected_muds)){ ! trr("inside loop with "+name); if(member_array("channel", keys(mudinfo[name]["services"]))!=-1){ // only tell muds that have the "channel" service... write_data(connected_muds[name], ({ "chanlist-reply",5,router_name,0,name,0,channel_update_counter,out })); } ! trr("done with: "+name); } } diff -c -r --new-file ds2.0r19/lib/secure/daemon/i3router/broadcast_mudlist.h ds2.0r20b/lib/secure/daemon/i3router/broadcast_mudlist.h *** ds2.0r19/lib/secure/daemon/i3router/broadcast_mudlist.h Wed Apr 5 18:44:57 2006 --- ds2.0r20b/lib/secure/daemon/i3router/broadcast_mudlist.h Sun Apr 9 23:51:25 2006 *************** *** 1,11 **** // This file written completely by Tim Johnson (Tim@TimMUD) // broadcast the mudlist when a mud just now got changed... ! static void broadcast_mudlist(string mudname){ string targ_mudname; mixed *packet1; // for muds that use protocol 1 or 2 mixed *packet3; // for muds that use protocol 3 ! Debug("broadcasting mudlist to let them know about "+mudname); packet1 = ({ "mudlist", 5, router_name, 0, "dummy", 0, mudinfo_update_counter,([ mudname:({ connected_muds[mudname] ? -1 : 0, --- 1,11 ---- // This file written completely by Tim Johnson (Tim@TimMUD) // broadcast the mudlist when a mud just now got changed... ! void broadcast_mudlist(string mudname){ string targ_mudname; mixed *packet1; // for muds that use protocol 1 or 2 mixed *packet3; // for muds that use protocol 3 ! trr("broadcasting mudlist to let them know about "+mudname,"red"); packet1 = ({ "mudlist", 5, router_name, 0, "dummy", 0, mudinfo_update_counter,([ mudname:({ connected_muds[mudname] ? -1 : 0, diff -c -r --new-file ds2.0r19/lib/secure/daemon/i3router/core_stuff.h ds2.0r20b/lib/secure/daemon/i3router/core_stuff.h *** ds2.0r19/lib/secure/daemon/i3router/core_stuff.h Wed Apr 5 18:44:57 2006 --- ds2.0r20b/lib/secure/daemon/i3router/core_stuff.h Sun Apr 9 23:51:25 2006 *************** *** 13,49 **** if(!channels) channels = ([]); if(!channel_updates) channel_updates = ([]); if(!channel_update_counter) channel_update_counter = 1; ! if(!router_name) router_name = "*yatmim"; ! if(!router_list) router_list = ({ ({"*yatmim", "149.152.218.102 23"}) }); log_file("server", "Created when uptime = " + uptime() + "\n"); ! Debug("server got created",DEB_OTHER); call_out("setup", 5); } static void setup(){ ! Debug("setup got called"); if ((router_socket = socket_create(MUD, "read_callback", "close_callback")) < 0){ log_file("server", "setup: Failed to create socket.\n"); return; } if (socket_bind(router_socket, MYSERVER) < 0) { socket_close(router_socket); log_file("server", "setup: Failed to bind socket to port.\n"); return; } if (socket_listen(router_socket, "listen_callback") < 0) { socket_close(router_socket); log_file("server", "setup: Failed to listen to socket.\n"); } ! Debug("setup ended"); } void remove(){ string mudname; log_file("server", "Being removed by: "+identify(previous_object())+"\n"); log_file("server", "sockets:"+identify(sockets)+"\n"); ! log_file("server", "Starting to destruct at uptime = " + uptime() + "\n"); mudinfo_update_counter++; // just increment once... all the connected muds // getting simultaneously disconnected is okay to count as one change :) foreach(mudname in keys(connected_muds)){ --- 13,62 ---- if(!channels) channels = ([]); if(!channel_updates) channel_updates = ([]); if(!channel_update_counter) channel_update_counter = 1; ! if(!router_name) router_name = "*test"; ! //if(!router_list) router_list = ({ ({"*yatmim", "149.152.218.102 23"}) }); ! if(!router_list) router_list = ({ ({"*test", "192.168.0.201 9000"}) }); log_file("server", "Created when uptime = " + uptime() + "\n"); ! trr("server got created"); call_out("setup", 5); + set_heart_beat(10); } + void heart_beat(){ + trr("BING!","white"); + this_object()->clear_discs(); + } + + static void setup(){ ! trr("setup got called"); if ((router_socket = socket_create(MUD, "read_callback", "close_callback")) < 0){ log_file("server", "setup: Failed to create socket.\n"); + trr("setup: Failed to create socket.\n"); return; } if (socket_bind(router_socket, MYSERVER) < 0) { socket_close(router_socket); log_file("server", "setup: Failed to bind socket to port.\n"); + trr("setup: Failed to bind socket to port.\n"); return; } if (socket_listen(router_socket, "listen_callback") < 0) { socket_close(router_socket); log_file("server", "setup: Failed to listen to socket.\n"); + trr("setup: Failed to listen to socket.\n"); } ! trr("setup ended"); } void remove(){ string mudname; log_file("server", "Being removed by: "+identify(previous_object())+"\n"); + trr("Being removed by: "+identify(previous_object())+"\n"); log_file("server", "sockets:"+identify(sockets)+"\n"); ! trr("sockets:"+identify(sockets)+"\n"); log_file("server", "Starting to destruct at uptime = " + uptime() + "\n"); + trr("Starting to destruct at uptime = " + uptime() + "\n"); mudinfo_update_counter++; // just increment once... all the connected muds // getting simultaneously disconnected is okay to count as one change :) foreach(mudname in keys(connected_muds)){ *************** *** 52,57 **** --- 65,71 ---- map_delete(connected_muds,mudname); // unneeded: connected_muds isn't saved anyway } log_file("server", "Successfully destructed when uptime = " + uptime() + "\n"); + trr("Successfully destructed when uptime = " + uptime() + "\n"); destruct(this_object()); } int query_prevent_shadow(object ob){ return 1; } diff -c -r --new-file ds2.0r19/lib/secure/daemon/i3router/debug.h ds2.0r20b/lib/secure/daemon/i3router/debug.h *** ds2.0r19/lib/secure/daemon/i3router/debug.h Wed Apr 5 18:44:57 2006 --- ds2.0r20b/lib/secure/daemon/i3router/debug.h Sun Apr 9 23:51:25 2006 *************** *** 4,23 **** if(find_player(DEBUGGER_GUY)) switch(level){ case DEB_IN: ! message("Debug", "%^BOLD%^%^WHITE%^SERVER INCOMING: %^MAGENTA%^"+str+"%^RESET%^\n", find_player(DEBUGGER_GUY)); break; case DEB_OUT: ! message("Debug", "%^BOLD%^%^WHITE%^SERVER OUTGOING: %^CYAN%^"+str+"%^RESET%^\n", find_player(DEBUGGER_GUY)); break; case DEB_INVALID: ! message("Debug", "%^BOLD%^%^WHITE%^SERVER THINKS THIS IS INVALID: %^RED%^"+str+"%^RESET%^\n", find_player(DEBUGGER_GUY)); break; case DEB_OTHER: default: !