Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ MXP and Pueblo
➜ mxp entities lagging player
mxp entities lagging player
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Lextasy
(5 posts) Bio
|
Date
| Sun 02 Apr 2006 08:22 PM (UTC) |
Message
| I am experiencing two problems, I call the function below whenever the prompt is called. This seems to cause the player a quarter/second or so of lag.
Also, the mxp variables show up for wintin.NET and zmud, but I can't seem to find them anywhere in mushclient. Any chance someone has an idea or two to toss out,whether it has to do with the lag or missing variables in mush?
void mxp_add_prompt_tags(struct descriptor_data *descriptor)
{
char mxp_entity[ 10000 ], mxp_buf[ 10000 ];
if (!descriptor->character)
return;
if((descriptor->mxp) && IS_SET(descriptor->character->specials.player_act,PLR_MXP))
{
snprintf( mxp_buf, 10000, "%s%s%s%s%s%s%s%s", MXP_SECURE_STRING,
"<!ENTITY CurrentHP %i PUBLISH>", "<!ENTITY CurrentMana %i PUBLISH>",
"<!ENTITY CurrentMove %i PUBLISH>", "<!ENTITY MaxHP %i PUBLISH>",
"<!ENTITY MaxMana %i PUBLISH>", "<!ENTITY MaxMove %i PUBLISH>",
MXP_LOCKED_STRING );
snprintf( mxp_entity, 10000, mxp_buf, GET_HIT(descriptor->character),
GET_MANA(descriptor->character), GET_MOVE(descriptor->character),
GET_MAX_HIT(descriptor->character), GET_MAX_MANA(descriptor->character),
GET_MAX_MOVE(descriptor->character));
write_to_descriptor(descriptor, mxp_entity);
}
Then I call this function in comm.c(DIKU) where make_prompt is called... | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #1 on Sun 02 Apr 2006 08:27 PM (UTC) |
Message
| What does this have to do with MUSHclient? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Lextasy
(5 posts) Bio
|
Date
| Reply #2 on Sun 02 Apr 2006 08:34 PM (UTC) Amended on Sun 02 Apr 2006 08:35 PM (UTC) by Lextasy
|
Message
| Always love responses like this, god forbid its my first post on these forums and I may of placed it in the wrong category.
How about the second question, any clue why the entities are not recording inside of mushclient? Or are they and I simply can't find them? Or isn't that related to mushclient enough for you?
I certainly hope there are less rude people about than this... | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #3 on Sun 02 Apr 2006 08:43 PM (UTC) |
Message
| There's nothing rude about a simple question. You're taking it out of context. I didn't notice you asked about MUSHclient though. I don't understand your question. What variables? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Lextasy
(5 posts) Bio
|
Date
| Reply #4 on Sun 02 Apr 2006 08:50 PM (UTC) |
Message
| I'm trying to get the entities for hps, maxhps, etc to show up inside of Mushclient. I think its under file-world properties, variables.
I have defined a bunch of mxp elements such as roomname,roomexits,etc. They all show up there. However the entities in the initial post here are not there,I can't seem to find them anywhere. However they are showing up in other clients so Im wondering if Im simply looking in the wrong spot...
Hope Im speaking clearly enough because this is all relatively new to me...
Thanks for trying to help btw, staring at the same problem for hours is getting a little frustrating-which is probably why I got upset, sorry about that.
| Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #5 on Sun 02 Apr 2006 08:52 PM (UTC) |
Message
| I'm not familiar with MXP very much either. You have MXP enabled on MUSHclient, correct? I believe MUSHclient trys to follow the standards of MXP, so if something does not appear to be working that may be related to it.
Have you tried looking at MUDs that have MXP? In the download section here, there is a Smaug with MXP. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #6 on Sun 02 Apr 2006 09:16 PM (UTC) |
Message
|
Quote:
Also, the mxp variables show up for wintin.NET and zmud, but I can't seem to find them anywhere in mushclient. Any chance someone has an idea or two to toss out,whether it has to do with the lag or missing variables in mush?
First, does this lag also occur in MUSHclient?
I tried sending part of that to MUSHclient with no noticeable lag. You may want to confirm if the lag is server-side or client-side.
I can't think why it would take a long time.
As for the second question, entities are stored internally in MUSHclient in its "custom server entities" table, which can be retrieved using a script, like this:
currenthp = GetEntity ("currenthp")
Note that the entity names are forced to lower case (somewhere it is documented in MXP that entities are not case-dependent) and thus using the exact capitalization you used (CurrentHP) will return nothing.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Lextasy
(5 posts) Bio
|
Date
| Reply #7 on Sun 02 Apr 2006 10:03 PM (UTC) |
Message
| Thanks a bunch, that answers why I was having a tough time finding the entities via MUSHclient.
The lag is server side, I notice it in all the MXP clients I am testing with. Now Im at a loss as to why. It has to be something with the amount of information I am sending to the player per prompt?
Thanks for all the help, its greatly appreciated...
Very nice client :-)
| Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #8 on Sun 02 Apr 2006 11:05 PM (UTC) |
Message
| Thanks. :)
As for your problem, I am at a loss to understand this code. For a start, you are allocating, on the stack, two buffers of 10,000 characters to hold something like this:
<!ENTITY CurrentHP 9999 PUBLISH>
<!ENTITY CurrentMana 9999 PUBLISH>
<!ENTITY CurrentMove 9999 PUBLISH>
<!ENTITY MaxHP 9999 PUBLISH>
<!ENTITY MaxMana 9999 PUBLISH>
<!ENTITY MaxMove 9999 PUBLISH>
That is around 200 bytes, nothing like 10,000. A buffer of 300 bytes would be plenty.
Allocating 20 Kb bytes every time the function is called may well slow the system down due to page faults.
The second thing is, why the two snprintfs? You seem to be using the first one to simply put into a (large) buffer the thing you want to send to the second one. Why not something like this? ...
void mxp_add_prompt_tags (struct descriptor_data *descriptor)
{
char mxp_buf [300]; /* increase if you add more stuff */
if (!descriptor->character)
return;
if ((descriptor->mxp) &&
IS_SET(descriptor->character->specials.player_act,PLR_MXP))
{
snprintf (mxp_buf, sizeof (mxp_buf) ,
"%s" /* secure string */
"<!ENTITY CurrentHP %i PUBLISH>"
"<!ENTITY CurrentMana %i PUBLISH>"
"<!ENTITY CurrentMove %i PUBLISH>"
"<!ENTITY MaxHP %i PUBLISH>"
"<!ENTITY MaxMana %i PUBLISH>"
"<!ENTITY MaxMove %i PUBLISH>"
"%s", /* locked string */
MXP_SECURE_STRING,
GET_HIT(descriptor->character),
GET_MANA(descriptor->character),
GET_MOVE(descriptor->character),
GET_MAX_HIT(descriptor->character),
GET_MAX_MANA(descriptor->character),
GET_MAX_MOVE(descriptor->character),
MXP_LOCKED_STRING);
write_to_descriptor(descriptor, mxp_buf);
}
}
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #9 on Sun 02 Apr 2006 11:07 PM (UTC) |
Message
|
Quote:
This seems to cause the player a quarter/second or so of lag.
...
The lag is server side ...
In that case, you are causing *all* players a quarter second of lag, every time one of them is shown the prompt. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Lextasy
(5 posts) Bio
|
Date
| Reply #10 on Mon 03 Apr 2006 01:33 AM (UTC) |
Message
| I appreciate all the help, as it turns out is wasn't the code lagging my server, but the placement of it. Instead of calling it everytime the mud moves, I'm calling it everytime the prompt changes. Now it works as it should.
And I am able to call all of my entities through MUSHclient:)
Is there a list of popular entities and elements anywhere?
I have added hps, maxhps, mvs, maxmoves, mana, maxmana. Then all of the room stuff such as name, exits, description.
I do apologize for swaying off topic and feel free to move the thread if it helps...
| Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #11 on Thu 06 Apr 2006 10:18 PM (UTC) |
Message
| I am not aware of a list of popular entities, but as this is specific to your particular MUD I don't think it matters. The custom entities are separate from the standard ones in MUSHclient, so you can pretty-well call them anything. I wouldn't however use standard HTML entities (like < ) for obvious reasons. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
26,449 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top