mirror of
https://github.com/tbamud/tbamud.git
synced 2026-03-25 13:46:33 +01:00
Remove rent code and cost per day
This commit is contained in:
parent
0bb44d02b5
commit
9d894e208d
41 changed files with 366 additions and 564 deletions
|
|
@ -87,7 +87,7 @@ static void perform_put(struct char_data *ch, struct obj_data *obj, struct obj_d
|
|||
|
||||
act("$n puts $p in $P.", TRUE, ch, obj, cont, TO_ROOM);
|
||||
|
||||
/* Yes, I realize this is strange until we have auto-equip on rent. -gg */
|
||||
/* Yes, I realize this is strange until we have auto-equip on load. -gg */
|
||||
if (OBJ_FLAGGED(obj, ITEM_NODROP) && !OBJ_FLAGGED(cont, ITEM_NODROP)) {
|
||||
SET_BIT_AR(GET_OBJ_EXTRA(cont), ITEM_NODROP);
|
||||
act("You get a strange feeling as you put $p in $P.", FALSE,
|
||||
|
|
|
|||
|
|
@ -3459,7 +3459,6 @@ ACMD(do_show)
|
|||
{ "nothing", 0 }, /* 0 */
|
||||
{ "zones", LVL_IMMORT }, /* 1 */
|
||||
{ "player", LVL_IMMORT },
|
||||
{ "rent", LVL_IMMORT },
|
||||
{ "stats", LVL_IMMORT },
|
||||
{ "errors", LVL_IMMORT }, /* 5 */
|
||||
{ "death", LVL_IMMORT },
|
||||
|
|
@ -3577,17 +3576,8 @@ ACMD(do_show)
|
|||
free_char(vict);
|
||||
break;
|
||||
}
|
||||
/* show rent */
|
||||
case 3:
|
||||
if (!*value) {
|
||||
send_to_char(ch, "A name would help.\r\n");
|
||||
return;
|
||||
}
|
||||
Crash_listrent(ch, value);
|
||||
break;
|
||||
|
||||
/* show stats */
|
||||
case 4:
|
||||
case 3:
|
||||
i = 0;
|
||||
j = 0;
|
||||
k = 0;
|
||||
|
|
@ -3626,7 +3616,7 @@ ACMD(do_show)
|
|||
break;
|
||||
|
||||
/* show errors */
|
||||
case 5:
|
||||
case 4:
|
||||
len = strlcpy(buf, "Errant Rooms\r\n------------\r\n", sizeof(buf));
|
||||
for (i = 0, k = 0; i <= top_of_world; i++)
|
||||
for (j = 0; j < DIR_COUNT; j++) {
|
||||
|
|
@ -3649,7 +3639,7 @@ ACMD(do_show)
|
|||
break;
|
||||
|
||||
/* show death */
|
||||
case 6:
|
||||
case 5:
|
||||
len = strlcpy(buf, "Death Traps\r\n-----------\r\n", sizeof(buf));
|
||||
for (i = 0, j = 0; i <= top_of_world; i++)
|
||||
if (ROOM_FLAGGED(i, ROOM_DEATH)) {
|
||||
|
|
@ -3662,7 +3652,7 @@ ACMD(do_show)
|
|||
break;
|
||||
|
||||
/* show godrooms */
|
||||
case 7:
|
||||
case 6:
|
||||
len = strlcpy(buf, "Godrooms\r\n--------------------------\r\n", sizeof(buf));
|
||||
for (i = 0, j = 0; i <= top_of_world; i++)
|
||||
if (ROOM_FLAGGED(i, ROOM_GODROOM)) {
|
||||
|
|
@ -3675,17 +3665,17 @@ ACMD(do_show)
|
|||
break;
|
||||
|
||||
/* show shops */
|
||||
case 8:
|
||||
case 7:
|
||||
show_shops(ch, value);
|
||||
break;
|
||||
|
||||
/* show houses */
|
||||
case 9:
|
||||
case 8:
|
||||
hcontrol_list_houses(ch, value);
|
||||
break;
|
||||
|
||||
/* show snoop */
|
||||
case 10:
|
||||
case 9:
|
||||
i = 0;
|
||||
send_to_char(ch, "People currently snooping:\r\n--------------------------\r\n");
|
||||
for (d = descriptor_list; d; d = d->next) {
|
||||
|
|
@ -3703,7 +3693,7 @@ ACMD(do_show)
|
|||
break;
|
||||
|
||||
/* show experience tables */
|
||||
case 11:
|
||||
case 10:
|
||||
len = strlcpy(buf, "LvL - Mu Cl Th Wa BA Ra Br Dr\r\n--------------------------\r\n", sizeof(buf));
|
||||
|
||||
for (i = 1; i < LVL_IMMORT; i++) {
|
||||
|
|
@ -3724,7 +3714,7 @@ ACMD(do_show)
|
|||
page_string(ch->desc, buf, TRUE);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
case 11:
|
||||
len = strlcpy(buf, "Colours\r\n--------------------------\r\n", sizeof(buf));
|
||||
k = 0;
|
||||
for (r = 0; r < 6; r++)
|
||||
|
|
@ -4726,11 +4716,11 @@ ACMD (do_zcheck)
|
|||
} /*switch on Item_Type*/
|
||||
|
||||
if (!CAN_WEAR(obj, ITEM_WEAR_TAKE)) {
|
||||
if ((GET_OBJ_COST(obj) || (GET_OBJ_WEIGHT(obj) && GET_OBJ_TYPE(obj) != ITEM_FOUNTAIN) ||
|
||||
GET_OBJ_RENT(obj)) && (found = 1))
|
||||
if ((GET_OBJ_COST(obj) || (GET_OBJ_WEIGHT(obj) && GET_OBJ_TYPE(obj) != ITEM_FOUNTAIN)) &&
|
||||
(found = 1))
|
||||
len += snprintf(buf + len, sizeof(buf) - len,
|
||||
"- is NO_TAKE, but has cost (%d) weight (%d) or rent (%d) set.\r\n",
|
||||
GET_OBJ_COST(obj), GET_OBJ_WEIGHT(obj), GET_OBJ_RENT(obj));
|
||||
"- is NO_TAKE, but has cost (%d) or weight (%d) set.\r\n",
|
||||
GET_OBJ_COST(obj), GET_OBJ_WEIGHT(obj));
|
||||
} else {
|
||||
if (GET_OBJ_COST(obj) == 0 && (found=1) && GET_OBJ_TYPE(obj) != ITEM_TRASH)
|
||||
len += snprintf(buf + len, sizeof(buf) - len,
|
||||
|
|
@ -5298,7 +5288,6 @@ ACMD(do_file)
|
|||
{ "levels", LVL_GOD, LEVELS_LOGFILE, TRUE},
|
||||
{ "rip", LVL_GOD, RIP_LOGFILE, TRUE},
|
||||
{ "players", LVL_GOD, NEWPLAYERS_LOGFILE, TRUE},
|
||||
{ "rentgone", LVL_GOD, RENTGONE_LOGFILE, TRUE},
|
||||
{ "errors", LVL_GOD, ERRORS_LOGFILE, TRUE},
|
||||
{ "godcmds", LVL_GOD, GODCMDS_LOGFILE, TRUE},
|
||||
{ "syslog", LVL_GOD, SYSLOG_LOGFILE, TRUE},
|
||||
|
|
|
|||
155
src/cedit.c
155
src/cedit.c
|
|
@ -88,7 +88,6 @@ static void cedit_setup(struct descriptor_data *d)
|
|||
OLC_CONFIG(d)->play.max_npc_corpse_time = CONFIG_MAX_NPC_CORPSE_TIME;
|
||||
OLC_CONFIG(d)->play.max_pc_corpse_time = CONFIG_MAX_PC_CORPSE_TIME;
|
||||
OLC_CONFIG(d)->play.idle_void = CONFIG_IDLE_VOID;
|
||||
OLC_CONFIG(d)->play.idle_rent_time = CONFIG_IDLE_RENT_TIME;
|
||||
OLC_CONFIG(d)->play.idle_max_level = CONFIG_IDLE_MAX_LEVEL;
|
||||
OLC_CONFIG(d)->play.dts_are_dumps = CONFIG_DTS_ARE_DUMPS;
|
||||
OLC_CONFIG(d)->play.load_into_inventory = CONFIG_LOAD_INVENTORY;
|
||||
|
|
@ -102,13 +101,9 @@ static void cedit_setup(struct descriptor_data *d)
|
|||
OLC_CONFIG(d)->play.script_players = CONFIG_SCRIPT_PLAYERS;
|
||||
|
||||
/* Crash Saves */
|
||||
OLC_CONFIG(d)->csd.free_rent = CONFIG_FREE_RENT;
|
||||
OLC_CONFIG(d)->csd.max_obj_save = CONFIG_MAX_OBJ_SAVE;
|
||||
OLC_CONFIG(d)->csd.min_rent_cost = CONFIG_MIN_RENT_COST;
|
||||
OLC_CONFIG(d)->csd.auto_save = CONFIG_AUTO_SAVE;
|
||||
OLC_CONFIG(d)->csd.autosave_time = CONFIG_AUTOSAVE_TIME;
|
||||
OLC_CONFIG(d)->csd.crash_file_timeout = CONFIG_CRASH_TIMEOUT;
|
||||
OLC_CONFIG(d)->csd.rent_file_timeout = CONFIG_RENT_TIMEOUT;
|
||||
|
||||
/* Room Numbers */
|
||||
OLC_CONFIG(d)->room_nums.mortal_start_room = CONFIG_MORTAL_START;
|
||||
|
|
@ -191,7 +186,6 @@ static void cedit_save_internally(struct descriptor_data *d)
|
|||
CONFIG_MAX_NPC_CORPSE_TIME = OLC_CONFIG(d)->play.max_npc_corpse_time;
|
||||
CONFIG_MAX_PC_CORPSE_TIME = OLC_CONFIG(d)->play.max_pc_corpse_time;
|
||||
CONFIG_IDLE_VOID = OLC_CONFIG(d)->play.idle_void;
|
||||
CONFIG_IDLE_RENT_TIME = OLC_CONFIG(d)->play.idle_rent_time;
|
||||
CONFIG_IDLE_MAX_LEVEL = OLC_CONFIG(d)->play.idle_max_level;
|
||||
CONFIG_DTS_ARE_DUMPS = OLC_CONFIG(d)->play.dts_are_dumps;
|
||||
CONFIG_LOAD_INVENTORY = OLC_CONFIG(d)->play.load_into_inventory;
|
||||
|
|
@ -205,13 +199,9 @@ static void cedit_save_internally(struct descriptor_data *d)
|
|||
CONFIG_SCRIPT_PLAYERS = OLC_CONFIG(d)->play.script_players;
|
||||
|
||||
/* Crash Saves */
|
||||
CONFIG_FREE_RENT = OLC_CONFIG(d)->csd.free_rent;
|
||||
CONFIG_MAX_OBJ_SAVE = OLC_CONFIG(d)->csd.max_obj_save;
|
||||
CONFIG_MIN_RENT_COST = OLC_CONFIG(d)->csd.min_rent_cost;
|
||||
CONFIG_AUTO_SAVE = OLC_CONFIG(d)->csd.auto_save;
|
||||
CONFIG_AUTOSAVE_TIME = OLC_CONFIG(d)->csd.autosave_time;
|
||||
CONFIG_CRASH_TIMEOUT = OLC_CONFIG(d)->csd.crash_file_timeout;
|
||||
CONFIG_RENT_TIMEOUT = OLC_CONFIG(d)->csd.rent_file_timeout;
|
||||
|
||||
/* Room Numbers */
|
||||
CONFIG_MORTAL_START = OLC_CONFIG(d)->room_nums.mortal_start_room;
|
||||
|
|
@ -354,8 +344,6 @@ int save_config( IDXTYPE nowhere )
|
|||
"max_pc_corpse_time = %d\n\n", CONFIG_MAX_PC_CORPSE_TIME);
|
||||
fprintf(fl, "* Number of tics before a PC is sent to the void.\n"
|
||||
"idle_void = %d\n\n", CONFIG_IDLE_VOID);
|
||||
fprintf(fl, "* Number of tics before a PC is autorented.\n"
|
||||
"idle_rent_time = %d\n\n", CONFIG_IDLE_RENT_TIME);
|
||||
fprintf(fl, "* Level and above of players whom are immune to idle penalties.\n"
|
||||
"idle_max_level = %d\n\n", CONFIG_IDLE_MAX_LEVEL);
|
||||
fprintf(fl, "* Should the items in death traps be junked automatically?\n"
|
||||
|
|
@ -404,15 +392,8 @@ int save_config( IDXTYPE nowhere )
|
|||
fprintf(fl, "* Text sent to players when an effect fails.\n"
|
||||
"noeffect = %s\n", buf);
|
||||
|
||||
/* RENT / CRASHSAVE OPTIONS */
|
||||
fprintf(fl, "\n\n\n* [ Rent/Crashsave Options ]\n");
|
||||
|
||||
fprintf(fl, "* Should the MUD allow you to 'rent' for free? (i.e. if you just quit,\n"
|
||||
"* your objects are saved at no cost, as in Merc-type MUDs.)\n"
|
||||
"free_rent = %d\n\n", CONFIG_FREE_RENT);
|
||||
|
||||
fprintf(fl, "* Maximum number of items players are allowed to rent.\n"
|
||||
"max_obj_save = %d\n\n", CONFIG_MAX_OBJ_SAVE);
|
||||
/* CRASHSAVE OPTIONS */
|
||||
fprintf(fl, "\n\n\n* [ Crashsave Options ]\n");
|
||||
|
||||
fprintf(fl, "* Should the game automatically save people?\n"
|
||||
"auto_save = %d\n\n", CONFIG_AUTO_SAVE);
|
||||
|
|
@ -420,11 +401,9 @@ int save_config( IDXTYPE nowhere )
|
|||
fprintf(fl, "* If auto_save = 1, how often (in minutes) should the game save people's objects?\n"
|
||||
"autosave_time = %d\n\n", CONFIG_AUTOSAVE_TIME);
|
||||
|
||||
fprintf(fl, "* Lifetime of crashfiles and force-rent (idlesave) files in days.\n"
|
||||
fprintf(fl, "* Lifetime of crashfiles and idle-save files in days.\n"
|
||||
"crash_file_timeout = %d\n\n", CONFIG_CRASH_TIMEOUT);
|
||||
|
||||
fprintf(fl, "* Lifetime of normal rent files in days.\n"
|
||||
"rent_file_timeout = %d\n\n", CONFIG_RENT_TIMEOUT);
|
||||
|
||||
/* ROOM NUMBERS */
|
||||
fprintf(fl, "\n\n\n* [ Room Numbers ]\n");
|
||||
|
|
@ -584,7 +563,7 @@ static void cedit_disp_menu(struct descriptor_data *d)
|
|||
write_to_output(d,
|
||||
"OasisOLC MUD Configuration Editor\r\n"
|
||||
"%sG%s) Game Play Options\r\n"
|
||||
"%sC%s) Crashsave/Rent Options\r\n"
|
||||
"%sC%s) Crashsave Options\r\n"
|
||||
"%sR%s) Room Numbers\r\n"
|
||||
"%sO%s) Operation Options\r\n"
|
||||
"%sA%s) Autowiz Options\r\n"
|
||||
|
|
@ -621,14 +600,13 @@ static void cedit_disp_game_play_options(struct descriptor_data *d)
|
|||
"%sH%s) Max Time for NPC Corpse : %s%d\r\n"
|
||||
"%sI%s) Max Time for PC Corpse : %s%d\r\n"
|
||||
"%sJ%s) Tics before PC sent to void : %s%d\r\n"
|
||||
"%sK%s) Tics before PC is autosaved : %s%d\r\n"
|
||||
"%sL%s) Level Immune To IDLE : %s%d\r\n"
|
||||
"%sM%s) Death Traps Junk Items : %s%s\r\n"
|
||||
"%sN%s) Objects Load Into Inventory : %s%s\r\n"
|
||||
"%sO%s) Track Through Doors : %s%s\r\n"
|
||||
"%sP%s) Display Closed Doors : %s%s\r\n"
|
||||
"%sR%s) Diagonal Directions : %s%s\r\n"
|
||||
"%sS%s) Prevent Mortal Level To Immortal : %s%s\r\n"
|
||||
"%sK%s) Level Immune To IDLE : %s%d\r\n"
|
||||
"%sL%s) Death Traps Junk Items : %s%s\r\n"
|
||||
"%sM%s) Objects Load Into Inventory : %s%s\r\n"
|
||||
"%sN%s) Track Through Doors : %s%s\r\n"
|
||||
"%sO%s) Display Closed Doors : %s%s\r\n"
|
||||
"%sP%s) Diagonal Directions : %s%s\r\n"
|
||||
"%sR%s) Prevent Mortal Level To Immortal : %s%s\r\n"
|
||||
"%s1%s) OK Message Text : %s%s"
|
||||
"%s2%s) HUH Message Text : %s%s"
|
||||
"%s3%s) NOPERSON Message Text : %s%s"
|
||||
|
|
@ -649,7 +627,6 @@ static void cedit_disp_game_play_options(struct descriptor_data *d)
|
|||
grn, nrm, cyn, OLC_CONFIG(d)->play.max_pc_corpse_time,
|
||||
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->play.idle_void,
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->play.idle_rent_time,
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->play.idle_max_level,
|
||||
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.dts_are_dumps),
|
||||
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.load_into_inventory),
|
||||
|
|
@ -679,22 +656,14 @@ static void cedit_disp_crash_save_options(struct descriptor_data *d)
|
|||
clear_screen(d);
|
||||
|
||||
write_to_output(d, "\r\n\r\n"
|
||||
"%sA%s) Free Rent : %s%s\r\n"
|
||||
"%sB%s) Max Objects Saved : %s%d\r\n"
|
||||
"%sC%s) Minimum Rent Cost : %s%d\r\n"
|
||||
"%sD%s) Auto Save : %s%s\r\n"
|
||||
"%sE%s) Auto Save Time : %s%d minute(s)\r\n"
|
||||
"%sF%s) Crash File Timeout : %s%d day(s)\r\n"
|
||||
"%sG%s) Rent File Timeout : %s%d day(s)\r\n"
|
||||
"%sA%s) Auto Save : %s%s\r\n"
|
||||
"%sB%s) Auto Save Time : %s%d minute(s)\r\n"
|
||||
"%sC%s) Crash File Timeout : %s%d day(s)\r\n"
|
||||
"%sQ%s) Exit To The Main Menu\r\n"
|
||||
"Enter your choice : ",
|
||||
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->csd.free_rent),
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->csd.max_obj_save,
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->csd.min_rent_cost,
|
||||
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->csd.auto_save),
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->csd.autosave_time,
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->csd.crash_file_timeout,
|
||||
grn, nrm, cyn, OLC_CONFIG(d)->csd.rent_file_timeout,
|
||||
grn, nrm
|
||||
);
|
||||
|
||||
|
|
@ -929,43 +898,37 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||
|
||||
case 'k':
|
||||
case 'K':
|
||||
write_to_output(d, "Enter the number of tics before PC's are automatically rented and forced to quit : ");
|
||||
OLC_MODE(d) = CEDIT_IDLE_RENT_TIME;
|
||||
return;
|
||||
|
||||
case 'l':
|
||||
case 'L':
|
||||
write_to_output(d, "Enter the level a player must be to become immune to IDLE : ");
|
||||
OLC_MODE(d) = CEDIT_IDLE_MAX_LEVEL;
|
||||
return;
|
||||
|
||||
case 'l':
|
||||
case 'L':
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->play.dts_are_dumps);
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
case 'M':
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->play.dts_are_dumps);
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->play.load_into_inventory);
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
case 'N':
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->play.load_into_inventory);
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->play.track_through_doors);
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
case 'O':
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->play.track_through_doors);
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->play.disp_closed_doors);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
case 'P':
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->play.disp_closed_doors);
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
case 'R':
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->play.diagonal_dirs);
|
||||
break;
|
||||
|
||||
case 's':
|
||||
case 'S':
|
||||
case 'r':
|
||||
case 'R':
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->play.no_mort_to_immort);
|
||||
break;
|
||||
|
||||
|
|
@ -1027,44 +990,21 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||
switch (*arg) {
|
||||
case 'a':
|
||||
case 'A':
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->csd.free_rent);
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->csd.auto_save);
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
case 'B':
|
||||
write_to_output(d, "Enter the maximum number of items players can rent : ");
|
||||
OLC_MODE(d) = CEDIT_MAX_OBJ_SAVE;
|
||||
return;
|
||||
|
||||
case 'c':
|
||||
case 'C':
|
||||
write_to_output(d, "Enter the surcharge on top of item costs : ");
|
||||
OLC_MODE(d) = CEDIT_MIN_RENT_COST;
|
||||
return;
|
||||
|
||||
case 'd':
|
||||
case 'D':
|
||||
TOGGLE_VAR(OLC_CONFIG(d)->csd.auto_save);
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
case 'E':
|
||||
write_to_output(d, "Enter how often (in minutes) should the MUD save players : ");
|
||||
OLC_MODE(d) = CEDIT_AUTOSAVE_TIME;
|
||||
return;
|
||||
|
||||
case 'f':
|
||||
case 'F':
|
||||
case 'c':
|
||||
case 'C':
|
||||
write_to_output(d, "Enter the lifetime of crash and idlesave files (days) : ");
|
||||
OLC_MODE(d) = CEDIT_CRASH_FILE_TIMEOUT;
|
||||
return;
|
||||
|
||||
case 'g':
|
||||
case 'G':
|
||||
write_to_output(d, "Enter the lifetime of normal rent files (days) : ");
|
||||
OLC_MODE(d) = CEDIT_RENT_FILE_TIMEOUT;
|
||||
return;
|
||||
|
||||
case 'q':
|
||||
case 'Q':
|
||||
cedit_disp_menu(d);
|
||||
|
|
@ -1367,16 +1307,6 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||
}
|
||||
break;
|
||||
|
||||
case CEDIT_IDLE_RENT_TIME:
|
||||
if (!*arg) {
|
||||
write_to_output(d,
|
||||
"That is an invalid choice!\r\n"
|
||||
"Enter the number of tics before PC's are automatically rented and forced to quit : ");
|
||||
} else {
|
||||
OLC_CONFIG(d)->play.idle_rent_time = atoi(arg);
|
||||
cedit_disp_game_play_options(d);
|
||||
}
|
||||
break;
|
||||
|
||||
case CEDIT_IDLE_MAX_LEVEL:
|
||||
if (!*arg) {
|
||||
|
|
@ -1437,27 +1367,6 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||
cedit_disp_game_play_options(d);
|
||||
break;
|
||||
|
||||
case CEDIT_MAX_OBJ_SAVE:
|
||||
if (!*arg) {
|
||||
write_to_output(d,
|
||||
"That is an invalid choice!\r\n"
|
||||
"Enter the maximum objects a player can save : ");
|
||||
} else {
|
||||
OLC_CONFIG(d)->csd.max_obj_save = atoi(arg);
|
||||
cedit_disp_crash_save_options(d);
|
||||
}
|
||||
break;
|
||||
|
||||
case CEDIT_MIN_RENT_COST:
|
||||
if (!*arg) {
|
||||
write_to_output(d,
|
||||
"That is an invalid choice!\r\n"
|
||||
"Enter the minimum amount it costs to rent : ");
|
||||
} else {
|
||||
OLC_CONFIG(d)->csd.min_rent_cost = atoi(arg);
|
||||
cedit_disp_crash_save_options(d);
|
||||
}
|
||||
break;
|
||||
|
||||
case CEDIT_AUTOSAVE_TIME:
|
||||
if (!*arg) {
|
||||
|
|
@ -1481,16 +1390,6 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
|||
}
|
||||
break;
|
||||
|
||||
case CEDIT_RENT_FILE_TIMEOUT:
|
||||
if (!*arg) {
|
||||
write_to_output(d,
|
||||
"That is an invalid choice!\r\n"
|
||||
"Enter the lifetime of rent files (days) : ");
|
||||
} else {
|
||||
OLC_CONFIG(d)->csd.rent_file_timeout = atoi(arg);
|
||||
cedit_disp_crash_save_options(d);
|
||||
}
|
||||
break;
|
||||
|
||||
case CEDIT_MORTAL_START_ROOM:
|
||||
if (!*arg) {
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ int main(int argc, char **argv)
|
|||
case 'm':
|
||||
mini_mud = 1;
|
||||
no_rent_check = 1;
|
||||
puts("Running in minimized mode & with no rent check.");
|
||||
puts("Running in minimized mode & with no save-file check.");
|
||||
break;
|
||||
case 'c':
|
||||
scheck = 1;
|
||||
|
|
@ -280,7 +280,7 @@ int main(int argc, char **argv)
|
|||
break;
|
||||
case 'q':
|
||||
no_rent_check = 1;
|
||||
puts("Quick boot mode -- rent check supressed.");
|
||||
puts("Quick boot mode -- save-file check suppressed.");
|
||||
break;
|
||||
case 'r':
|
||||
circle_restrict = 1;
|
||||
|
|
@ -300,7 +300,7 @@ int main(int argc, char **argv)
|
|||
" -m Start in mini-MUD mode.\n"
|
||||
" -f<file> Use <file> for configuration.\n"
|
||||
" -o <file> Write log to <file> instead of stderr.\n"
|
||||
" -q Quick boot (doesn't scan rent for object limits)\n"
|
||||
" -q Quick boot (doesn't scan save files for object limits)\n"
|
||||
" -r Restrict MUD -- no new players allowed.\n"
|
||||
" -s Suppress special procedure assignments.\n"
|
||||
" Note: These arguments are 'CaSe SeNsItIvE!!!'\n",
|
||||
|
|
|
|||
19
src/config.c
19
src/config.c
|
|
@ -64,9 +64,8 @@ int max_exp_loss = 500000; /* max losable per death */
|
|||
int max_npc_corpse_time = 5;
|
||||
int max_pc_corpse_time = 10;
|
||||
|
||||
/* How many ticks before a player is sent to the void or idle-rented. */
|
||||
/* How many ticks before a player is sent to the void. */
|
||||
int idle_void = 8;
|
||||
int idle_rent_time = 48;
|
||||
|
||||
/* This level and up is immune to idling, LVL_IMPL+1 will disable it. */
|
||||
int idle_max_level = LVL_IMMORT;
|
||||
|
|
@ -101,17 +100,7 @@ int no_mort_to_immort = YES;
|
|||
* If set to NO, then only the 6 directions n,e,s,w,u,d are allowed */
|
||||
int diagonal_dirs = NO;
|
||||
|
||||
/* RENT/CRASHSAVE OPTIONS */
|
||||
/* Should the MUD allow you to 'rent' for free? (i.e. if you just quit, your
|
||||
* objects are saved at no cost). */
|
||||
int free_rent = YES;
|
||||
|
||||
/* Maximum number of items players are allowed to rent. */
|
||||
int max_obj_save = 30;
|
||||
|
||||
/* Receptionist's surcharge on top of item costs. */
|
||||
int min_rent_cost = 100;
|
||||
|
||||
/* CRASHSAVE OPTIONS */
|
||||
/* Should the game automatically save people? (i.e., save player data every 4
|
||||
* kills (on average), and Crash-save as defined below. If auto_save is YES,
|
||||
* then the 'save' command will be disabled to prevent item duplication via
|
||||
|
|
@ -123,11 +112,9 @@ int auto_save = YES;
|
|||
* save players' houses. */
|
||||
int autosave_time = 5;
|
||||
|
||||
/* Lifetime of crashfiles and forced-rent (idlesave) files in days. */
|
||||
/* Lifetime of crashfiles and idle-save files in days. */
|
||||
int crash_file_timeout = 10;
|
||||
|
||||
/* Lifetime of normal rent files in days. */
|
||||
int rent_file_timeout = 30;
|
||||
|
||||
/* Do you want to automatically wipe players who've been gone too long? */
|
||||
int auto_pwipe = NO;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ extern int max_exp_loss;
|
|||
extern int max_npc_corpse_time;
|
||||
extern int max_pc_corpse_time;
|
||||
extern int idle_void;
|
||||
extern int idle_rent_time;
|
||||
extern int idle_max_level;
|
||||
extern int dts_are_dumps;
|
||||
extern int load_into_inventory;
|
||||
|
|
@ -35,13 +34,9 @@ extern const char *NOEFFECT;
|
|||
extern int track_through_doors;
|
||||
extern int no_mort_to_immort;
|
||||
extern int diagonal_dirs;
|
||||
extern int free_rent;
|
||||
extern int max_obj_save;
|
||||
extern int min_rent_cost;
|
||||
extern int auto_save;
|
||||
extern int autosave_time;
|
||||
extern int crash_file_timeout;
|
||||
extern int rent_file_timeout;
|
||||
/* Room Numbers */
|
||||
extern room_vnum mortal_start_room;
|
||||
extern room_vnum immort_start_room;
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ const char *wear_bits[] = {
|
|||
const char *extra_bits[] = {
|
||||
"GLOW",
|
||||
"HUM",
|
||||
"NO_RENT",
|
||||
"UNUSED",
|
||||
"NO_DONATE",
|
||||
"NO_INVIS",
|
||||
"INVISIBLE",
|
||||
|
|
|
|||
30
src/db.c
30
src/db.c
|
|
@ -84,7 +84,7 @@ int top_shop = -1; /* top of shop table */
|
|||
|
||||
int no_mail = 0; /* mail disabled? */
|
||||
int mini_mud = 0; /* mini-mud mode? */
|
||||
int no_rent_check = 0; /* skip rent check on boot? */
|
||||
int no_rent_check = 0; /* skip save-file check on boot? */
|
||||
time_t boot_time = 0; /* time of mud boot */
|
||||
int circle_restrict = 0; /* level of game restriction */
|
||||
room_rnum r_mortal_start_room; /* rnum of mortal start room */
|
||||
|
|
@ -772,7 +772,7 @@ void boot_db(void)
|
|||
load_ibt_file(SCMD_TYPO);
|
||||
|
||||
if (!no_rent_check) {
|
||||
log("Deleting timed-out crash and rent files:");
|
||||
log("Deleting timed-out crash and idle-save files:");
|
||||
update_obj_file();
|
||||
log(" Done.");
|
||||
}
|
||||
|
|
@ -2207,7 +2207,7 @@ char *parse_object(FILE *obj_f, int nr)
|
|||
|
||||
GET_OBJ_WEIGHT(obj_proto + i) = t[0];
|
||||
GET_OBJ_COST(obj_proto + i) = t[1];
|
||||
GET_OBJ_RENT(obj_proto + i) = t[2];
|
||||
GET_OBJ_COST_PER_DAY(obj_proto + i) = 0;
|
||||
GET_OBJ_LEVEL(obj_proto + i) = t[3];
|
||||
GET_OBJ_TIMER(obj_proto + i) = t[4];
|
||||
|
||||
|
|
@ -3993,10 +3993,6 @@ static int check_object(struct obj_data *obj)
|
|||
log("SYSERR: Object #%d (%s) has negative weight (%d).",
|
||||
GET_OBJ_VNUM(obj), obj->short_description, GET_OBJ_WEIGHT(obj));
|
||||
|
||||
if (GET_OBJ_RENT(obj) < 0 && (error = TRUE))
|
||||
log("SYSERR: Object #%d (%s) has negative cost/day (%d).",
|
||||
GET_OBJ_VNUM(obj), obj->short_description, GET_OBJ_RENT(obj));
|
||||
|
||||
snprintf(objname, sizeof(objname), "Object #%d (%s)", GET_OBJ_VNUM(obj), obj->short_description);
|
||||
for(y = 0; y < TW_ARRAY_MAX; y++) {
|
||||
error |= check_bitvector_names(GET_OBJ_WEAR(obj)[y], wear_bits_count, objname, "object wear");
|
||||
|
|
@ -4139,7 +4135,6 @@ static void load_default_config( void )
|
|||
CONFIG_MAX_NPC_CORPSE_TIME = max_npc_corpse_time;
|
||||
CONFIG_MAX_PC_CORPSE_TIME = max_pc_corpse_time;
|
||||
CONFIG_IDLE_VOID = idle_void;
|
||||
CONFIG_IDLE_RENT_TIME = idle_rent_time;
|
||||
CONFIG_IDLE_MAX_LEVEL = idle_max_level;
|
||||
CONFIG_DTS_ARE_DUMPS = dts_are_dumps;
|
||||
CONFIG_LOAD_INVENTORY = load_into_inventory;
|
||||
|
|
@ -4159,14 +4154,10 @@ static void load_default_config( void )
|
|||
CONFIG_SCRIPT_PLAYERS = script_players;
|
||||
CONFIG_DEBUG_MODE = debug_mode;
|
||||
|
||||
/* Rent / crashsave options. */
|
||||
CONFIG_FREE_RENT = free_rent;
|
||||
CONFIG_MAX_OBJ_SAVE = max_obj_save;
|
||||
CONFIG_MIN_RENT_COST = min_rent_cost;
|
||||
/* Crashsave options. */
|
||||
CONFIG_AUTO_SAVE = auto_save;
|
||||
CONFIG_AUTOSAVE_TIME = autosave_time;
|
||||
CONFIG_CRASH_TIMEOUT = crash_file_timeout;
|
||||
CONFIG_RENT_TIMEOUT = rent_file_timeout;
|
||||
|
||||
/* Room numbers. */
|
||||
CONFIG_MORTAL_START = mortal_start_room;
|
||||
|
|
@ -4292,9 +4283,7 @@ void load_config( void )
|
|||
break;
|
||||
|
||||
case 'f':
|
||||
if (!str_cmp(tag, "free_rent"))
|
||||
CONFIG_FREE_RENT = num;
|
||||
else if (!str_cmp(tag, "frozen_start_room"))
|
||||
if (!str_cmp(tag, "frozen_start_room"))
|
||||
CONFIG_FROZEN_START = num;
|
||||
break;
|
||||
|
||||
|
|
@ -4311,8 +4300,6 @@ void load_config( void )
|
|||
case 'i':
|
||||
if (!str_cmp(tag, "idle_void"))
|
||||
CONFIG_IDLE_VOID = num;
|
||||
else if (!str_cmp(tag, "idle_rent_time"))
|
||||
CONFIG_IDLE_RENT_TIME = num;
|
||||
else if (!str_cmp(tag, "idle_max_level"))
|
||||
CONFIG_IDLE_MAX_LEVEL = num;
|
||||
else if (!str_cmp(tag, "immort_start_room"))
|
||||
|
|
@ -4347,8 +4334,6 @@ void load_config( void )
|
|||
CONFIG_MAX_FILESIZE = num;
|
||||
else if (!str_cmp(tag, "max_npc_corpse_time"))
|
||||
CONFIG_MAX_NPC_CORPSE_TIME = num;
|
||||
else if (!str_cmp(tag, "max_obj_save"))
|
||||
CONFIG_MAX_OBJ_SAVE = num;
|
||||
else if (!str_cmp(tag, "max_pc_corpse_time"))
|
||||
CONFIG_MAX_PC_CORPSE_TIME = num;
|
||||
else if (!str_cmp(tag, "max_playing"))
|
||||
|
|
@ -4359,8 +4344,7 @@ void load_config( void )
|
|||
strncpy(buf, "Reading menu in load_config()", sizeof(buf));
|
||||
CONFIG_MENU = fread_string(fl, buf);
|
||||
parse_at(CONFIG_MENU);
|
||||
} else if (!str_cmp(tag, "min_rent_cost"))
|
||||
CONFIG_MIN_RENT_COST = num;
|
||||
}
|
||||
else if (!str_cmp(tag, "min_wizlist_lev"))
|
||||
CONFIG_MIN_WIZLIST_LEV = num;
|
||||
else if (!str_cmp(tag, "mortal_start_room"))
|
||||
|
|
@ -4411,8 +4395,6 @@ void load_config( void )
|
|||
break;
|
||||
|
||||
case 'r':
|
||||
if (!str_cmp(tag, "rent_file_timeout"))
|
||||
CONFIG_RENT_TIMEOUT = num;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
|
|
|
|||
4
src/db.h
4
src/db.h
|
|
@ -116,7 +116,6 @@
|
|||
#define LEVELS_LOGFILE PREFIX_LOGFILE"levels"
|
||||
#define RIP_LOGFILE PREFIX_LOGFILE"rip"
|
||||
#define NEWPLAYERS_LOGFILE PREFIX_LOGFILE"newplayers"
|
||||
#define RENTGONE_LOGFILE PREFIX_LOGFILE"rentgone"
|
||||
#define ERRORS_LOGFILE PREFIX_LOGFILE"errors"
|
||||
#define GODCMDS_LOGFILE PREFIX_LOGFILE"godcmds"
|
||||
#define HELP_LOGFILE PREFIX_LOGFILE"help"
|
||||
|
|
@ -227,7 +226,7 @@ struct help_index_element {
|
|||
|
||||
/* The ban defines and structs were moved to ban.h */
|
||||
|
||||
/* for the "buffered" rent and house object loading */
|
||||
/* for the buffered save and house object loading */
|
||||
struct obj_save_data_t {
|
||||
struct obj_data *obj;
|
||||
int locate;
|
||||
|
|
@ -273,7 +272,6 @@ void Crash_save_all(void);
|
|||
void Crash_idlesave(struct char_data *ch);
|
||||
void Crash_crashsave(struct char_data *ch);
|
||||
int Crash_load(struct char_data *ch);
|
||||
void Crash_listrent(struct char_data *ch, char *name);
|
||||
int Crash_clean_file(char *name);
|
||||
int Crash_delete_crashfile(struct char_data *ch);
|
||||
int Crash_delete_file(char *name);
|
||||
|
|
|
|||
|
|
@ -1148,14 +1148,6 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
|||
snprintf(str, slen, "%d", GET_OBJ_COST(o));
|
||||
}
|
||||
|
||||
else if (!str_cmp(field, "cost_per_day")) {
|
||||
if (subfield && *subfield) {
|
||||
int addition = atoi(subfield);
|
||||
GET_OBJ_RENT(o) = MAX(1, addition + GET_OBJ_RENT(o));
|
||||
}
|
||||
snprintf(str, slen, "%d", GET_OBJ_RENT(o));
|
||||
}
|
||||
|
||||
else if (!str_cmp(field, "carried_by")) {
|
||||
if (o->carried_by)
|
||||
snprintf(str, slen,"%c%ld",UID_CHAR, char_script_id(o->carried_by));
|
||||
|
|
|
|||
|
|
@ -270,7 +270,6 @@ static void make_corpse(struct char_data *ch)
|
|||
GET_OBJ_VAL(corpse, 0) = 0; /* You can't store stuff in a corpse */
|
||||
GET_OBJ_VAL(corpse, 3) = 1; /* corpse identifier */
|
||||
GET_OBJ_WEIGHT(corpse) = GET_WEIGHT(ch) + IS_CARRYING_W(ch);
|
||||
GET_OBJ_RENT(corpse) = 100000;
|
||||
if (IS_NPC(ch))
|
||||
GET_OBJ_TIMER(corpse) = CONFIG_MAX_NPC_CORPSE_TIME;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ int save_objects(zone_rnum zone_num)
|
|||
GET_OBJ_VAL(obj, 0), GET_OBJ_VAL(obj, 1),
|
||||
GET_OBJ_VAL(obj, 2), GET_OBJ_VAL(obj, 3),
|
||||
GET_OBJ_WEIGHT(obj), GET_OBJ_COST(obj),
|
||||
GET_OBJ_RENT(obj), GET_OBJ_LEVEL(obj), GET_OBJ_TIMER(obj)
|
||||
GET_OBJ_COST_PER_DAY(obj), GET_OBJ_LEVEL(obj), GET_OBJ_TIMER(obj)
|
||||
);
|
||||
|
||||
/* Do we have script(s) attached? */
|
||||
|
|
|
|||
|
|
@ -844,7 +844,7 @@ static int export_save_objects(zone_rnum zrnum)
|
|||
|
||||
fprintf(obj_file,
|
||||
"%d %d %d %d\n",
|
||||
GET_OBJ_WEIGHT(obj), GET_OBJ_COST(obj), GET_OBJ_RENT(obj), GET_OBJ_LEVEL(obj));
|
||||
GET_OBJ_WEIGHT(obj), GET_OBJ_COST(obj), GET_OBJ_COST_PER_DAY(obj), GET_OBJ_LEVEL(obj));
|
||||
|
||||
/* Do we have script(s) attached? */
|
||||
export_script_save_to_disk(obj_file, obj, OBJ_TRIGGER);
|
||||
|
|
|
|||
14
src/house.c
14
src/house.c
|
|
@ -180,8 +180,8 @@ static void House_listrent(struct char_data *ch, room_vnum vnum)
|
|||
loaded = objsave_parse_objects(fl);
|
||||
|
||||
for (current = loaded; current != NULL; current = current->next)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " [%5d] (%5dau) %s\r\n",
|
||||
GET_OBJ_VNUM(current->obj), GET_OBJ_RENT(current->obj), current->obj->short_description);
|
||||
len += snprintf(buf+len, sizeof(buf)-len, " [%5d] %s\r\n",
|
||||
GET_OBJ_VNUM(current->obj), current->obj->short_description);
|
||||
|
||||
/* now it's safe to free the obj_save_data list - all members of it
|
||||
* have been put in the correct lists by obj_to_room()
|
||||
|
|
@ -613,7 +613,7 @@ void House_list_guests(struct char_data *ch, int i, int quiet)
|
|||
|
||||
/*************************************************************************
|
||||
* All code below this point and the code above, marked "CONVERSION" *
|
||||
* can be removed after you have converted your house rent files using *
|
||||
* can be removed after you have converted your house save files using *
|
||||
* the command *
|
||||
* hcontrol asciiconvert *
|
||||
* *
|
||||
|
|
@ -621,7 +621,7 @@ void House_list_guests(struct char_data *ch, int i, int quiet)
|
|||
* After you have converted your house files, I suggest a reboot, which *
|
||||
* will let your house files load on the next bootup. -Welcor *
|
||||
************************************************************************/
|
||||
/* Code for conversion to ascii house rent files. */
|
||||
/* Code for conversion to ascii house save files. */
|
||||
static void hcontrol_convert_houses(struct char_data *ch)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -689,7 +689,7 @@ static int ascii_convert_house(struct char_data *ch, obj_vnum vnum)
|
|||
return (0);
|
||||
if (ferror(in)) {
|
||||
perror("SYSERR: Reading house file in House_load");
|
||||
send_to_char(ch, "...read error in house rent file.\r\n");
|
||||
send_to_char(ch, "...read error in house save file.\r\n");
|
||||
free(outfile);
|
||||
fclose(in);
|
||||
fclose(out);
|
||||
|
|
@ -700,7 +700,7 @@ static int ascii_convert_house(struct char_data *ch, obj_vnum vnum)
|
|||
tmp = Obj_from_store(object, &i);
|
||||
if (!objsave_save_obj_record(tmp, out, i))
|
||||
{
|
||||
send_to_char(ch, "...write error in house rent file.\r\n");
|
||||
send_to_char(ch, "...write error in house save file.\r\n");
|
||||
free(outfile);
|
||||
fclose(in);
|
||||
fclose(out);
|
||||
|
|
@ -721,7 +721,7 @@ static int ascii_convert_house(struct char_data *ch, obj_vnum vnum)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/* The circle 3.1 function for reading rent files. No longer used by the rent system. */
|
||||
/* The circle 3.1 function for reading save files. No longer used by the current system. */
|
||||
static struct obj_data *Obj_from_store(struct obj_file_elem object, int *location)
|
||||
{
|
||||
struct obj_data *obj;
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ static void check_idling(struct char_data *ch)
|
|||
Crash_crashsave(ch);
|
||||
char_from_room(ch);
|
||||
char_to_room(ch, 1);
|
||||
} else if (ch->char_specials.timer > CONFIG_IDLE_RENT_TIME) {
|
||||
} else if (ch->char_specials.timer > (CONFIG_IDLE_VOID * 2)) {
|
||||
if (IN_ROOM(ch) != NOWHERE)
|
||||
char_from_room(ch);
|
||||
char_to_room(ch, 3);
|
||||
|
|
@ -386,11 +386,8 @@ static void check_idling(struct char_data *ch)
|
|||
ch->desc->character = NULL;
|
||||
ch->desc = NULL;
|
||||
}
|
||||
if (CONFIG_FREE_RENT)
|
||||
Crash_rentsave(ch, 0);
|
||||
else
|
||||
Crash_idlesave(ch);
|
||||
mudlog(CMP, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s force-rented and extracted (idle).", GET_NAME(ch));
|
||||
Crash_idlesave(ch);
|
||||
mudlog(CMP, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s idle-saved and extracted (idle).", GET_NAME(ch));
|
||||
add_llog_entry(ch, LAST_IDLEOUT);
|
||||
extract_char(ch);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -350,7 +350,6 @@ static void postmaster_receive_mail(struct char_data *ch, struct char_data *mail
|
|||
SET_BIT_AR(GET_OBJ_WEAR(obj), ITEM_WEAR_TAKE);
|
||||
GET_OBJ_WEIGHT(obj) = 1;
|
||||
GET_OBJ_COST(obj) = 30;
|
||||
GET_OBJ_RENT(obj) = 10;
|
||||
obj->main_description = read_delete(GET_IDNUM(ch));
|
||||
|
||||
if (obj->main_description == NULL)
|
||||
|
|
|
|||
56
src/oasis.h
56
src/oasis.h
|
|
@ -53,7 +53,6 @@
|
|||
|
||||
#define MAX_OBJ_WEIGHT 1000000
|
||||
#define MAX_OBJ_COST 2000000
|
||||
#define MAX_OBJ_RENT 2000000
|
||||
#define MAX_CONTAINER_SIZE 10000
|
||||
|
||||
#define MAX_MOB_GOLD 100000
|
||||
|
|
@ -187,7 +186,6 @@ extern const char *nrm, *grn, *cyn, *yel;
|
|||
#define OEDIT_WEAR 8
|
||||
#define OEDIT_WEIGHT 9
|
||||
#define OEDIT_COST 10
|
||||
#define OEDIT_COSTPERDAY 11
|
||||
#define OEDIT_TIMER 12
|
||||
#define OEDIT_VALUE_1 13
|
||||
#define OEDIT_VALUE_2 14
|
||||
|
|
@ -368,35 +366,31 @@ extern const char *nrm, *grn, *cyn, *yel;
|
|||
#define CEDIT_MAX_NPC_CORPSE_TIME 26
|
||||
#define CEDIT_MAX_PC_CORPSE_TIME 27
|
||||
#define CEDIT_IDLE_VOID 28
|
||||
#define CEDIT_IDLE_RENT_TIME 29
|
||||
#define CEDIT_IDLE_MAX_LEVEL 30
|
||||
#define CEDIT_DTS_ARE_DUMPS 31
|
||||
#define CEDIT_LOAD_INTO_INVENTORY 32
|
||||
#define CEDIT_TRACK_THROUGH_DOORS 33
|
||||
#define CEDIT_NO_MORT_TO_IMMORT 34
|
||||
#define CEDIT_MAX_OBJ_SAVE 35
|
||||
#define CEDIT_MIN_RENT_COST 36
|
||||
#define CEDIT_AUTOSAVE_TIME 37
|
||||
#define CEDIT_CRASH_FILE_TIMEOUT 38
|
||||
#define CEDIT_RENT_FILE_TIMEOUT 39
|
||||
#define CEDIT_MORTAL_START_ROOM 40
|
||||
#define CEDIT_IMMORT_START_ROOM 41
|
||||
#define CEDIT_FROZEN_START_ROOM 42
|
||||
#define CEDIT_DONATION_ROOM_1 43
|
||||
#define CEDIT_DONATION_ROOM_2 44
|
||||
#define CEDIT_DONATION_ROOM_3 45
|
||||
#define CEDIT_DFLT_PORT 46
|
||||
#define CEDIT_MAX_PLAYING 47
|
||||
#define CEDIT_MAX_FILESIZE 48
|
||||
#define CEDIT_MAX_BAD_PWS 49
|
||||
#define CEDIT_SITEOK_EVERYONE 50
|
||||
#define CEDIT_NAMESERVER_IS_SLOW 51
|
||||
#define CEDIT_USE_AUTOWIZ 52
|
||||
#define CEDIT_MIN_WIZLIST_LEV 53
|
||||
#define CEDIT_MAP_OPTION 54
|
||||
#define CEDIT_MAP_SIZE 55
|
||||
#define CEDIT_MINIMAP_SIZE 56
|
||||
#define CEDIT_DEBUG_MODE 57
|
||||
#define CEDIT_IDLE_MAX_LEVEL 29
|
||||
#define CEDIT_DTS_ARE_DUMPS 30
|
||||
#define CEDIT_LOAD_INTO_INVENTORY 31
|
||||
#define CEDIT_TRACK_THROUGH_DOORS 32
|
||||
#define CEDIT_NO_MORT_TO_IMMORT 33
|
||||
#define CEDIT_AUTOSAVE_TIME 34
|
||||
#define CEDIT_CRASH_FILE_TIMEOUT 35
|
||||
#define CEDIT_MORTAL_START_ROOM 36
|
||||
#define CEDIT_IMMORT_START_ROOM 37
|
||||
#define CEDIT_FROZEN_START_ROOM 38
|
||||
#define CEDIT_DONATION_ROOM_1 39
|
||||
#define CEDIT_DONATION_ROOM_2 40
|
||||
#define CEDIT_DONATION_ROOM_3 41
|
||||
#define CEDIT_DFLT_PORT 42
|
||||
#define CEDIT_MAX_PLAYING 43
|
||||
#define CEDIT_MAX_FILESIZE 44
|
||||
#define CEDIT_MAX_BAD_PWS 45
|
||||
#define CEDIT_SITEOK_EVERYONE 46
|
||||
#define CEDIT_NAMESERVER_IS_SLOW 47
|
||||
#define CEDIT_USE_AUTOWIZ 48
|
||||
#define CEDIT_MIN_WIZLIST_LEV 49
|
||||
#define CEDIT_MAP_OPTION 50
|
||||
#define CEDIT_MAP_SIZE 51
|
||||
#define CEDIT_MINIMAP_SIZE 52
|
||||
#define CEDIT_DEBUG_MODE 53
|
||||
|
||||
/* Hedit Submodes of connectedness. */
|
||||
#define HEDIT_CONFIRM_SAVESTRING 0
|
||||
|
|
|
|||
273
src/objsave.c
273
src/objsave.c
|
|
@ -1,6 +1,6 @@
|
|||
/**************************************************************************
|
||||
* File: objsave.c Part of tbaMUD *
|
||||
* Usage: loading/saving player objects for rent and crash-save *
|
||||
* Usage: loading/saving player objects for crash-save and login restore *
|
||||
* *
|
||||
* All rights reserved. See license for complete information. *
|
||||
* *
|
||||
|
|
@ -24,7 +24,6 @@
|
|||
#include "genolc.h" /* for strip_cr and sprintascii */
|
||||
|
||||
/* these factors should be unique integers */
|
||||
#define RENT_FACTOR 1
|
||||
#define CRYO_FACTOR 4
|
||||
|
||||
#define LOC_INVENTORY 0
|
||||
|
|
@ -36,6 +35,7 @@ static void auto_equip(struct char_data *ch, struct obj_data *obj, int location)
|
|||
static void Crash_restore_weight(struct obj_data *obj);
|
||||
static int Crash_load_objs(struct char_data *ch);
|
||||
static int handle_obj(struct obj_data *obj, struct char_data *ch, int locate, struct obj_data **cont_rows);
|
||||
static void Crash_write_header(struct char_data *ch, FILE *fp, int savecode);
|
||||
|
||||
/* Writes one object record to FILE. Old name: Obj_to_store().
|
||||
* Updated to save all NUM_OBJ_VAL_POSITIONS values instead of only 4. */
|
||||
|
|
@ -117,8 +117,6 @@ int objsave_save_obj_record(struct obj_data *obj, FILE *fp, int locate)
|
|||
fprintf(fp, "Wght: %d\n", GET_OBJ_WEIGHT(obj));
|
||||
if (GET_OBJ_COST(obj) != GET_OBJ_COST(temp))
|
||||
fprintf(fp, "Cost: %d\n", GET_OBJ_COST(obj));
|
||||
if (GET_OBJ_RENT(obj) != GET_OBJ_RENT(temp))
|
||||
fprintf(fp, "Rent: %d\n", GET_OBJ_RENT(obj));
|
||||
|
||||
/* Permanent affects (array words) */
|
||||
if (GET_OBJ_AFFECT(obj)[0] != GET_OBJ_AFFECT(temp)[0] ||
|
||||
|
|
@ -272,7 +270,7 @@ int Crash_delete_crashfile(struct char_data *ch)
|
|||
char filename[MAX_INPUT_LENGTH];
|
||||
int numread;
|
||||
FILE *fl;
|
||||
int rentcode;
|
||||
int savecode;
|
||||
char line[READ_SIZE];
|
||||
|
||||
if (!get_filename(filename, sizeof(filename), CRASH_FILE, GET_NAME(ch)))
|
||||
|
|
@ -288,9 +286,9 @@ int Crash_delete_crashfile(struct char_data *ch)
|
|||
|
||||
if (numread == FALSE)
|
||||
return FALSE;
|
||||
sscanf(line,"%d ",&rentcode);
|
||||
sscanf(line,"%d ",&savecode);
|
||||
|
||||
if (rentcode == RENT_CRASH)
|
||||
if (savecode == SAVE_CRASH)
|
||||
Crash_delete_file(GET_NAME(ch));
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -301,7 +299,7 @@ int Crash_clean_file(char *name)
|
|||
char filename[MAX_INPUT_LENGTH], filetype[20];
|
||||
int numread;
|
||||
FILE *fl;
|
||||
int rentcode, timed, netcost, gold, account, nitems;
|
||||
int savecode, timed, netcost, gold, account, nitems;
|
||||
char line[READ_SIZE];
|
||||
|
||||
if (!get_filename(filename, sizeof(filename), CRASH_FILE, name))
|
||||
|
|
@ -319,23 +317,27 @@ int Crash_clean_file(char *name)
|
|||
if (numread == FALSE)
|
||||
return FALSE;
|
||||
|
||||
sscanf(line, "%d %d %d %d %d %d",&rentcode,&timed,&netcost,
|
||||
sscanf(line, "%d %d %d %d %d %d",&savecode,&timed,&netcost,
|
||||
&gold,&account,&nitems);
|
||||
|
||||
if ((rentcode == RENT_CRASH) ||
|
||||
(rentcode == RENT_FORCED) ||
|
||||
(rentcode == RENT_TIMEDOUT) ) {
|
||||
if ((savecode == SAVE_CRASH) ||
|
||||
(savecode == SAVE_LOGOUT) ||
|
||||
(savecode == SAVE_FORCED) ||
|
||||
(savecode == SAVE_TIMEDOUT) ) {
|
||||
if (timed < time(0) - (CONFIG_CRASH_TIMEOUT * SECS_PER_REAL_DAY)) {
|
||||
Crash_delete_file(name);
|
||||
switch (rentcode) {
|
||||
case RENT_CRASH:
|
||||
switch (savecode) {
|
||||
case SAVE_CRASH:
|
||||
strcpy(filetype, "crash");
|
||||
break;
|
||||
case RENT_FORCED:
|
||||
strcpy(filetype, "forced rent");
|
||||
case SAVE_LOGOUT:
|
||||
strcpy(filetype, "legacy save");
|
||||
break;
|
||||
case RENT_TIMEDOUT:
|
||||
strcpy(filetype, "idlesave");
|
||||
case SAVE_FORCED:
|
||||
strcpy(filetype, "idle save");
|
||||
break;
|
||||
case SAVE_TIMEDOUT:
|
||||
strcpy(filetype, "idle save");
|
||||
break;
|
||||
default:
|
||||
strcpy(filetype, "UNKNOWN!");
|
||||
|
|
@ -344,13 +346,7 @@ int Crash_clean_file(char *name)
|
|||
log(" Deleting %s's %s file.", name, filetype);
|
||||
return TRUE;
|
||||
}
|
||||
/* Must retrieve rented items w/in 30 days */
|
||||
} else if (rentcode == RENT_RENTED)
|
||||
if (timed < time(0) - (CONFIG_RENT_TIMEOUT * SECS_PER_REAL_DAY)) {
|
||||
Crash_delete_file(name);
|
||||
log(" Deleting %s's rent file.", name);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -363,77 +359,9 @@ void update_obj_file(void)
|
|||
Crash_clean_file(player_table[i].name);
|
||||
}
|
||||
|
||||
void Crash_listrent(struct char_data *ch, char *name)
|
||||
{
|
||||
FILE *fl;
|
||||
char filename[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH], line[READ_SIZE];
|
||||
obj_save_data *loaded, *current;
|
||||
int rentcode = RENT_UNDEF, timed, netcost, gold, account, nitems, numread, len;
|
||||
|
||||
if (!get_filename(filename, sizeof(filename), CRASH_FILE, name))
|
||||
return;
|
||||
|
||||
if (!(fl = fopen(filename, "r"))) {
|
||||
send_to_char(ch, "%s has no rent file.\r\n", name);
|
||||
return;
|
||||
}
|
||||
len = snprintf(buf, sizeof(buf),"%s\r\n", filename);
|
||||
|
||||
numread = get_line(fl, line);
|
||||
|
||||
/* Oops, can't get the data, punt. */
|
||||
if (numread == FALSE) {
|
||||
send_to_char(ch, "Error reading rent information.\r\n");
|
||||
fclose(fl);
|
||||
return;
|
||||
}
|
||||
|
||||
sscanf(line,"%d %d %d %d %d %d",
|
||||
&rentcode,&timed,&netcost,&gold,&account,&nitems);
|
||||
|
||||
switch (rentcode) {
|
||||
case RENT_RENTED:
|
||||
len += snprintf(buf+len, sizeof(buf)-len, "Rent\r\n");
|
||||
break;
|
||||
case RENT_CRASH:
|
||||
len += snprintf(buf+len, sizeof(buf)-len,"Crash\r\n");
|
||||
break;
|
||||
case RENT_CRYO:
|
||||
len += snprintf(buf+len, sizeof(buf)-len, "Cryo\r\n");
|
||||
break;
|
||||
case RENT_TIMEDOUT:
|
||||
case RENT_FORCED:
|
||||
len += snprintf(buf+len, sizeof(buf)-len, "TimedOut\r\n");
|
||||
break;
|
||||
default:
|
||||
len += snprintf(buf+len, sizeof(buf)-len, "Undef\r\n");
|
||||
break;
|
||||
}
|
||||
|
||||
loaded = objsave_parse_objects(fl);
|
||||
|
||||
for (current = loaded; current != NULL; current=current->next)
|
||||
len += snprintf(buf+len, sizeof(buf)-len, "[%5d] (%5dau) %-20s\r\n",
|
||||
GET_OBJ_VNUM(current->obj),
|
||||
GET_OBJ_RENT(current->obj),
|
||||
current->obj->short_description);
|
||||
|
||||
/* Now it's safe to free the obj_save_data list and the objects on it. */
|
||||
while (loaded != NULL) {
|
||||
current = loaded;
|
||||
loaded = loaded->next;
|
||||
extract_obj(current->obj);
|
||||
free(current);
|
||||
}
|
||||
|
||||
page_string(ch->desc,buf,0);
|
||||
fclose(fl);
|
||||
}
|
||||
|
||||
/* Return values:
|
||||
* 0 - successful load, keep char in rent room.
|
||||
* 1 - load failure or load of crash items -- put char in temple.
|
||||
* 2 - rented equipment lost (no $) */
|
||||
* 0 - successful load, keep char in load room.
|
||||
* 1 - load failure or load of crash items -- put char in temple. */
|
||||
int Crash_load(struct char_data *ch)
|
||||
{
|
||||
return (Crash_load_objs(ch));
|
||||
|
|
@ -469,6 +397,17 @@ static void Crash_restore_weight(struct obj_data *obj)
|
|||
}
|
||||
}
|
||||
|
||||
static void Crash_write_header(struct char_data *ch, FILE *fp, int savecode)
|
||||
{
|
||||
int timed = (int)time(0);
|
||||
int netcost = 0;
|
||||
int gold = ch ? GET_GOLD(ch) : 0;
|
||||
int account = ch ? GET_BANK_GOLD(ch) : 0;
|
||||
int nitems = 0;
|
||||
|
||||
fprintf(fp, "%d %d %d %d %d %d\n", savecode, timed, netcost, gold, account, nitems);
|
||||
}
|
||||
|
||||
void Crash_crashsave(struct char_data *ch)
|
||||
{
|
||||
char buf[MAX_INPUT_LENGTH];
|
||||
|
|
@ -484,8 +423,7 @@ void Crash_crashsave(struct char_data *ch)
|
|||
if (!(fp = fopen(buf, "w")))
|
||||
return;
|
||||
|
||||
/* Skip rent header logic — just write directly. */
|
||||
fprintf(fp, "Crashsave for %s\n", GET_NAME(ch));
|
||||
Crash_write_header(ch, fp, SAVE_CRASH);
|
||||
|
||||
for (j = 0; j < NUM_WEARS; j++)
|
||||
if (GET_EQ(ch, j)) {
|
||||
|
|
@ -507,22 +445,80 @@ void Crash_crashsave(struct char_data *ch)
|
|||
REMOVE_BIT_AR(PLR_FLAGS(ch), PLR_CRASH);
|
||||
}
|
||||
|
||||
/* Shortened because we don't handle rent in this game */
|
||||
/* Shortened because we don't use storage fees in this game */
|
||||
void Crash_idlesave(struct char_data *ch)
|
||||
{
|
||||
if (!ch || IS_NPC(ch))
|
||||
return;
|
||||
|
||||
Crash_crashsave(ch);
|
||||
char buf[MAX_INPUT_LENGTH];
|
||||
int j;
|
||||
FILE *fp;
|
||||
|
||||
if (!get_filename(buf, sizeof(buf), CRASH_FILE, GET_NAME(ch)))
|
||||
return;
|
||||
|
||||
if (!(fp = fopen(buf, "w")))
|
||||
return;
|
||||
|
||||
Crash_write_header(ch, fp, SAVE_FORCED);
|
||||
|
||||
for (j = 0; j < NUM_WEARS; j++)
|
||||
if (GET_EQ(ch, j)) {
|
||||
if (!Crash_save(GET_EQ(ch, j), fp, j + 1)) {
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
Crash_restore_weight(GET_EQ(ch, j));
|
||||
}
|
||||
|
||||
if (!Crash_save(ch->carrying, fp, 0)) {
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
Crash_restore_weight(ch->carrying);
|
||||
|
||||
fprintf(fp, "$~\n");
|
||||
fclose(fp);
|
||||
REMOVE_BIT_AR(PLR_FLAGS(ch), PLR_CRASH);
|
||||
}
|
||||
|
||||
/* Shortened because we don't handle rent in this game */
|
||||
/* Shortened because we don't use storage fees in this game */
|
||||
void Crash_rentsave(struct char_data *ch, int cost)
|
||||
{
|
||||
if (!ch || IS_NPC(ch))
|
||||
return;
|
||||
|
||||
Crash_crashsave(ch);
|
||||
char buf[MAX_INPUT_LENGTH];
|
||||
int j;
|
||||
FILE *fp;
|
||||
|
||||
if (!get_filename(buf, sizeof(buf), CRASH_FILE, GET_NAME(ch)))
|
||||
return;
|
||||
|
||||
if (!(fp = fopen(buf, "w")))
|
||||
return;
|
||||
|
||||
Crash_write_header(ch, fp, SAVE_LOGOUT);
|
||||
|
||||
for (j = 0; j < NUM_WEARS; j++)
|
||||
if (GET_EQ(ch, j)) {
|
||||
if (!Crash_save(GET_EQ(ch, j), fp, j + 1)) {
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
Crash_restore_weight(GET_EQ(ch, j));
|
||||
}
|
||||
|
||||
if (!Crash_save(ch->carrying, fp, 0)) {
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
Crash_restore_weight(ch->carrying);
|
||||
|
||||
fprintf(fp, "$~\n");
|
||||
fclose(fp);
|
||||
REMOVE_BIT_AR(PLR_FLAGS(ch), PLR_CRASH);
|
||||
}
|
||||
|
||||
void Crash_save_all(void)
|
||||
|
|
@ -582,7 +578,7 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
if (pending_nest <= 0) {
|
||||
if (loc < 0 || loc > NUM_WEARS) {
|
||||
mudlog(NRM, LVL_IMMORT, TRUE,
|
||||
"RENT-LOAD: bad locate %d for vnum %d; defaulting to inventory.",
|
||||
"SAVE-LOAD: bad locate %d for vnum %d; defaulting to inventory.",
|
||||
loc, GET_OBJ_VNUM(temp));
|
||||
loc = 0;
|
||||
}
|
||||
|
|
@ -641,7 +637,7 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
vnum = strtol(line + 1, NULL, 10);
|
||||
|
||||
if (vnum <= 0) {
|
||||
mudlog(NRM, LVL_IMMORT, TRUE, "RENT-LOAD: bad vnum header: '%s'", line);
|
||||
mudlog(NRM, LVL_IMMORT, TRUE, "SAVE-LOAD: bad vnum header: '%s'", line);
|
||||
temp = NULL;
|
||||
pending_locate = 0;
|
||||
pending_nest = 0;
|
||||
|
|
@ -672,7 +668,7 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
|
||||
if (!*tag) continue;
|
||||
if (!temp) {
|
||||
mudlog(NRM, LVL_IMMORT, TRUE, "RENT-LOAD: data before header ignored: '%s'", line);
|
||||
mudlog(NRM, LVL_IMMORT, TRUE, "SAVE-LOAD: data before header ignored: '%s'", line);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -684,7 +680,7 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
if (pending_nest < 0) pending_nest = 0;
|
||||
if (pending_nest > MAX_BAG_ROWS) {
|
||||
mudlog(NRM, LVL_IMMORT, TRUE,
|
||||
"RENT-LOAD: nest level %d too deep; clamping to %d.",
|
||||
"SAVE-LOAD: nest level %d too deep; clamping to %d.",
|
||||
pending_nest, MAX_BAG_ROWS);
|
||||
pending_nest = MAX_BAG_ROWS;
|
||||
}
|
||||
|
|
@ -703,7 +699,7 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
GET_OBJ_COST(temp) = (int)strtol(payload, NULL, 10);
|
||||
}
|
||||
else if (!strcmp(tag, "Rent")) {
|
||||
GET_OBJ_RENT(temp) = (int)strtol(payload, NULL, 10);
|
||||
/* Legacy tag ignored (cost-per-day no longer used). */
|
||||
}
|
||||
else if (!strcmp(tag, "Type")) {
|
||||
GET_OBJ_TYPE(temp) = (int)strtol(payload, NULL, 10);
|
||||
|
|
@ -718,7 +714,7 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
if (i < TW_ARRAY_MAX) GET_OBJ_WEAR_AR(temp, i) = (bitvector_t)words[i];
|
||||
else if (words[i])
|
||||
mudlog(NRM, LVL_IMMORT, TRUE,
|
||||
"RENT-LOAD: Wear word %d (%lu) truncated (TW_ARRAY_MAX=%d).",
|
||||
"SAVE-LOAD: Wear word %d (%lu) truncated (TW_ARRAY_MAX=%d).",
|
||||
i, words[i], TW_ARRAY_MAX);
|
||||
}
|
||||
#elif defined(GET_OBJ_WEAR_AR)
|
||||
|
|
@ -735,7 +731,7 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
if (i < EF_ARRAY_MAX) GET_OBJ_EXTRA_AR(temp, i) = (bitvector_t)words[i];
|
||||
else if (words[i])
|
||||
mudlog(NRM, LVL_IMMORT, TRUE,
|
||||
"RENT-LOAD: Extra word %d (%lu) truncated (EF_ARRAY_MAX=%d).",
|
||||
"SAVE-LOAD: Extra word %d (%lu) truncated (EF_ARRAY_MAX=%d).",
|
||||
i, words[i], EF_ARRAY_MAX);
|
||||
}
|
||||
#elif defined(GET_OBJ_EXTRA_AR)
|
||||
|
|
@ -762,7 +758,7 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
commit_current();
|
||||
}
|
||||
else {
|
||||
mudlog(NRM, LVL_IMMORT, TRUE, "RENT-LOAD: unknown tag '%s'", tag);
|
||||
mudlog(NRM, LVL_IMMORT, TRUE, "SAVE-LOAD: unknown tag '%s'", tag);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -776,11 +772,9 @@ static int Crash_load_objs(struct char_data *ch) {
|
|||
char filename[PATH_MAX];
|
||||
char line[READ_SIZE];
|
||||
char buf[MAX_STRING_LENGTH];
|
||||
char str[64];
|
||||
int i, num_of_days, orig_rent_code, num_objs=0;
|
||||
unsigned long cost;
|
||||
int i, orig_save_code, num_objs=0;
|
||||
struct obj_data *cont_row[MAX_BAG_ROWS];
|
||||
int rentcode = RENT_UNDEF;
|
||||
int savecode = SAVE_UNDEF;
|
||||
int timed=0,netcost=0,gold,account,nitems;
|
||||
obj_save_data *loaded, *current;
|
||||
|
||||
|
|
@ -803,48 +797,36 @@ static int Crash_load_objs(struct char_data *ch) {
|
|||
}
|
||||
|
||||
if (!get_line(fl, line))
|
||||
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "Failed to read player's rent code: %s.", GET_NAME(ch));
|
||||
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE, "Failed to read player's save code: %s.", GET_NAME(ch));
|
||||
else
|
||||
sscanf(line,"%d %d %d %d %d %d",&rentcode, &timed, &netcost,&gold,&account,&nitems);
|
||||
sscanf(line,"%d %d %d %d %d %d",&savecode, &timed, &netcost,&gold,&account,&nitems);
|
||||
|
||||
if (rentcode == RENT_RENTED || rentcode == RENT_TIMEDOUT) {
|
||||
sprintf(str, "%d", SECS_PER_REAL_DAY);
|
||||
num_of_days = (int)((float) (time(0) - timed) / atoi(str));
|
||||
cost = (unsigned int) (netcost * num_of_days);
|
||||
if (cost > (unsigned int)GET_GOLD(ch) + (unsigned int)GET_BANK_GOLD(ch)) {
|
||||
fclose(fl);
|
||||
mudlog(BRF, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
|
||||
"%s entering game, rented equipment lost (no $).", GET_NAME(ch));
|
||||
Crash_crashsave(ch);
|
||||
return 2;
|
||||
} else {
|
||||
GET_BANK_GOLD(ch) -= MAX(cost - GET_GOLD(ch), 0);
|
||||
GET_GOLD(ch) = MAX(GET_GOLD(ch) - cost, 0);
|
||||
save_char(ch);
|
||||
}
|
||||
}
|
||||
switch (orig_rent_code = rentcode) {
|
||||
case RENT_RENTED:
|
||||
if (savecode == SAVE_LOGOUT || savecode == SAVE_TIMEDOUT) {
|
||||
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
|
||||
"%s un-renting and entering game.", GET_NAME(ch));
|
||||
"%s entering game with legacy save code; no fees applied.", GET_NAME(ch));
|
||||
}
|
||||
switch (orig_save_code = savecode) {
|
||||
case SAVE_LOGOUT:
|
||||
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
|
||||
"%s restoring saved items and entering game.", GET_NAME(ch));
|
||||
break;
|
||||
case RENT_CRASH:
|
||||
case SAVE_CRASH:
|
||||
|
||||
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
|
||||
"%s retrieving crash-saved items and entering game.", GET_NAME(ch));
|
||||
break;
|
||||
case RENT_CRYO:
|
||||
case SAVE_CRYO:
|
||||
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
|
||||
"%s un-cryo'ing and entering game.", GET_NAME(ch));
|
||||
"%s restoring cryo-saved items and entering game.", GET_NAME(ch));
|
||||
break;
|
||||
case RENT_FORCED:
|
||||
case RENT_TIMEDOUT:
|
||||
case SAVE_FORCED:
|
||||
case SAVE_TIMEDOUT:
|
||||
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
|
||||
"%s retrieving force-saved items and entering game.", GET_NAME(ch));
|
||||
"%s retrieving idle-saved items and entering game.", GET_NAME(ch));
|
||||
break;
|
||||
default:
|
||||
mudlog(NRM, MAX(LVL_IMMORT, GET_INVIS_LEV(ch)), TRUE,
|
||||
"WARNING: %s entering game with undefined rent code.", GET_NAME(ch));
|
||||
"WARNING: %s entering game with undefined save code.", GET_NAME(ch));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -861,12 +843,12 @@ static int Crash_load_objs(struct char_data *ch) {
|
|||
}
|
||||
|
||||
/* Little hoarding check. -gg 3/1/98 */
|
||||
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s (level %d) has %d object%s (max %d).",
|
||||
GET_NAME(ch), GET_LEVEL(ch), num_objs, num_objs != 1 ? "s" : "", CONFIG_MAX_OBJ_SAVE);
|
||||
mudlog(NRM, MAX(LVL_GOD, GET_INVIS_LEV(ch)), TRUE, "%s (level %d) has %d object%s.",
|
||||
GET_NAME(ch), GET_LEVEL(ch), num_objs, num_objs != 1 ? "s" : "");
|
||||
|
||||
fclose(fl);
|
||||
|
||||
if ((orig_rent_code == RENT_RENTED) || (orig_rent_code == RENT_CRYO))
|
||||
if ((orig_save_code == SAVE_LOGOUT) || (orig_save_code == SAVE_CRYO))
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
|
|
@ -953,7 +935,7 @@ static int handle_obj(struct obj_data *temp, struct char_data *ch, int locate, s
|
|||
if (locate < 0 && locate >= -MAX_BAG_ROWS) {
|
||||
/* let obj be part of content list
|
||||
but put it at the list's end thus having the items
|
||||
in the same order as before renting */
|
||||
in the same order as before saving */
|
||||
obj_from_char(temp);
|
||||
if ((obj1 = cont_row[-locate-1])) {
|
||||
while (obj1->next_content)
|
||||
|
|
@ -966,4 +948,3 @@ static int handle_obj(struct obj_data *temp, struct char_data *ch, int locate, s
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
17
src/oedit.c
17
src/oedit.c
|
|
@ -563,8 +563,7 @@ static void oedit_disp_menu(struct descriptor_data *d)
|
|||
"%s7%s) Wear flags : %s%s\r\n"
|
||||
"%s8%s) Weight : %s%d\r\n"
|
||||
"%s9%s) Cost : %s%d\r\n"
|
||||
"%sA%s) Cost/Day : %s%d\r\n"
|
||||
"%sB%s) Timer : %s%d\r\n"
|
||||
"%sA%s) Timer : %s%d\r\n"
|
||||
"%sM%s) Min Level : %s%d\r\n"
|
||||
"%sP%s) Perm Affects: %s%s\r\n"
|
||||
"%sS%s) Script : %s%s\r\n"
|
||||
|
|
@ -574,7 +573,6 @@ static void oedit_disp_menu(struct descriptor_data *d)
|
|||
grn, nrm, cyn, buf1,
|
||||
grn, nrm, cyn, GET_OBJ_WEIGHT(obj),
|
||||
grn, nrm, cyn, GET_OBJ_COST(obj),
|
||||
grn, nrm, cyn, GET_OBJ_RENT(obj),
|
||||
grn, nrm, cyn, GET_OBJ_TIMER(obj),
|
||||
grn, nrm, cyn, GET_OBJ_LEVEL(obj),
|
||||
grn, nrm, cyn, buf2,
|
||||
|
|
@ -659,7 +657,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
|
|||
case '4':
|
||||
OLC_MODE(d) = OEDIT_MAINDESC;
|
||||
send_editor_help(d);
|
||||
write_to_output(d, "Enter action description:\r\n\r\n");
|
||||
write_to_output(d, "Enter main description:\r\n\r\n");
|
||||
if (OLC_OBJ(d)->main_description) {
|
||||
write_to_output(d, "%s", OLC_OBJ(d)->main_description);
|
||||
oldtext = strdup(OLC_OBJ(d)->main_description);
|
||||
|
|
@ -689,10 +687,6 @@ void oedit_parse(struct descriptor_data *d, char *arg)
|
|||
OLC_MODE(d) = OEDIT_COST;
|
||||
break;
|
||||
case 'a': case 'A':
|
||||
write_to_output(d, "Enter cost per day : ");
|
||||
OLC_MODE(d) = OEDIT_COSTPERDAY;
|
||||
break;
|
||||
case 'b': case 'B':
|
||||
write_to_output(d, "Enter timer : ");
|
||||
OLC_MODE(d) = OEDIT_TIMER;
|
||||
break;
|
||||
|
|
@ -875,13 +869,6 @@ void oedit_parse(struct descriptor_data *d, char *arg)
|
|||
oedit_disp_menu(d);
|
||||
return;
|
||||
|
||||
case OEDIT_COSTPERDAY:
|
||||
GET_OBJ_RENT(OLC_OBJ(d)) = LIMIT(atoi(arg), 0, MAX_OBJ_RENT);
|
||||
OLC_DIRTY(d) = 1;
|
||||
OLC_MODE(d) = OEDIT_MAIN_MENU;
|
||||
oedit_disp_menu(d);
|
||||
return;
|
||||
|
||||
case OEDIT_TIMER:
|
||||
GET_OBJ_TIMER(OLC_OBJ(d)) = LIMIT(atoi(arg), 0, MAX_OBJ_TIMER);
|
||||
OLC_DIRTY(d) = 1;
|
||||
|
|
|
|||
|
|
@ -85,9 +85,9 @@ static struct obj_data *roomsave_read_list_ctx(FILE *fl, int stop_on_E)
|
|||
break;
|
||||
}
|
||||
|
||||
/* Parse object header: O vnum timer weight cost rent */
|
||||
int vnum, timer, weight, cost, rent;
|
||||
if (sscanf(line, "O %d %d %d %d %d", &vnum, &timer, &weight, &cost, &rent) != 5)
|
||||
/* Parse object header: O vnum timer weight cost unused */
|
||||
int vnum, timer, weight, cost, unused_cost;
|
||||
if (sscanf(line, "O %d %d %d %d %d", &vnum, &timer, &weight, &cost, &unused_cost) != 5)
|
||||
continue;
|
||||
|
||||
/* IMPORTANT: read by VNUM (VIRTUAL), not real index */
|
||||
|
|
@ -110,7 +110,7 @@ static struct obj_data *roomsave_read_list_ctx(FILE *fl, int stop_on_E)
|
|||
GET_OBJ_TIMER(obj) = timer;
|
||||
GET_OBJ_WEIGHT(obj) = weight;
|
||||
GET_OBJ_COST(obj) = cost;
|
||||
GET_OBJ_RENT(obj) = rent;
|
||||
GET_OBJ_COST_PER_DAY(obj) = 0;
|
||||
|
||||
/* Clear array flags so missing slots don't keep proto bits */
|
||||
#ifdef EF_ARRAY_MAX
|
||||
|
|
@ -198,7 +198,7 @@ static struct obj_data *roomsave_read_list(FILE *fl)
|
|||
|
||||
/* ---------- Minimal line format ----------
|
||||
#R <vnum> <unix_time>
|
||||
O <vnum> <timer> <extra_flags> <wear_flags> <weight> <cost> <rent>
|
||||
O <vnum> <timer> <extra_flags> <wear_flags> <weight> <cost> <unused>
|
||||
V <i> <val[i]> ; repeated for all value slots present on this obj
|
||||
B ; begin contents of this object (container)
|
||||
E ; end contents of this object
|
||||
|
|
@ -234,7 +234,7 @@ static void write_one_object(FILE *fl, struct obj_data *obj) {
|
|||
GET_OBJ_TIMER(obj),
|
||||
GET_OBJ_WEIGHT(obj),
|
||||
GET_OBJ_COST(obj),
|
||||
GET_OBJ_RENT(obj));
|
||||
GET_OBJ_COST_PER_DAY(obj));
|
||||
|
||||
/* Extra flags array */
|
||||
#if defined(EF_ARRAY_MAX) && defined(GET_OBJ_EXTRA_AR)
|
||||
|
|
|
|||
|
|
@ -319,8 +319,8 @@ ASPELL(spell_identify)
|
|||
sprintbitarray(GET_OBJ_EXTRA(obj), extra_bits, EF_ARRAY_MAX, bitbuf);
|
||||
send_to_char(ch, "Item is: %s\r\n", bitbuf);
|
||||
|
||||
send_to_char(ch, "Weight: %d, Value: %d, Rent: %d, Min. level: %d\r\n",
|
||||
GET_OBJ_WEIGHT(obj), GET_OBJ_COST(obj), GET_OBJ_RENT(obj), GET_OBJ_LEVEL(obj));
|
||||
send_to_char(ch, "Weight: %d, Value: %d, Min. level: %d\r\n",
|
||||
GET_OBJ_WEIGHT(obj), GET_OBJ_COST(obj), GET_OBJ_LEVEL(obj));
|
||||
|
||||
switch (GET_OBJ_TYPE(obj)) {
|
||||
case ITEM_SCROLL:
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include <time.h>
|
||||
|
||||
/** If you want equipment to be automatically equipped to the same place
|
||||
* it was when players rented, set the define below to 1 because
|
||||
* it was when players saved, set the define below to 1 because
|
||||
* TRUE/FALSE aren't defined yet. */
|
||||
#define USE_AUTOEQ 1
|
||||
|
||||
|
|
@ -424,7 +424,7 @@
|
|||
/* Extra object flags: used by obj_data.obj_flags.extra_flags */
|
||||
#define ITEM_GLOW 0 /**< Item is glowing */
|
||||
#define ITEM_HUM 1 /**< Item is humming */
|
||||
#define ITEM_NORENT 2 /**< Item cannot be rented */
|
||||
#define ITEM_UNUSED2 2 /**< Reserved (unused) */
|
||||
#define ITEM_NODONATE 3 /**< Item cannot be donated */
|
||||
#define ITEM_NOINVIS 4 /**< Item cannot be made invis */
|
||||
#define ITEM_INVISIBLE 5 /**< Item is invisible */
|
||||
|
|
@ -533,13 +533,13 @@
|
|||
#define SKY_RAINING 2 /**< Weather = Rain */
|
||||
#define SKY_LIGHTNING 3 /**< Weather = Lightning storm */
|
||||
|
||||
/* Rent codes */
|
||||
#define RENT_UNDEF 0 /**< Character inv save status = undefined */
|
||||
#define RENT_CRASH 1 /**< Character inv save status = game crash */
|
||||
#define RENT_RENTED 2 /**< Character inv save status = rented */
|
||||
#define RENT_CRYO 3 /**< Character inv save status = cryogenics */
|
||||
#define RENT_FORCED 4 /**< Character inv save status = forced rent */
|
||||
#define RENT_TIMEDOUT 5 /**< Character inv save status = timed out */
|
||||
/* Save codes (legacy) */
|
||||
#define SAVE_UNDEF 0 /**< Character inv save status = undefined */
|
||||
#define SAVE_CRASH 1 /**< Character inv save status = game crash */
|
||||
#define SAVE_LOGOUT 2 /**< Character inv save status = legacy save */
|
||||
#define SAVE_CRYO 3 /**< Character inv save status = cryogenics */
|
||||
#define SAVE_FORCED 4 /**< Character inv save status = forced save */
|
||||
#define SAVE_TIMEDOUT 5 /**< Character inv save status = timed out */
|
||||
|
||||
/* Settings for Bit Vectors */
|
||||
#define RF_ARRAY_MAX 4 /**< # Bytes in Bit vector - Room flags */
|
||||
|
|
@ -711,7 +711,7 @@ struct obj_flag_data
|
|||
int extra_flags[EF_ARRAY_MAX]; /**< If it hums, glows, etc. */
|
||||
int weight; /**< Weight of the object */
|
||||
int cost; /**< Value when sold */
|
||||
int cost_per_day; /**< Rent cost per real day */
|
||||
int cost_per_day; /**< Legacy per-day value (unused) */
|
||||
int timer; /**< Timer for object */
|
||||
int bitvector[AF_ARRAY_MAX]; /**< Affects characters */
|
||||
};
|
||||
|
|
@ -776,7 +776,7 @@ struct obj_file_elem
|
|||
struct obj_affected_type affected[MAX_OBJ_AFFECT]; /**< Affects to mobs */
|
||||
};
|
||||
|
||||
/** Header block for rent files.
|
||||
/** Header block for legacy save files.
|
||||
* DO NOT CHANGE the structure if you are using binary object files
|
||||
* and already have a player base and don't want to do a player wipe.
|
||||
* If you are using binary player files, feel free to turn the spare
|
||||
|
|
@ -784,10 +784,10 @@ struct obj_file_elem
|
|||
* int datatype.
|
||||
* NOTE: This is *not* used with the ascii playerfiles.
|
||||
* NOTE 2: This structure appears to be unused in this codebase? */
|
||||
struct rent_info
|
||||
struct save_info
|
||||
{
|
||||
int time;
|
||||
int rentcode; /**< How this character rented */
|
||||
int savecode; /**< How this character saved */
|
||||
int net_cost_per_diem; /**< ? Appears to be unused ? */
|
||||
int gold; /**< ? Appears to be unused ? */
|
||||
int account; /**< ? Appears to be unused ? */
|
||||
|
|
@ -1375,7 +1375,6 @@ struct game_data
|
|||
int max_npc_corpse_time; /**< Num tics before NPC corpses decompose*/
|
||||
int max_pc_corpse_time; /**< Num tics before PC corpse decomposes.*/
|
||||
int idle_void; /**< Num tics before PC sent to void(idle)*/
|
||||
int idle_rent_time; /**< Num tics before PC is autorented. */
|
||||
int idle_max_level; /**< Level of players immune to idle. */
|
||||
int dts_are_dumps; /**< Should items in dt's be junked? */
|
||||
int load_into_inventory; /**< Objects load in immortals inventory. */
|
||||
|
|
@ -1394,16 +1393,12 @@ struct game_data
|
|||
char *NOEFFECT; /**< 'Nothing seems to happen.' */
|
||||
};
|
||||
|
||||
/** The rent and crashsave options. */
|
||||
/** Crashsave options. */
|
||||
struct crash_save_data
|
||||
{
|
||||
int free_rent; /**< Should the MUD allow rent for free? */
|
||||
int max_obj_save; /**< Max items players can rent. */
|
||||
int min_rent_cost; /**< surcharge on top of item costs. */
|
||||
int auto_save; /**< Does the game automatically save ppl? */
|
||||
int autosave_time; /**< if auto_save=TRUE, how often? */
|
||||
int crash_file_timeout; /**< Life of crashfiles and idlesaves. */
|
||||
int rent_file_timeout; /**< Lifetime of normal rent files in days */
|
||||
};
|
||||
|
||||
/** Important room numbers. This structure stores vnums, not real array
|
||||
|
|
@ -1464,7 +1459,7 @@ struct config_data
|
|||
char *CONFFILE;
|
||||
/** In-game specific global settings, such as allowing player killing. */
|
||||
struct game_data play;
|
||||
/** How is renting, crash files, and object saving handled? */
|
||||
/** How are crash files and object saving handled? */
|
||||
struct crash_save_data csd;
|
||||
/** Special designated rooms, like start rooms, and donation rooms. */
|
||||
struct room_numbers room_nums;
|
||||
|
|
|
|||
14
src/utils.h
14
src/utils.h
|
|
@ -781,8 +781,8 @@ do \
|
|||
#define GET_OBJ_TYPE(obj) ((obj)->obj_flags.type_flag)
|
||||
/** Cost of obj. */
|
||||
#define GET_OBJ_COST(obj) ((obj)->obj_flags.cost)
|
||||
/** Cost per day to rent obj, if rent is turned on. */
|
||||
#define GET_OBJ_RENT(obj) ((obj)->obj_flags.cost_per_day)
|
||||
/** Per-day value, kept for legacy object data. */
|
||||
#define GET_OBJ_COST_PER_DAY(obj) ((obj)->obj_flags.cost_per_day)
|
||||
/** Affect flags on obj. */
|
||||
#define GET_OBJ_AFFECT(obj) ((obj)->obj_flags.bitvector)
|
||||
/** Extra flags bit array on obj. */
|
||||
|
|
@ -1036,8 +1036,6 @@ do \
|
|||
#define CONFIG_MAX_PC_CORPSE_TIME config_info.play.max_pc_corpse_time
|
||||
/** How long can a pc be idled before being pulled into the void? */
|
||||
#define CONFIG_IDLE_VOID config_info.play.idle_void
|
||||
/** How long until the idle pc is force rented? */
|
||||
#define CONFIG_IDLE_RENT_TIME config_info.play.idle_rent_time
|
||||
/** What level and above is immune to idle outs? */
|
||||
#define CONFIG_IDLE_MAX_LEVEL config_info.play.idle_max_level
|
||||
/** Are death traps dumps? */
|
||||
|
|
@ -1071,20 +1069,12 @@ do \
|
|||
#define CONFIG_SCRIPT_PLAYERS config_info.play.script_players
|
||||
|
||||
/* Crash Saves */
|
||||
/** Get free rent setting. */
|
||||
#define CONFIG_FREE_RENT config_info.csd.free_rent
|
||||
/** Get max number of objects to save. */
|
||||
#define CONFIG_MAX_OBJ_SAVE config_info.csd.max_obj_save
|
||||
/** Get minimum cost to rent. */
|
||||
#define CONFIG_MIN_RENT_COST config_info.csd.min_rent_cost
|
||||
/** Get the auto save setting. */
|
||||
#define CONFIG_AUTO_SAVE config_info.csd.auto_save
|
||||
/** Get the auto save frequency. */
|
||||
#define CONFIG_AUTOSAVE_TIME config_info.csd.autosave_time
|
||||
/** Get the length of time to hold crash files. */
|
||||
#define CONFIG_CRASH_TIMEOUT config_info.csd.crash_file_timeout
|
||||
/** Get legnth of time to hold rent files. */
|
||||
#define CONFIG_RENT_TIMEOUT config_info.csd.rent_file_timeout
|
||||
|
||||
/* Room Numbers */
|
||||
/** Get the mortal start room. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue