[MISC] CraftProxy 0.2.0 - Reduce bandwidth use by caching chunk data [1.6]

Discussion in 'Archived: Plugin Releases' started by Raphfrk, May 1, 2011.

  1. Offline

    Raphfrk

    CraftProxy - Reduce bandwidth use by caching chunk data
    Version: 0.2.0

    Description

    This plugin and local client allows chunk data to be cached locally by players. This reduces the bandwidth required for hosting the server. It also helps users who are on slower connections.

    I am not sure what the status of this system is. It doesn't count as a plugin, since it has 2 parts.

    Even when running the plugin, players who don't use the client proxy can still connect. However, they will use the full bandwidth.

    The system can reduce bandwidth by 70-90% (after the 2nd login).

    Setup

    Server

    Add the plugin file to the plugins folder

    Client

    Start minecraft client and login
    Double click on the client jar file
    Enter login details
    Enter the server location/port in the GUI
    Press start on the GUI
    Connect to localhost on the minecraft client

    Stable Builds

    None yet

    Dev Builds

    Warning: These may not be stable

    Client
    Plugin

    Had it get the compress/decompression gain backwards.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
    Jushy, Martin1704, Nathan C and 24 others like this.
  2. Offline

    LEOcab

    Oh man... He really needs to update this plugin. I will lose like 3 players because they can't play without it, and if one of these days Mojang decides to change their network code then boom. :(
     
  3. Offline

    Simanova

    v99 tested with cb 975-978 and 1.7.3, no problems, works great
     
  4. Offline

    AgentKid

    In my tests, it hasn't worked when I had BukkitContrib installed, though that could be another client mod that's in that same .jar.....I'll go redo my tests
     
  5. Offline

    1n5aN1aC

    I wouldn't think it would conflict with bukkitcontrib, since you connect to the proxy. your not actually modding anything.

    unless bukkitcontrib uses some extra packets, and they happen to be the same ones this uses.
     
  6. Offline

    Brekkjern

    It does. I can't remember what one. You would have to check that up.
     
  7. Offline

    lipe123

    The server keeps crashing after a few days of use, is this a known issue? Could you plese set it to run in plugin mode again?
     
  8. Offline

    LEOcab

    I have mine running in plugin mode and it runs for days without crashing. I don't know why he said that plugin mode doesn't work...
     
  9. Offline

    lipe123

    Oh sweet because I think its just cause its left running too long, I reboot my server every day anyways so in plugin mode this will reboot with it and should solve that issue.
     
  10. Offline

    LEOcab

    Haha, yeah, I used to have 2 separate scripts to start/stop each process and sometimes it got messy.:D
     
  11. Offline

    AgentKid

    Yeah, it won't let me get into the server at all. Perspectives:

    Client:
    Code:
    Disconnected by Server
    [CraftProxyLiter] Protocol Stream Closed
    Proxy:
    Code:
    Connection from 192.168.5.4/58444
    [1:24:33 AM] 192.168.5.4/58444 (AgentKid): Connecting to : 192.168.5.102 25565
    [1:24:33 AM] 192.168.5.4/58444 (AgentKid): Attempting to connect to: 192.168.5.102:25565
    [1:24:33 AM] 192.168.5.4/58444 (AgentKid): Connection successful
    [1:24:33 AM] 192.168.5.4/58444 (AgentKid): Connecting using proxy to server connection format
    [1:24:34 AM] 192.168.5.4/58444 (AgentKid): Server login successful
    [email protected] Unknown packet Id c3
    [email protected] Unknown packet Id c3
    [email protected] 50 67 ae 14 80 0 0 c0 4f 2c 46 a1 89 e2 93 c3 39 5a af 41 9a cc df 0 3 0 6 0 2f 0 30 0 2e 0 31 0 2e 0 33 *c3* 0 0 0 5 0 0 0 7 1 ff ff
    [1:24:34 AM] 192.168.5.4/58444 (AgentKid): [email protected] Unable to read packet
    [1:24:34 AM] 192.168.5.4/58444 (AgentKid): Packets: [13, 3]
    [email protected] Unknown packet Id c3
    [email protected] Unknown packet Id c3
    [email protected] ed 6f ff 57 96 ff 77 fe 7d 26 8b 5f 58 3f d4 ca f5 43 9 eb c7 23 61 fd f8 54 56 3f 2e 7e 9b a9 1f ff 7 94 5d 18 7c *c3* 0 0 0 2 0 0 0 10 0 1c 86 7b 0 4 0 6e 0 6f 0 6e 0 65 0 4 0 6e 0 6f 0 6e 0 65 c3 0 0 0 2 0 0
    [1:24:34 AM] 192.168.5.4/58444 (AgentKid): [email protected] Unable to read packet
    [1:24:34 AM] 192.168.5.4/58444 (AgentKid): Packets: [103, 33, 31, 31, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 31, 31, 31, 31, 8, 51]
    [1:24:34 AM] 192.168.5.4/58444 (AgentKid): Closed connection to server
    [1:24:34 AM] 192.168.5.4/58444 (AgentKid): Closed connection to client
    Server that I'm trying to connect to:
    Code:
    01:23:57 [INFO] AgentKid [/192.168.5.103:48943] logged in with entity id 2220464 at ([Creative] -38.50347750642243, 64.0, -62.3459054873721)
    01:23:57 [INFO] [staff] AgentKid has joined the channel
    01:23:57 [INFO] [Game] AgentKid has joined the channel
    01:23:58 [INFO] AgentKid lost connection: disconnect.endOfStream
    01:23:58 [INFO] [staff] AgentKid has left the channel
    01:23:58 [INFO] [Game] AgentKid has left the channel
    Also this is without the server even having BukkitContrib installed, just a vanilla client with BukkitContrib connecting to the proxy. I think that the proxy should just forward all unknown packets to the server/client if that's possible.
     
  12. Offline

    LEOcab

    Oooohh... Yeah, BukkitContrib has new network packets and apparently CraftProxy doesn't forward them like you say. Not compatible. I was about to try BukkitContrib too... I want capes. Guess not. :(
     
  13. Offline

    Raphfrk

    Looks like Bukkit Contrib has updated so that it includes the packet length in the packet. This will allow it to be properly skipped without needing to actually understand contrib packets.

    However, I did a quick look at one of his packets, and I don't think the length is right.

    Edit: looks like that will be fixed for the next version.

    Updated to 103.

    This should hopefully work with BukkitContrib eventually. It still doesn't match Afforess' code and need to figure out why there is a mismatch.

    There are also 2 packets which 100% don't work, but will be fixed for the next update.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  14. Offline

    big_hairy_jimbo

    Is the download link broken??
    I'm logged into the Bukkit site OK, so It's not that.
    I keep getting this error when I try to download.

    Forbidden

    You don't have permission to access /minec/latestcplr/CraftProxyLiter.jar on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
     
  15. Offline

    Raphfrk

    Sorry about that, it should work now.
     
    big_hairy_jimbo likes this.
  16. Offline

    AgentKid

    Now I'm getting a mix of "[CraftProxyLiter] Protocol stream closed" "NullPointerException" and "Bad packet ID 121" messages when trying to connect through the proxy with a BukkitContrib client.
     
  17. Offline

    Raphfrk

    It doesn't work with contrib yet due to a bug in the way contrib calculates the length of the packets. However, it should work with the next contrib update, which is happening tomarrow.
     
  18. Offline

    AgentKid

    Ah, okay. Thanks :)
     
  19. Offline

    big_hairy_jimbo

    Thanks, it worked like a charm now.
     
  20. Offline

    Raphfrk

    I updated this again. It is only a small change. It now sends a respawn packet when you connect to another server. This forces the client to change the sky colour. World seed still isn't changed, but that is a Notch thing :(.

    Previously, teleporting from Nether on one server to normal on another would mean that the sky colour wouldn't change.

    I assume that the reason that there were no complaints was that everyone was teleporting between the same kinds of world.
     
  21. Offline

    AgentKid

    Still doesn't work with BukkitContrib version 0.1.5 and CraftProxy v105. Error on Proxy:
    Code:
    Connection from 192.168.5.4/60407
    [5:17:31 PM] 192.168.5.4/60407 (AgentKid): Connecting to : 192.168.5.102 25565
    [5:17:31 PM] 192.168.5.4/60407 (AgentKid): Attempting to connect to: 192.168.5.102:25565
    [5:17:31 PM] 192.168.5.4/60407 (AgentKid): Connection successful
    [5:17:31 PM] 192.168.5.4/60407 (AgentKid): Connecting using proxy to server connection format
    [5:17:32 PM] 192.168.5.4/60407 (AgentKid): Server login successful
     Unknown packet Id 40
     Unknown packet Id 40
    41 f7 33 35 0 3 0 6 0 2f 0 30 0 2e 0 31 0 2e 0 35 c3 0 0 0 5 0 0 0 b 0 ff ff d 40 72 86 5e 8 15 81 *40* 40 56 0 0 0 0 0 0 40 56 67 ae 14 80 0 0 c0 5f ca a 2f e0 b5 2 42 5f 8d eb 41 f7 33 35 0
    [5:17:32 PM] 192.168.5.4/60407 (AgentKid): Upstream link
    [5:17:32 PM] 192.168.5.4/60407 (AgentKid):  Unable to read packet
    [5:17:32 PM] 192.168.5.4/60407 (AgentKid): Packets: [13, 3, -61]
    [5:17:32 PM] 192.168.5.4/60407 (AgentKid): Timeout
    [5:17:32 PM] 192.168.5.4/60407 (AgentKid): Closed connection to server
    [5:17:32 PM] 192.168.5.4/60407 (AgentKid): Closed connection to client
     
  22. Offline

    Raphfrk

    Still not my fault :).

    The server plugin is working, but there is still a bug in the client mod, it doesn't report the packet size according to the protocol as agreed.

    I submitted a pull request with the bug fix, that is as much as I can do.

    I can't even give a modified version of the client since the version of the client on github, doesn't include the texture fixes for 1.5 release. Well, I guess I could, but portals show up as blue and fire is red text and I have no idea how stable it is.

    I am not sure when Afforess is doing his next release, so could be next weekend :(. Do you know how often he normally updates Contrib?

    @AgentKid

    Looks like there will be another release of Bukkit Contrib Today or Tomarrow, so hopefully should be fixed then.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  23. Offline

    LEOcab

    Mr. Raphfrk - for the second time thanks a lot for this plugin. Now a question: why do you recommend not running the plugin as a plugin? Both modes work fine. :p
     
  24. Offline

    AgentKid

    Yep, works great now with BukkitContrib 0.1.6! One issue, though. Whenever I teleport to a different world via /mvtp or just teleporting to a player, my client gets disconnect with the error "Internal Exception: java.lang.NullPointerException". On the proxy it says:
    Code:
    Connection from 192.168.5.4/59858
    [1:05:13 AM] 192.168.5.4/59858 (AgentKid): Connecting to : 192.168.5.102 25565
    [1:05:13 AM] 192.168.5.4/59858 (AgentKid): Attempting to connect to: 192.168.5.102:25565
    [1:05:13 AM] 192.168.5.4/59858 (AgentKid): Connection successful
    [1:05:13 AM] 192.168.5.4/59858 (AgentKid): Connecting using proxy to server connection format
    [1:05:13 AM] 192.168.5.4/59858 (AgentKid): Server login successful
    [1:05:59 AM] 192.168.5.4/59858 (AgentKid): Unable to flush output stream
    [1:05:59 AM] 192.168.5.4/59858 (AgentKid): EOF reached
    [1:05:59 AM] 192.168.5.4/59858 (AgentKid): Closed connection to server
    [1:05:59 AM] 192.168.5.4/59858 (AgentKid): Closed connection to client
     
  25. Offline

    Raphfrk

    This happens for me even without CraftProxy, so it isn't a CraftProxy thing.

    You need to complain in the Contrib thread.

    However, before I wash my hands of it, it is possibly related to other code I submitted to BukkitContrib that updates the world seed when you teleport between world. However, everything works fine with the code on github, so not sure what is happening.
     
  26. Offline

    Juze

    @Raphfrk : I know this sounds silly, but your category tag is wrong. It's required to be a correct one for plugins.bukkit.org. [MISC] may work fine.

    EDIT: Edited it for you.
     
  27. Offline

    MaWe4585

    I set remoteserver to the data i usually connect to and local server to localhost with port 20000.
    When it starts downloading the terrain i get an error:
    Disconnected by Server
    [CraftProxyLiter] Protocol stream closed

    I'm using craftbukkit build #1000 as server and 1.7.3 as client


    Server says this:

    2011-07-18 09:56:41 [INFO] MaWe4585 logged in with entity id 16319 at ([world] -984.0625, 56.0, 1058.5)
    2011-07-18 09:56:41 [SCHWERWIEGEND] java.io.IOException: Bad packet id 80
    2011-07-18 09:56:41 [SCHWERWIEGEND] at net.minecraft.server.Packet.a(Packet.java:73)
    2011-07-18 09:56:41 [SCHWERWIEGEND] at net.minecraft.server.NetworkManager.g(NetworkManager.java:149)
    2011-07-18 09:56:41 [SCHWERWIEGEND] at net.minecraft.server.NetworkManager.c(NetworkManager.java:259)
    2011-07-18 09:56:41 [SCHWERWIEGEND] at net.minecraft.server.NetworkReaderThread.run(SourceFile:84)
    2011-07-18 09:56:42 [INFO] MaWe4585 lost connection: disconnect.genericReason
    2011-07-18 09:56:45 [WARNUNG] Can't keep up! Did the system time change, or is the server overloaded?
     
  28. Offline

    Raphfrk

    Thanks :).

    I think you are directly connecting to the server with the local proxy. Packet 80 is a craftproxy fake packet that is use by the proxy. Is there a proxy running on on the server too? If so, make sure the remote server port is the server proxy's port (20000 by default) rather than the standard game port (25565).

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  29. Offline

    MaWe4585

    server is a simple computer behind the same router than me.
    i connect via dyndns local port on the server is 25565.
    router forwards the port to 25565.
    that usually works fine.

    now i understood that craftproxy connects to my server so i need to connect to dyndns and port 25565 since there is the server.

    craftproxy needs to run on the client, right?

    so i started craftproxy there connecting to dyndns 25565 and taking the local port 20000 where the game itself connects to.
     
  30. Offline

    Raphfrk

    You need to have a proxy on the server as well.

    See

    [​IMG]


    The point is that you must run a proxy on both the server and at the client end (row 2 in the diagram). The proxy on the server normally listens on port 20000.
     
  31. Offline

    MaWe4585

    ok, and can i connect there without craftproxy on the client?

    or can i use both? one connects via craftproxy the other doesn't?
     

Share This Page