Deleting a GMCP client entry from the server

Share your scripts and packages with other Mudlet users.
Post Reply
Jaren
Posts: 31
Joined: Sun Nov 17, 2013 1:55 pm

Deleting a GMCP client entry from the server

Post by Jaren »

We have been adding GMCP to our server and things have been working out nicely but during the course of our development I have stumbled onto a small problem that requires me delete a key/value entry from the clients GMCP memory.

I made a work around for this by setting the value of a key to "del" and then having my plugins search for that and delete it manually by setting it to nil but this feels like a bad way to do this.

i.e.

Code: Select all

0xFF 0xFA 0xC9 package.testkey "del" 0xFF 0xF0
I know that I can send a null data value but code in Mudlet knows that null and nil is not the same thing so it keeps the key/value and just plops it there as null.

Anyone have an idea of how to fix this or is my work around the only way to go?

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Deleting a GMCP client entry from the server

Post by Vadi »

Send a table without the key in it?

Jaren
Posts: 31
Joined: Sun Nov 17, 2013 1:55 pm

Re: Deleting a GMCP client entry from the server

Post by Jaren »

Thanks, A good idea but sadly it just leaves a placeholder. Looks like I can overwrite stuff pretty easily but getting rid of it entirely is the tricky thing.

Tried these:

Code: Select all

0xFF 0xFA 0xC9 package.testkey [] 0xFF 0xF0
0xFF 0xFA 0xC9 package.testkey {} 0xFF 0xF0
This will not parse:

Code: Select all

0xFF 0xFA 0xC9 package.testkey {:test} 0xFF 0xF0
This will parse but leaves a weird function:

Code: Select all

0xFF 0xFA 0xC9 package.testkey  0xFF 0xF0
Outputs:
testkey = "function: 06E18230",

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Deleting a GMCP client entry from the server

Post by Vadi »

It's unclear to me why do you need to get rid of it?

Jaren
Posts: 31
Joined: Sun Nov 17, 2013 1:55 pm

Re: Deleting a GMCP client entry from the server

Post by Jaren »

I have a plugin which lists all the skills that the player is currently monitoring. They also have the ability to toggle which skills are being monitored so if I start sending live data as to how their monitored skills are progressing, It could run into a situation where they un-toggle a particular skill but that skill will still be listed there despite now being dormant doing nothing.

Like I said, I made a work around for this client side but I was just hoping that there was something easy that the server could send to Mudlet telling it to remove the entry entirely. Plus when the client restarts it erases all the gmcp data anyways. Thanks for the input though.

Post Reply