Welcome to the Builder Academy

Question login and prompt

More
21 Mar 2018 22:05 #7751 by Moss
login and prompt was created by Moss
Hey everyone. New member here. Just wanted to start by saying what a great thing you people have going here.
I'm very new to CircleMUD/tbaMUD, but I have decided to use this for my new project, for various reasons.
I'm a bit OCD about things, and I always find myself trying to learn the hard stuff first.

Anyways, I have been going through some options and code, changing stuff like combat speed, map icons, room name colors, everything going smoothly so far.

Earlier I tried turning my prompt off, and this caused two problems. There is still a '>' character on the line showing the empty prompt, and I can't turn the prompt back on. prompt all and prompt auto say "Okay", but don't actually do anything.

Can anyone suggest a way to completely disable prompt? and/or any snippet for a new prompt?

My other question is about the very top "Attempting to detect" client stuff on the login screen.

Can this be disabled too? or is some of that information stored and used?

If anyone could point me in the right direction would be appreciated.

I like to customize everything from the very first screen a player will see, to all of the commands they will be using mostly while they play, before I start adding new stuff.

Please Log in or Create an account to join the conversation.

More
23 Mar 2018 14:30 - 24 Mar 2018 00:48 #7765 by lacrc
Replied by lacrc on topic login and prompt
Hi Moss!
Also a new member here and yeah, this thing going here looks pretty neat indeed! :)
I would also like to take the time to say thanks to everybody here and anybody else for their work in maintaining circle and developing TBA! You guys are AWESOME!

