Login
User Name:

Password:



Register

Forgot your password?
do_owhere recursive
Author: Khonsu
Submitted by: Khonsu
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
Users Online
CommonCrawl, DotBot, Google, AhrefsBot

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
489
3,794
19,649
596
Elwood

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Codebases » SmaugFUSS » Config +/- issue
Forum Rules | Mark all | Recent Posts

Config +/- issue
< Newer Topic :: Older Topic > EXT_BV not saving new act flags

Pages:<< prev 1 next >>
Post is unread #1 Apr 2, 2024 6:25 pm   Last edited Apr 2, 2024 6:42 pm by Seventeen
Go to the top of the page
Go to the bottom of the page

Seventeen
Fledgling
GroupMembers
Posts10
JoinedOct 26, 2023

 
My config +/- will add an act flag, or a pcflag, but for some odd reason it's not saving it to the player.
The defines have been set in mud.h in the player_flags enum as a PLR_ flag.
Every other flag is works completely fine, except the two new ones i created, they can be turned on or off, but when the player logs off, or a reboot, or a hotboot has been done, the flags are reset even though none of those flags are set to be removed from the player by any other means. and it's completely racking my mind..

The extended bitvector or EXT_BV for act - excepts up to 256 bits, and the enum for player_flags is carrying 134 bits, so I know it's not that the bitvector isn't being overloaded or anything as i've dbl checked. but the part I don't understand is how every other bit config is working in the config function but these two specific ones ive added, there's gotta be something stupid im missing because i need something to work lol.


