-
Notifications
You must be signed in to change notification settings - Fork 760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds support for <account id> param for getcharid(). Deprecates charid2rid. #2350
base: master
Are you sure you want to change the base?
Conversation
a6a89a2
to
a4595d7
Compare
…d2rid(), its functionality now merged into getcharid().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*charid2rid
is still useful to retrieve the value from SQL table or item's char id field
^--- EDITED ---
-
from SQL
select char_id fromchar
where online = 1;
well yes can use select account_id ...
but charid2rid return 0 when player is offline, similar to isloggedin return 0 when player is offline -
signed item
Hercules/doc/script_commands.txt
Lines 5006 to 5017 in 52360f0
// First, let's get an ID of a character who's name will be on the // item. Only an existing character's name may be there. // Let's assume our character is 'Adam' and find his ID. .@charid = getcharid(CHAR_ID_CHAR, "Adam"); // Now we split the character ID number into two portions with a // binary shift operation. If you don't understand what this does, // just copy it. .@card3 = .@charid & 65535; .@card4 = .@charid >> 16;
this only return char id
@AnnieRuru I don't understand what you're saying. This PR does not reduce functionality of getcharid(), only improve it. getcharid() already returns 0 if player is offline. getcharid
charid2rid
|
what I am saying is just don't deprecate the oops, edit that post, I word it wrongly again
yes, getcharid() return 0, but the signed item only return char id WITHOUT account ID getcharid(CHAR_ID_ACCOUNT, <char_id>) ???? EDITING ---- OK I WRITE A SAMPLE SCRIPT ----- |
EDIT: --> .@account_id = getcharid(3, .@charid); |
@AnnieRuru, @EyesOfAHawk has modified the getcharid, so that CHAR_ID_ACCOUNT will check for char_id and not for account id as 2nd argument Although the PR seems fine, but let @Asheraf or @MishimaHaruna review whether it is good idea to merge these 2 functionality |
ok I misread that part, approve it actually yeah, need discussion, because |
The part about |
hmm, rathena has this PR rathena/rathena#3924
I rather have a script command that is clearly state what it is doing, EDIT: exactly the point, it confused me/makes me misunderstood in previous posts |
I do agree with you. In my opinion this special case unnecessary. If someone is able to pass a character ID to retrieve the corresponding account ID, he should also be able to pass the character's name instead. |
Pull Request Prelude
Changes Proposed
Adds support for account id to
getcharid()
.I.e.
getcharid(<type>{, "<character name>"})
getcharid(<type>{, <account id>})
Deprecates
charid2rid()
in favour ofgetcharid(CHAR_ID_ACCOUNT, <char id>)
.Issues addressed:
N/A