Page 1 of 1

Deleting a GMCP client entry from the server

Posted: Fri Jan 25, 2019 10:11 am
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?

Re: Deleting a GMCP client entry from the server

Posted: Fri Jan 25, 2019 3:46 pm
by Vadi
Send a table without the key in it?

Re: Deleting a GMCP client entry from the server

Posted: Fri Jan 25, 2019 8:50 pm
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",

Re: Deleting a GMCP client entry from the server

Posted: Fri Jan 25, 2019 9:58 pm
by Vadi
It's unclear to me why do you need to get rid of it?

Re: Deleting a GMCP client entry from the server

Posted: Fri Jan 25, 2019 11:35 pm
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.