Posted October 30, 201411 yr I am having some difficulty receiving packets on the server(or packets sent from the client in general) Where the packet is being sent (verified via breakpoints that it is being called) Where the packet is registered Handler class Packet class
October 30, 201411 yr Author I believe the issue is that the request packet isn't bent received by the server (I have a print to console to check)
October 30, 201411 yr Author The code to send it is defiantly being called but I am unsure if the packet is actually being sent
October 31, 201411 yr Author Nope , I can send packets from the server to the client fine but not the other way around. If it matters I am using forge 1230
October 31, 201411 yr I'm with dieSieben, can't see anything wrong. Time for a couple of breakpoints in the forge code I think. Been there myself trying to debug network code and it was moderately painful. You might try first putting a breakpoint in FMLProxyPacket.processPacket, or NetworkManager.processReceivedPackets to see if your packet arrives but just isn't handled correctly . A lot of packets go through there so I'd suggest you add a precondition to it, i.e. put a second breakpoint in your command send method and then "Disabled until selected breakpoint is hit" (IntelliJ) for your FMLProxyPacket breakpoint. Hopefully yours won't be too far down the queue then. -TGG
October 31, 201411 yr Author Well after break pointing both of those methods and none of them being tripped. Could this be a forge/mc bug? Lucas1998 has reported that he is unable to send packets from client to the server as well. Also the constructor and toBytes method is being when I am expecting it to
October 31, 201411 yr Could be; although packets work fine for me on 1230 Post your project code somewhere, I can give it a try over the next day? -TGG
October 31, 201411 yr Author https://github.com/disconsented/ANSSRPG Its all there and I haven't done anything since the last commit
October 31, 201411 yr Hi Your code doesn't seem to have anything in it to open your PerkGUI for testing, how were you testing it? -TGG
October 31, 201411 yr Author You need to break a block to bring it up (temporary solution) . What I was doing was selecting one of the non null buttons from the list and press go. For the sake of consistency here are the configs I have been using
October 31, 201411 yr Hi Well I've wrestled with it a bit with no luck. It just seems to disappear into the void and never pop out the other side. I tried tracing through to see why but it will take a more powerful brain than mine to understand what's going on in all those channels and listeners and contexts. It does appear to have something to do with the fact you're sending it from a GUI . When I move the send command to a client-side event eg @SubscribeEvent public void onKey(InputEvent.KeyInputEvent event) { Main.snw.sendToServer(new Request("test")); } then it works fine. I'm at the limits of my knowledge here, sorry. Perhaps folks who have used GUI before might be more help... -TGG
October 31, 201411 yr Author I know its a mess and I have learned a lot whilst making this. The issue is that your GUI pauses the game (override doesGuiPauseGame ). That freezes the client ticking, so no new packets are being sent. When you close the GUI you can see that the packet is then send. Your packet crashes the server though, I have not looked into that. A couple of things: Your .gitignore is broken. Your .project file should not be in the repo and the gradlew.bat is excluded, which should not be. Why do you handle the player data saving yourself? What is wrong with IExtendedEntityProperties? Please use Generics! In e.g. the DataSave class you just throw around raw HashMaps and ArrayLists That's just on a first glance. Overall your code is, sorry to say, a big mess. Good to know, after I have the GUI sorted I was planning to go through and redo a ton of code anyway I originally was using it without really understanding how it worked. Became frustrated with it and decided to handle it myself so I knew how it worked Will keep that it mind when I go back over that code Looks like a simple enough fix thanks for your help diesieben07 and TheGreyGhost
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.