alextoti99 Posted July 12, 2017 Author Share Posted July 12, 2017 Hello, im writing a code that when a play steps on a tile to send a packet and open a window at client the code:Client:```ModBuy:Sub OpenBuy(ByVal name As String)frmBuy.ShowfrmBuy.lblname.Caption = nameEnd SubModEnum:SSentBuyCharModHandleData: HandleDataSub(SSentBuyChar) = GetAddress(AddressOf HandleSetBuyChar)Private Sub HandleSetBuyChar(ByVal Index As Long, ByRef data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim buffer As clsBufferDim CharName As StringSet buffer = New clsBufferbuffer.WriteBytes data()CharName = buffer.ReadStringSet buffer = NothingCall OpenBuy(CharName)End Sub```Server:```ModEnum: SSentBuyCharModServerTCP: Public Sub SetBuyChar(ByVal index As Long)Call PlayerMsg(index, "You can't continue on the rest map without buying the game!", Red)Dim buffer As clsBufferSet buffer = New clsBufferbuffer.WriteLong SSentBuyCharbuffer.WriteString GetPlayerName(index)SendDataTo index, buffer.ToArraySet buffer = NothingModPlayer:' PremiumIf (GetPlayerX(index) = 26) And (GetPlayerY(index) = 11) And (GetPlayerMap(index) = 10) And (GetPlayerBoughtChar(index) <> 1) ThenCall PlayerWarp(index, 10, 31, 11)Call SetBuyChar(index)End If```The error is that when i go on that tile the client closes automatically without any error. Link to comment Share on other sites More sharing options...
BeNjO Posted July 12, 2017 Share Posted July 12, 2017 Best thing to do would be break point every part of it server side and client side and see which line closes it. The player name should be stored client side anyway so sending it from the server would be a waste of resources. Let me know which line you find is breaking it and I will help further. Link to comment Share on other sites More sharing options...
alextoti99 Posted July 12, 2017 Author Share Posted July 12, 2017 i dont get any error, the client just close when i step on the tile Link to comment Share on other sites More sharing options...
BeNjO Posted July 12, 2017 Share Posted July 12, 2017 You need to break point every line server side and client side, by "error" I meant the closing. You break point every line and click play slowly and see which line was the one that closes then go from there. Link to comment Share on other sites More sharing options...
alextoti99 Posted July 12, 2017 Author Share Posted July 12, 2017 with which button cna i do that :P sry im new with vb6 Link to comment Share on other sites More sharing options...
BeNjO Posted July 12, 2017 Share Posted July 12, 2017 ![](https://puu.sh/wHEzO/00699f1e9e.png)The little bar on the left, You can click it and it puts a brown circle to indicate a break point. You click again to remove it. When the code is ran it pauses the IDE so you can debug etc.Hovering over App.Path shows this when using breakpoints to debug:![](https://puu.sh/wHEYy/969732ce3f.png) Link to comment Share on other sites More sharing options...
alextoti99 Posted July 12, 2017 Author Share Posted July 12, 2017 when doing this the yellow line goes at the message send at server adn nth happens , my bad i didnt understand it now i think i did :P Link to comment Share on other sites More sharing options...
BeNjO Posted July 12, 2017 Share Posted July 12, 2017 @'alextoti99':> when doing this the yellow line goes at the message send at server adn nth happens , my bad i didnt understand it now i think i did :PDo you have Team Viewer? I'll just connect and do it? Google it if you don't have it and PM me the information to connect. Link to comment Share on other sites More sharing options...
alextoti99 Posted July 12, 2017 Author Share Posted July 12, 2017 yeah i have teamviewer could u? :D i can now :D sent u a pm iwth credentials Link to comment Share on other sites More sharing options...
BeNjO Posted July 12, 2017 Share Posted July 12, 2017 Fixed. You need to make sure S#### goes in the SERVER Enums and C##### goes CLIENT Enums, You had client in server, server in client and some randomly placed none defined (no S or C) in the server one, Thus your count was 119 which was greater than your clients 117 count.I saved both sources for you, Close them both and re-open to delete any break points I left behind. Link to comment Share on other sites More sharing options...
alextoti99 Posted July 12, 2017 Author Share Posted July 12, 2017 thx a lot dude, i thought that they were going both at the same :P my bad lock the topic fixed Link to comment Share on other sites More sharing options...
BeNjO Posted July 12, 2017 Share Posted July 12, 2017 Not a problem :).Locked as requested. 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