iLeGiTiMx Posted May 8, 2016 Author Share Posted May 8, 2016 Hey.I have a HandleDataSub from Rob```HandleDataSub(SSendAuctions) = GetAddress(AddressOf HandleSendAuctions)``````Private Sub HandleSendAuctions(ByVal Index As Long, ByRef data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)Dim buffer As clsBufferDim i As Long'Clear the List of Auctions on the Main PagefrmMain.listAuctions.ClearSet buffer = New clsBufferbuffer.WriteBytes data()For i = 1 To MAX_AUCTIONSAuction(i).ItemNum = buffer.ReadLongAuction(i).Amount = buffer.ReadLongAuction(i).Owner = buffer.ReadStringAuction(i).Current_Bid = buffer.ReadLongAuction(i).Current_Bid_Owner = buffer.ReadStringAuction(i).Buyout_Bid = buffer.ReadLongAuction(i).Currency_ItemNum = buffer.ReadLongAuction(i).MinuteCounter = buffer.ReadLongAuction(i).Status = buffer.ReadByteAuction(i).Claimed = buffer.ReadByte'Add running items to the listIf Auction(i).Status = Auction_Running ThenIf Auction(i).ItemNum > 0 ThenfrmMain.listAuctions.AddItem Trim(Item(Auction(i).ItemNum).Name) & " [Current Bid: " & Auction(i).Current_Bid & " " & Trim(Item(Auction(i).Currency_ItemNum).Name) & "] - [Buyout: " & Auction(i).Buyout_Bid & "] " & Trim(Item(Auction(i).Currency_ItemNum).Name)ElsefrmMain.listAuctions.AddItem "Available Auction Slot"End IfEnd If'Add successful items to the listIf Auction(i).Status = Auction_Successful ThenIf Auction(i).ItemNum > 0 ThenfrmMain.listAuctions.AddItem "Ended Successfully - " & Trim(Item(Auction(i).ItemNum).Name) & " [Current Bid: " & Auction(i).Current_Bid & " " & Trim(Item(Auction(i).Currency_ItemNum).Name) & "]"ElsefrmMain.listAuctions.AddItem "Available Auction Slot"End IfEnd If'Add expired items to the listIf Auction(i).Status = Auction_Expired ThenIf Auction(i).ItemNum > 0 ThenfrmMain.listAuctions.AddItem "Expired - " & Trim(Item(Auction(i).ItemNum).Name) & " [Current Bid: " & Auction(i).Current_Bid & " " & Trim(Item(Auction(i).Currency_ItemNum).Name) & "]"ElsefrmMain.listAuctions.AddItem "Available Auction Slot"End IfEnd IfNext iEnd Sub```The HandleDataSub is called at login, I tested it with a Breakpoint.But the Function HandleSendAuctions not. In another vb project it works like this.When i rename the HandleSendAuctions to something existing, it works.In modEnumerations i have "SSendAuctions" so this is not the problem.I don´t know where the mistake is. It´s exactly like another project.Thank you :)Best regards, TGSLp Link to comment Share on other sites More sharing options...
Diefool Posted May 8, 2016 Share Posted May 8, 2016 Do you have SSendAuctions in the server? This will only trigger if it receives that command from the server.The code looks fine, I'm thinking the problem lies in another part of the code you have not shown. Link to comment Share on other sites More sharing options...
iLeGiTiMx Posted May 9, 2016 Author Share Posted May 9, 2016 Yes i have this in modEnumerations in the serverproject. When i rename the func "HandleSendAuctions" to another existing, it´s gonna called.. It´s so weird.. Link to comment Share on other sites More sharing options...
Diefool Posted May 10, 2016 Share Posted May 10, 2016 SSendAuctions needed in server and client bothalso need CRequestAuctions (A packet from client to server requesting this list) and they need to interact. Have you done anything like this before to understand communications? Link to comment Share on other sites More sharing options...
abhi2011 Posted May 10, 2016 Share Posted May 10, 2016 @'Diefool':> **also need CRequestAuctions (A packet from client to server requesting this list)** and they need to interact. Have you done anything like this before to understand communications?A packet for that isn't ~~needed~~ necessary. [EDIT: [url=http://www.freemmorpgmaker.com/thread-85838-post-946434.html#pid946434]What I actually meant]To the OP: Do you send a packet with header 'SSendAuctions' from the server to the client?> When i rename the func "HandleSendAuctions" to another existing, it´s gonna called..Do you mean you change the name of the function or the 'GetAddress(AddressOf) part? ```HandleDataSub(SSendAuctions) = GetAddress(AddressOf HandleSendAuctions)```^ That should be InitMessages and should be called when the game first initializes and not at login. Make sure the value of 'HandleDataSub(SSendAuctions)' when it is first assigned and sometime later is the same. P.S I apologize if the font of this post comes out weird.. This post reply editor isn't behaving properly. Link to comment Share on other sites More sharing options...
Diefool Posted May 10, 2016 Share Posted May 10, 2016 Why isn't it necessary for the client to request this information? If the server doesn't send it upon request of the client, how will the server know when to send the auction list? Sorry, I'm not trying to argue your point, just understand. Link to comment Share on other sites More sharing options...
abhi2011 Posted May 11, 2016 Share Posted May 11, 2016 When I said "**A packet for that isn't needed.**", what I actually meant was that it isn't always necessary to request data to be sent. Consider the list of items of the game. This is sent when the client is authenticated and logs in. It really isn't 'requested'. It just gets sent, once. The list is updated and sent to the clients only when an admin modifies any item.In the context of an auction list, it's easier and better to actually have request packets. 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