Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-27-2009, 01:12 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
getCommunityName(), getAccount()

getCommunityName(str account) - returns the community name of the player specified. Accepts either an account name or community name.

getAccount(str cname) - returns the account of the player specified. Accepts either an account name or community name.

It seems ridiculous that we're expected to adapt to community names without even basic functions like these available.
__________________
Reply With Quote
  #2  
Old 11-27-2009, 03:43 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
findPlayer(account).communityname

findPlayerbyCommunityName(communityname).account


Is there any reason why these won't do? And why would you ever use getAccount(account) or getCommunityName(communityname)?
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #3  
Old 11-27-2009, 04:51 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Situations when the account is offline would make these handy, looks a little cleaner code-wise as well.
__________________
Quote:
Reply With Quote
  #4  
Old 11-27-2009, 06:31 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by LoneAngelIbesu View Post
findPlayer(account).communityname

findPlayerbyCommunityName(communityname).account


Is there any reason why these won't do? And why would you ever use getAccount(account) or getCommunityName(communityname)?
Absolutely. For example, a support center where you want to display the community name, a bank system where you can enter a community name to transfer money to the account (the same thing for adding to gangs, businesses, ...), staff account lookups, etc.
__________________
Reply With Quote
  #5  
Old 11-27-2009, 06:46 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
So does findplayer(account) work for old accounts and graal12345 accounts as well? If not, it should, as scripters shouldn't need to do constant checks between old accounts and new... and in that case:
findplayer(acc).displayacc or some other sort of short var that will return the name players desire to see(in the case of old accounts... the account, in the case of new accounts, the community name).

So simply: findplayer(account) should work seemlessly between the two account types. After all, new accounts still use a static account name in the form of graal12345, and scriptwise, as far as data concerns, scripters don't need the community name. In that case, findplayer(account).account should return either the old account name or the new graal123546 account(which is what scripters need for behind-the-scene stuff).

Display-wise, just an easy way to display the desired account to the player in the form of old account name or their community name, where graal12345 is undesirable(unless they have no community name, in which graal12345 should be substituted).

I haven't messed with community names much, so I'm not sure if these sort of things are already in place.

So ideally, if I were writing, say... a bank script, the best way I can think of to reflect all those changes would be as such:
PHP Code:
function onActionServerside(cmd) {
  if (
cmd == "deposit") {
    
temp.findnpc("BankDB");
    
temp.acc findplayer(params[1]).account;
    
n.(@ "stash_" acc) += params[2];
    
acc.chat "A total of " params[2] @ " has been deposited to the account of " acc.displayaccount;
  } 
}
//#CLIENTSIDE
function onPlayerchats() {
  if (
player.chat.starts("/deposit")) {
    
triggerserver("gui",name,"deposit",player.account,player.chat.substring(8));
  }

Which would always save the money to their static account(DustyPorViva or Graal123456, depending on when the account was made), but always display their community name when they deposit. That's how it should work, and would simply things a lot.

Last edited by DustyPorViva; 11-27-2009 at 07:02 AM..
Reply With Quote
  #6  
Old 11-27-2009, 07:09 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by DustyPorViva View Post
stuff
findPlayer() will accept an account name; old or new, they're still accounts

findPlayerByCommunityName() will accept an account name or community name; players with old accounts have their account as their community name

Let's assume "Graal123" has a cname of "Bob"
PHP Code:
// work:
temp.pl findPlayer("cbk1994");
temp.pl findPlayerByCommunityName("cbk1994");
temp.pl findPlayer("Graal123");
temp.pl findPlayerByCommunityName("Graal123");

// don't work:
temp.pl findPlayer("Bob"); 
The reason these commands are needed is not for findPlayer, but for when accounts are offline.
__________________
Reply With Quote
  #7  
Old 11-27-2009, 07:15 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by cbk1994 View Post
findPlayer() will accept an account name; old or new, they're still accounts

findPlayerByCommunityName() will accept an account name or community name; players with old accounts have their account as their community name

Let's assume "Graal123" has a cname of "Bob"
PHP Code:
// work:
temp.pl findPlayer("cbk1994");
temp.pl findPlayerByCommunityName("cbk1994");
temp.pl findPlayer("Graal123");
temp.pl findPlayerByCommunityName("Graal123");

// don't work:
temp.pl findPlayer("Bob"); 
The reason these commands are needed is not for findPlayer, but for when accounts are offline.
I guess that makes sense if the only thing available is their community name... but why would you ever only have their community name available? However, I still think the script I posted above should work, as it seems pretty easy and with minimal effort on the scripters part.
Reply With Quote
  #8  
Old 11-27-2009, 07:24 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by DustyPorViva View Post
I guess that makes sense if the only thing available is their community name... but why would you ever only have their community name available?
Commands players use, such as ":hire account", or even staff commands?

Quote:
However, I still think the script I posted above should work, as it seems pretty easy and with minimal effort on the scripters part.
Sure, that's not the problem. The problem arises when the other player is offline.
__________________
Reply With Quote
  #9  
Old 11-27-2009, 07:34 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by cbk1994 View Post
Commands players use, such as ":hire account", or even staff commands?
True points. I agree, this is a mess for scripters. I hate having to do checks like this.

Quote:
Originally Posted by cbk1994 View Post
Sure, that's not the problem. The problem arises when the other player is offline.
What about them being offline? As far as I know, findplayer() does not allow access to an offline player data anyways?
Reply With Quote
  #10  
Old 11-27-2009, 07:36 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by DustyPorViva View Post
What about them being offline? As far as I know, findplayer() does not allow access to an offline player data anyways?
Yes, but bank accounts are usually stored in a database NPC, SQL, etc.
__________________
Reply With Quote
  #11  
Old 11-27-2009, 07:49 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by cbk1994 View Post
Yes, but bank accounts are usually stored in a database NPC, SQL, etc.
Ah, ya, I get it now. Same conditions of :hire account thing.

What a mess.
Reply With Quote
  #12  
Old 11-27-2009, 01:49 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
It could be added somehow although the call might need to be blocking (like waitfor()) since it might need to contact the serverlister / accounts database.
Reply With Quote
  #13  
Old 11-28-2009, 12:25 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Stefan View Post
It could be added somehow although the call might need to be blocking (like waitfor()) since it might need to contact the serverlister / accounts database.
Well, if we're expected to transition to community names, these kind of functions are definitely needed. I can't imagine it's too hard to avoid the waitfor scope loss, but I don't know the details of it.
__________________
Reply With Quote
  #14  
Old 11-28-2009, 12:33 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by cbk1994 View Post
Commands players use, such as ":hire account", or even staff commands?
Chat commands should be eliminated completely. Only time they should exist is as a secondary way of triggering functions that are already available in some kind of GUI.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #15  
Old 11-28-2009, 01:50 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
Chat commands should be eliminated completely. Only time they should exist is as a secondary way of triggering functions that are already available in some kind of GUI.
There are still plenty of cases where you may only know the community name.

__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:41 PM.


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