But on to your thread:
1- It's kinda hard to tell why your prompt isn't working from just what you described. It appears that the prompt command is working fine but I can't tell if it's (or isn't) setting the flags for the prompt to work out properly or if you disabled the flags from working.

In stock TBA what happens when you "prompt" is that it sets or removes three flags:
H - Sets/removes the PRF_DISPHP flag;
M - Sets/removes the PRF_DISPMANA flag
V - Sets/removes the PRF_DISPMOVE flag

If you "prompt all" it sets all of them, if you prompt "off" it removes them.
If you "prompt auto" it sets/unsets the PRF_DISPAUTO flag.
This is all done in ACMD(do_display) in act.other.c.

THEN when output is sent to the player all those flags are checked and the particular values for each flag are printed to the player. This is done in make_prompt() in comm.c.
You will find in that function all the checks to the flags mentioned (and some others), they all add something to the player's prompt, which is also where an extra '>' is added.

But what do you mean by "completely disable prompt" you want just a blank line added to the end of every output sent to the player or just set it as a fixed and the player won't be able to change it?

2 - The "Attempting to detect stuff" at the beginning is part of Kavir's Protocol Plugin (see protocol.c and protocol.h) that detects what kind of protocols (and other stuff like color or UTF-8 capability) the player's client supports, since the player can login from different clients that info is stored only for the current session in the descriptor's data, it isn't saved to the player file or anything like that.

Then onto changes, what *I* did was reduce the wait time of protocol negotiation, something that someone in the forums said (don't remember who or what post, sorry you!!).
In comm.c search for:
Code:
if (CONFIG_PROTOCOL_NEGOTIATION) {
And then right under it you'll see:
Code:
NEW_EVENT(ePROTOCOLS, newd, NULL, 1.5 * PASSES_PER_SEC);
You can reduce that time but the person who suggested that also said that if you reduce it too much it can cause some problems (I reduced it to 0.5 and it's working fine).

If you were thinking about removing/editing the messages you have the first message right bellow the line I mentioned before:
Code:
write_to_output(newd, "Attempting to Detect Client, Please Wait...\r\n");
The other message, sent after the player enters the game, I think is in interpreter.c.
The same code is called twice, in perform_dupe_check() and in nanny(), for cases when the player is reconnecting and when the player is joining the game, respectively. You can find both instances searching interpreter.c for:
Code:
MXPSendTag( d, "<VERSION>" );

Well, hope this helps you, and if I said some bs someone please step in!
Last edit: 24 Mar 2018 00:48 by lacrc.
The following user(s) said Thank You: thomas, Moss

Please Log in or Create an account to join the conversation.

More
26 Mar 2018 03:28 #7802 by Moss
Replied by Moss on topic login and prompt
Hey, Thank you for the detailed reply.
I manged to speed it up with the 0.5 like you said, cleared a line of text, and commented out a few lines of text.
Works perfect, no longer see any of that MXP stuff but it's still stored.

Still working on the prompt, would be nice to have it completely removed.

I have a better understanding on how to properly shutdown, compile and restart the MUD now.
I'm also using grepWin so that is really helping too. (thanks whoever/wherever I saw that)

Please Log in or Create an account to join the conversation.

More
26 Mar 2018 11:53 #7804 by lacrc
Replied by lacrc on topic login and prompt
But why would you want to completely remove the prompt? It's so nice!! JK :P

Well to completely remove the prompt you would have to remove all the prompt-making stuff from the make_prompt() function in comm.c.
I suggest that you leave the parts that assemble the prompt for people currently paging something (after page_string() is called) and for immortals switched to mobs, in the end you would have something like this for your make_prompt() function:
Code:
static char *make_prompt(struct descriptor_data *d) { static char prompt[MAX_PROMPT_LENGTH]; /* Note, prompt is truncated at MAX_PROMPT_LENGTH chars (structs.h) */ if (d->showstr_count) snprintf(prompt, sizeof(prompt), "[ Return to continue, (q)uit, (r)efresh, (b)ack, or page number (%d/%d) ]", d->showstr_page, d->showstr_count); else if (d->str) strcpy(prompt, "] "); /* strcpy: OK (for 'MAX_PROMPT_LENGTH >= 3') */ else if (STATE(d) == CON_PLAYING && IS_NPC(d->character)) snprintf(prompt, sizeof(prompt), "%s> ", GET_NAME(d->character)); else *prompt = '\0'; return (prompt); }
Keep in mind that you would also need to remove the commands related to the prompt (ie. do_display) and the flags (PRF_DISPAUTO and etc), since those will no longer have any use, or at least repurpose them into some other flag, otherwise you'll be left with things being set up without any use and that's not good practice! :)

Please Log in or Create an account to join the conversation.

More
13 Apr 2018 23:06 #7914 by Moss
Replied by Moss on topic login and prompt
Tried using a fancy prompt snippet from circlemud.org, had to change a bunch of stuff, but I finally got it working.
I didn't really like it that much, so I decided to get rid of it. Haha.

Anyways, I'm now trying to figure out how to remove these extra lines of blank space between each combat round,
Code:
k spi You try to pierce the small spider but pierce the air instead! The small spider tickles you as it bites you. You barely pierce the small spider. The small spider tickles you as it bites you. You tickle the small spider as you pierce it. The small spider tickles you as it bites you. You pierce the small spider. The small spider is stunned, but will probably regain consciousness again. You pierce the small spider hard. The small spider is mortally wounded, and will die soon, if not aided. You pierce the small spider's heart, you heartbreaker you... The small spider is dead! R.I.P. You receive 38 experience points. Your blood freezes as you hear the small spider's death cry. You can't seem to find any coins in the corpse of the small spider. The corpse of the small spider seems to be empty. Your sacrifice to the Gods is rewarded with 1 gold coins

Any suggestions? Thank you.

Please Log in or Create an account to join the conversation.

More
14 Apr 2018 00:49 - 14 Apr 2018 00:51 #7917 by lacrc
Replied by lacrc on topic login and prompt
Well you're probably looking for a lost "\r\n" from the snippet or something similar.

Does it only happen during combat? You might look in fight.c, on the skill_message() and dam_message().

But maybe that's not the cause since the double blank lines only show after the whole combat.

Isn't it your prompt? Or the not-prompt (since there isn't any lol)
Did the snippet add any special functionality to the prompt during combat?

You might wanna check make_prompt() in comm.c for a leftover "\r\n" with a combat check like:
Code:
FIGHTING(d->character)
Last edit: 14 Apr 2018 00:51 by lacrc.

Please Log in or Create an account to join the conversation.

Time to create page: 0.287 seconds