Jump to content

Packet not Sending from Client to Server


DanielRuns

Recommended Posts

Just to be sure, when isRemote is true then the code is running on the client. I'm writing it, because in your code you're sending packet client -> server. But in the incoming packet code is:

                        if(!world.isRemote){
                                PacketDispatcher.sendPacketToServer(packet);
                        }

~ On a server side if it is a server side you resend same packet to a server?

 

I compared it to mine packet handling and I can't see anything bad (I'm using getEffectiveSide but world object should carry same information).

You can take a look (it's functional code):

https://github.com/mnn/jaffas/blob/b6b35d87e3a00b2fa36baf297569982a38fd5250/src/minecraft/monnef/jaffas/food/common/SpawnStonePacketUtils.java

https://github.com/mnn/jaffas/blob/b6b35d87e3a00b2fa36baf297569982a38fd5250/src/minecraft/monnef/jaffas/food/common/PacketHandler.java

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Link to comment
Share on other sites

That code snippet is from your packet handler. If you're talking about my code than you're doing something wrong.

 

My handler uses 2 types of packets and each type is strictly either client->server or server->client, so it's not possible to loop infinitely (one is request for update from client, second is update packet for client. on a second one client does not respond, so there can't be a loop).

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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