void do_config(CHAR_DATA *ch, char *argument)
{
char arg[MAX_INPUT_LENGTH];

if (IS_NPC(ch))
return;

one_argument(argument, arg);

set_char_color(AT_GREEN, ch);

if (arg[0] == '\0')
{
set_char_color(AT_DGREEN, ch);
send_to_char("\n\rConfigurations ", ch);
set_char_color(AT_GREEN, ch);
send_to_char("(use 'config +/- ' to toggle, see 'help config')\n\r\n\r", ch);
set_char_color(AT_DGREEN, ch);
send_to_char("Display: ", ch);
set_char_color(AT_GREY, ch);
ch_printf(ch, "%-12s %-12s %-12s %-12s\n\r %-12s %-12s %-12s %-12s\n\r %-12s %-12s %-12s %-12s",
IS_SET(ch->pcdata->flags, PCFLAG_PAGERON) ? "[+] PAGER"
: "[-] pager",
IS_SET(ch->pcdata->flags, PCFLAG_GAG) ? "[+] GAG"
: "[-] gag",
xIS_SET(ch->act, PLR_FILTER) ? "[+] CHATFILTER"
: "[-] chatfilter",
xIS_SET(ch->act, PLR_BLIND) ? "[+] BLINDMODE"
: "[-] blindmode",
xIS_SET(ch->act, PLR_BRIEF) ? "[+] BRIEF"
: "[-] brief",
xIS_SET(ch->act, PLR_COMBINE) ? "[+] COMBINE"
: "[-] combine",
xIS_SET(ch->act, PLR_BLANK) ? "[+] BLANK"
: "[-] blank",
xIS_SET(ch->act, PLR_PROMPT) ? "[+] PROMPT"
: "[-] prompt",
xIS_SET(ch->act, PLR_ANSI) ? "[+] ANSI"
: "[-] ansi",
xIS_SET(ch->act, PLR_RIP) ? "[+] RIP"
: "[-] rip",
xIS_SET(ch->act, PLR_SHOWSTATS) ? "[+] SHOWSTATS" : "[-] showstats", <-----------------------these are the flags that i can config on or off but wont save to the player at all
xIS_SET(ch->act, PLR_SHOWBONUSES) ? "[+] SHOWBONUSES" : "[-] showbonuses");

set_char_color(AT_DGREEN, ch);
send_to_char("\n\r\n\rAuto: ", ch);
set_char_color(AT_GREY, ch);
ch_printf(ch, "%-12s %-12s %-12s %-12s %-12s\n\r"
" %-12s %-12s %-12s",
xIS_SET(ch->act, PLR_AUTOSAC) ? "[+] AUTOSAC" : "[-] autosac",
xIS_SET(ch->act, PLR_AUTOGOLD) ? "[+] AUTOGOLD" : "[-] autogold",
xIS_SET(ch->act, PLR_AUTOLOOT) ? "[+] AUTOLOOT" : "[-] autoloot",
xIS_SET(ch->act, PLR_AUTOEXIT) ? "[+] AUTOEXIT" : "[-] autoexit",
xIS_SET(ch->act, PLR_SHOWGRAPHIC) ? "[+] SHOWGRAPHIC" : "[-] showgraphic",
xIS_SET(ch->act, PLR_SHOWMAP) ? "[+] SHOWMAP" : "[-] showmap" );

set_char_color(AT_DGREEN, ch);
send_to_char("\n\r\n\rSafeties: ", ch);
set_char_color(AT_GREY, ch);
ch_printf(ch, "%-12s %-12s",
IS_SET(ch->pcdata->flags, PCFLAG_NORECALL) ? "[+] NORECALL"
: "[-] norecall",
IS_SET(ch->pcdata->flags, PCFLAG_NOSUMMON) ? "[+] NOSUMMON"
: "[-] nosummon");
if (!IS_SET(ch->pcdata->flags, PCFLAG_DEADLY))
ch_printf(ch, " %-12s %-12s",
xIS_SET(ch->act, PLR_SHOVEDRAG) ? "[+] DRAG"
: "[-] drag",
xIS_SET(ch->act, PLR_NICE) ? "[+] NICE"
: "[-] nice");
set_char_color(AT_DGREEN, ch);
send_to_char("\n\r\n\rMisc: ", ch);
set_char_color(AT_GREY, ch);
ch_printf(ch, "%-12s %-12s %-12s",
xIS_SET(ch->act, PLR_TELNET_GA) ? "[+] TELNETGA"
: "[-] telnetga",
IS_SET(ch->pcdata->flags, PCFLAG_GROUPWHO) ? "[+] GROUPWHO"
: "[-] groupwho",
IS_SET(ch->pcdata->flags, PCFLAG_NOINTRO) ? "[+] NOINTRO"
: "[-] nointro");
set_char_color(AT_DGREEN, ch);
send_to_char("\n\r\n\rSettings: ", ch);
set_char_color(AT_GREY, ch);
ch_printf_color(ch, "Pager Length (%d) Wimpy (&W%d&w)",
ch->pcdata->pagerlen,
ch->wimpy);

if (IS_IMMORTAL(ch))
{
set_char_color(AT_DGREEN, ch);
send_to_char("\n\r\n\rImmortal toggles: ", ch);
set_char_color(AT_GREY, ch);
ch_printf(ch, "Roomvnum [%s]",
// ch_printf( ch, "Roomvnum [%s] Automap [%s]",
xIS_SET(ch->act, PLR_ROOMVNUM) ? "+"
: " ");
}

set_char_color(AT_DGREEN, ch);
send_to_char("\n\r\n\rSentences imposed on you (if any):", ch);
set_char_color(AT_YELLOW, ch);
ch_printf(ch, "\n\r%s%s%s%s%s%s",
xIS_SET(ch->act, PLR_SILENCE) ? " For your abuse of channels, you are currently silenced.\n\r" : "",
xIS_SET(ch->act, PLR_NO_EMOTE) ? " The gods have removed your emotes.\n\r" : "",
xIS_SET(ch->act, PLR_NO_TELL) ? " You are not permitted to send 'tells' to others.\n\r" : "",
xIS_SET(ch->act, PLR_LITTERBUG) ? " A convicted litterbug. You cannot drop anything.\n\r" : "",
xIS_SET(ch->act, PLR_THIEF) ? " A proven thief, you will be hunted by the authorities.\n\r" : "",
xIS_SET(ch->act, PLR_KILLER) ? " For the crime of murder you are sentenced to death...\n\r" : "");
}
else
{
bool fSet;
int bit = 0;

if (arg[0] == '+')
fSet = TRUE;
else if (arg[0] == '-')
fSet = FALSE;
else
{
send_to_char("Config -option or +option?\n\r", ch);
return;
}

if (!str_prefix(arg + 1, "autoexit"))
bit = PLR_AUTOEXIT;
else if (!str_prefix(arg + 1, "autoloot"))
bit = PLR_AUTOLOOT;
else if (!str_prefix(arg + 1, "autosac"))
bit = PLR_AUTOSAC;
else if (!str_prefix(arg + 1, "chatfilter"))
bit = PLR_FILTER;
else if (!str_prefix(arg + 1, "blindmode"))
bit = PLR_BLIND;
else if (!str_prefix(arg + 1, "mapbg"))
bit = PLR_MAPBG;
else if (!str_prefix(arg + 1, "showgraphic"))
bit = PLR_SHOWGRAPHIC;
else if (!str_prefix(arg + 1, "showmap"))
bit = PLR_SHOWMAP;
else if (!str_prefix(arg + 1, "autogold"))
bit = PLR_AUTOGOLD;
else if (!str_prefix(arg + 1, "blank"))
bit = PLR_BLANK;
else if (!str_prefix(arg + 1, "brief"))
bit = PLR_BRIEF;
else if (!str_prefix(arg + 1, "combine"))
bit = PLR_COMBINE;
else if (!str_prefix(arg + 1, "prompt"))
bit = PLR_PROMPT;
else if (!str_prefix(arg + 1, "telnetga"))
bit = PLR_TELNET_GA;
else if (!str_prefix(arg + 1, "ansi"))
bit = PLR_ANSI;
else if (!str_prefix(arg + 1, "rip"))
bit = PLR_RIP;
else if (!str_prefix(arg + 1, "nice"))
bit = PLR_NICE;
else if (!str_prefix(arg + 1, "drag"))
bit = PLR_SHOVEDRAG;
else if (IS_IMMORTAL(ch) && !str_prefix(arg + 1, "vnum"))
bit = PLR_ROOMVNUM;
else if (IS_IMMORTAL(ch) && !str_prefix(arg + 1, "map"))
bit = PLR_AUTOMAP;
else if (!str_prefix(arg + 1, "showstats")) <----------------here is where their set.
bit = PLR_SHOWSTATS;
else if (!str_prefix(arg + 1, "showbonuses"))
bit = PLR_SHOWBONUSES;
// else if (!str_prefix(arg + 1, "worldmobs"))
// bit = PLR_WORLDMOBS;

/* maps */

if (bit)
{
if ((bit == PLR_FLEE || bit == PLR_NICE || bit == PLR_SHOVEDRAG) && IS_SET(ch->pcdata->flags, PCFLAG_DEADLY))
{
send_to_char("Pkill characters can not config that option.\n\r", ch);
return;
}

if (fSet)
xSET_BIT(ch->act, bit);
else
xREMOVE_BIT(ch->act, bit);
send_to_char("Ok.\n\r", ch);
return;
}
else
{
if (!str_prefix(arg + 1, "norecall"))
bit = PCFLAG_NORECALL;
else if (!str_prefix(arg + 1, "nointro"))
bit = PCFLAG_NOINTRO;
else if (!str_prefix(arg + 1, "nosummon"))
bit = PCFLAG_NOSUMMON;
else if (!str_prefix(arg + 1, "gag"))
bit = PCFLAG_GAG;
else if (!str_prefix(arg + 1, "pager"))
bit = PCFLAG_PAGERON;
else if (!str_prefix(arg + 1, "groupwho"))
bit = PCFLAG_GROUPWHO;
else if (!str_prefix(arg + 1, "@hgflag_"))
bit = PCFLAG_HIGHGAG;
else
{
send_to_char("Config which option?\n\r", ch);
return;
}

if (fSet)
SET_BIT(ch->pcdata->flags, bit);
else
REMOVE_BIT(ch->pcdata->flags, bit);

send_to_char("Ok.\n\r", ch);
return;
}
}

return;
}

