Ejemplo n.º 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!");
  }
}
Ejemplo n.º 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();
}
Ejemplo n.º 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;
}
Ejemplo n.º 4
0
void open_datagram()
{
	ACCESS_CHECK(previous_program() == LIB_CONN
		|| calling_object() == this_object());

	conn::open_datagram(nil);
}
Ejemplo n.º 5
0
void receive_datagram(string packet)
{
	ACCESS_CHECK(previous_program() == LIB_CONN
		|| calling_object() == this_object());

	conn::receive_datagram(nil, packet);
}
Ejemplo n.º 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);
}
Ejemplo n.º 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;
}
Ejemplo n.º 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;
}
Ejemplo n.º 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;
}
Ejemplo n.º 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);
}
Ejemplo n.º 11
0
int message_done()
{
	ACCESS_CHECK(previous_program() == LIB_CONN
		|| calling_object() == this_object());

	conn::message_done(nil);

	return MODE_NOCHANGE;
}
Ejemplo n.º 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);
	}
}
Ejemplo n.º 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);
}
Ejemplo n.º 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());
	}
}
Ejemplo n.º 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);
}
Ejemplo n.º 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;
}
Ejemplo n.º 17
0
string query_toucher()
{
	LOGD->post_message("system", LOG_WARN, previous_program() + " is using obsolete query_toucher.");

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

	return path;
}
Ejemplo n.º 21
0
void heart_beat_func(void) {
  if(previous_program() == TIMED) {

  }
}
Ejemplo n.º 22
0
int forbid_inherit(string from, string path, int priv)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

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

	return nil;
}
Ejemplo n.º 26
0
string query_constructor(string path)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

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

	return 0;
}