This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [Help] Create an Account from the Login Screen  (Read 1255 times)

tx423w

  • Registred Member
  • MWCS Enthusiast
  • *****
  • Posts: 2
    • View Profile
[Help] Create an Account from the Login Screen
« on: December 02, 2017, 06:12:46 am »
Hey everyone.

I'm currently stuck on a feature which I try to develope.
I want to create a PlayerAccount from the Login Screen.

I use the newest TrinityCore Version for 3.3.5.

I was already able to create the Button on the Screen as well as the Form which collects the Accountname and Password.
The biggest Problem is, that you can't use any http Requests in your AccountLogin.lua File the WoW Api just does not Provide any Methods that can connect to the Internet.
Except one Method - The Login Method DefaultServerLogin();

My Idea now was to send a regular expression in front of the username and using this Method Login Method.
Example: DefaultServerLogin("_newacc_" .. username, password);

Now I try to take these Information at my Server (located in Authserver/Server/AuthSession.ccp)
I was already able to find the Method which is able to give me the Accountname, but I´m struggeling to find the method where the password is comming in.

With my current work I'm only able to create a Playeraccount from the Client with a Pre-Defined Password (Serversided).

It would be really nice if someone is able to help me find the Method the to find the Password - to work with it further.

Best Regards
tx

noc

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 121
    • View Profile
Re: [Help] Create an Account from the Login Screen
« Reply #1 on: December 02, 2017, 10:11:07 am »
Hello,
if you can recover the account name, you should be able to recover the password. Why want to use an http request while the server can create an account? In the event that you do not succeed, why not put the password after the name? A special character used to separate the account name from the password will have to be identified, that goes for the server to create the account. Small questions by the way, how much character does the customer agree to send for the account login? What are the characters prohibited by the customer?


Bonjour,
si vous pouvez récupérer le nom du compte, vous devriez pouvoir récupérer le mot de passe. Pourquoi vouloir utiliser une requête http alors que le serveur peut créer un compte? Dans l’éventualité où vous n'y arrivez pas, pourquoi ne pas placer le mot de passe a la suite du nom? Un caractère spécial servant à séparer le nom du compte du mot de passe devra être identifié, cela va de soit pour que le serveur crée le compte. Petites questions en passant, combien de caractère le client accepte d'envoyer pour la connexion du compte? Quels sont les caractères interdits par le client?

schlumpf

  • Administrator
  • Creator of Worlds
  • *****
  • Posts: 2967
    • View Profile
Re: [Help] Create an Account from the Login Screen
« Reply #2 on: December 02, 2017, 12:55:00 pm »
Wow never transfers the content of the password field in plain text. In fact, it doesn’t even transfer a hash of it. Recovering it on server side is impossible.

You can as suggested just add the password to the account field and transfer it this way. That would make the entire process insecure as fuck, but fine:

- user enters account name and password
- defaultserverlogin(“CREAT_” + user + “:” + password)
- Server gets request for login. If starts with CREAT_
— extract real user and password from “username”
— create bnet and game account
— replace username with real username
- continue normal login

tx423w

  • Registred Member
  • MWCS Enthusiast
  • *****
  • Posts: 2
    • View Profile
Re: [Help] Create an Account from the Login Screen
« Reply #3 on: December 02, 2017, 03:03:02 pm »
Thank you very much guys! That helped me alot, the Idea you gave me schlumpf should fix my problem. The Server is for me and my friends so I take the insecurity. Maybe I find another way to to give that more security soon :)

[Edit:] Works now! Thanks again!
« Last Edit: December 02, 2017, 04:33:16 pm by tx423w »

Irachkom

  • Registred Member
  • GM Isle Explorer
  • *****
  • Posts: 19
    • View Profile
Re: [Help] Create an Account from the Login Screen
« Reply #4 on: December 02, 2017, 07:38:15 pm »
You're going with auto-create acc?
If there's no account with such username you enters, it creates it?