Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

  • 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)

  • 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

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

 

 

  • 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 :|

  • 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

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

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.