コード例 #1
0
ファイル: mudinfo.c プロジェクト: mudchina/nitan3
int main(object me) 
{
        float value;
        mapping r;

        if (time() - me->query_temp("scan_time") < 10
           && ! wizardp(me))
                return notify_fail("等等,系统喘气中……\n");

        r = rusage();
        value = SCALE * (r["utime"] + r["stime"]) / uptime();

        write(NOR + WHT "\n\t\t         .__________ 系 统 资 讯 __________.\n");
        write(NOR + WHT "\t\t ─────────────────────────\n");
        write(NOR + WHT "\t\t 游戏的识别名称:  " + MUD_NAME + "\n");
        write(NOR + WHT "\t\t 界面系统的版本:  " + __VERSION__ + "\n");
        write(NOR + WHT "\t\t 系统函数库版本:  Nitan Mudlib Version 2.1\n");
        printf(NOR + WHT "\t\t CPU 使用百分比:  %f %% 被这个游戏使用中\n", value );
        write(NOR + WHT "\t\t CPU 的负担状况:  " + query_load_average() + "\n");
        printf(NOR + WHT "\t\t 共使用的记忆体:  %s bytes\n", memory_expression(memory_info()) );
        write(NOR + WHT "\t\t 线上使用者总数:  " + sizeof( users() ) + "  个人在线上\n");
        write(NOR + WHT "\t\t 注册使用者总数:  " + count_ppls() + "  个人在本游戏注册\n");
        write(NOR + WHT "\t\t 载入的物件总数:  " + sizeof( objects() ) + " 个物件\n");
        write(NOR + WHT "\t\t 心跳总数的资讯:  " + sizeof(heart_beats()) + " 个\n");
        write(NOR + WHT "\t\t 延迟呼叫数资讯:  " + sizeof(call_out_info()) + " 个\n");
        write(NOR + WHT "\t\t 系统负载的资讯:  " + query_load_average() + "\n");
        write(NOR + WHT "\t\t 讯息传输的资讯:  " + query_rusage_message() + "\n");
        write(NOR + WHT "\t\t 连续执行的时间:  " + dotime() + "\n");
        write(NOR + WHT "\t\t 游戏现在的状态:  " + STATUS + "\n" NOR);
        write(NOR + WHT "\t\t 游戏对 PK 限制:   每天不超过 8 人,每人不超过 2 次\n\n" NOR);

        me->set_temp("scan_time", time());

        return 1;
}
コード例 #2
0
ファイル: _mudstatus.c プロジェクト: ehershey/pd
int cmd_mudstatus() {
    int utime=uptime(), mem=memory_info(), i=0, ct=0;
    object *o;

    if(!archp(this_player())) return 0;
    write("%^BLUE%^+=+=+=+( %^BOLD%^%^WHITE%^Mud Status%^RESET%^%^BLUE%^ )+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=%^RESET%^");

    write("    The mud has been online for "+query_time(uptime())+"");
    write("    The mud will reboot in "+query_time((EVENTS_D->query_next_reboot())-time())+"");
    write("    Number of Objects Loaded:  "+i=sizeof(o=objects()));
    write("    "+add_commas(mem)+" bytes of memory is loaded.");
    while(i--) if(query_heart_beat(o[i])) ct++;
    write("    Number of objects with heartbeats: "+ct+".");
    write("    Number of callouts: "+sizeof(call_out_info())+".");
    write("    Processing "+query_load_average()+".");
    if(find_object("/d/nopk/standard/freezer"))
        write("    Number of link-dead players: "+
              sizeof( all_inventory( find_object( "/d/nopk/standard/freezer" ) ) ) );
    write("    Number of players online: "+(string)sizeof(users()));
    write("%^BLUE%^+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+%^RESET%^\n");
    return 1;
}
コード例 #3
0
ファイル: qload.c プロジェクト: huangleon/fy2005
int main()
{
    write(query_load_average() + "\n");
    return 1;
}
コード例 #4
0
ファイル: c_view2.c プロジェクト: szhowardhuang/fs2
void second( object *user , string str )
{
	int     i, count, state;
	string  list, CO, state_str, list2;
	user = sort_array(user, "sort_rank", this_object());
        i = sizeof(user);
        list = sprintf( HIG"《"HIY"%|10s"HIG"》"HIC" 线上帮众 "NOR"-\n", str );
	list+= "───────────────────────────────────────\n";
	count = 0;

        while( i-- )
        {
                switch(user[i]->query("clan/rank")) {
	case 1  :       CO = HIW + "Ψ";        break;
	case 2  :       CO = HIC + "ζ";        break;
        case 3  :       CO = HIY + "Φ";        break;
        case 4  :       CO = HIG + "卍";        break;
        case 5  :       CO = HIM + "Ξ";        break;
        case 6  :       CO = HIB + "∏";        break;
        case 7  :       CO = HIR + "Χ";        break;
		default :       CO = NOR + "?";        break;
		}

        if(this_player())
        if( wizardp(user[i]) && !wizardp(this_player()))
			continue;
		if( wiz_level(this_player())<6 && user[i]->query("env/隐身") && wiz_level(user[i]) && wiz_level(user[i]) > wiz_level(this_player()) )
		{
		 continue;
		}
		state = 0;
		state_str = "";
		count++;

                list = sprintf( "%s"HIC"【"NOR"%|10s"HIC"】"NOR"%s%|10s%s"NOR"",
			list,
                        area(user[i]),
                        CO,
                        (user[i]->query("clan/title") ? user[i]->query("clan/title") : "--无职衔--"), CO );
/*
		list2 = (user[i]->query("title") ? user[i]->query("title") : "" ) +
                        (user[i]->query("nickname") ? "「"+user[i]->query("nickname")+"”" : " " ) +
                        user[i]->query("name")+"("+user[i]->query("id")+")";
                if( strlen((list2))>80 )*/
                	list2 = (user[i]->query("nickname") ? "「"+user[i]->query("nickname")+"”" : " " ) +
                        	user[i]->query("name")+"("+user[i]->query("id")+")";
                list += list2;

		if( user[i]->query_temp("netdead") ) {
			state_str += HIR"(断线)"NOR;
			state = 1;
		}
		if( !environment(user[i]) ) {
			state_str += HIG"(异次元)"NOR;
			state = 1;
		}
		if( in_edit(user[i]) ) {
			state_str += HIY"(编辑)"NOR;
			state = 1;
		}
		if( in_input(user[i]) ) {
			state_str += HIC"(阅\读)"NOR;
			state = 1;
		}
		if( interactive(user[i]) && query_idle(user[i])>120 ) {
                	state_str += sprintf( "%s", HIM"(发呆 "+query_idle(user[i])/60+" 分钟)"NOR );
                	state = 1;
                }
                if( state ) list = list + /*"\t\t\t   " +*/ state_str;
                list += "\n";
        }

	list +=	"───────────────────────────────────────\n";
	list += sprintf( " 目前线上共有 %d 位帮众, 系统负担: %s\n\n", count, query_load_average() );

        this_player()->start_more(list);
}