mirror of
https://github.com/tbamud/tbamud.git
synced 2025-09-21 21:40:49 +02:00
Migrated away from using asctime() and ctime() - in favor of strftime().
Added year to several datestamps. Unbounded dates are locale-specific. - Minor re-formatting was needed for STAT PLAYER and SHOW PLAYER. The 'slay' feature of do_kill now requires a GRGOD or higher. 'last *' and 'last all' are now synonyms.
This commit is contained in:
parent
ffead13dc1
commit
5119361f15
10 changed files with 178 additions and 176 deletions
|
@ -286,21 +286,21 @@ AC-CONFIDENCE ARMOR-CLASS ARMOUR-CLASS AC-APPLY
|
|||
is at protecting you. When you don armor, any AC apply that armor has is
|
||||
subtracted from your standard (naked) AC value, modified depending on where on
|
||||
the body you are wearing the armor. Some items have a special bonus, and
|
||||
subtract from the AC directly. Negative AC is better. Modifiers: Body X3,
|
||||
head and legs X2.
|
||||
subtract from the AC directly. Negative AC is better.
|
||||
|
||||
See also: MEDIT-AC
|
||||
#31
|
||||
See Also: ARMOR-SPELL
|
||||
#0
|
||||
AC-CONFIDENCE ARMOR-CLASS ARMOUR-CLASS AC-APPLY
|
||||
|
||||
Your Armor Class (often called AC) is an expression for how good your armor
|
||||
is at protecting you. When you don armor, any AC apply that armor has is
|
||||
subtracted from your standard (naked) AC value, modified depending on where on
|
||||
the body you are wearing the armor. Some items have a special bonus, and
|
||||
subtract from the AC directly. Negative AC is better.
|
||||
subtract from the AC directly. Negative AC is better. Modifiers: Body X3,
|
||||
head and legs X2.
|
||||
|
||||
See Also: ARMOR-SPELL
|
||||
#0
|
||||
See also: MEDIT-AC
|
||||
#31
|
||||
ACRONYMS TERMINOLOGY VOCABULARY
|
||||
|
||||
Here are some common terms used in building, and TBA zone:
|
||||
|
@ -1184,36 +1184,6 @@ NOTE: Buildwalk does not autosave on exit. You must type SAVEALL. This way if
|
|||
|
||||
See also: TOGGLE, SAVEALL, REDIT, OLC, RLIST, DIG
|
||||
#31
|
||||
BULLETINS BOARDS BULLETIN-BOARDS MESSAGE-BOARDS POSTING
|
||||
|
||||
Bulletin boards are the forum of inter-player communication on the MUD.
|
||||
There are different bulletin boards for different purposes -- for example,
|
||||
a standard mortal board, a board for immortals, a board for fun "social"
|
||||
messages, etc. Naturally, not all players may be allowed to read all
|
||||
types of boards.
|
||||
|
||||
Type "LOOK BOARD" to see the messages already posted on a board. Type
|
||||
"WRITE <subject>" to post a message to a board; terminate a message with
|
||||
a '/s' as the first characters on a line. Type "READ <number>" to read a
|
||||
post. Type "REMOVE <number>" to remove your own messages.
|
||||
|
||||
Examples:
|
||||
> look at board
|
||||
> write Crash Bug I found!
|
||||
[writes the message; terminates with '/s']
|
||||
> look at board
|
||||
> read 6
|
||||
> remove 6
|
||||
|
||||
Boards are just a normal object with a special procedure attached in the
|
||||
MUD's code. Ask your friendly implementor if you need to make one.
|
||||
|
||||
@uRoom - Board@n
|
||||
1204 - Immortal Board
|
||||
1290 - Social Board
|
||||
|
||||
See also: MAIL, READ, WRITE, SPECIALS
|
||||
#31
|
||||
BULLETINS BOARDS BULLETIN-BOARDS MESSAGE-BOARDS
|
||||
|
||||
Bulletin boards are the forum of inter-player communication on the MUD.
|
||||
|
@ -1244,6 +1214,36 @@ MUD's code. Ask your friendly implementor if you need to make one.
|
|||
|
||||
See also: MAIL, READ, WRITE
|
||||
#0
|
||||
BULLETINS BOARDS BULLETIN-BOARDS MESSAGE-BOARDS POSTING
|
||||
|
||||
Bulletin boards are the forum of inter-player communication on the MUD.
|
||||
There are different bulletin boards for different purposes -- for example,
|
||||
a standard mortal board, a board for immortals, a board for fun "social"
|
||||
messages, etc. Naturally, not all players may be allowed to read all
|
||||
types of boards.
|
||||
|
||||
Type "LOOK BOARD" to see the messages already posted on a board. Type
|
||||
"WRITE <subject>" to post a message to a board; terminate a message with
|
||||
a '/s' as the first characters on a line. Type "READ <number>" to read a
|
||||
post. Type "REMOVE <number>" to remove your own messages.
|
||||
|
||||
Examples:
|
||||
> look at board
|
||||
> write Crash Bug I found!
|
||||
[writes the message; terminates with '/s']
|
||||
> look at board
|
||||
> read 6
|
||||
> remove 6
|
||||
|
||||
Boards are just a normal object with a special procedure attached in the
|
||||
MUD's code. Ask your friendly implementor if you need to make one.
|
||||
|
||||
@uRoom - Board@n
|
||||
1204 - Immortal Board
|
||||
1290 - Social Board
|
||||
|
||||
See also: MAIL, READ, WRITE, SPECIALS
|
||||
#31
|
||||
BURNING-HANDS
|
||||
|
||||
Usage : cast 'burning hands' <victim>
|
||||
|
@ -1989,29 +1989,6 @@ See also: REMOTE
|
|||
#31
|
||||
CONTROL-WEATHER
|
||||
|
||||
Usage : cast 'control weather' <'better' | 'worse'>
|
||||
Accumulative: Yes
|
||||
|
||||
This spell will change the "course" of the current weather.
|
||||
|
||||
Example:
|
||||
|
||||
> cast 'control wea' worse
|
||||
See also: %WEATHER%, WEATHER
|
||||
#31
|
||||
CONTROL-WEATHER
|
||||
|
||||
Usage : cast 'control weather' <'better' | 'worse'>
|
||||
Accumulative: Yes
|
||||
|
||||
This spell will change the "course" of the current weather.
|
||||
|
||||
Example:
|
||||
|
||||
> cast 'control wea' worse
|
||||
#0
|
||||
CONTROL-WEATHER
|
||||
|
||||
Usage : cast 'control weather' <'better' | 'worse'>
|
||||
Accumulative: Yes
|
||||
Duration : -
|
||||
|
@ -2023,6 +2000,29 @@ Example:
|
|||
|
||||
> cast 'control wea' worse
|
||||
#0
|
||||
CONTROL-WEATHER
|
||||
|
||||
Usage : cast 'control weather' <'better' | 'worse'>
|
||||
Accumulative: Yes
|
||||
|
||||
This spell will change the "course" of the current weather.
|
||||
|
||||
Example:
|
||||
|
||||
> cast 'control wea' worse
|
||||
#0
|
||||
CONTROL-WEATHER
|
||||
|
||||
Usage : cast 'control weather' <'better' | 'worse'>
|
||||
Accumulative: Yes
|
||||
|
||||
This spell will change the "course" of the current weather.
|
||||
|
||||
Example:
|
||||
|
||||
> cast 'control wea' worse
|
||||
See also: %WEATHER%, WEATHER
|
||||
#31
|
||||
COPYOVERS
|
||||
|
||||
Usage: copyover
|
||||
|
@ -4252,7 +4252,7 @@ all the / commands do).
|
|||
#31
|
||||
LAST LASTLISTS
|
||||
|
||||
Usage: last [player_name | all] [#]
|
||||
Usage: last [[#] [player_name] | all | *]
|
||||
|
||||
For checking the last time(s) a person logged on, their sitename, and their
|
||||
ID number. This now works similar to the unix version of 'last'. This will
|
||||
|
@ -10256,6 +10256,27 @@ TNL
|
|||
An acronym for to next level. The amount of experience required before you
|
||||
can attain the next level.
|
||||
|
||||
#0
|
||||
TOGGLES CONFIGURE SETTINGS
|
||||
|
||||
Usage: toggle
|
||||
toggle <option> <argument>
|
||||
|
||||
TOGGLE shows you the current values of various toggles available on the MUD.
|
||||
This command can also be used to change these values, if used with the correct
|
||||
argument. When a toggle is set, it will be saved in that state until the next
|
||||
time you change it.
|
||||
|
||||
Hit Pnt Display: OFF Brief: OFF Summonable: OFF
|
||||
Move Display: OFF Compact: ON Quest: OFF
|
||||
Mana Display: OFF NoTell: OFF NoRepeat: OFF
|
||||
AutoExits: OFF NoShout: OFF Wimpy: OFF
|
||||
NoGossip: OFF NoAuction: OFF NoGrats: OFF
|
||||
AutoLoot: ON AutoGold: ON AutoSplit: ON
|
||||
AutoSac: ON AutoAssist: ON AFK: OFF
|
||||
Pagelength: 23 Color: off
|
||||
|
||||
See also: DISPLAY, NOSHOUT, NOSUMM, NOTELL, QUEST, REPEAT, WIMP
|
||||
#0
|
||||
TOGGLES CONFIGURE SETTINGS
|
||||
|
||||
|
@ -10281,27 +10302,6 @@ Hit Pnt Display: OFF Brief: OFF Summonable: OFF
|
|||
Pagelength: 32 Screenwidth: 80 AFK: OFF
|
||||
Autokey: OFF Autodoor: OFF Color: on
|
||||
|
||||
See also: DISPLAY, NOSHOUT, NOSUMM, NOTELL, QUEST, REPEAT, WIMP
|
||||
#0
|
||||
TOGGLES CONFIGURE SETTINGS
|
||||
|
||||
Usage: toggle
|
||||
toggle <option> <argument>
|
||||
|
||||
TOGGLE shows you the current values of various toggles available on the MUD.
|
||||
This command can also be used to change these values, if used with the correct
|
||||
argument. When a toggle is set, it will be saved in that state until the next
|
||||
time you change it.
|
||||
|
||||
Hit Pnt Display: OFF Brief: OFF Summonable: OFF
|
||||
Move Display: OFF Compact: ON Quest: OFF
|
||||
Mana Display: OFF NoTell: OFF NoRepeat: OFF
|
||||
AutoExits: OFF NoShout: OFF Wimpy: OFF
|
||||
NoGossip: OFF NoAuction: OFF NoGrats: OFF
|
||||
AutoLoot: ON AutoGold: ON AutoSplit: ON
|
||||
AutoSac: ON AutoAssist: ON AFK: OFF
|
||||
Pagelength: 23 Color: off
|
||||
|
||||
See also: DISPLAY, NOSHOUT, NOSUMM, NOTELL, QUEST, REPEAT, WIMP
|
||||
#0
|
||||
TRACK TRAIL
|
||||
|
|
|
@ -996,7 +996,6 @@ ACMD(do_time)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
send_to_char(ch, "The %d%s Day of the %s, Year %d.\r\n",
|
||||
day, suf, month_name[time_info.month], time_info.year);
|
||||
}
|
||||
|
@ -1363,7 +1362,7 @@ ACMD(do_who)
|
|||
ACMD(do_users)
|
||||
{
|
||||
char line[200], line2[220], idletime[10], classname[20];
|
||||
char state[30], *timeptr, mode;
|
||||
char state[30], timestr[9], mode;
|
||||
char name_search[MAX_INPUT_LENGTH], host_search[MAX_INPUT_LENGTH];
|
||||
struct char_data *tch;
|
||||
struct descriptor_data *d;
|
||||
|
@ -1463,9 +1462,7 @@ ACMD(do_users)
|
|||
} else
|
||||
strcpy(classname, " - ");
|
||||
|
||||
timeptr = asctime(localtime(&d->login_time));
|
||||
timeptr += 11;
|
||||
*(timeptr + 8) = '\0';
|
||||
strftime(timestr, sizeof(timestr), "%H:%M:%S", localtime(&(d->login_time)));
|
||||
|
||||
if (STATE(d) == CON_PLAYING && d->original)
|
||||
strcpy(state, "Switched");
|
||||
|
@ -1482,7 +1479,7 @@ ACMD(do_users)
|
|||
d->original && d->original->player.name ? d->original->player.name :
|
||||
d->character && d->character->player.name ? d->character->player.name :
|
||||
"UNDEFINED",
|
||||
state, idletime, timeptr);
|
||||
state, idletime, timestr);
|
||||
|
||||
if (d->host && *d->host)
|
||||
sprintf(line + strlen(line), "[%s]\r\n", d->host);
|
||||
|
@ -2405,8 +2402,7 @@ ACMD(do_whois)
|
|||
send_to_char(ch, "Level: %d\r\n", GET_LEVEL(victim));
|
||||
|
||||
if (!(GET_LEVEL(victim) < LVL_IMMORT) || (GET_LEVEL(ch) >= GET_LEVEL(victim))) {
|
||||
strcpy (buf, (char *) asctime(localtime(&(victim->player.time.logon))));
|
||||
buf[10] = '\0';
|
||||
strftime(buf, sizeof(buf), "%a %b %d %Y", localtime(&(victim->player.time.logon)));
|
||||
|
||||
hours = (time(0) - victim->player.time.logon) / 3600;
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ ACMD(do_kill)
|
|||
char arg[MAX_INPUT_LENGTH];
|
||||
struct char_data *vict;
|
||||
|
||||
if (GET_LEVEL(ch) < LVL_IMMORT || IS_NPC(ch) || !PRF_FLAGGED(ch, PRF_NOHASSLE)) {
|
||||
if (GET_LEVEL(ch) < LVL_GRGOD || IS_NPC(ch) || !PRF_FLAGGED(ch, PRF_NOHASSLE)) {
|
||||
do_hit(ch, argument, cmd, subcmd);
|
||||
return;
|
||||
}
|
||||
|
|
123
src/act.wizard.c
123
src/act.wizard.c
|
@ -764,16 +764,14 @@ static void do_stat_character(struct char_data *ch, struct char_data *k)
|
|||
if (!IS_NPC(k)) {
|
||||
char buf1[64], buf2[64];
|
||||
|
||||
strlcpy(buf1, asctime(localtime(&(k->player.time.birth))), sizeof(buf1));
|
||||
strlcpy(buf2, asctime(localtime(&(k->player.time.logon))), sizeof(buf2));
|
||||
buf1[10] = buf2[10] = '\0';
|
||||
strftime(buf1, sizeof(buf1), "%a %b %d %Y", localtime(&(k->player.time.birth)));
|
||||
strftime(buf2, sizeof(buf2), "%a %b %d %Y", localtime(&(k->player.time.logon)));
|
||||
|
||||
send_to_char(ch, "Created: [%s], Last Logon: [%s], Played [%dh %dm], Age [%d]\r\n",
|
||||
buf1, buf2, k->player.time.played / 3600,
|
||||
((k->player.time.played % 3600) / 60), age(k)->year);
|
||||
send_to_char(ch, "Created: [%s], Last Logon: [%s]\r\n", buf1, buf2);
|
||||
|
||||
send_to_char(ch, "STL[%d]/per[%d]/NSTL[%d]",
|
||||
GET_PRACTICES(k), int_app[GET_INT(k)].learn,
|
||||
send_to_char(ch, "Played: [%dh %dm], Age: [%d], STL[%d]/per[%d]/NSTL[%d]",
|
||||
k->player.time.played / 3600, (k->player.time.played % 3600) / 60,
|
||||
age(k)->year, GET_PRACTICES(k), int_app[GET_INT(k)].learn,
|
||||
wis_app[GET_WIS(k)].bonus);
|
||||
/* Display OLC zone for immorts. */
|
||||
if (GET_LEVEL(k) >= LVL_BUILDER) {
|
||||
|
@ -1766,7 +1764,7 @@ ACMD(do_wizlock)
|
|||
|
||||
ACMD(do_date)
|
||||
{
|
||||
char *tmstr;
|
||||
char timestr[25];
|
||||
time_t mytime;
|
||||
int d, h, m;
|
||||
|
||||
|
@ -1775,18 +1773,17 @@ ACMD(do_date)
|
|||
else
|
||||
mytime = boot_time;
|
||||
|
||||
tmstr = (char *) asctime(localtime(&mytime));
|
||||
*(tmstr + strlen(tmstr) - 1) = '\0';
|
||||
strftime(timestr, sizeof(timestr), "%c", localtime(&mytime));
|
||||
|
||||
if (subcmd == SCMD_DATE)
|
||||
send_to_char(ch, "Current machine time: %s\r\n", tmstr);
|
||||
send_to_char(ch, "Current machine time: %s\r\n", timestr);
|
||||
else {
|
||||
mytime = time(0) - boot_time;
|
||||
d = mytime / 86400;
|
||||
h = (mytime / 3600) % 24;
|
||||
m = (mytime / 60) % 60;
|
||||
|
||||
send_to_char(ch, "Up since %s: %d day%s, %d:%02d\r\n", tmstr, d, d == 1 ? "" : "s", h, m);
|
||||
send_to_char(ch, "Up since %s: %d day%s, %d:%02d\r\n", timestr, d, d == 1 ? "" : "s", h, m);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1977,6 +1974,7 @@ void list_llog_entries(struct char_data *ch)
|
|||
FILE *fp;
|
||||
struct last_entry llast;
|
||||
int i;
|
||||
char timestr[25];
|
||||
|
||||
if(!(fp=fopen(LAST_FILE,"r"))) {
|
||||
log("bad things.");
|
||||
|
@ -1985,9 +1983,11 @@ void list_llog_entries(struct char_data *ch)
|
|||
send_to_char(ch, "Last log\r\n");
|
||||
i = fread(&llast, sizeof(struct last_entry), 1, fp);
|
||||
|
||||
strftime(timestr, sizeof(timestr), "%a %b %d %Y %H:%M:%S", localtime(&llast.time));
|
||||
|
||||
while(!feof(fp)) {
|
||||
send_to_char(ch, "%10s\t%d\t%s\t%s", llast.username, llast.punique,
|
||||
last_array[llast.close_type], ctime(&llast.time));
|
||||
send_to_char(ch, "%10s\t%d\t%s\t%s\r\n", llast.username, llast.punique,
|
||||
last_array[llast.close_type], timestr);
|
||||
i = fread(&llast, sizeof(struct last_entry), 1, fp);
|
||||
}
|
||||
}
|
||||
|
@ -2005,12 +2005,13 @@ static struct char_data *is_in_game(long idnum) {
|
|||
|
||||
ACMD(do_last)
|
||||
{
|
||||
char arg[MAX_INPUT_LENGTH], name[MAX_INPUT_LENGTH];
|
||||
char arg[MAX_INPUT_LENGTH], name[MAX_INPUT_LENGTH], timestr[25], to[6];
|
||||
char deltastr[6];
|
||||
time_t delta;
|
||||
struct char_data *vict = NULL;
|
||||
struct char_data *temp;
|
||||
int recs, i, num = 0;
|
||||
FILE *fp;
|
||||
time_t delta;
|
||||
struct last_entry mlast;
|
||||
|
||||
*name = '\0';
|
||||
|
@ -2018,7 +2019,7 @@ ACMD(do_last)
|
|||
if (*argument) { /* parse it */
|
||||
half_chop(argument, arg, argument);
|
||||
while (*arg) {
|
||||
if ((*arg == '*') && (GET_LEVEL(ch) == LVL_IMPL)) {
|
||||
if ((*arg == '*' || !strcmp(arg, "all")) && (GET_LEVEL(ch) == LVL_IMPL)) {
|
||||
list_llog_entries(ch);
|
||||
return;
|
||||
}
|
||||
|
@ -2043,11 +2044,12 @@ ACMD(do_last)
|
|||
return;
|
||||
}
|
||||
|
||||
send_to_char(ch, "[%5ld] [%2d %s] %-12s : %-18s : %-20s\r\n",
|
||||
strftime(timestr, sizeof(timestr), "%a %b %d %H:%M:%S %Y", localtime(&(vict->player.time.logon)));
|
||||
|
||||
send_to_char(ch, "[%5ld] [%2d %s] %-12s : %-18s : %-24s\r\n",
|
||||
GET_IDNUM(vict), (int) GET_LEVEL(vict),
|
||||
class_abbrevs[(int) GET_CLASS(vict)], GET_NAME(vict),
|
||||
GET_HOST(vict) && *GET_HOST(vict) ? GET_HOST(vict) : "(NOHOST)",
|
||||
ctime(&vict->player.time.logon));
|
||||
GET_HOST(vict) && *GET_HOST(vict) ? GET_HOST(vict) : "(NOHOST)", timestr);
|
||||
free_char(vict);
|
||||
return;
|
||||
}
|
||||
|
@ -2069,15 +2071,18 @@ ACMD(do_last)
|
|||
i = fread(&mlast,sizeof(struct last_entry),1,fp);
|
||||
fseek(fp,-1*((long)sizeof(struct last_entry)),SEEK_CUR);
|
||||
if(!*name ||(*name && !str_cmp(name, mlast.username))) {
|
||||
send_to_char(ch,"%10.10s %20.20s %16.16s - ",
|
||||
mlast.username, mlast.hostname, ctime(&mlast.time));
|
||||
strftime(timestr, sizeof(timestr), "%a %b %d %Y %H:%M", localtime(&mlast.time));
|
||||
send_to_char(ch,"%10.10s %20.20s %20.21s - ",
|
||||
mlast.username, mlast.hostname, timestr);
|
||||
if((temp=is_in_game(mlast.idnum)) && mlast.punique == GET_PREF(temp)) {
|
||||
send_to_char(ch, "Still Playing ");
|
||||
} else {
|
||||
send_to_char(ch, "%5.5s ",ctime(&mlast.close_time)+11);
|
||||
delta=mlast.close_time - mlast.time;
|
||||
send_to_char(ch, "(%5.5s) ",asctime(gmtime(&delta))+11);
|
||||
send_to_char(ch, "%s", last_array[mlast.close_type]);
|
||||
delta = mlast.close_time - mlast.time;
|
||||
strftime(to, sizeof(to), "%H:%M", localtime(&mlast.close_time));
|
||||
strftime(deltastr, sizeof(deltastr), "%H:%M", gmtime(&delta));
|
||||
|
||||
send_to_char(ch, "%5.5s (%5.5s) %s", to, deltastr,
|
||||
last_array[mlast.close_type]);
|
||||
}
|
||||
|
||||
send_to_char(ch, "\r\n");
|
||||
|
@ -2543,7 +2548,9 @@ ACMD(do_show)
|
|||
break;
|
||||
|
||||
/* show player */
|
||||
case 2:
|
||||
case 2: {
|
||||
char buf1[64], buf2[64];
|
||||
|
||||
if (!*value) {
|
||||
send_to_char(ch, "A name would help.\r\n");
|
||||
return;
|
||||
|
@ -2558,22 +2565,24 @@ ACMD(do_show)
|
|||
free_char(vict);
|
||||
return;
|
||||
}
|
||||
|
||||
strftime(buf1, sizeof(buf1), "%a %b %d %H:%M:%S %Y", localtime(&(vict->player.time.birth)));
|
||||
strftime(buf2, sizeof(buf2), "%a %b %d %H:%H:%S %Y", localtime(&(vict->player.time.logon)));
|
||||
|
||||
send_to_char(ch, "Player: %-12s (%s) [%2d %s]\r\n", GET_NAME(vict),
|
||||
genders[(int) GET_SEX(vict)], GET_LEVEL(vict), class_abbrevs[(int)
|
||||
GET_CLASS(vict)]);
|
||||
send_to_char(ch, "Au: %-8d Bal: %-8d Exp: %-8d Align: %-5d Lessons: %-3d\r\n",
|
||||
GET_GOLD(vict), GET_BANK_GOLD(vict), GET_EXP(vict),
|
||||
GET_ALIGNMENT(vict), GET_PRACTICES(vict));
|
||||
|
||||
/* ctime() uses static buffer: do not combine. */
|
||||
send_to_char(ch, "Started: %-20.16s ", ctime(&vict->player.time.birth));
|
||||
send_to_char(ch, "Last: %-20.16s Played: %3dh %2dm\r\n",
|
||||
ctime(&vict->player.time.logon),
|
||||
send_to_char(ch, "Gold: %-8d Bal: %-8d Exp: %-8d Align: %-5d Lessons: %-3d\r\n",
|
||||
GET_GOLD(vict), GET_BANK_GOLD(vict), GET_EXP(vict),
|
||||
GET_ALIGNMENT(vict), GET_PRACTICES(vict));
|
||||
send_to_char(ch, "Started: %-25.25s Last: %-25.25s\r\n", buf1, buf2);
|
||||
send_to_char(ch, "Played: %dh %dm\r\n",
|
||||
(int) (vict->player.time.played / 3600),
|
||||
(int) (vict->player.time.played / 60 % 60));
|
||||
|
||||
free_char(vict);
|
||||
break;
|
||||
|
||||
}
|
||||
/* show rent */
|
||||
case 3:
|
||||
if (!*value) {
|
||||
|
@ -4412,7 +4421,7 @@ ACMD(do_file)
|
|||
ACMD(do_changelog)
|
||||
{
|
||||
time_t rawtime;
|
||||
char tmstr[MAX_INPUT_LENGTH], line[READ_SIZE], last_buf[READ_SIZE],
|
||||
char timestr[12], line[READ_SIZE], last_buf[READ_SIZE],
|
||||
buf[READ_SIZE];
|
||||
FILE *fl, *new;
|
||||
|
||||
|
@ -4452,9 +4461,9 @@ ACMD(do_changelog)
|
|||
}
|
||||
|
||||
rawtime = time(0);
|
||||
strftime(tmstr, sizeof(tmstr), "%b %d %Y", localtime(&rawtime));
|
||||
strftime(timestr, sizeof(timestr), "%b %d %Y", localtime(&rawtime));
|
||||
|
||||
sprintf(buf, "[%s] - %s", tmstr, GET_NAME(ch));
|
||||
sprintf(buf, "[%s] - %s", timestr, GET_NAME(ch));
|
||||
|
||||
fprintf(new, "%s\n", buf);
|
||||
fprintf(new, " %s\n", argument);
|
||||
|
@ -4476,7 +4485,7 @@ ACMD(do_changelog)
|
|||
ACMD(do_plist)
|
||||
{
|
||||
int i, len = 0, count = 0;
|
||||
char mode, buf[MAX_STRING_LENGTH * 20], name_search[MAX_NAME_LENGTH], time_str[MAX_STRING_LENGTH];
|
||||
char mode, buf[MAX_STRING_LENGTH * 20], name_search[MAX_NAME_LENGTH], timestr[MAX_STRING_LENGTH];
|
||||
struct time_info_data time_away;
|
||||
int low = 0, high = LVL_IMPL, low_day = 0, high_day = 10000, low_hr = 0, high_hr = 24;
|
||||
|
||||
|
@ -4549,12 +4558,11 @@ ACMD(do_plist)
|
|||
if (time_away.hours > high_hr || time_away.hours < low_hr)
|
||||
continue;
|
||||
|
||||
strcpy(time_str, asctime(localtime(&player_table[i].last)));
|
||||
time_str[strlen(time_str) - 1] = '\0';
|
||||
strftime(timestr, sizeof(timestr), "%c", localtime(&player_table[i].last));
|
||||
|
||||
len += snprintf(buf + len, sizeof(buf) - len, "[%3ld] (%2d) %c%-15s %s\r\n",
|
||||
player_table[i].id, player_table[i].level,
|
||||
UPPER(*player_table[i].name), player_table[i].name + 1, time_str);
|
||||
UPPER(*player_table[i].name), player_table[i].name + 1, timestr);
|
||||
count++;
|
||||
}
|
||||
snprintf(buf + len, sizeof(buf) - len, "%s-------------------------------------%s\r\n"
|
||||
|
@ -4949,7 +4957,7 @@ void free_recent_players(void)
|
|||
ACMD(do_recent)
|
||||
{
|
||||
time_t ct;
|
||||
char *tmstr, arg[MAX_INPUT_LENGTH];
|
||||
char timestr[MAX_INPUT_LENGTH], arg[MAX_INPUT_LENGTH];
|
||||
int hits = 0, limit = 0, count = 0;
|
||||
struct recent_player *this;
|
||||
bool loc;
|
||||
|
@ -4962,9 +4970,9 @@ ACMD(do_recent)
|
|||
}
|
||||
|
||||
if (GET_LEVEL(ch) >= LVL_GRGOD) { /* If High-Level Imm, then show Host IP */
|
||||
send_to_char(ch, " ID | DATE/TIME | HOST IP | Player Name\r\n");
|
||||
send_to_char(ch, " ID | DATE/TIME | HOST IP | Player Name\r\n");
|
||||
} else {
|
||||
send_to_char(ch, " ID | DATE/TIME | Player Name\r\n");
|
||||
send_to_char(ch, " ID | DATE/TIME | Player Name\r\n");
|
||||
}
|
||||
|
||||
this = recent_list;
|
||||
|
@ -4973,8 +4981,8 @@ ACMD(do_recent)
|
|||
loc = FALSE;
|
||||
hits++;
|
||||
ct = this->time;
|
||||
tmstr = asctime(localtime(&ct));
|
||||
*(tmstr + strlen(tmstr) - 1) = '\0'; /* Cut off last char */
|
||||
strftime(timestr, sizeof(timestr), "%a %b %d %H:%M:%S %Y", localtime(&ct));
|
||||
|
||||
if (this->host && *(this->host)) {
|
||||
if (!strcmp(this->host, "localhost")) loc = TRUE;
|
||||
}
|
||||
|
@ -4984,21 +4992,21 @@ ACMD(do_recent)
|
|||
if (GET_LEVEL(ch) >= LVL_GRGOD) /* If High-Level Imm, then show Host IP */
|
||||
{
|
||||
if (this->new_player == TRUE) {
|
||||
send_to_char(ch, "%3d | %-19.19s | %s%-37s%s | %s %s(New Player)%s\r\n", this->vnum, tmstr, loc ? QRED : "", this->host, QNRM, this->name, QYEL, QNRM);
|
||||
send_to_char(ch, "%3d | %-24.24s | %s%-32s%s | %s %s(New Player)%s\r\n", this->vnum, timestr, loc ? QRED : "", this->host, QNRM, this->name, QYEL, QNRM);
|
||||
} else if (this->copyover_player == TRUE) {
|
||||
send_to_char(ch, "%3d | %-19.19s | %s%-37s%s | %s %s(Copyover)%s\r\n", this->vnum, tmstr, loc ? QRED : "", this->host, QNRM, this->name, QCYN, QNRM);
|
||||
send_to_char(ch, "%3d | %-24.24s | %s%-32s%s | %s %s(Copyover)%s\r\n", this->vnum, timestr, loc ? QRED : "", this->host, QNRM, this->name, QCYN, QNRM);
|
||||
} else {
|
||||
send_to_char(ch, "%3d | %-19.19s | %s%-37s%s | %s\r\n", this->vnum, tmstr, loc ? QRED : "", this->host, QNRM, this->name);
|
||||
send_to_char(ch, "%3d | %-24.24s | %s%-32s%s | %s\r\n", this->vnum, timestr, loc ? QRED : "", this->host, QNRM, this->name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this->new_player == TRUE) {
|
||||
send_to_char(ch, "%3d | %-19.19s | %s %s(New Player)%s\r\n", this->vnum, tmstr, this->name, QYEL, QNRM);
|
||||
send_to_char(ch, "%3d | %-24.24s | %s %s(New Player)%s\r\n", this->vnum, timestr, this->name, QYEL, QNRM);
|
||||
} else if (this->copyover_player == TRUE) {
|
||||
send_to_char(ch, "%3d | %-19.19s | %s %s(Copyover)%s\r\n", this->vnum, tmstr, this->name, QCYN, QNRM);
|
||||
send_to_char(ch, "%3d | %-24.24s | %s %s(Copyover)%s\r\n", this->vnum, timestr, this->name, QCYN, QNRM);
|
||||
} else {
|
||||
send_to_char(ch, "%3d | %-19.19s | %s\r\n", this->vnum, tmstr, this->name);
|
||||
send_to_char(ch, "%3d | %-24.24s | %s\r\n", this->vnum, timestr, this->name);
|
||||
}
|
||||
}
|
||||
count++;
|
||||
|
@ -5012,9 +5020,8 @@ ACMD(do_recent)
|
|||
}
|
||||
|
||||
ct = time(0); /* Grab the current time */
|
||||
tmstr = asctime(localtime(&ct));
|
||||
*(tmstr + strlen(tmstr) - 1) = '\0';
|
||||
send_to_char(ch, "Current Server Time: %-19.19s\r\nShowing %d players since last copyover/reboot\r\n", tmstr, hits);
|
||||
strftime(timestr, sizeof(timestr), "%c", localtime(&ct));
|
||||
send_to_char(ch, "Current Server Time: %s\r\nShowing %d players since last copyover/reboot\r\n", timestr, hits);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ static void write_ban_list(void)
|
|||
return;
|
||||
}
|
||||
|
||||
#define BAN_LIST_FORMAT "%-25.25s %-8.8s %-10.10s %-16.16s\r\n"
|
||||
#define BAN_LIST_FORMAT "%-25.25s %-8.8s %-15.15s %-16.16s\r\n"
|
||||
ACMD(do_ban)
|
||||
{
|
||||
char flag[MAX_INPUT_LENGTH], site[MAX_INPUT_LENGTH], *nextchar;
|
||||
|
@ -144,8 +144,7 @@ ACMD(do_ban)
|
|||
|
||||
for (ban_node = ban_list; ban_node; ban_node = ban_node->next) {
|
||||
if (ban_node->date) {
|
||||
strlcpy(timestr, asctime(localtime(&(ban_node->date))), 10);
|
||||
timestr[10] = '\0';
|
||||
strftime(timestr, sizeof(timestr), "%a %b %d %Y", localtime(&(ban_node->date)));
|
||||
} else
|
||||
strcpy(timestr, "Unknown"); /* strcpy: OK (strlen("Unknown") < 16) */
|
||||
|
||||
|
|
20
src/house.c
20
src/house.c
|
@ -291,7 +291,7 @@ const char *HCONTROL_FORMAT =
|
|||
void hcontrol_list_houses(struct char_data *ch, char *arg)
|
||||
{
|
||||
int i;
|
||||
char *timestr, *temp;
|
||||
char *temp;
|
||||
char built_on[128], last_pay[128], own_name[MAX_NAME_LENGTH + 1];
|
||||
|
||||
if (arg && *arg) {
|
||||
|
@ -315,8 +315,8 @@ void hcontrol_list_houses(struct char_data *ch, char *arg)
|
|||
return;
|
||||
}
|
||||
send_to_char(ch,
|
||||
"Address Atrium Build Date Guests Owner Last Paymt\r\n"
|
||||
"------- ------ ---------- ------ ------------ ----------\r\n");
|
||||
"Address Atrium Build Date Guests Owner Last Paymt\r\n"
|
||||
"------- ------ --------------- ------ ------------ ---------------\r\n");
|
||||
|
||||
for (i = 0; i < num_of_houses; i++) {
|
||||
/* Avoid seeing <UNDEF> entries from self-deleted people. -gg 6/21/98 */
|
||||
|
@ -324,22 +324,18 @@ void hcontrol_list_houses(struct char_data *ch, char *arg)
|
|||
continue;
|
||||
|
||||
if (house_control[i].built_on) {
|
||||
timestr = asctime(localtime(&(house_control[i].built_on)));
|
||||
*(timestr + 10) = '\0';
|
||||
strlcpy(built_on, timestr, sizeof(built_on));
|
||||
strftime(built_on, sizeof(built_on), "%a %b %d %Y", localtime(&(house_control[i].built_on)));
|
||||
} else
|
||||
strcpy(built_on, "Unknown"); /* strcpy: OK (for 'strlen("Unknown") < 128') */
|
||||
strcpy(built_on, "Unknown"); /* strcpy: OK */
|
||||
|
||||
if (house_control[i].last_payment) {
|
||||
timestr = asctime(localtime(&(house_control[i].last_payment)));
|
||||
*(timestr + 10) = '\0';
|
||||
strlcpy(last_pay, timestr, sizeof(last_pay));
|
||||
strftime(last_pay, sizeof(last_pay), "%a %b %d %Y", localtime(&(house_control[i].last_payment)));
|
||||
} else
|
||||
strcpy(last_pay, "None"); /* strcpy: OK (for 'strlen("None") < 128') */
|
||||
strcpy(last_pay, "None"); /* strcpy: OK */
|
||||
|
||||
/* Now we need a copy of the owner's name to capitalize. -gg 6/21/98 */
|
||||
strcpy(own_name, temp); /* strcpy: OK (names guaranteed <= MAX_NAME_LENGTH+1) */
|
||||
send_to_char(ch, "%7d %7d %-10s %2d %-12s %s\r\n",
|
||||
send_to_char(ch, "%7d %7d %-15s %2d %-12s %s\r\n",
|
||||
house_control[i].vnum, house_control[i].atrium, built_on,
|
||||
house_control[i].num_of_guests, CAP(own_name), last_pay);
|
||||
|
||||
|
|
10
src/ibt.c
10
src/ibt.c
|
@ -453,7 +453,7 @@ static bool is_ibt_logger(IBT_DATA *ibtData, struct char_data *ch)
|
|||
ACMD(do_ibt)
|
||||
{
|
||||
char arg[MAX_STRING_LENGTH], arg2[MAX_STRING_LENGTH];
|
||||
char buf[MAX_STRING_LENGTH], *arg_text, imp[30];
|
||||
char buf[MAX_STRING_LENGTH], *arg_text, imp[30], timestr[128];
|
||||
int i, num_res, num_unres;
|
||||
IBT_DATA *ibtData, *first_ibt, *last_ibt;
|
||||
int ano=0;
|
||||
|
@ -516,9 +516,13 @@ ACMD(do_ibt)
|
|||
if ((GET_LEVEL(ch) < LVL_IMMORT) && (!is_ibt_logger(ibtData, ch))) {
|
||||
send_to_char(ch, "Sorry but you may only view %ss you have posted yourself.\n\r", ibt_types[subcmd]);
|
||||
} else {
|
||||
|
||||
send_to_char(ch, "%s%s by %s%s\r\n",QCYN, ibt_types[subcmd], QYEL, ibtData->name);
|
||||
send_to_char(ch, "%sSubmitted: %s%s", QCYN, QYEL, ibtData->dated ? ctime((const time_t*)&ibtData->dated) : "Unknown\r\n");
|
||||
if (ibtData->dated != 0) {
|
||||
strftime(timestr, sizeof(timestr), "%c", localtime(&(ibtData->dated)));
|
||||
} else {
|
||||
strcpy(timestr, "Unknown");
|
||||
}
|
||||
send_to_char(ch, "%sSubmitted: %s%s\r\n", QCYN, QYEL, timestr);
|
||||
if (GET_LEVEL(ch) >= LVL_IMMORT) {
|
||||
send_to_char(ch, "%sLevel: %s%d\r\n",QCYN, QYEL, ibtData->level);
|
||||
send_to_char(ch, "%sRoom : %s%d\r\n",QCYN, QYEL, ibtData->room);
|
||||
|
|
|
@ -211,10 +211,9 @@ char *read_delete(long recipient)
|
|||
if (!record_to_keep)
|
||||
sprintf(buf, "Mail system error - please report");
|
||||
else {
|
||||
char *tmstr, *from, *to;
|
||||
char timestr[25], *from, *to;
|
||||
|
||||
tmstr = asctime(localtime(&record_to_keep->sent_time));
|
||||
*(tmstr + strlen(tmstr) - 1) = '\0';
|
||||
strftime(timestr, sizeof(timestr), "%c", localtime(&(record_to_keep->sent_time)));
|
||||
|
||||
from = get_name_by_id(record_to_keep->sender);
|
||||
to = get_name_by_id(record_to_keep->recipient);
|
||||
|
@ -227,7 +226,7 @@ char *read_delete(long recipient)
|
|||
"\r\n"
|
||||
"%s",
|
||||
|
||||
tmstr,
|
||||
timestr,
|
||||
to ? to : "Unknown",
|
||||
from ? from : "Unknown",
|
||||
record_to_keep->body ? record_to_keep->body : "No message" );
|
||||
|
|
|
@ -778,7 +778,7 @@ void tag_argument(char *argument, char *tag)
|
|||
* deleted by an immortal, or deleted by the auto-wipe system (if enabled). */
|
||||
void remove_player(int pfilepos)
|
||||
{
|
||||
char filename[MAX_STRING_LENGTH];
|
||||
char filename[MAX_STRING_LENGTH], timestr[25];
|
||||
int i;
|
||||
|
||||
if (!*player_table[pfilepos].name)
|
||||
|
@ -790,9 +790,10 @@ void remove_player(int pfilepos)
|
|||
unlink(filename);
|
||||
}
|
||||
|
||||
strftime(timestr, sizeof(timestr), "%c", localtime(&(player_table[pfilepos].last)));
|
||||
log("PCLEAN: %s Lev: %d Last: %s",
|
||||
player_table[pfilepos].name, player_table[pfilepos].level,
|
||||
asctime(localtime(&player_table[pfilepos].last)));
|
||||
timestr);
|
||||
player_table[pfilepos].name[0] = '\0';
|
||||
|
||||
/* Update index table. */
|
||||
|
|
|
@ -196,7 +196,7 @@ int strn_cmp(const char *arg1, const char *arg2, int n)
|
|||
void basic_mud_vlog(const char *format, va_list args)
|
||||
{
|
||||
time_t ct = time(0);
|
||||
char *time_s = asctime(localtime(&ct));
|
||||
char timestr[20];
|
||||
|
||||
if (logfile == NULL) {
|
||||
puts("SYSERR: Using log() before stream was initialized!");
|
||||
|
@ -206,9 +206,9 @@ void basic_mud_vlog(const char *format, va_list args)
|
|||
if (format == NULL)
|
||||
format = "SYSERR: log() received a NULL format.";
|
||||
|
||||
time_s[strlen(time_s) - 1] = '\0';
|
||||
strftime(timestr, sizeof(timestr), "%b %d %H:%M:%S %Y", localtime(&ct));
|
||||
|
||||
fprintf(logfile, "%-15.15s :: ", time_s + 4);
|
||||
fprintf(logfile, "%-20.20s :: ", timestr);
|
||||
vfprintf(logfile, format, args);
|
||||
fputc('\n', logfile);
|
||||
fflush(logfile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue