Having a email verafaction is good just in case people loose there passwords, and also good for warnings and ban reasons instead of the msgbox.
---------
Basicly easy to copy and paste 2/5
Understanding 3/5
///CLIENT SIDE///Make your SendNewAccount Look like this.
Code:
Sub SendNewAccount(ByVal Name As String, ByVal Password As String, ByVal Email As String)
Dim Packet As String
Packet = "newaccount" & SEP_CHAR & Trim(Name) & SEP_CHAR & Trim(Password) & SEP_CHAR & Trim(Email) & SEP_CHAR & END_CHAR
Call SendData(Packet)
End Sub
Add these into ModConstantsNow add:
Code:
Public Const MENU_STATE_EMAIL = 9
Right now add:
Code:
Public Const EMAIL_LENGTH = 50
Now Find Private SUb Pic_Connect in frmNewaccount and add:
Code:
If Trim(txtName.Text) <> "" And Trim(txtPassword.Text) <> "" And Trim(txtEmail.Text) <> "" Then
Now find Public Sub MenuState(ByVal State As Long) and go to Call SendNewaccount and add:
Code:
frmNewAccount.txtEmail.Text
Now on form frmNewAccount add these:
A text Box with the name of txtEmail and set the caption to nothing(THE NAME OF THE TEXT BOX MATTERS)
Put a label and call it labelemail and set the caption to Email (Doesn't matter on the name of the label)
Ok thats all for Client Side..
///Server Side///
Make your AddAccount look like this:
Code:
Sub AddAccount(ByVal index As Long, ByVal Name As String, ByVal Password As String,ByVal Email As String)
Dim i As Long
Player(index).Login = Name
Player(index).Password = Password
Player(index).Email = Email
For i = 1 To MAX_CHARS
Call ClearChar(index, i)
Next i
Call SavePlayer(index)
End Sub
Add Under AccountRec:
Code:
Type EmailRec
Email As String * EMAIL_LENGTH
End Type
And Now in AccountRec add to the bottom of it:
Code:
Email as string
Now go to ModConstants and add the 2 following constants:
Code:
Public Const EMAIL_LENGTH = 50
Code:
Public Const MAX_EMAIL = 15
Under HandleData add :
Code:
Dim Email As String
Add Under New account Packet
Code:
Email = Parse(3)
And just below that add next to
Code:
Or Len(Trim(Password)) < 3
Code:
Or Len(Trim(Email)) < 15
now find If Not AccountExist(Name) Then change the line Call AddAccount(index, Name, Password) to look like this:
Code:
Call AddAccount(index, Name, Password, Email)
Now find
Code:
Call PutVar(FileName, "GENERAL", "Password", Trim(Player(index).Password))
and add under it.
Code:
Call PutVar(FileName, "GENERAL", "Email", Trim(Player(index).Email))
I think thats about it msn me if there is any problems