PVJsquad Posted February 3, 2012 Author Share Posted February 3, 2012 **Intro**This guide may be not so important, but there may be a need for other programs such as sending an email to that user, here I just added it's email, so in addition to delivery Username and Password I also sent email data and put it into your account,**Thank's**Previously, I thank to **abhi2011** and **Deathbeam** to convert these systems to be more usefulhttp://www.touchofdeathforums.com/smf2/index.php/topic,79963.0.htmlhttp://www.touchofdeathforums.com/smf2/index.php/topic,79964.0.html**CLIENT SIDE****Client Work**in **frmMenu** i add the text **txtREmail** in **picRegister**![](http://www.freemmorpgmaker.com/files/imagehost/pics/45863b7a7989d9d74809ec890dbcdec3.bmp)**Client Side**in **frmMenu** in **txtRAccept** replace this code```Private Sub txtRAccept_Click()  Dim Name As String  Dim Password As String  Dim PasswordAgain As String  Dim Email As String  ' If debug mode, handle error then exit out  If Options.Debug = 1 Then On Error GoTo errorhandler  Name = Trim$(txtRUser.text)  Password = Trim$(txtRPass.text)  PasswordAgain = Trim$(txtRPass2.text)  Email = Trim$(txtREmail.text)  If isLoginLegal(Name, Password) Then    If Password <> PasswordAgain Then      Call MsgBox("Passwords don't match.")      Exit Sub    End If    If Not isStringLegal(Name) Then      Exit Sub    End If    Call MenuState(MENU_STATE_NEWACCOUNT)  End If  ' Error handler  Exit Suberrorhandler:  HandleError "txtRAccept_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext  Err.Clear  Exit SubEnd Sub```in **modGeneral** in **Public Sub MenuState** this code **Case MENU_STATE_NEWACCOUNT** replace with```Case MENU_STATE_NEWACCOUNT      frmMenu.Visible = False      frmMenu.picCredits.Visible = False      frmMenu.picLogin.Visible = False      frmMenu.picCharacter.Visible = False      frmMenu.picRegister.Visible = False      If ConnectToServer(1) Then        Call SetStatus("Connected, sending new account information...")        Call SendNewAccount(frmMenu.txtRUser.text, frmMenu.txtRPass.text, frmMenu.txtREmail.text)      End If```in **modClientTCP** in **Public Sub SendNewAccount**replace the sub```Public Sub SendNewAccount(ByVal Name As String, ByVal Password As String,ByVal Email 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 Email  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```**SERVER SIDE**in **modHandleData** in **Private Sub HandleNewAccount**will replace that```Private Sub HandleNewAccount(ByVal index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)  Dim Buffer As clsBuffer  Dim Name As String  Dim Password As String  Dim Email As String  Dim i As Long  Dim n As Long  If Not IsPlaying(index) Then    If Not IsLoggedIn(index) Then      Set Buffer = New clsBuffer      Buffer.WriteBytes Data()      ' Get the data      Name = Buffer.ReadString      Password = Buffer.ReadString      Email = Buffer.ReadString      ' Prevent hacking      If Len(Trim$(Name)) < 3 Or Len(Trim$(Password)) < 3 Or Len(Trim$(Email)) < 3 Then        Call AlertMsg(index, "Your account name must be between 3 and 12 characters long. Your password must be between 3 and 20 characters long.")        Exit Sub      End If      ' Prevent hacking      If Len(Trim$(Name)) > ACCOUNT_LENGTH Or Len(Trim$(Password)) > NAME_LENGTH Then        Call AlertMsg(index, "Your account name must be between 3 and 12 characters long. Your password must be between 3 and 20 characters long.")        Exit Sub      End If      ' 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      ' Check to see if account already exists      If Not AccountExist(Name) Then        Call AddAccount(index, Name, Password, Email)        Call TextAdd("Account " & Name & " has been created.")        Call AddLog("Account " & Name & " has been created.", PLAYER_LOG)        ' Load the player        Call LoadPlayer(index, Name)        ' Check if character data has been created        If LenB(Trim$(Player(index).Name)) > 0 Then          ' we have a char!          HandleUseChar index        Else          ' send new char crap          If Not IsPlaying(index) Then            Call SendNewCharClasses(index)          End If        End If        ' Show the player up on the socket status        Call AddLog(GetPlayerLogin(index) & " has logged in from " & GetPlayerIP(index) & ".", PLAYER_LOG)        Call TextAdd(GetPlayerLogin(index) & " has logged in from " & GetPlayerIP(index) & ".")      Else        Call AlertMsg(index, "Sorry, that account name is already taken!")      End If      Set Buffer = Nothing    End If  End IfEnd Sub```in **modDatabase** replace```Sub AddAccount(ByVal index As Long, ByVal Name As String, ByVal Password As String,ByVal Email As String)  Dim i As Long  ClearPlayer index  Player(index).Login = Name  Player(index).Password = Password  Player(index).Email = Email  Call SavePlayer(index)End Sub```and in **modTypes**in **playerRec**I Add```Email As String * 255```Its Simple and you can add another than **Email** Link to comment Share on other sites More sharing options...
decipher0070 Posted February 3, 2012 Share Posted February 3, 2012 This really Helps alot !-DECIPHER Link to comment Share on other sites More sharing options...
Whackeddie99 Posted February 3, 2012 Share Posted February 3, 2012 Looks good I'll have to try it out thanks! Link to comment Share on other sites More sharing options...
PVJsquad Posted February 3, 2012 Author Share Posted February 3, 2012 also let me know something was wrong :D Link to comment Share on other sites More sharing options...
DarkScythe57 Posted February 13, 2012 Share Posted February 13, 2012 @GoldSide:> also let me know something was wrong :Dfound somthing wrong. for the first task it says to replace this code. with wat do we replace this code with? Link to comment Share on other sites More sharing options...
Domino_ Posted February 13, 2012 Share Posted February 13, 2012 @DarkScythe57:> found somthing wrong. for the first task it says to replace this code. with wat do we replace this code with?LOL, with txtAccept, this tut is not newbie friendly xD Link to comment Share on other sites More sharing options...
PVJsquad Posted February 14, 2012 Author Share Posted February 14, 2012 @DarkScythe57:> found somthing wrong. for the first task it says to replace this code. with wat do we replace this code with?find the this code **Private Sub txtRAccept_Click()** in **frmMenu**and replace this sub with this code```Private Sub txtRAccept_Click()  Dim Name As String  Dim Password As String  Dim PasswordAgain As String  Dim Email As String  ' If debug mode, handle error then exit out  If Options.Debug = 1 Then On Error GoTo errorhandler  Name = Trim$(txtRUser.text)  Password = Trim$(txtRPass.text)  PasswordAgain = Trim$(txtRPass2.text)  Email = Trim$(txtREmail.text)  If isLoginLegal(Name, Password) Then    If Password <> PasswordAgain Then      Call MsgBox("Passwords don't match.")      Exit Sub    End If    If Not isStringLegal(Name) Then      Exit Sub    End If    Call MenuState(MENU_STATE_NEWACCOUNT)  End If  ' Error handler  Exit Suberrorhandler:  HandleError "txtRAccept_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext  Err.Clear  Exit SubEnd Sub``` Link to comment Share on other sites More sharing options...
DarkScythe57 Posted February 17, 2012 Share Posted February 17, 2012 When i replace that i get variable not defined and it is referring to txtREmail.text Link to comment Share on other sites More sharing options...
Ruins of Hell Posted February 17, 2012 Share Posted February 17, 2012 Make sure you did this part:@GoldSide:> **CLIENT SIDE**> > **Client Work**> in **frmMenu** i add the text **txtREmail** in **picRegister**> ![](http://www.freemmorpgmaker.com/files/imagehost/pics/45863b7a7989d9d74809ec890dbcdec3.bmp) Link to comment Share on other sites More sharing options...
wito35 Posted March 15, 2012 Share Posted March 15, 2012 Yeah! this works ;) Thanks man! :D Link to comment Share on other sites More sharing options...
PVJsquad Posted March 16, 2012 Author Share Posted March 16, 2012 @wito35:> Yeah! this works ;) Thanks man! :Dyeah noproblem just add the little function Link to comment Share on other sites More sharing options...
abhi2011 Posted May 5, 2012 Share Posted May 5, 2012 It would be awesome if an email was sent to the email! Link to comment Share on other sites More sharing options...
tslusny Posted May 5, 2012 Share Posted May 5, 2012 so this wont send email? only writes email to account data? Link to comment Share on other sites More sharing options...
erkro1 Posted May 5, 2012 Share Posted May 5, 2012 @tslusny:> so this wont send email? only writes email to account data?Yes Link to comment Share on other sites More sharing options...
abhi2011 Posted May 5, 2012 Share Posted May 5, 2012 @tslusny:> so this wont send email? only writes email to account data?It won't send. if it has to send i think u have to integrate with a forum. (or whatever it means!) Link to comment Share on other sites More sharing options...
tslusny Posted May 7, 2012 Share Posted May 7, 2012 i found a way to send e-mail from vb6 [http://www.freevbcode.com/ShowCode.asp?ID=109](http://www.freevbcode.com/ShowCode.asp?ID=109), i try to implement it to your systemI found a better and simplier way throught Winsock```Dim UserName$, UserMail$, MailRecipiant$, MailBody$, SockData$Private Sub Command1_Click()UserName = "YourUserName_or_Addr"UserMail = "Your Name "MailRecipiant = UserMailMailBody = "The message goes here"Winsock1.LocalPort = 0Winsock1.RemoteHost = "smtp-server"Winsock1.RemotePort = 25Winsock1.ConnectEnd SubPrivate Sub Winsock1_Connect()Label1 = "Sending message..."Winsock1.SendData "EHLO " & UserName & vbCrLfIf Not WaitFor("250") Then GoTo 100Winsock1.SendData "MAIL FROM: " & UserMail & vbCrLfIf Not WaitFor("250") Then GoTo 100Winsock1.SendData "RCPT TO: " & MailRecipiant & vbCrLfIf Not WaitFor("250") Then GoTo 100Winsock1.SendData "DATA" & vbCrLfIf Not WaitFor("354") Then GoTo 100Winsock1.SendData MailBody & vbCrLf & "." & vbCrLfIf Not WaitFor("250") Then GoTo 100Winsock1.SendData "QUIT" & vbCrLfIf Not WaitFor("221") Then GoTo 100Label1 = "Message sent"GoTo 200100Label1 = SockData200Winsock1.CloseEnd SubPrivate Sub Winsock1_DataArrival(ByVal bytesTotal As Long)Winsock1.GetData SockDataEnd SubPrivate Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)Label1 = "Error: " & DescriptionSockData = "Error"Winsock1.CloseEnd SubPrivate Function WaitFor(SockResponse As String) As BooleanDo While Left(SockData, 3) <> SockResponse And Left(SockData, 3) <> "220" And Left(SockData, 3) <> "250" DoEvents If Left(SockData, 3) > "400" Then Exit FunctionLoopWaitFor = 1SockData = ""End Function```I think this will be easy to integrate to eclipse. Just some modification must be made. Read from textboxes and so… Link to comment Share on other sites More sharing options...
abhi2011 Posted May 7, 2012 Share Posted May 7, 2012 I'll try to do! Link to comment Share on other sites More sharing options...
tslusny Posted May 7, 2012 Share Posted May 7, 2012 i tried it but i need some free smtp client without authentification to make this code work Link to comment Share on other sites More sharing options...
abhi2011 Posted May 7, 2012 Share Posted May 7, 2012 well i dont have that! i think gmail offers smtp!http://email.about.com/od/accessinggmail/f/Gmail_SMTP_Settings.htmhttp://lifehacker.com/111166/how-to-use-gmail-as-your-smtp-server Link to comment Share on other sites More sharing options...
PVJsquad Posted July 5, 2012 Author Share Posted July 5, 2012 I thank to **abhi2011** and **Deathbeam** to convert these systems to be more usefulafter doing the tutorial above, I recommend to visit this threadhttp://www.touchofdeathforums.com/smf2/index.php/topic,79963.0.htmlhttp://www.touchofdeathforums.com/smf2/index.php/topic,79964.0.html Link to comment Share on other sites More sharing options...
abhi2011 Posted July 5, 2012 Share Posted July 5, 2012 We couldn't have done without u adding this. Link to comment Share on other sites More sharing options...
PVJsquad Posted July 5, 2012 Author Share Posted July 5, 2012 but your system is very useful for all 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