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

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

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

	conn::message_done(nil);

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

	return patcher;
}
示例#18
0
文件: initd.c 项目: shentino/kotaka
void booted_module(string module)
{
	ACCESS_CHECK(previous_program() == MODULED);
}
示例#19
0
文件: initd.c 项目: shentino/kotaka
void shutdown_module(string module)
{
	ACCESS_CHECK(previous_program() == MODULED);
}
示例#20
0
文件: initd.c 项目: shentino/kotaka
string include_file(string compiled, string from, string path)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

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

  }
}
示例#22
0
文件: initd.c 项目: shentino/kotaka
int forbid_inherit(string from, string path, int priv)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

	return 0;
}
示例#23
0
void set_game_driver(object new_driver) {
  if(previous_program() == GAME_INITD)
    game_driver = new_driver;
}
示例#24
0
文件: initd.c 项目: shentino/kotaka
void upgrade_module()
{
	ACCESS_CHECK(previous_program() == MODULED);
}
示例#25
0
文件: initd.c 项目: shentino/kotaka
string query_patcher(string path)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

	return nil;
}
示例#26
0
文件: initd.c 项目: shentino/kotaka
string query_constructor(string path)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

	return nil;
}
示例#27
0
文件: initd.c 项目: shentino/kotaka
void prepare_reboot()
{
	ACCESS_CHECK(previous_program() == MODULED);
}
示例#28
0
文件: initd.c 项目: shentino/kotaka
void hotboot()
{
	ACCESS_CHECK(previous_program() == MODULED);
}
示例#29
0
void set_up_heart_beat(void) {
  if(previous_program() == GAME_INITD) {
    TIMED->set_heart_beat(TIMED_HALF_MINUTE, "heart_beat_func");
  }
}
示例#30
0
文件: initd.c 项目: shentino/kotaka
int forbid_call(string path)
{
	ACCESS_CHECK(previous_program() == OBJECTD);

	return 0;
}