• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ previous_object函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中previous_object函数的典型用法代码示例。如果您正苦于以下问题:C++ previous_object函数的具体用法?C++ previous_object怎么用?C++ previous_object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了previous_object函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: gateway

varargs string gateway(mixed args){
    string pass_hash, who, password, ip;
    string ret = "";
    int max_tries = 3;
    int no_user = 0;

    if(ENABLE_CREWEB){ 

        ip = previous_object()->GetIp();

        if(!args || !stringp(args)) args = "123456789101112";
        if(sscanf(args,"%s&%s",who, password) != 2){
            ret = "<br>";
        }

        else {
            who = lower_case(who);

            if(!strsrch(who,"username=")) who = replace_string(who,"username=","",1);
            if(!strsrch(password,"password=")) password = replace_string(password,"password=","",1);

            if(!ret && !user_exists(who)){
                no_user = 1;
            }

            else {
                if(!Tries) Tries = ([]);
                if(!Tries[ip]) Tries[ip] = 0;
                if(no_user) pass_hash = alpha_crypt(32);
                else pass_hash = PLAYERS_D->GetPlayerData(who,"Password");
                if(pass_hash != crypt(password, pass_hash)){
                    Tries[ip]++;
                    ret = "Fail! Tries left: "+(max_tries - Tries[ip])+"<br>";
                    if(Tries[ip] >= max_tries){
                        previous_object()->eventBlockIp();
                        Tries[ip] = 0;
                    }
                }
                else {
                    string shibboleth = alpha_crypt(32);
                    string packet=who+"."+shibboleth;
                    WEB_SESSIONS_D->StartSession(ip,who,shibboleth);
                    ret = "Login successful<br>";
                    Tries[ip] = 0;
                    ret += "<meta http-equiv=\"Set-Cookie\" content=\"creweb="+packet+";path=/\">";
                    ret += "<META http-equiv=\"refresh\" content=\"1;URL=creweb.html\">";
                    return ret;
                }
            }
        }

        ret += "Log in to CreWeb using your mud username and mud password.<br><br>";
        ret += "<FORM ACTION=\"login.html\" METHOD=POST>";
        ret += "username: <INPUT TYPE=TEXT NAME=\"username\" MAXLENGTH=32><BR>";
        ret += "password:   <INPUT TYPE=PASSWORD NAME=\"password\" MAXLENGTH=32>";
        ret += "<P><INPUT TYPE=SUBMIT VALUE=\"submit\">";
        ret += "</FORM>";
        ret += "<br>";
    }
    else {
开发者ID:arylwen,项目名称:terebi,代码行数:60,代码来源:login.c


示例2: init

void init()
{
	::init();
	if( !previous_object()
	||	!userp(previous_object())
	||	wizardp(previous_object()) ) return;
	call_out( "death_stage", 3, previous_object(), 0 );
}
开发者ID:mudchina,项目名称:fy2,代码行数:8,代码来源:panguan.c


示例3: player_died

player_died() {
  looser=previous_object()->query_name();
  loos=previous_object();
  remove_call_out("duel_end");
  remove_call_out("duel_end");
  remove_call_out("duel_end");
  call_out("duel_end",3);
}
开发者ID:nfarrar,项目名称:mudfiles,代码行数:8,代码来源:dark_duel.c


示例4: init

void init() {
  ::init();
  if (!interactive(previous_object())) return 0;
  if ("/secure/master"->high_programmer(geteuid(previous_object())))
    add_action("do_banish", "banish"); /* Site banishing... */
  add_action("do_access", "access"); /* Show the current access list. */
  add_action("do_suspend", "suspend");
  add_action("do_unsuspend", "unsuspend");
} /* init() */
开发者ID:quixadhal,项目名称:discworld,代码行数:9,代码来源:site_control.c


示例5: delete_access

// delete() uses delete_access(entry) rather than set_access(entry,0) because
// that is The Right Thing (tm) to do.
nomask int delete_access(string entry)
{
    string eff_user;

    eff_user = ( previous_object() ? geteuid( previous_object() ) : geteuid() );
    if( eff_user != geteuid() && eff_user != ROOT_UID ) return 0; // Fail.

    map_delete( perms, entry );
}
开发者ID:Hobbitron,项目名称:tmi2_fluffos_v3,代码行数:11,代码来源:priv.c


示例6: secure

int secure()
{
  if (!previous_object()) return 0;
  if (geteuid(previous_object())==ROOTID) return 1;
  if (geteuid(previous_object()) != geteuid(this_interactive())) return 0;
  if (this_interactive() != this_player()) return 0;
  if (!ARCH_SECURITY) return 0;
  return 1;
}
开发者ID:Kebap,项目名称:mg-mudlib,代码行数:9,代码来源:ptool.c


示例7: query_temp_ob_data

mapping query_temp_ob_data() {
   if(!adminp(geteuid(previous_object())) &&
      geteuid(previous_object()) != ROOT_UID)  return 0;
#ifdef SECURE
  return copy(tmp_ob_data);
#else
   return tmp_ob_data;
#endif
}
开发者ID:Hobbitron,项目名称:tmi2_fluffos_v3,代码行数:9,代码来源:prop.c


示例8: shutdown

void shutdown(int code)
{
  object me = previous_object(1);
  object mob = previous_object(0);

  if( wiz_level(me) >= 5
  ||  strcmp(file_name(mob), "/obj/npc/demogorgon") != -1 )
    efun::shutdown(code);
}
开发者ID:szhowardhuang,项目名称:fs2,代码行数:9,代码来源:system.c


示例9: cmd_destold

int cmd_destold(string str) {
    object ob, act_ob, *obs;
    string msg, opt;
    int clean, global, l, s;

    act_ob = previous_object();
    seteuid(geteuid(act_ob));

    notify_fail( SYNTAX );
    if (!str || str == "")  return 0;

#ifdef GUEST_NO_DEST
    if (getuid(previous_object()) == "guest") {
	write ("Guest is not permitted to dest objects.\n") ;
	return 1 ;
    }
#endif

    if (str == "all")
	return dest_all(act_ob, 0);

    if (sscanf(str, "-%s %s", opt, str) == 2) {
	if (strsrch(opt, 'a') != -1)  clean = 1;
	if (strsrch(opt, 'g') != -1)  global = 1;
    }

    if (global) {
	if (!adminp(geteuid(act_ob))) {
	    write("Global Dest: Permission denied.\n");
	    return 1;
	}

	str = resolv_path("cwd", str);
	l = strlen(str);
	obs = objects();
	s = sizeof(obs);

	write("Global destructing: " + str + "\n");

	cnt = 0;
	while (s--) {
	    if (!obs[s])  continue;
	    if (strncmp(file_name(obs[s]), str, l) == 0) {
		if (clean)
		    dest_all(obs[s], 1);
		cnt++;
		if (obs[s]) {
		    catch(obs[s]->remove());
		    destruct(obs[s]);
		}
	    }
	}

	write("object(s) destructed: " + cnt + "\n");
    } else {
	if (!(ob = get_object(str))) {
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:56,代码来源:_destold.c


示例10: teleport_to

int teleport_to(string place) {
    object destination =
        load_object(resolve_path(previous_object()->query_cwd(), place));

    if (!destination) {
        return error_out("Could not load object " + place);
    }

    return teleport(previous_object(), destination);
}
开发者ID:rmanis,项目名称:lil,代码行数:10,代码来源:teleport.c


示例11: main

int main(string arg)
{
    string name = previous_object()->query_name();

    ACCOUNT_D->set_offline(name);
    write("Bye.\n");
    say((string)previous_object()->query_name()
            + " leaves this reality.\n");
    previous_object()->remove();
    return 1;
}
开发者ID:quixadhal,项目名称:SuckingMUD,代码行数:11,代码来源:quit.c


示例12: add_point

void add_point( string wizname, int amount, string reason ) {
   if( getuid(previous_object()) != "root" ) return;

   if( amount > 100 ) raise_error( "/daemon/point: Hard limit, can't add more than 100 points at a time. Sorry." );

   wizpoints[wizname] += amount;
   if( wizpoints[wizname] > 0 ) {
      log_file( "points", as_string(previous_object()) + " added " + amount + " points to " + wizname + ", total " + wizpoints[wizname] + ": " + reason + ".\n" );

      if( !weekpoints[wizname] )
         weekpoints[wizname] = ({ });
开发者ID:shentino,项目名称:simud,代码行数:11,代码来源:point.c


示例13: valid_compile_to_c

/*
 * $Locker:  $
 * $Id: valid_to_c.c,v 1.1 1998/01/06 05:12:03 ceres Exp $
 * $Log: valid_to_c.c,v $
 * Revision 1.1  1998/01/06 05:12:03  ceres
 * Initial revision
 * 
*/
int valid_compile_to_c() {
  if (previous_object() == this_object())
    return 1;
  if (previous_object() != find_object("/secure/cmds/creator/compile"))
    return 0;
  if (!interactive(previous_object(1)))
    return 0;
  if (!this_object()->query_lord(previous_object(-1)))
    return 0;
  return 1;
} /* valid_compile_to_c() */
开发者ID:Yuffster,项目名称:discworld_distribution_mudlib,代码行数:19,代码来源:valid_to_c.c


示例14: disable_player

nomask void disable_player(string type)
{
	if( geteuid(previous_object())!=ROOT_UID
	&&	previous_object()!=this_object()) return;

	set("disable_type", type);
	set_temp("disabled", 1);
	disable_commands();
	enable_commands();  // enable command again so this object would be
                            // marked living again. block command in alias.c
                            // instead of here.
}
开发者ID:gongfuPanada,项目名称:xyj2006,代码行数:12,代码来源:command.c


示例15: zap_shadow

void zap_shadow(object ob) {
/* Just in case there is more than one on us... */
  if (interactive(previous_object())) {
    destruct(this_object());
    return ;
  }
  if (previous_object() == foll) {
    destruct(this_object());
    return ;
  }
  me->zap_shadow();
} /* zap_shadow() */
开发者ID:quixadhal,项目名称:discworld,代码行数:12,代码来源:follow_player.c


示例16: send_support_q

void send_support_q(string host, mixed port, string cmd, string param)
{
        int idx;
        function f; 
        if(!ACCESS_CHECK(previous_object())) return; 
if (!param) param = ""; 
        f = (: previous_object(), "support_q_callback" :); 
        idx = index_add(f); 
        DNS_MASTER->send_udp(host, port,
                sprintf("@@@%s||NAME:%s||PORTUDP:%d||CMD:%s||ANSWERID:%[email protected]@@\n",
                        DNS_SUPPORT_Q, Mud_name(), udp_port(),
                        cmd + (strlen(param) ? "||PARAM:"+param : ""), idx));
}    
开发者ID:mudchina,项目名称:fy4,代码行数:13,代码来源:support_q.c


示例17: set_access

nomask int set_access(string entry, int new_access) {
    string eff_user;
    int curr_access;

    // first, get the identity of who is trying to change the access.

    if (!previous_object()) eff_user = geteuid();
    else eff_user = geteuid(previous_object());

#ifdef DEBUG
    write(eff_user + " is trying to change access " + entry + " to " +
          new_access + " for " + file_name(this_object()) + "\n");
#endif

    // Only two euid can generally change the permissions on things.
    // the owner, because it makes sense, and Root, just because.

    if (eff_user != geteuid(this_object()) && eff_user != ROOT_UID)
        return 0;

    // now get it's protection level.
    // then, switch through the various types of protection.

    curr_access = check_access(entry);
    if(!intp(curr_access))  curr_access = 0;

    switch(curr_access) {
    case PUBLIC:
    case READ_ONLY:
    case OWNER_ONLY:
        perms[entry] = new_access;
        return 1;
        break;
    case LOCKED:
    case PRIVATE:
        return 0;
        break;
    case MASTER_ONLY:
        if (eff_user == ROOT_UID) {
            perms[entry] = new_access;
            return 1;
        }
        return 0;
        break;
    default:
        // the item isn't even in priv.h - probably an error
        perms[entry] = new_access;
        return 1;
        break;
    }
}
开发者ID:Hobbitron,项目名称:tmi2_fluffos_v3,代码行数:51,代码来源:priv.c


示例18: cmd_haven

int cmd_haven(string str) {

   int i;

   if (!str || (str!="off" && str!="on")) return help() ;
   if (str=="on") {
	write ("You are now hidden.\n") ;
	previous_object()->hide(1) ;
	return 1 ;
   }
   write ("You become unhidden again.\n") ;
   previous_object()->hide(0) ;
   return 1 ;
}
开发者ID:ehershey,项目名称:pd,代码行数:14,代码来源:_haven.c


示例19: clean_dir

int clean_dir(string dir, int flag) {
   string tmp;
 
   //	Check euid of initiator to confirm correct permissions
   if(geteuid(previous_object()) != ROOT_UID &&
      !adminp(geteuid(previous_object())))
	return 0;
 
   if(!dir || dir == "")  return 0;
 
   if(file_size(dir) != -2)  return 0;		//  Not a directory
 
 
return move_contents(dir + "/", flag); }
开发者ID:ClockworkSoul,项目名称:MortalRemains,代码行数:14,代码来源:move_dir.c


示例20: cmd

mixed cmd(string args) {

    if(!archp(previous_object())) {
        write("No.");
        return 1;
    }

    if(!args || !sizeof(args)) args = "me";

    args = lower_case(args);

    if(args == "me" || args == this_player()->GetKeyName()){
        write("To reset your own password, use the command: passwd");
        return 1;
    }

    if( (int)previous_object()->GetForced() )
        return "You cannot be forced to change a password.";
    if( previous_object() != this_player() )
        return "You're being sploited to reset someone's password.";

    if(!user_exists(args)){
        write("That person does not exist on this mud.");
        return 1;
    }

    if(find_player(args)){
        write("That player is currently logged on. Please use "
          "the passwd command to reset their password.");
        return 1;
    }

    savefile = DIR_CRES + "/" + args[0..0] + "/" + args + ".o";
    if(!file_exists(savefile)) {
        write("Couldn't find "+savefile+". Looking for alternate.");
        savefile = DIR_PLAYERS + "/" + args[0..0] + "/"+ args + ".o";
    }

    if(!file_exists(savefile)){
        write("Save file could not be found. Exiting.");
        return 1;
    }

    write("Found "+savefile+".");

    previous_object()->eventPrint("New password: ", MSG_PROMPT);
    input_to( (: NewPass :), I_NOECHO | I_NOESC, previous_object() || args);
    return 1;
}
开发者ID:arylwen,项目名称:terebi,代码行数:49,代码来源:resetpasswd.c



注:本文中的previous_object函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ prf函数代码示例发布时间:2022-05-30
下一篇:
C++ previousBlockState函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap