gdog12356 Posted June 2, 2012 Author Share Posted June 2, 2012 Ok well I don't think anyone released this yet so I figured I would release it.So here we will start with the server:In the server you will want to navigate to Private Sub HandleNewAccount.under```Dim Password As String```add```Dim Password2 As String```next find```Password = Buffer.ReadString```and under it add```Password2 = Buffer.ReadString```Now find your way to``` ' Prevent hacking For i = 1 To Len(Name) n = AscW(Mid$(Name, i, 1)) If Not isNameLegal(n) Then Call AlertMsg(index, "Invalid name, only letters, numbers, spaces, and _ allowed in names.") Exit Sub End If Next```under that whole thing, add``` If IsPassTheSame(Password, Password2) = False Then Call AlertMsg(index, "Passwords Do Not Match.") Exit Sub End If```This is checking if the two passwords match, and it will read form the data sent to the server from the client. Now we want to actually add the function so…In ModServerTCP add this function to the bottom```Function IsPassTheSame(ByVal Password As String, ByVal Password2 As String) As Boolean If UCase$(Trim$(Password)) = UCase$(Trim$(Password2)) Then IsPassTheSame = True Else IsPassTheSame = False End IfEnd Function```Now, open up your client and navigate to Public Sub MenuStatechange``` Call SendNewAccount(sUser, sPass)```to``` Call SendNewAccount(sUser, sPass, sPass2)```Now replace Public Sub SendNewAccount with this:```' *****************************' ** Outgoing Client Packets **' *****************************Public Sub SendNewAccount(ByVal name As String, ByVal Password As String, ByVal Password2 As String)Dim Buffer As clsBuffer ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set Buffer = New clsBuffer Buffer.WriteLong CNewAccount Buffer.WriteString name Buffer.WriteString Password Buffer.WriteString Password2 Buffer.WriteLong CLIENT_MAJOR Buffer.WriteLong CLIENT_MINOR Buffer.WriteLong CLIENT_REVISION SendData Buffer.ToArray() Set Buffer = Nothing ' Error handler Exit Suberrorhandler: HandleError "SendNewAccount", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit SubEnd Sub```What this does is send the data in the confirmation field to the server to be checked.And walla! Your all done! No need to give credit's if you use this as it was easy as fuck but it would much appreciated. :). Link to comment Share on other sites More sharing options...
JohnPony Posted June 2, 2012 Share Posted June 2, 2012 Nice job duck :) Link to comment Share on other sites More sharing options...
gdog12356 Posted June 2, 2012 Author Share Posted June 2, 2012 @John:> Nice job duck :)lol, thanks. :) Link to comment Share on other sites More sharing options...
Yuko Posted June 2, 2012 Share Posted June 2, 2012 Thanks I really need to fix the glitchy register.>.>Nice job:star: :star: :star: :star: :star: Link to comment Share on other sites More sharing options...
JohnPony Posted June 2, 2012 Share Posted June 2, 2012 @Ã‚à ¹€Ã‚à ¹€:> Thanks I really need to fix the glitchy register.> > >.>> Nice job> > :star: :star: :star: :star: :star:It never really glitched, it just did not have the function to check if both passwords matched. Link to comment Share on other sites More sharing options...
Yuko Posted June 2, 2012 Share Posted June 2, 2012 @John:> It never really glitched, it just did not have the function to check if both passwords matched.I wasn't talking about that, John..Talking about a glitch I accidentally made, but never came to fixing it. Link to comment Share on other sites More sharing options...
erkro1 Posted June 3, 2012 Share Posted June 3, 2012 Isn't this already in EO but then at client side? Link to comment Share on other sites More sharing options...
The New World Posted June 3, 2012 Share Posted June 3, 2012 This is for CS:DE Link to comment Share on other sites More sharing options...
erkro1 Posted June 4, 2012 Share Posted June 4, 2012 @WÑ–ng:> This is for CS:DEOh yeah, stupid me not reading the title correctly.. Link to comment Share on other sites More sharing options...
Joost Posted June 10, 2012 Share Posted June 10, 2012 I would recommend doing this client-side, since there is no reason (security or whatever) to do the check server-side, it's just sending the same string twice to compare it there. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now