Post is unread #2 Apr 3, 2024 9:03 am   Last edited Apr 3, 2024 9:04 am by Khonsu
Go to the top of the page
Go to the bottom of the page

Khonsu
Fledgling
GroupMembers
Posts3
JoinedMar 21, 2024

 
I am more familiar with 1.4 than FUSS but I don't see anything here with an entry within const char *const plr_flags [] in build.c? I don't have FUSS running but that is the only thing I can see missing.

Post is unread #3 Apr 3, 2024 5:02 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,917
JoinedJul 26, 2005

 
ok so you have them setup so you can set them but more to it all then just do_config part. Have to put where you added them in all the other places too for us to be able to help. wouldn't help to check the way it saves and loads the flags as well.

Post is unread #4 Apr 4, 2024 2:28 pm   
Go to the top of the page
Go to the bottom of the page

Khonsu
Fledgling
GroupMembers
Posts3
JoinedMar 21, 2024

 
I don't think you have declare anything new to fread/load in new flags since they're all in one place within the pc_data or something. I am looking over a commit I did and I don't think I changed anything there.

Admittedly I am pretty new to coding/mud coding.

In do_config I added:
		set_char_color( AT_DGREEN, ch );
		send_to_char( "\n\r\n\rMap:       ", ch );
		set_char_color( AT_GREY, ch );
		ch_printf( ch, "%-12s\n\r", 
					xIS_SET(ch->act, PLR_MAPPER )	? "[+] MAPPER" : "[-] mapper");


