Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

abhi2011

Members
  • Posts

    2897
  • Joined

  • Last visited

    Never

Everything posted by abhi2011

  1. @tslusny: > btw why make new picDelete, you can just add lblDelete to login menu and change code to read from login textboxes If u mean getting rid of picdelaccount and adding a label saying that delete account and changing the code for duser and dpass to luser and lpass well it is possible. Never actually tried it. but it is possible as ur are removing 1 step. But what i did was just copy paste piclogin and change the back colour and height :D If u want to knoe how to remoce picdelaccount pm me!
  2. Hey guys. Can anyone explain to me what this piece of code does? And is there a limit to the size of string we can send to the server from client? ``` Public Sub WriteBytes(ByRef nByte() As Byte) Dim nLength As Long nLength = (UBound(nByte) - LBound(nByte)) + 1 If WriteHead + nLength - 1 > BufferSize Then Allocate nLength CopyMemory buffer(WriteHead), nByte(0), nLength WriteHead = WriteHead + nLength End Sub ``` I want to knoe because I am writing something for a tutorial. And when the packet data of 2 strings reach the client it will highlight this piece of code! ``` nLength = (UBound(nByte) - LBound(nByte)) + 1 ```It is in clsbuffer! Thanks!
  3. @tslusny: > Wow report system will be epic. Good Luck :cheesy: thanks again! don't leak it! :) Want to be the first one 1 release the source. Erwin already has 1\. but no tut!
  4. @tslusny: > nice tut i will use this for my game. Nice job :cheesy: Thanks. I tried chnage pass. Wasnt easy. Will try again later. Currently i am trying a report system!
  5. @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!)
  6. It would be awesome if an email was sent to the email!
  7. Here is what everything does explained! ``` If Not picDelAccount.Visible Then ' destroy socket, change visiblity DestroyTCP picDelAccount.Visible = True picCredits.Visible = False picLogin.Visible = False picRegister.Visible = False picCharacter.Visible = False picMain.Visible = False ' play sound PlaySound Sound_ButtonClick End If ```What this piece of code does is that it will check whether picDel is currently visible or not. If not then it will make it visible. ``` picDelAccount.Visible = False ```This will make the other picdel invisible when i click on a picbutton. ``` ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If isLoginLegal(txtDUser.text, txtDPass.text) Then Call MenuState(MENU_STATE_DELACCOUNT) End If errorhandler: HandleError "lblDAccept_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub ```This piece of code will check whether login is legal. i.e whether username and password > 3\. If so then it will call the menu state "MENU_STATE_DELACCOUNT" in sub MenuState. ``` Case MENU_STATE_DELACCOUNT frmMenu.Visible = False frmMenu.picCredits.Visible = False frmMenu.picLogin.Visible = False frmMenu.picCharacter.Visible = False frmMenu.picRegister.Visible = False frmMenu.picDelAccount.Visible = False If ConnectToServer(1) Then Call SetStatus("Connected, Deleting account...") Call SendDelAccount(frmMenu.txtDUser.text, frmMenu.txtDPass.text) End If Exit Sub End Select ```This is the new code that is added along with a few extras! All it will do is make the frmLoad visible and all the other invisible then it will connect to server and set the status of the frmLoad (frmLoad is the small thing that notifies you of connection status and stuff.) Then it will Send the Delete Account packet. With txtDUser and txtDPass as name and password. That is about it. Once the packet is send the server does the rest. It validates the username and password and checks if the account exsists. If everything is fullfilled it will Kill/Delete the account in "Accounts/Name"
  8. This is my second tutorial and credits go to Robin for writing the packet which was already added when EO 2 was released and to me for writing the rest of the code. There is nothing in server side!!! Only Client side! Client Work (frmMenu) Picture Box ``` Name = picDelAccount Back Colour = &H00000000& Height = 210 Width = 442 Left = 37 Top = 44 ``` 2 Labels With caption username and password for indication purposes 2 Textboxes > Name = txtDUser and txtDPass > Text = "" Label ``` Name = lblDAccept Caption = Accept ``` Now add another label underneath any of the buttons and name it "lblDel" and caption "Delete account" Now double click "lbldel" and add the following piece of code ``` If Not picDelAccount.Visible Then ' destroy socket, change visiblity DestroyTCP picDelAccount.Visible = True picCredits.Visible = False picLogin.Visible = False picRegister.Visible = False picCharacter.Visible = False picMain.Visible = False ' play sound PlaySound Sound_ButtonClick End If ``` Now in the sub ``` Private Sub imgButton_Click(Index As Integer) ``` Above 'play sound add ``` picDelAccount.Visible = False ``` Then in the click even of lblDAccept add ``` ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If isLoginLegal(txtDUser.text, txtDPass.text) Then Call MenuState(MENU_STATE_DELACCOUNT) End If errorhandler: HandleError "lblDAccept_Click", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub ``` Now in the sub ``` Public Sub MenuState(ByVal state As Long) ```in modGeneral Replace ``` Select Case state Case MENU_STATE_ADDCHAR 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 character addition data...") If frmMenu.optMale.Value Then Call SendAddChar(frmMenu.txtCName, SEX_MALE, frmMenu.cmbClass.ListIndex + 1, newCharSprite) Else Call SendAddChar(frmMenu.txtCName, SEX_FEMALE, frmMenu.cmbClass.ListIndex + 1, newCharSprite) End If End If 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) End If Case MENU_STATE_LOGIN 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 login information...") Call SendLogin(frmMenu.txtLUser.text, frmMenu.txtLPass.text) Exit Sub End If End Select ``` with this ``` Select Case state Case MENU_STATE_ADDCHAR 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 character addition data...") If frmMenu.optMale.Value Then Call SendAddChar(frmMenu.txtCName, SEX_MALE, frmMenu.cmbClass.ListIndex + 1, newCharSprite) Else Call SendAddChar(frmMenu.txtCName, SEX_FEMALE, frmMenu.cmbClass.ListIndex + 1, newCharSprite) End If End If 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) End If Case MENU_STATE_LOGIN 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 login information...") Call SendLogin(frmMenu.txtLUser.text, frmMenu.txtLPass.text) End If Case MENU_STATE_DELACCOUNT frmMenu.Visible = False frmMenu.picCredits.Visible = False frmMenu.picLogin.Visible = False frmMenu.picCharacter.Visible = False frmMenu.picRegister.Visible = False frmMenu.picDelAccount.Visible = False If ConnectToServer(1) Then Call SetStatus("Connected, Deleting account...") Call SendDelAccount(frmMenu.txtDUser.text, frmMenu.txtDPass.text) End If Exit Sub End Select ``` That's about it. I will explain what everything does later. Again Credits go to Robin and myself
  9. Nice tutorial. And is this used for 1 person or for every account? 1 person meaning he donates he gets a unique code that can be used only 1nce. After that the code is deleted? or can it be used multiple times?
  10. @Erwin: > Player position is the same as coordinates I guess, Player(index).X and the other stuff displays the player X and Y position on the map, so thesame as you see when the /loc thing is turned on. > And Player(MyIndex) has nothing to do if the player if playing, because you can only check that at server side with IsPlaying sub, its an array with data of the player. (Please note that MyIndex can only be used at client side and will always be the player playing at the client) So client side is for the person playing the game and server side can be used for any player? So does that mean I have will have to write the code for sending a packet and stuff? I also wanted to ask if there was a need to wirte a packet why is there a write.buffer code in client/server TCP module. And what is cls.buffer?
  11. I mean the player's position (if it is the same as coordinate)on the screen cuz i want to try and make a right click option and when right clicked should come up near the player. And Erwin doesn't player(myindex) mean the player that is playing? like if i were playing it would be me?
  12. What is the code for finding the player coordinates and storing them so that i can use it for a control? The coordinates are displayed when "/loc" is inputted but that is not what I want so don't suggest it. Something like "GetPlayerPos"
  13. How is the admin panel over the inventory buttons and the pics while in the frmMain the panel is not even near to the images? Is there any code to it?
  14. This might be a noob question but what is CPS?
  15. This should be told to Robin also. There is the same mistake in CS.
  16. Never Mind. I figured it out. Anyways I'll explain what I was talking about. What if there was already caption. I want that caption including another caption below it.
  17. I know that if there is a caption it will change automatically to what I write. However my problem is different. There is no caption currently. But when I click a label, there should be a caption. And in the next line there should be something. And the next line there should be something. What is the code for it? Please help.
  18. It can be made a bit more better. I was thinking about it, you should also add the part in which you make the properties of the text box where the text box isn't editable. –---------------------------------------------------------------------------------------------------------------------------------- Added the post after while Meteor Rain was actually posting so I though of editing. There are a lot of newbs there who will need help in almost everything.
×
×
  • Create New...