Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Case sensitivity in strings (https://forums.graalonline.com/forums/showthread.php?t=68297)

ChibiChibiLuc 08-23-2006 03:54 AM

Case sensitivity in strings
 
Okay, so after testing around I've found out what Zodiac's problem is.

Players are able to change the capitals in their accounts.
I can log in with my account as yen, Yen, yEn, YeN, yEN, or YEn. All of them will work.
If I have something like: this.array = {"Yen","Stefan","(npc-server)"} and I do this.array.index(player.account), unless my account is Yen it will return -1
If my account is yEn, it will return a -1.
This is bugging up parties, trade, ect.

I can fix it by converting all accounts to lowercase when they're received, but is it mean't to act like this?

Admins 08-24-2006 12:54 AM

Just ignore the account name sent with the trigger by the client, never trust clientside data. On serverside you can also do account = findplayer(account).account to fix it.

Yen 08-24-2006 02:52 AM

^^ Thanks.

Rapidwolve 08-24-2006 04:34 AM

Whyd you use another account to post o_o


All times are GMT +2. The time now is 10:06 PM.

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