The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find by name
Author Message
Dullais
Journeyman
*

Posts: 65
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #1
Find by name
Hello everyone !
Can anybody tell me how to find charter by name ?
I don't mean goname.
I have discovered that people registering on shard can use the same name, so there can be 2 guys(or girls) with the same name and that is not acceptable for me. So i was wondering mby there is some way of not allowing to use the name that is already being used by another person ?
I was thinking about making script, that forces player Change name after loging in the first time (like dialog with textentry) that checks for given name and changes it if the name is not used by anyone) but i don't really know how to make this work ? I guess i could use FORCHARS but i have heard it is a very laggy thing to do for server.
Besides .goname already uses function like i need, so there must be a way !
Can anybody help me please ? Smile
03-13-2013 10:55 PM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Find by name
using mysql is best solution for this.
03-13-2013 11:18 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Dullais
Journeyman
*

Posts: 65
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #3
RE: Find by name
(03-13-2013 11:18 PM)Shaklaban Wrote:  using mysql is best solution for this.

I was afraid of that Big Grin I really was...
03-13-2013 11:20 PM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #4
RE: Find by name
using f_onchar_create and make a loop for the existing char on the account?
btw I am doing it via mysql because we create the char via homepage *g*
03-13-2013 11:50 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: Find by name
Mysql apart, using a loop on f_onchar_create it's the only solution i think .

Also consider that character creation doesn't happen very often, so the "lag impact" of the possible implementation shouldn't affect much the server's performance.
03-13-2013 11:59 PM
Find all posts by this user Like Post Quote this message in a reply
Dullais
Journeyman
*

Posts: 65
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #6
RE: Find by name
(03-13-2013 11:59 PM)darksun84 Wrote:  Mysql apart, using a loop on f_onchar_create it's the only solution i think .

Also consider that character creation doesn't happen very often, so the "lag impact" of the possible implementation shouldn't affect much the server's performance.

I have heard that if you got 100+ clients online (man can dream Big Grin ) it can freez the server up to 20 seconds. Is that right ?
03-14-2013 12:10 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #7
RE: Find by name
yea possible, considering that if you have 100 clients online , your total character player base will be much higher than 100 Tongue
(This post was last modified: 03-14-2013 12:16 AM by darksun84.)
03-14-2013 12:15 AM
Find all posts by this user Like Post Quote this message in a reply
Staff_Stanic
Journeyman
*

Posts: 96
Likes Given: 25
Likes Received: 14 in 8 posts
Joined: Nov 2012
Reputation: 1

Dimension Shard

Post: #8
RE: Find by name
try with
Code:
FOR 0 <eval <SERV.ACCOUNTS>-1>
(This post was last modified: 03-14-2013 05:40 AM by Staff_Stanic.)
03-14-2013 05:40 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #9
RE: Find by name
I had a thought....

It would involve recording player names as they are created (and deleting the record of them as they are deleted) but...

Code:
[FUNCTION f_onchar_create]
if <LIST.player_names.COUNT>
    if <LIST.player_names.FINDELEM <src.name>>
        src.sysmessage The name you have chosen is not available
        src.sysmessage Please chose a different name
        src.dialog d_name_change
    else
        LIST.player_names.ADD <src.name>
    endif
else
    LIST.player_names.ADD <src.name>
endif

[FUNCTION f_onchar_delete]
LIST.player_names.<LIST.player_names.FINDELEM <src.name>>.REMOVE

This is COMPLETELY untested, and obviously on a pre-existing server you would have to write and run a function to gather all player names and add them into the list.
I'm not even saying this method would be effective or efficient, I just started playing with lists properly and wondered if this might be viable.


Made it anyway: http://forum.spherecommunity.net/sshare....wnload=223

[Image: 2nis46r.jpg]
(This post was last modified: 03-15-2013 05:59 AM by Mordaunt.)
03-14-2013 05:59 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Dullais
Journeyman
*

Posts: 65
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #10
RE: Find by name
(03-14-2013 05:59 AM)Mordaunt Wrote:  I had a thought....

It would involve recording player names as they are created (and deleting the record of them as they are deleted) but...

Code:
[FUNCTION f_onchar_create]
if <LIST.player_names.COUNT>
    if <LIST.player_names.FINDELEM <src.name>>
        src.sysmessage The name you have chosen is not available
        src.sysmessage Please chose a different name
        src.dialog d_name_change
    else
        LIST.player_names.ADD <src.name>
    endif
else
    LIST.player_names.ADD <src.name>
endif

[FUNCTION f_onchar_delete]
LIST.player_names.<LIST.player_names.FINDELEM <src.name>>.REMOVE

This is COMPLETELY untested, and obviously on a pre-existing server you would have to write and run a function to gather all player names and add them into the list.
I'm not even saying this method would be effective or efficient, I just started playing with lists properly and wondered if this might be viable.

Looks interesting, it could and should work (i think) mby a little bit of tweaking and it's good to go.
But on second thought, i will make mysql database because i'am going to make serious connections with my webpage and list of all players will be there one way or another, so i think i will make this one with mysql later, when web page and server will be ready Smile
Anyway, Thanks for advise guys ! Smile
03-14-2013 07:03 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)