/****************************************************************************
* [S]imulated [M]edieval [A]dventure multi[U]ser [G]ame | \\._.// *
* -----------------------------------------------------------| (0...0) *
* SMAUG 1.0 (C) 1994, 1995, 1996, 1998 by Derek Snider | ).:.( *
* -----------------------------------------------------------| {o o} *
* SMAUG code team: Thoric, Altrag, Blodkai, Narn, Haus, | / ' ' \ *
* Scryn, Rennard, Swordbearer, Gorog, Grishnakh, Nivek, |~'~.VxvxV.~'~*
* Tricops and Fireblade | *
* ------------------------------------------------------------------------ *
* Merc 2.1 Diku Mud improvments copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
* ------------------------------------------------------------------------ *
* Wizard/god command module *
****************************************************************************/
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include "mud.h"
#ifdef WIN32
#include <io.h>
#define F_OK 0
#endif
#define RESTORE_INTERVAL 21600
char * const save_flag[] =
{ "death", "kill", "passwd", "drop", "put", "give", "auto", "zap",
"auction", "get", "receive", "idle", "backup", "quitbackup", "fill",
"empty", "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", "r24",
"r25", "r26", "r27", "r28", "r29", "r30", "r31" };
/* from reset.c */
int generate_itemlevel args ( ( AREA_DATA *pArea, OBJ_INDEX_DATA *pObjIndex ));
/* from comm.c */
bool write_to_descriptor args( ( int desc, char *txt, int length ) );
bool check_parse_name args( ( char *name, bool newchar ) );
/* from boards.c */
void note_attach( CHAR_DATA *ch);
/* from build.c */
int get_risflag( char *flag );
int get_defenseflag( char *flag );
int get_attackflag( char *flag );
/* from tables.c */
void write_race_file( int ra );
/*
* Local functions.
*/
ROOM_INDEX_DATA * find_location args( ( CHAR_DATA *ch, char *arg ) );
void save_watchlist args( ( void ) );
void save_banlist args( ( void ) );
void close_area args( ( AREA_DATA *pArea ) );
int get_color (char *argument); /* function proto */
void sort_reserved args( ( RESERVE_DATA *pRes ) );
PROJECT_DATA * get_project_by_number args( ( int pnum ) );
NOTE_DATA * get_log_by_number args( ( PROJECT_DATA *pproject, int pnum ) );
/*
* Global variables.
*/
char reboot_time[50];
time_t new_boot_time_t;
extern struct tm new_boot_struct;
extern OBJ_INDEX_DATA *obj_index_hash[MAX_KEY_HASH];
extern MOB_INDEX_DATA *mob_index_hash[MAX_KEY_HASH];
int get_saveflag( char *name )
{
int x;
for ( x = 0; x < sizeof(save_flag) / sizeof(save_flag[0]); x++ )
if ( !str_cmp( name, save_flag[x] ) )
return x;
return -1;
}
/*
* Toggle "Do Not Disturb" flag. Used to prevent lower level imms from
* using commands like "trans" and "goto" on higher level imms.
*/
void do_dnd( CHAR_DATA *ch, char *argument )
{
if ( !IS_NPC(ch) && ch->pcdata )
if ( IS_SET(ch->pcdata->flags, PCFLAG_DND) )
{
REMOVE_BIT(ch->pcdata->flags, PCFLAG_DND);
send_to_char( "Your 'do not disturb' flag is now off.\n\r", ch );
}
else
{
SET_BIT(ch->pcdata->flags, PCFLAG_DND);
send_to_char( "Your 'do not disturb' flag is now on.\n\r", ch );
}
else
send_to_char( "huh?\n\r", ch );
}
/*
* The "watch" facility allows imms to specify the name of a player or
* the name of a site to be watched. It is like "logging" a player except
* the results are written to a file in the "watch" directory named with
* the same name as the imm. The idea is to allow lower level imms to
* watch players or sites without having to have access to the log files.
*/
void do_watch( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
char arg3[MAX_INPUT_LENGTH];
WATCH_DATA *pw;
if ( IS_NPC(ch) )
return;
argument = one_argument( argument, arg );
set_pager_color( AT_IMMORT, ch );
if ( arg[0] == '\0' || !str_cmp(arg, "help") )
{
send_to_pager("Syntax Examples:\n\r", ch);
/*
* Only IMP+ can see all the watches. The rest can just see their own.
*/
if ( get_trust(ch) >= LEVEL_IMPLEMENTOR )
send_to_pager(
" watch show all show all watches\n\r", ch);
send_to_pager(
" watch show show all my watches\n\r"
" watch size show the size of my watch file\n\r"
" watch player joe add a new player watch\n\r"
" watch site 2.3.123 add a new site watch\n\r"
" watch command make add a new command watch\n\r"
" watch site 2.3.12 matches 2.3.12x\n\r"
" watch site 2.3.12. matches 2.3.12.x\n\r"
" watch delete n delete my nth watch\n\r"
" watch print 500 print watch file starting at line 500\n\r"
" watch print 500 1000 print 1000 lines starting at line 500\n\r"
" watch clear clear my watch file\n\r",
ch);
return;
}
set_pager_color( AT_PLAIN, ch );
argument = one_argument(argument, arg2);
argument = one_argument(argument, arg3);
/*
* Clear watch file
*/
if ( !str_cmp(arg, "clear") )
{
char fname[MAX_INPUT_LENGTH];
sprintf( fname, "%s%s", WATCH_DIR, strlower( ch->name ) );
if ( 0==remove( fname ) )
{
send_to_pager( "Ok. Your watch file has been cleared.\n\r", ch);
return;
}
send_to_pager( "You have no valid watch file to clear.\n\r", ch);
return;
}
/*
* Display size of watch file
*/
if ( !str_cmp(arg, "size") )
{
FILE *fp;
char fname[MAX_INPUT_LENGTH], s[MAX_STRING_LENGTH];
int rec_count=0;
sprintf( fname, "%s%s", WATCH_DIR, strlower( ch->name ) );
if ( !(fp = fopen( fname, "r" )) )
{
send_to_pager(
"You have no watch file. Perhaps you cleared it?\n\r", ch );
return;
}
fgets( s, MAX_STRING_LENGTH, fp );
while( !feof(fp) )
{
rec_count++;
fgets( s, MAX_STRING_LENGTH, fp );
}
pager_printf( ch, "You have %d lines in your watch file.\n\r", rec_count);
fclose(fp);
return;
}
/*
* Print watch file
*/
if ( !str_cmp(arg, "print") )
{
FILE *fp;
char fname[MAX_INPUT_LENGTH], s[MAX_STRING_LENGTH];
const int MAX_DISPLAY_LINES = 1000;
int start, limit, disp_count=0, rec_count=0;
if ( arg2[0] == '\0' )
{
send_to_pager(
"Sorry. You must specify a starting line number.\n\r", ch);
return;
}
start = atoi(arg2);
limit = (arg3[0]=='\0') ? MAX_DISPLAY_LINES : atoi(arg3);
limit = UMIN( limit, MAX_DISPLAY_LINES);
sprintf( fname, "%s%s", WATCH_DIR, strlower( ch->name ) );
if ( !(fp = fopen( fname, "r" )) )
return;
fgets( s, MAX_STRING_LENGTH, fp );
while( (disp_count<limit) && (!feof(fp)) )
{
if ( ++rec_count >= start )
{
send_to_pager( s, ch );
disp_count++;
}
fgets( s, MAX_STRING_LENGTH, fp );
}
send_to_pager( "\n\r", ch );
if ( disp_count >= MAX_DISPLAY_LINES )
send_to_pager(
"Maximum display lines exceeded. List is terminated.\n\r"
"Type 'help watch' to see how to print the rest of the list.\n\r"
"\n\r"
"Your watch file is large. Perhaps y
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 76 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
- yzyz5452014-02-21不会用,不好用。
- Sheneyan2012-09-29代码不全,很不好用~
- jackson9192014-05-19缺文件! 不能运行
![avatar](https://profile-avatar.csdnimg.cn/17d558433e6b4ff8ae875d566ca4506b_jonaph.jpg!1)
jonaph
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)