and:
		else if ( !str_prefix( arg + 1, "mapper" ) )
			bit = PLR_MAPPER;


and in mud.h added in the enum for player_flags
PLR_MAPPER,


and in build.c within const plr_flags [] = added:
, "mapper"


Honestly that looks like it.

Double check how many bits you can set as well in mud.h? I think the standard is 128. I would be extremely cautious changing any of this though. Changing the alignment or number of these could offset where its looking for the flags and cause a lot of issues. I'd do a full backup before messing with it at all personally.
/*
 * Defines for extended bitvectors
 */
#ifndef INTBITS
  #define INTBITS	32
#endif
#define XBM		31	/* extended bitmask   ( INTBITS - 1 )	*/
#define RSV		5	/* right-shift value  ( sqrt(XBM+1) )	*/
#define XBI		4	/* integers in an extended bitvector	*/
#define MAX_BITS	XBI * INTBITS

Post is unread #5 Apr 4, 2024 6:57 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,917
JoinedJul 26, 2005

 
ok its been ages since i messed with flags but lets see, while on the character set the flags on and save then look at your pfile and see what it saved for your act in your pfile then turn them off and save and see what it saved in your pfile. if it is different with them on and off great they are being set and it knows it and is saving the change. if not then you need to see why it isn't. If it is doing fine up to that point then you need to figure out why its loosing them on loading up the pfile.

Post is unread #6 Apr 14, 2024 11:38 pm   
Go to the top of the page
Go to the bottom of the page

Seventeen
Fledgling
GroupMembers
Posts10
JoinedOct 26, 2023

 
I've since fixed the issue, thanks though guys.

Post is unread #7 Apr 15, 2024 7:51 am   
Go to the top of the page
Go to the bottom of the page

Khonsu
Fledgling
GroupMembers
Posts3
JoinedMar 21, 2024

 
Could you share your solution in case someone comes across the same issue?

Pages:<< prev 1 next >>