Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Graal V4 Main Forum (https://forums.graalonline.com/forums/forumdisplay.php?f=143)
-   -   onPlayerLogout() (https://forums.graalonline.com/forums/showthread.php?t=70398)

Twinny 11-26-2006 06:24 AM

onPlayerLogout()
 
Would it be possible to allow scripts to modify the object created by this function? I would like to erase a load of clientr. flags when the player logs off.

Gambet 11-26-2006 06:36 AM

You can create a similar effect by doing so when the moment they log on. Though, I agree, that would be nice.

Ducati_Link 11-26-2006 08:00 AM

Great idea! I would like that. :D

contiga 11-26-2006 02:18 PM

That'd be awesome.

xAndrewx 11-26-2006 02:29 PM

I'm guessing you'd use something like that clientrc command to view offline player's details.

Skyld 11-26-2006 03:41 PM

Quote:

Originally Posted by xAndrewx (Post 1247356)
I'm guessing you'd use something like that clientrc command to view offline player's details.

Client-RC only works clientside and if you have RC rights.

Twinny 11-26-2006 03:43 PM

Not sure what they are.. all I want to have is the ability for any to script to write to an offline player.

For example,
PHP Code:

function onPlayerLogout(pl)
{
  
pl.clientr.logout getTime();
  
pl._mudClear(); //Removes all clientr. beginning with 'mud'



Gambet 11-27-2006 10:51 PM

Quote:

Originally Posted by Twinny (Post 1247380)
Not sure what they are.. all I want to have is the ability for any to script to write to an offline player.

For example,
PHP Code:

function onPlayerLogout(pl)
{
  
pl.clientr.logout getTime();
  
pl._mudClear(); //Removes all clientr. beginning with 'mud'




It would be the same thing to clear them the moment they logged back on. Clearing their strings while they're offline does you no good, since no changes will be effected until the next time they log on anyways.

I don't really see why you would need to write to offline players, when you can do the same thing the moment they log on.

Have an NPC check to see if the player is online, and if they log off, then have it save to a DB or something and then have the DB be read when a player logs on and if their account is in the DB, then the strings would clear.


There are several ways you can do such a thing, or rather, create the same effect.

Twinny 11-27-2006 11:17 PM

Apparently having alot of clientr. 's leads to a slower login.

Gambet 11-28-2006 12:16 AM

Quote:

Originally Posted by Twinny (Post 1247836)
Apparently having alot of clientr. 's leads to a slower login.



That shouldn't happen. I believe Graal truncates a player's flags after it exceeds a certain amount.

Twinny 11-28-2006 03:49 AM

Well...it's still an idea >_<

Andy0687 12-01-2006 08:47 AM

Quote:

Originally Posted by Gambet (Post 1247850)
That shouldn't happen. I believe Graal truncates a player's flags after it exceeds a certain amount.

I think he is talking about how many flags are in the players attribs, not how long the string is.

So far to my knowledge there is no end to the flags you can store on a player, in 4+ years at babylon i never found one.

KuJi 12-01-2006 09:34 AM

Hehe, I had a problem thinking the length was too long, I later found out I had a function that caused lag on clientside that was no longer used.. lol =(

jake13jake 12-07-2006 06:09 AM

Quote:

Originally Posted by Twinny (Post 1247297)
Would it be possible to allow scripts to modify the object created by this function? I would like to erase a load of clientr. flags when the player logs off.

I imagine this would actually save a lot of load-up time.

When the player logs in, they need to download all of their weapons, client.flags, clientr.flags, saved attributes, and all of the surrounding players/NPCs.

Would it be better to locally store client/r.flags and other data and let there be a single packet that the server would have to send in order for those to be used? Wouldn't know if it does that.

Even better, the server could specify to the client which flags it can't pre-load from local storage before using them. I wonder if the login event in the control-NPC is executed before the player loads anything else, otherwise it would be kindof strange to delete client/r.flags when that happens.

Admins 12-09-2006 02:31 AM

Normally you can write the game so that it doesn't use any client/clientr flags that are not necessary. Most flags don't require a lot of network bandwidth though since e.g. items use similar names and can be easily compressed when sent to the client.
The reason why you currently cannot modify the player data (except on kingdoms) is that the gserver is managing the player data and when the npcserver is handling the logout the gserver has already saved and deleted the player object. This will be changed sometime in the future though, there will be special npcservers managing the player login and rights, and the playerworld npcserver will manage the game data itself.


All times are GMT +2. The time now is 08:05 AM.

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