| zokemon |
11-09-2006 04:27 AM |
The mass deletion of client. and clientr. variables! Yay!
So I want to be able to delete mass amounts of client. and clientr. variables in the most efficient way.
First thing I tried:
NPC Code:
for (temp.d : client.blah.getdynamicvarnames()) {
("client.blah." @ temp.d) = "";
}
A for loop that checks all the getdynamicvarnames() and deletes all that data in each sub variable. Problem here is you get a "folder depth" issue where you have to have for loops inside for loops if you have variables like this:
client.blah.rar.test (while trying to clear client.blah)
This method works but is obviously very lag intensive.
Second thing I tried:
NPC Code:
client.blah.copyfrom(null);
This is a much easier way to clear all the data and sub-variables in the variable but there remains a big problem with client. and clientr. variables:
If a client. or clientr. variable is cleared using a method such as copyfrom(), The effect can be seen on the side it is done on (clientside or serverside) but the effect does not transfer over to the other side and also does not save to the account (you don't see the changes if you do "/open account" in rc).
Third thing I tried
NPC Code:
client.blah = new TStaticVar("client.blah");
client.blah.destroy();
client.blah = new TGraalVar("client.blah");
Maybe making a client. or clientr. variable an object and then destroying it will work? Not quiet. It deletes all the data and sub-variables like we want but it has the same problem as above: The data does transfer to the other side.
So...
Anyone have another way to do this? Thoughts on the process? Ideas? Questions? Comments?
Thanks,
- Zero
|