Example #1
0
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!");
  }
}
Example #2
0
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();
}
Example #3
0
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;
}
Example #4
0
void open_datagram()
{
	ACCESS_CHECK(previous_program() == LIB_CONN
		|| calling_object() == this_object());

	conn::open_datagram(nil);
}
Example #5
0
void receive_datagram(string packet)
{
	ACCESS_CHECK(previous_program() == LIB_CONN
		|| calling_object() == this_object());

	conn::receive_datagram(nil, packet);
}
Example #6
0
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);
}
Example #7
0
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;
}
Example #8
0
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;
}
Example #9
0
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;
}
Example #10
0
int login(string str)
{
	ACCESS_CHECK(previous_program() == LIB_CONN);

	previous_object()->message("Welcome to Shentino's mudclient extension.\n");

	return ::login(str);
}
Example #11
0
int message_done()
{
	ACCESS_CHECK(previous_program() == LIB_CONN
		|| calling_object() == this_object());

	conn::message_done(nil);

	return MODE_NOCHANGE;
}
Example #12
0
static void call_touch(object obj)
{
	/* anyone can use call_touch */

	if (previous_program() == TOUCHD) {
		::call_touch(obj);
	} else {
		TOUCHD->touch_object(obj);
	}
}
Example #13
0
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);
}
Example #14
0
void logout(int quit)
{
	ACCESS_CHECK(previous_program() == LIB_CONN
		|| calling_object() == this_object());

	close(nil, quit);

	if (quit) {
		destruct_object(this_object());
	}
}
Example #15
0
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);
}
Example #16
0
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;
}
Example #17
0
string query_toucher()
{
	LOGD->post_message("system", LOG_WARN, previous_program() + " is using obsolete query_toucher.");

	return patcher;
}
Example #18
0
void booted_module(string module)
{
	ACCESS_CHECK(previous_program() == MODULED);
}
Example #19
0
void shutdown_module(string module)
{
	ACCESS_CHECK(previous_program() == MODULED);
}
Example #20
0
string include_file(string compiled, string from, string path)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

	return path;
}
Example #21
0
void heart_beat_func(void) {
  if(previous_program() == TIMED) {

  }
}
Example #22
0
int forbid_inherit(string from, string path, int priv)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

	return 0;
}
Example #23
0
void set_game_driver(object new_driver) {
  if(previous_program() == GAME_INITD)
    game_driver = new_driver;
}
Example #24
0
void upgrade_module()
{
	ACCESS_CHECK(previous_program() == MODULED);
}
Example #25
0
string query_patcher(string path)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

	return nil;
}
Example #26
0
string query_constructor(string path)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

	return nil;
}
Example #27
0
void prepare_reboot()
{
	ACCESS_CHECK(previous_program() == MODULED);
}
Example #28
0
void hotboot()
{
	ACCESS_CHECK(previous_program() == MODULED);
}
Example #29
0
void set_up_heart_beat(void) {
  if(previous_program() == GAME_INITD) {
    TIMED->set_heart_beat(TIMED_HALF_MINUTE, "heart_beat_func");
  }
}
Example #30
0
int forbid_call(string path)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

	return 0;
}