I have the same, when the "create" button is pressed, I call this code:
The server listens for a username/password beginning with ?. It runs some verification and if all passes, it creates the account. It responds with a error code depending upon how far it gets.Code:function CreateAccountFinal(self) CreateAccountFrame:Hide(); local username = AccountNameEditBox:GetText(); local password = AccountPasswordEditBox:GetText(); local cpassword = AccountPasswordConfirmEditBox:GetText(); if ( password ~= cpassword ) then GlueDialog_Show("REALM_TOURNAMENT_WARNING", "Account creation failed.\n\rPasswords do not match.", nil); return; elseif ( strlen(username) < 3 or strlen(username) < 5 or strfind(username, "[^%w]") or strfind(password, "[^%w]") ) then GlueDialog_Show("REALM_TOURNAMENT_WARNING", "Account creation failed.\n\rOnly alphanumerical characters (A-Z, 0-9) allowed!", nil); return; end local info = table.concat({"?", username, "?", password, "?"}); CreateAccountReply = true; DefaultServerLogin(info, tostring(math.random(1, 100000))); end
The bool that I flag as true makes the error messages on login display differently if it is true. This way I can create custom error messages for account creation.
Thank you for that perfect idea, but is there a way to send account info with email together?
If i've set info like:
local info = table.concat({"?", username, "?", password, "?", email, "?"});
client automaticaly starts downloading WoW-x.x.x.x-4.0.0.12911-Downloader
I can't explain myself why, because i have no patching implemented.
If it is patching on login then you have not adjusted your realmlist or are trying to login with an email.
My server side code:
You would add email by adding it to the table with a question mark, then having the server side code look for the next question mark.Code:// Clear the shitty hash (for server) string AccountName = (char*)&m_challenge.I; if (AccountName.substr(0, 1) == "?") { if (AccountName.find_first_not_of("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789?") != string::npos) { LOG_ERROR("[AuthChallenge]: Tried to create account with illegal characters."); SendChallengeError(CE_NO_ACCOUNT); //Well **** you for editing the files! return; } int pass_start = AccountName.find("?", 1) + 1; if (pass_start < 4) //No username { LOG_ERROR("[AuthChallenge] Tried to create account with no account name."); SendChallengeError(CE_NO_ACCOUNT); return; } int pass_end = AccountName.rfind("?"); if (pass_end <= pass_start) //No password { LOG_ERROR("[AuthChallenge] Tried to create account with no password."); SendChallengeError(CE_NO_ACCOUNT); return; } int name_len = pass_start - 2; int pass_len = pass_end - pass_start; string username = AccountName.substr(1, name_len); string password = AccountName.substr(pass_start, pass_len); m_account = AccountMgr::getSingleton().GetAccount(username); if (m_account != 0) { LOG_ERROR("[AuthChallenge] Account creation failed: account name already taken."); SendChallengeError(CE_ACCOUNT_IN_USE); return; } string cmd = username + " " + password + " none"; //Prepare command for CreateAccount char acct[50]; memcpy(acct, cmd.c_str(), 50); //CreateAccount doesn't take const char* LogonConsole::getSingleton().CreateAccount(acct); SendChallengeError(CE_SERVER_FULL); //Success! LOG_BASIC("[AuthChallenge] Client %s has created an account with name: \"%s\"", GetRemoteIP().c_str(), username.c_str()); return; }
Thanks for help mate. I realized that email is not so important to know.
Topic can be closed.
Regards, Sufursky.