Jump to content

Multiplayer Packet Handling: Client to Server


Luigi Wollknäuel

Recommended Posts

Hayho!

 

I'm about to make my mod, Industrial Farming, Server-compatible.

 

Therefore, I have to convert every Packet Handling stuff to something the Server is able to deal with - And here comes my problem.

 

The Gui of one of my blocks contains a Slider. The value set by this slider is supposed to go to the Block TileEntity on both sides, Server and Client. Since the Gui is ClientSide only, I have to get the MinecraftServer-instance to send the corresponding packet. But if I use the common methods to send Packets from Client to Server, neither "PacketDispatcher.sendPacketToServer([Packet])" nor "FMLClientHandler.instance().sendPacket([Packet])" work

 

- Do you know any possibility to get a variable set in the Client be sent to the Server?

 

note, that this works completely fine in SinglePlayer.

 

Thanks,

Luigi

Link to comment
Share on other sites

And no, I use two different packet channels, one for Server and one for Client Side. That's fine, too.

Maybe I'm missunderstanding something, but you say that you send packets over different channels? I'm kinda wondering why you would do that. Why don't you use the same channel for both client and server? Seperating channels would only makes sense when you have to handle submodules, but not to seperate client and server.

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.

×
×
  • Create New...

Important Information

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