void set_path_special_object(object new_obj) { if(previous_program() == GAME_INITD || previous_program() == INITD) { PATHSPECIAL->set_game_path_object(new_obj); INITD->set_path_special_object(find_object(PATHSPECIAL)); } else { error("Tylko GAME_INITD może ustawiać obiekt path_special!"); } }
nomask void _F_touch(string func) { object this; string name; string path; string *patches; int oindex; int sz; ACCESS_CHECK(previous_program() == OBJECTD); this = this_object(); name = object_name(this); if (!sscanf(name, "%*s#%d", oindex)) { oindex = status(this, O_INDEX); } patches = TOUCHD->query_patches(oindex); TOUCHD->clear_patches(oindex); if (patches) { for (sz = sizeof(patches) - 1; sz >= 0; --sz) { catch { call_other(this_object(), patches[sz]); } } } touch(); }
void init(object new_user, object new_next_state) { if(previous_program() != SYSTEM_USER_IO) error("Użyj funkcji push_new_state i pop_state dla stanów użytkownika!"); user = new_user; next_state = new_next_state; }
void open_datagram() { ACCESS_CHECK(previous_program() == LIB_CONN || calling_object() == this_object()); conn::open_datagram(nil); }
void receive_datagram(string packet) { ACCESS_CHECK(previous_program() == LIB_CONN || calling_object() == this_object()); conn::receive_datagram(nil, packet); }
void set_mode(int new_mode) { object conn; ACCESS_CHECK(previous_program() == LIB_CONN || SYSTEM() || calling_object() == this_object()); if (!this_object() || !query_conn() || new_mode == MODE_NOCHANGE) { return; } /* we have to do it this way because set_mode is also called to handle return values for hooks in the user object */ /* this can happen more than once in a connection chain, so we need to intercept disconnects and do them */ /* in a 0 callout to avoid double destruction */ /* since network events are asynchronous anyway we aren't causing any actual harm */ if (new_mode == MODE_DISCONNECT) { query_conn()->set_mode(MODE_BLOCK); conn::close(nil, 1); call_out("self_disconnect", 0); return; } query_conn()->set_mode(new_mode); }
object get_wiztool(string user) { object wiztool; int firstchar; string creator; ACCESS_CHECK(PRIVILEGED() || INTERFACE()); creator = DRIVER->creator(previous_program()); CHECKARG(user && user != "" && STRINGD->is_valid_username(user), 1, "get_proxy"); check_security(user, creator); wiztool = new_object("~/lwo/wiztool", user); if (audit) { INITD->message("Wiztool being issued to " + creator + " for " + user); } return wiztool; }
object get_proxy(string user) { object proxy; int firstchar; string creator; ACCESS_CHECK(PRIVILEGED() || INTERFACE()); creator = DRIVER->creator(previous_program()); CHECKARG(user && user != "" && STRINGD->is_valid_username(user), 1, "get_proxy"); check_security(user, creator); proxy = new_object("~/lwo/proxy", user); /* only the object who requested a proxy is allowed to use it */ proxy->set_client(previous_object()); if (audit) { INITD->message("User access proxy being issued to " + creator + " for " + user + ", assigned to " + object_name(previous_object())); } return proxy; }
void set_toucher(string new_patcher) { ACCESS_CHECK(SYSTEM()); LOGD->post_message("system", LOG_WARN, previous_program() + " is using obsolete set_toucher."); patcher = new_patcher; }
int login(string str) { ACCESS_CHECK(previous_program() == LIB_CONN); previous_object()->message("Welcome to Shentino's mudclient extension.\n"); return ::login(str); }
int message_done() { ACCESS_CHECK(previous_program() == LIB_CONN || calling_object() == this_object()); conn::message_done(nil); return MODE_NOCHANGE; }
static void call_touch(object obj) { /* anyone can use call_touch */ if (previous_program() == TOUCHD) { ::call_touch(obj); } else { TOUCHD->touch_object(obj); } }
int receive_message(string str) { int newmode; string err; ACCESS_CHECK(previous_program() == LIB_CONN || calling_object() == this_object()); /* LIB_CONN does an implicit call to set_mode */ return conn::receive_message(nil, str); }
void logout(int quit) { ACCESS_CHECK(previous_program() == LIB_CONN || calling_object() == this_object()); close(nil, quit); if (quit) { destruct_object(this_object()); } }
int login(string str) { ACCESS_CHECK(previous_program() == LIB_CONN || calling_object() == this_object()); connection(previous_object()); open(nil); /* LIB_CONN does an implicit call to set_mode */ return conn::receive_message(nil, str); }
string get_logging_item() { string t, program; mixed *a; int i; a = explode(previous_program(1), "/"); program = a[sizeof(a)-1] + ".c"; i = sizeof(call_trace()); a = call_trace()[i-4]; t = program + "->" + a[TRACE_FUNCTION] + "() (" + a[TRACE_LINE] + ")"; return t; }
string query_toucher() { LOGD->post_message("system", LOG_WARN, previous_program() + " is using obsolete query_toucher."); return patcher; }
void booted_module(string module) { ACCESS_CHECK(previous_program() == MODULED); }
void shutdown_module(string module) { ACCESS_CHECK(previous_program() == MODULED); }
string include_file(string compiled, string from, string path) { ACCESS_CHECK(previous_program() == OBJECTD); return path; }
void heart_beat_func(void) { if(previous_program() == TIMED) { } }
int forbid_inherit(string from, string path, int priv) { ACCESS_CHECK(previous_program() == OBJECTD); return 0; }
void set_game_driver(object new_driver) { if(previous_program() == GAME_INITD) game_driver = new_driver; }
void upgrade_module() { ACCESS_CHECK(previous_program() == MODULED); }
string query_patcher(string path) { ACCESS_CHECK(previous_program() == OBJECTD); return nil; }
string query_constructor(string path) { ACCESS_CHECK(previous_program() == OBJECTD); return nil; }
void prepare_reboot() { ACCESS_CHECK(previous_program() == MODULED); }
void hotboot() { ACCESS_CHECK(previous_program() == MODULED); }
void set_up_heart_beat(void) { if(previous_program() == GAME_INITD) { TIMED->set_heart_beat(TIMED_HALF_MINUTE, "heart_beat_func"); } }
int forbid_call(string path) { ACCESS_CHECK(previous_program() == OBJECTD); return 0; }