From 7c838af396e8b231d3d5e9b10e304ad7bf87d4e0 Mon Sep 17 00:00:00 2001 From: Siddhant Date: Sun, 8 May 2016 16:15:31 +0530 Subject: [PATCH 01/10] Fixed create command for Containers --- tools/steam-shell.pike | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/steam-shell.pike b/tools/steam-shell.pike index 7470e7a..db79d87 100755 --- a/tools/steam-shell.pike +++ b/tools/steam-shell.pike @@ -702,8 +702,9 @@ int create_ob(string type,string name) data = ([ "link_to":link_to ]); } object myobj = create_object(type,name,desc,data); - if(type=="Room") + if(type=="Room" || type=="Container") myobj->move(OBJ(getpath())); + return 0; } From 84f0e2b3ce570d3eac34b7c83e3cbf5c9ec87266 Mon Sep 17 00:00:00 2001 From: Siddhant Date: Tue, 10 May 2016 18:32:45 +0530 Subject: [PATCH 02/10] made the improvement as discussed by not checking for the last / using getpath()[-1]==47 --- tools/steam-shell.pike | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/tools/steam-shell.pike b/tools/steam-shell.pike index db79d87..f215870 100755 --- a/tools/steam-shell.pike +++ b/tools/steam-shell.pike @@ -548,16 +548,8 @@ int goto_room(string where) pathobj = OBJ(where); if(!pathobj) //Relative room checking { - if(getpath()[-1]==47) //check last "/" - { - pathobj = OBJ(getpath()+where); - where=getpath()+where; - } - else - { - pathobj = OBJ(getpath()+"/"+where); - where=getpath()+"/"+where; - } + pathobj = OBJ(getpath()+"/"+where); + where=getpath()+"/"+where; } roomname = pathobj->query_attribute("OBJ_NAME"); string factory = _Server->get_factory(pathobj)->query_attribute("OBJ_NAME"); @@ -628,10 +620,7 @@ int look(string|void str) int take(string name) { string fullpath=""; - if(getpath()[-1]==47) //check last "/" - fullpath = getpath()+name; - else - fullpath = getpath()+"/"+name; + fullpath = getpath()+"/"+name; object orig_file = OBJ(fullpath); if(orig_file) { @@ -647,10 +636,7 @@ int take(string name) int gothrough(string gatename) { string fullpath = ""; - if(getpath()[-1]==47) //check last "/" - fullpath = getpath()+gatename; - else - fullpath = getpath()+"/"+gatename; + fullpath = getpath()+"/"+gatename; object gate = OBJ(fullpath); if(gate) { @@ -676,10 +662,7 @@ int gothrough(string gatename) int delete(string file_cont_name) { string fullpath=""; - if(getpath()[-1]==47) //check last "/" - fullpath = getpath()+file_cont_name; - else - fullpath = getpath()+"/"+file_cont_name; + fullpath = getpath()+"/"+file_cont_name; if(OBJ(fullpath)) return 0; return 0; @@ -712,10 +695,7 @@ int create_ob(string type,string name) int peek(string container) { string fullpath = ""; - if(getpath()[-1]==47) //check last "/" - fullpath = getpath()+container; - else - fullpath = getpath()+"/"+container; + fullpath = getpath()+"/"+container; string pathfact = _Server->get_factory(OBJ(fullpath))->query_attribute("OBJ_NAME"); if(pathfact=="Room.factory") { @@ -763,10 +743,7 @@ int inventory() int editfile(string filename) { string fullpath = ""; - if(getpath()[-1]==47) //check last "/" - fullpath = getpath()+filename; - else - fullpath = getpath()+"/"+filename; + fullpath = getpath()+"/"+filename; string pathfact = _Server->get_factory(OBJ(fullpath))->query_attribute("OBJ_NAME"); if(pathfact=="Document.factory") applaunch(OBJ(fullpath),exitnow); From 8672aa26e176f8b0685a244f93df7df9bde54807 Mon Sep 17 00:00:00 2001 From: Siddhant Date: Tue, 10 May 2016 19:08:45 +0530 Subject: [PATCH 03/10] Added the new feature to provide destination with the create command. Working for Rooms and containers --- tools/steam-shell.pike | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/steam-shell.pike b/tools/steam-shell.pike index f215870..7fc34cd 100755 --- a/tools/steam-shell.pike +++ b/tools/steam-shell.pike @@ -48,7 +48,7 @@ room Describe the Room you are currently in. look Look around the Room. take Copy a object in your inventory. gothrough Go through a gate. -create Create an object (File/Container/Exit) in current Room. +create Create an object (File/Container/Exit). Provide the full path of the destination or a . if you want it in current folder. peek Peek through a container. inventory(i) List your inventory. edit Edit a file in the current Room. @@ -82,7 +82,7 @@ hilfe Help for Hilfe commands. write("Go through a gate.\n"); return; case "create": - write("Create an object (File/Container/Exit) in current Room.\n"); + write("Create an object (File/Container/Exit). Provide the full path of the destination or a . if you want it in current folder.\n"); return; case "peek": write("Peek through a container.\n"); @@ -240,6 +240,8 @@ int main(int argc, array(string) argv) myarray[command_arr[0]](command_arr[1],command_arr[2]); else if(num==1) myarray[command_arr[0]](); + else if(num==4) + myarray[command_arr[0]](command_arr[1],command_arr[2],command_arr[3]); }; if(result!=0) @@ -668,7 +670,7 @@ int delete(string file_cont_name) return 0; } -int create_ob(string type,string name) +int create_ob(string type,string name,string destination) { string desc = readln->read("How would you describe it?\n"); mapping data = ([]); @@ -685,8 +687,12 @@ int create_ob(string type,string name) data = ([ "link_to":link_to ]); } object myobj = create_object(type,name,desc,data); - if(type=="Room" || type=="Container") - myobj->move(OBJ(getpath())); + if(type=="Room" || type=="Container"){ + if(destination==".") + myobj->move(OBJ(getpath())); + else + myobj->move(OBJ(destination)); + } return 0; From 30bd57a28034e8460aca8c00d83701b4b8aaee28 Mon Sep 17 00:00:00 2001 From: Siddhant Date: Fri, 13 May 2016 21:31:08 +0530 Subject: [PATCH 04/10] Extended the destination feature of the create command to all type of objects --- tools/steam-shell.pike | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/steam-shell.pike b/tools/steam-shell.pike index 7fc34cd..b2cf955 100755 --- a/tools/steam-shell.pike +++ b/tools/steam-shell.pike @@ -675,11 +675,13 @@ int create_ob(string type,string name,string destination) string desc = readln->read("How would you describe it?\n"); mapping data = ([]); type = String.capitalize(type); + if(destination == ".") + destination = getpath(); if(type=="Exit") { object exit_to = OBJ(readln->read("Where do you want to exit to?(full path)\n")); - object exit_from = OBJ(getpath()); - data = ([ "exit_from":exit_from, "exit_to":exit_to ]); +// object exit_from = OBJ(getpath()); + data = ([ "exit_from":OBJ(destination), "exit_to":exit_to ]); } else if(type=="Link") { @@ -687,13 +689,15 @@ int create_ob(string type,string name,string destination) data = ([ "link_to":link_to ]); } object myobj = create_object(type,name,desc,data); - if(type=="Room" || type=="Container"){ +/* if(type=="Room" || type=="Container"){ if(destination==".") myobj->move(OBJ(getpath())); else myobj->move(OBJ(destination)); } - + */ + if(!(type == "Exit")) + myobj->move(OBJ(destination)); return 0; } From 7ed2115c1c92f792c97245fd3233842a854ba34c Mon Sep 17 00:00:00 2001 From: Siddhant085 Date: Tue, 21 Jun 2016 23:38:02 +0530 Subject: [PATCH 05/10] functionality to create and join groups --- tools/steam-shell.pike | 74 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/tools/steam-shell.pike b/tools/steam-shell.pike index b2cf955..c89e963 100755 --- a/tools/steam-shell.pike +++ b/tools/steam-shell.pike @@ -52,6 +52,7 @@ create Create an object (File/Container/Exit). Provide the full path of peek Peek through a container. inventory(i) List your inventory. edit Edit a file in the current Room. +group Use group commands. (list/join/leave) hilfe Help for Hilfe commands. "; switch(line) { @@ -94,6 +95,9 @@ hilfe Help for Hilfe commands. case "edit": write("Edit a file in the current Room.\n"); return; + case "group": + write("Use group commands. (list/join/leave)"); + return; //Hilfe internal help case "me more": write( documentation_help_me_more ); @@ -216,6 +220,7 @@ int main(int argc, array(string) argv) "inventory" : inventory, "i" : inventory, "edit" : editfile, + "group" : group, ]); // Regexp.SimpleRegexp a = Regexp.SimpleRegexp("[a-zA-Z]* [\"|'][a-zA-Z _-]*[\"|']"); array(string) command_arr; @@ -358,6 +363,7 @@ mapping assign(object conn, object _Server, object users) "look" : look, "take" : take, "gothrough" : gothrough, + "group" : group, // from database.h : "_SECURITY" : _Server->get_module("security"), @@ -389,6 +395,62 @@ mapping assign(object conn, object _Server, object users) ]); } +void group(string command,void|string name) +{ + switch(command) + { + case "list": + mapping mp = Process.run("tput cols"); + int screenwidth = (int)mp["stdout"]; + string toappend=""; + write("My groups\n"); + array(object) joined_groups = me->get_groups(); + foreach(joined_groups,object group) + { + toappend = toappend + group->get_name() +"\n"; + } + write("%-$*s\n", screenwidth,toappend); + write("\nOther groups\n"); + toappend=""; + array(object) other_groups = _Server->get_module("groups")->get_groups(); + foreach(other_groups,object group) + { + if(search(joined_groups,group)==-1) + toappend = toappend + group->get_name() + "\n"; + } + write("%-$*s\n", screenwidth,toappend); + write("\n"); + return; + case "join": + if(!stringp(name)){ + write("group join "); + return; + } + object group = _Server->get_module("groups")->get_group(name); + if(group == 0){ + write("The group does not exists\n"); + return; + } + int result = group->add_member(me); + switch(result){ + case 1:write("Joined group "+name+"\n"); + break; + case 0:write("Couldn't join group "+name+"\n"); + break; + case -1:write("pending\n"); + break; + case -2:write("pending failed"); + break; + } + return; + case "leave": + return; + default: + write("Group command: list/join/leave\n"); + } +} + + // create new sTeam objects // with code taken from the web script create.pike mixed create_object(string|void objectclass, string|void name, void|string desc, void|mapping data) @@ -688,6 +750,11 @@ int create_ob(string type,string name,string destination) object link_to = OBJ(readln->read("Where does the link lead?\n")); data = ([ "link_to":link_to ]); } + else if(type=="Group") + { + string parent = readln->read("Subgroup of?\n"); + data = (["parentgroup":parent]); + } object myobj = create_object(type,name,desc,data); /* if(type=="Room" || type=="Container"){ if(destination==".") @@ -696,9 +763,12 @@ int create_ob(string type,string name,string destination) myobj->move(OBJ(destination)); } */ - if(!(type == "Exit")) + if(!(type == "Exit" || type=="Group")) myobj->move(OBJ(destination)); - + if(type=="Group") + { + myobj->add_member(me); + } return 0; } From 232c945ffaa8ca2ab9c795663fbdb16a7e133b9f Mon Sep 17 00:00:00 2001 From: Siddhant085 Date: Thu, 23 Jun 2016 09:16:32 +0530 Subject: [PATCH 06/10] code to leave groups. --- tools/steam-shell.pike | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/steam-shell.pike b/tools/steam-shell.pike index c89e963..8e83dfd 100755 --- a/tools/steam-shell.pike +++ b/tools/steam-shell.pike @@ -444,6 +444,16 @@ void group(string command,void|string name) } return; case "leave": + if(!stringp(name)){ + write("group leave "); + return; + } + group = _Server->get_module("groups")->get_group(name); + if(group == 0){ + write("The group does not exists\n"); + return; + } + group->remove_member(me); return; default: write("Group command: list/join/leave\n"); From f520a7d8e475094f2d85fa938a84ac79a9c140f6 Mon Sep 17 00:00:00 2001 From: Siddhant085 Date: Thu, 23 Jun 2016 16:39:14 +0530 Subject: [PATCH 07/10] changed the interface for join and leave --- tools/steam-shell.pike | 61 ++++++++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/tools/steam-shell.pike b/tools/steam-shell.pike index 8e83dfd..570a8d6 100755 --- a/tools/steam-shell.pike +++ b/tools/steam-shell.pike @@ -52,6 +52,8 @@ create Create an object (File/Container/Exit). Provide the full path of peek Peek through a container. inventory(i) List your inventory. edit Edit a file in the current Room. +join Join a group. +leave Leave a group. group Use group commands. (list/join/leave) hilfe Help for Hilfe commands. "; @@ -95,8 +97,14 @@ hilfe Help for Hilfe commands. case "edit": write("Edit a file in the current Room.\n"); return; + case "join": + write("Join a group.\n"); + return; + case "leave": + write("Leave a group.\n"); + return; case "group": - write("Use group commands. (list/join/leave)"); + write("Use group commands. (list/join/leave)\n"); return; //Hilfe internal help case "me more": @@ -220,6 +228,8 @@ int main(int argc, array(string) argv) "inventory" : inventory, "i" : inventory, "edit" : editfile, + "join" : join, + "leave" : leave, "group" : group, ]); // Regexp.SimpleRegexp a = Regexp.SimpleRegexp("[a-zA-Z]* [\"|'][a-zA-Z _-]*[\"|']"); @@ -363,6 +373,8 @@ mapping assign(object conn, object _Server, object users) "look" : look, "take" : take, "gothrough" : gothrough, + "join" : join, + "leave" : leave, "group" : group, // from database.h : @@ -421,9 +433,34 @@ void group(string command,void|string name) write("%-$*s\n", screenwidth,toappend); write("\n"); return; - case "join": - if(!stringp(name)){ - write("group join "); + default: + write("Group command: list/join/leave\n"); + } +} + +void leave(string what,void|string name) +{ + if(what=="group") + { + if(!stringp(name)){ + write("leave group \n"); + return; + } + object group = _Server->get_module("groups")->get_group(name); + if(group == 0){ + write("The group does not exists\n"); + return; + } + group->remove_member(me); + } +} + +void join(string what,void|string name) +{ + if(what=="group") + { + if(!stringp(name)){ + write("join group \n"); return; } object group = _Server->get_module("groups")->get_group(name); @@ -442,25 +479,9 @@ void group(string command,void|string name) case -2:write("pending failed"); break; } - return; - case "leave": - if(!stringp(name)){ - write("group leave "); - return; - } - group = _Server->get_module("groups")->get_group(name); - if(group == 0){ - write("The group does not exists\n"); - return; - } - group->remove_member(me); - return; - default: - write("Group command: list/join/leave\n"); } } - // create new sTeam objects // with code taken from the web script create.pike mixed create_object(string|void objectclass, string|void name, void|string desc, void|mapping data) From 06ecc06898060a4b66c16e1dc609e75c44905791 Mon Sep 17 00:00:00 2001 From: Siddhant085 Date: Thu, 23 Jun 2016 19:08:19 +0530 Subject: [PATCH 08/10] Changed get_list to allow it to be extended for any kind of object. --- tools/steam-shell.pike | 149 ++++++++++++++++++----------------------- 1 file changed, 65 insertions(+), 84 deletions(-) diff --git a/tools/steam-shell.pike b/tools/steam-shell.pike index 570a8d6..9350946 100755 --- a/tools/steam-shell.pike +++ b/tools/steam-shell.pike @@ -24,6 +24,7 @@ constant cvs_version="$Id: debug.pike.in,v 1.1 2008/03/31 13:39:57 exodusd Exp $ inherit "applauncher.pike"; #define OBJ(o) _Server->get_module("filepath:tree")->path_to_object(o) +#include Stdio.Readline readln; mapping options; @@ -54,7 +55,6 @@ inventory(i) List your inventory. edit Edit a file in the current Room. join Join a group. leave Leave a group. -group Use group commands. (list/join/leave) hilfe Help for Hilfe commands. "; switch(line) { @@ -103,9 +103,6 @@ hilfe Help for Hilfe commands. case "leave": write("Leave a group.\n"); return; - case "group": - write("Use group commands. (list/join/leave)\n"); - return; //Hilfe internal help case "me more": write( documentation_help_me_more ); @@ -230,7 +227,6 @@ int main(int argc, array(string) argv) "edit" : editfile, "join" : join, "leave" : leave, - "group" : group, ]); // Regexp.SimpleRegexp a = Regexp.SimpleRegexp("[a-zA-Z]* [\"|'][a-zA-Z _-]*[\"|']"); array(string) command_arr; @@ -375,7 +371,6 @@ mapping assign(object conn, object _Server, object users) "gothrough" : gothrough, "join" : join, "leave" : leave, - "group" : group, // from database.h : "_SECURITY" : _Server->get_module("security"), @@ -407,37 +402,6 @@ mapping assign(object conn, object _Server, object users) ]); } -void group(string command,void|string name) -{ - switch(command) - { - case "list": - mapping mp = Process.run("tput cols"); - int screenwidth = (int)mp["stdout"]; - string toappend=""; - write("My groups\n"); - array(object) joined_groups = me->get_groups(); - foreach(joined_groups,object group) - { - toappend = toappend + group->get_name() +"\n"; - } - write("%-$*s\n", screenwidth,toappend); - write("\nOther groups\n"); - toappend=""; - array(object) other_groups = _Server->get_module("groups")->get_groups(); - foreach(other_groups,object group) - { - if(search(joined_groups,group)==-1) - toappend = toappend + group->get_name() + "\n"; - } - write("%-$*s\n", screenwidth,toappend); - write("\n"); - return; - default: - write("Group command: list/join/leave\n"); - } -} - void leave(string what,void|string name) { if(what=="group") @@ -560,72 +524,89 @@ int list(string what) if(sizeof(display)==0) toappend = "There are no "+what+" in this room\n"; else - toappend = "Here is a list of all "+what+" in the current room\n"; + toappend = "Here is a list of all "+what+"\n"; foreach(display,string str) { - a=a+(str+" "); + a=a+(str+"\n"); if(str=="Invalid command") { flag=1; write(str+"\n"); } } - if(flag==0) - write(toappend+a+"\n\n"); + if(flag==0){ + mapping mp = Process.run("tput cols"); + int screenwidth = (int)mp["stdout"]; + write(toappend + "\n"); + write("%-$*s\n", screenwidth,a); + write("\n"); + } return 0; } array(string) get_list(string what,string|object|void lpath) { -// string name; -// object to; - array(string) gates=({}),containers=({}),documents=({}),rooms = ({}),rest=({}); -// mapping(string:object) s = ([ ]); + array(string) whatlist = ({}); object pathobj; - if(!lpath) - pathobj = OBJ(getpath()); - else if(stringp(lpath)) - pathobj = OBJ(lpath); - else if(objectp(lpath)) - pathobj = lpath; -// string pathfact = _Server->get_factory(pathobj)->query_attribute("OBJ_NAME"); - mixed all = pathobj->get_inventory_by_class(0x3cffffff); //CLASS_ALL - foreach(all, object obj) + if(!lpath) + pathobj = OBJ(getpath()); + else if(stringp(lpath)) + pathobj = OBJ(lpath); + else if(objectp(lpath)) + pathobj = lpath; + switch (what) { - string fact_name = _Server->get_factory(obj)->query_attribute("OBJ_NAME"); - string obj_name = obj->query_attribute("OBJ_NAME"); -// write("normally : "+obj_name+"\n"); - if(fact_name=="Document.factory") - documents = Array.push(documents,obj_name); -// write(obj_name+"\n"); - else if(fact_name=="Exit.factory"){ - string fullgate = obj_name+" : "+obj->get_exit()->query_attribute("OBJ_NAME"); - gates = Array.push(gates,fullgate); -// write("in gates : "+fullgate+"\n"); + case "containers": + { + mixed all = pathobj->get_inventory_by_class(CLASS_CONTAINER); + foreach(all, object obj) + { + string fact_name = _Server->get_factory(obj)->query_attribute("OBJ_NAME"); + string obj_name = obj->query_attribute("OBJ_NAME"); + whatlist = Array.push(whatlist,obj_name); + } } - else if(fact_name=="Container.factory") - containers = Array.push(containers,obj_name); -// write("in containers : "+obj_name+"\n"); - else if(fact_name=="Room.factory") - rooms = Array.push(rooms,obj_name); - else - rest = Array.push(rest, obj_name); + break; + case "files": + { + mixed all = pathobj->get_inventory_by_class(CLASS_DOCUMENT|CLASS_DOCLPC|CLASS_DOCEXTERN|CLASS_DOCHTML|CLASS_DOCXML|CLASS_DOCXSL); + foreach(all, object obj) + { + string fact_name = _Server->get_factory(obj)->query_attribute("OBJ_NAME"); + string obj_name = obj->query_attribute("OBJ_NAME"); + whatlist = Array.push(whatlist,obj_name); + } + } + break; + case "exits": + case "gates": + case "rooms": + { + mixed all = pathobj->get_inventory_by_class(CLASS_ROOM|CLASS_EXIT); + foreach(all, object obj) + { + string fact_name = _Server->get_factory(obj)->query_attribute("OBJ_NAME"); + string obj_name = obj->query_attribute("OBJ_NAME"); + whatlist = Array.push(whatlist,obj_name); + } + } + break; + case "groups": + { + array(object) groups = _Server->get_module("groups")->get_groups(); + foreach(groups,object group) + { + string obj_name = group->get_name(); + whatlist = Array.push(whatlist,obj_name); + } + } + break; + default: + whatlist = ({"Invalid command"}); } - if(what=="gates") - return gates; - else if(what=="rooms") - return rooms; - else if(what=="containers") - return containers; - else if(what=="files") - return documents; - else if(what=="others") - return rest; - else - return ({"Invalid command"}); + return whatlist; } - int goto_room(string where) { string roomname=""; From 70b2e86649a4daeec1d611bcd53810c9398bcce8 Mon Sep 17 00:00:00 2001 From: Siddhant085 Date: Thu, 30 Jun 2016 18:52:45 +0530 Subject: [PATCH 09/10] separated out rooms and gates --- tools/steam-shell.pike | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/steam-shell.pike b/tools/steam-shell.pike index 9350946..72271ad 100755 --- a/tools/steam-shell.pike +++ b/tools/steam-shell.pike @@ -580,9 +580,19 @@ array(string) get_list(string what,string|object|void lpath) break; case "exits": case "gates": + { + mixed all = pathobj->get_inventory_by_class(CLASS_EXIT); + foreach(all, object obj) + { + string fact_name = _Server->get_factory(obj)->query_attribute("OBJ_NAME"); + string obj_name = obj->query_attribute("OBJ_NAME"); + whatlist = Array.push(whatlist,obj_name); + } + } + break; case "rooms": { - mixed all = pathobj->get_inventory_by_class(CLASS_ROOM|CLASS_EXIT); + mixed all = pathobj->get_inventory_by_class(CLASS_ROOM); foreach(all, object obj) { string fact_name = _Server->get_factory(obj)->query_attribute("OBJ_NAME"); From 2aafc32a41aaf08f42d019829c02942f4127f433 Mon Sep 17 00:00:00 2001 From: Siddhant085 Date: Fri, 1 Jul 2016 17:20:37 +0530 Subject: [PATCH 10/10] Added the case others and removed some redundant code --- tools/steam-shell.pike | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tools/steam-shell.pike b/tools/steam-shell.pike index 72271ad..c7e5677 100755 --- a/tools/steam-shell.pike +++ b/tools/steam-shell.pike @@ -561,7 +561,6 @@ array(string) get_list(string what,string|object|void lpath) mixed all = pathobj->get_inventory_by_class(CLASS_CONTAINER); foreach(all, object obj) { - string fact_name = _Server->get_factory(obj)->query_attribute("OBJ_NAME"); string obj_name = obj->query_attribute("OBJ_NAME"); whatlist = Array.push(whatlist,obj_name); } @@ -572,7 +571,6 @@ array(string) get_list(string what,string|object|void lpath) mixed all = pathobj->get_inventory_by_class(CLASS_DOCUMENT|CLASS_DOCLPC|CLASS_DOCEXTERN|CLASS_DOCHTML|CLASS_DOCXML|CLASS_DOCXSL); foreach(all, object obj) { - string fact_name = _Server->get_factory(obj)->query_attribute("OBJ_NAME"); string obj_name = obj->query_attribute("OBJ_NAME"); whatlist = Array.push(whatlist,obj_name); } @@ -584,7 +582,6 @@ array(string) get_list(string what,string|object|void lpath) mixed all = pathobj->get_inventory_by_class(CLASS_EXIT); foreach(all, object obj) { - string fact_name = _Server->get_factory(obj)->query_attribute("OBJ_NAME"); string obj_name = obj->query_attribute("OBJ_NAME"); whatlist = Array.push(whatlist,obj_name); } @@ -595,7 +592,6 @@ array(string) get_list(string what,string|object|void lpath) mixed all = pathobj->get_inventory_by_class(CLASS_ROOM); foreach(all, object obj) { - string fact_name = _Server->get_factory(obj)->query_attribute("OBJ_NAME"); string obj_name = obj->query_attribute("OBJ_NAME"); whatlist = Array.push(whatlist,obj_name); } @@ -611,6 +607,20 @@ array(string) get_list(string what,string|object|void lpath) } } break; + case "others": + { + mixed all = pathobj->get_inventory_by_class(CLASS_ALL); + foreach(all, object obj) + { + string fact_name = _Server->get_factory(obj)->query_attribute("OBJ_NAME"); + if(!(fact_name == "Group.factory" || fact_name == "Room.factory" || fact_name == "Exit.factory" || fact_name == "Container.factory" || fact_name == "Document.factory" || fact_name == "DocExtern.factory")) + { + string obj_name = obj->query_attribute("OBJ_NAME"); + whatlist = Array.push(whatlist,obj_name); + } + } + } + break; default: whatlist = ({"Invalid command"}); }