Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   loadPlayer() (https://forums.graalonline.com/forums/showthread.php?t=87580)

cbk1994 08-24-2009 06:04 AM

loadPlayer()
 
Would be wonderful if there was a way to modify the attributes of offline players. Something like

PHP Code:

temp.pl loadPlayer("cbk1994");
pl.clientr.var = "foo"

If the player is online, loadPlayer should just return the TServerPlayer object (like findPlayer).

I'm not sure what the most effective way to save changes is, but I'm sure it's somehow possible. I'm guessing the garbage collector, which "destroys" the object, could save it once all references to it have been dropped (the function ends)?

fowlplay4 08-24-2009 06:37 AM

It'd be nice to edit variables like that instead of having a DB-NPC and queuing actions to be executed when they log on. Hell even if we could only read variables it would definitely come in handy.

oo_jazz_oo 08-24-2009 07:09 AM

Could this be done by editing the players files in the accounts folder?

I remember some time ago a friend gave themselves full folder rights by changing it in their accounts folder...so, if that is possible, couldnt you also edit variables in the player via the players file?

e: Im not saying to do that, im just saying isnt it possible. Because if its possible that way, im sure they could add a built in function to do it...because the only way to accomplish that would be to give the npc server write rights to the accounts folder...and that could be bad if the wrong people knew about that.

cbk1994 08-24-2009 07:40 AM

Quote:

Originally Posted by oo_jazz_oo (Post 1518089)
Could this be done by editing the players files in the accounts folder?

I remember some time ago a friend gave themselves full folder rights by changing it in their accounts folder...so, if that is possible, couldnt you also edit variables in the player via the players file?

e: Im not saying to do that, im just saying isnt it possible. Because if its possible that way, im sure they could add a built in function to do it...because the only way to accomplish that would be to give the npc server write rights to the accounts folder...and that could be bad if the wrong people knew about that.

Yes, the accounts folder holds folder rights, as well as all the other rights, which is why you should avoid giving the NPC-server write access to the accounts folder. However, yes, it would be possible using the accounts folder.

oo_jazz_oo 08-24-2009 07:46 AM

Well then, it shouldn't be that hard to implement what you asked. ;P

I think this would make alot of things easier...it sure as hell could have helped me in the past. >_>

Admins 08-24-2009 11:31 AM

You can load offline players but not modify / save yet:
PHP Code:

temp.pl = new TServerPlayer("cbk1994");
echo(
"check: " temp.pl.nick);
temp.pl.destroy(); 


Crow 08-24-2009 02:26 PM

Quote:

Originally Posted by Stefan (Post 1518115)
but not modify / save

Well, that's the point, that's what we're requesting. Please?

WhiteDragon 08-24-2009 03:51 PM

Quote:

Originally Posted by Stefan (Post 1518115)
You can load offline players but not modify / save yet:
PHP Code:

temp.pl = new TServerPlayer("cbk1994");
echo(
"check: " temp.pl.nick);
temp.pl.destroy(); 


Just wondering, do you have to explicitly destroy it?

cbk1994 08-24-2009 09:50 PM

Quote:

Originally Posted by Stefan (Post 1518115)
You can load offline players but not modify / save yet:
PHP Code:

temp.pl = new TServerPlayer("cbk1994");
echo(
"check: " temp.pl.nick);
temp.pl.destroy(); 


Excellent, this should be documented somewhere. I'll try to add it to the wiki later.


All times are GMT +2. The time now is 01:25 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.