[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

    Raphfrk

    Ahh great.
     
  3. Offline

    Heliwr

    To confirm, I am still getting buffer erros with #140:
    Code:
    Buffer full and unable to parse packet
    Buffer full and unable to parse packet
    Bytes: c3, a4, cc, 0, 20, 0, 5, bd, 30, c4, 0, 20, 0, 5, c1, 38, e3, 0, 20, 0, 5, c1, 3a, 6c, 0, 20, 0, 5, c1, 37, a, 0, _33_, ff, ff, fd, f0, 0, 0, 0, 0, 0, 60, f, 7f, f, 0, 0, 12, ec, 78, 9c, ed, 5d, bd, 8e, 1c, c7, 11, ee, f6, ac, bd, a6, cd, c5, 9c, 95, 38, 14, 25, 1, 8e, 5, 42, 20, 16, b0, 1, 13, 10, 98, b, 84, cd, 98, 89, a0, c0, c9, 45, 82, 42, 66, 82, 32, 86, 82, 22, 66, 86, ec, e4, 42, 41, 52, 70, a9, c1, 13, 70, f, 70, 67, dc, b, 50, f0, 13, d8, 9e, e9, 9f, 99, ea, 9f, ea, e9, ea, 9a, d9, b9, 3d, 76, 5, 3a, de, de, d4, 7e, dd, 3d, 5d, f5, 55, 55, d7, 8c, b6, fb, 88, b4, 9d, 48, 29, 7a, 91, ad, 15, f3, 1, f8, a4, ff, ac, 6d, 9b, e6, 17, a2, 5c, b6, db, ed, 7e, eb, a2, 37, d, c0, b, f0, e5, f8, bb, 9c, 9, df, 87, d7, 3, 8, f0, 1a, f5, 2b, c4, 97, fd, 9f, 3, fc, 77, de, 61, e3, db, 15, 90, 0, bf, ff, 58, e, f0, 6a, 74, fd, 9f, 9f, 46, f0, 9, 23, d8, 6, 3, 68, dc, 5, f0, f0, db, 9, fc, e6, 77, bd, 90, f0, bd, fb, 8f, e1, b7, 66, 55, 5c, fc, a7, 4f, 9d, 1, f4, ff, a4, cd, df, df, 7d, 6a, 0, a, cb, c7, 77, 44, df, 9a, ee, 7e, 74, 3, 18, b6, c0, ae, d1, f8, d9, e8, fd, fc, f7, ce, 8, a4, 36
    IO ERROR
    [2:26:09 PM] ip/57973 (sander_20): Closed connection to server
    [2:26:09 PM] ip/57973 (sander_20): Closed connection to client
    
     
  4. Offline

    Raphfrk

    I added more debug info in 141. Is there any other exceptions ? The other changes may just have been unrelated bugs.
     
  5. Offline

    Heliwr

    #141 is providing much more information, but no other exceptions I can see:
    Code:
    Start scan
    Start scan
    Start 652470
    Start 652470
    dataLength 2890
    dataLength 2890
    Op code: JUMP_FIXED
    Op code: JUMP_FIXED
    Param: 14
    Param: 14
    Op code: INT_SIZED
    Op code: INT_SIZED
    Param: 0
    Param: 0
    Size: 3080
    Size: 3080
    position: 655568
    position: 655568
    Start: 652470
    Start: 652470
    dataLength: 2890
    dataLength: 2890
    maxPacketSize: 92160
    maxPacketSize: 92160
    Return packet: null
    Return packet: null
    Buffer full and unable to parse packet
    Buffer full and unable to parse packet
    Bytes: 5f, cb, b, 96, 97, 8e, 5f, e9, f2, e2, f1, 8f, 95, 97, 8e, 5f, 8d, ff, b, 2f, 2f, 1d, bf, 77, 3a, fe, ff, 7, 78, ce, aa, cd, _33_, ff, ff, fc, b0, 0, 0, 0, 0, 1, 20, f, 7f, f, 0, 0, c, 8, 78, 9c, ed, 9d, bd, 8e, 1e, 45, 16, 86, bb, 28, b3, cd, b0, b4, 7a, c4, 15, 20, 11, 90, 2, 22, a8, 90, c4, e9, 86, c4, 64, a4, 84, be, 3, e4, 6c, a3, d, 1c, 39, 5b, ad, 9c, 10, 22, 44, 40, ce, 2d, 20, ee, 60, 25, df, c1, 6e, 77, 75, fd, ff, 75, 7f, 73, 4e, f5, 71, fb, 3b, 6f, e0, 99, 91, 7d, e6, a9, bf, 53, 6f, 55, 75, f5, e7, 51, 8d, a3, 52, 62, d5, df, 87, 61, f9, 53, 2d, 92, 72, 9e, 26, 31, 2c, 3f, cf, 9b, 84, fd, c6, 48, ae, 1a, 86, f5, cf, f, fe, 31, 40, 34, ae, f2, fc, 41, 17, 60, e1, 2f, c8, c1, 17, a0, 27, 5f, 19, 2d, 40, 5d, e5, a5, 0, 86, 19, 34, 40, 2a, 8d, 1f, 4, bc, 0, 63, 58, 80, ad, ca, c2, f2, bf, a8, f2, b7, ea, 8b, 19, 81, af, 46, 29, 93, 2, 34, ea, bf, 2, cd, d7, e5, 5f, 63, f0, 47, 15, 75, c1, e0, a1, 62, ca, b, 60, f9, 6b, f1, c4, 8c, c3, 77, f5, b7, 5, 28, f2, 37, 70, c0, 77, e5, 1, 15, 60, a9, be, 52, 15, be, eb, 80, 2f, 9f, 2d, 8a, f8, 36, 21, e0, fc, b0, fd, 63, fe, 3c, 57, f9, 2, 8f, af, 82, c, d8
    IO ERROR
    [10:55:29 PM] ip/61545 (SuNnYxD): Closed connection to server
    [10:55:29 PM] ip/61545 (SuNnYxD): Closed connection to client
    
     
  6. Offline

    Simanova

  7. Offline

    Raphfrk

    Thanks for the info. I made a change that may fix it (plus adds a tiny bit more info)
     
  8. Offline

    Heliwr

    I haven't had any complaints today, fingers crossed this did fix it. Thanks for keeping at it!
     
  9. Offline

    Raphfrk

    Great, thanks for the error reports.
     
  10. Offline

    sawine

    Hey,

    I'm getting those errors on #142 in the proxy console:

    Code:
    Exception in thread "Proxy Listener" Exception in thread "Passthrough connection - 1329088583111" java.lang.OutOfMemoryError: unable to create new native thread
            at java.lang.Thread.start0(Native Method)
            at java.lang.Thread.start(Thread.java:691)
            at com.raphfrk.netutil.MaxLatencyBufferedOutputStream.<init>(MaxLatencyBufferedOutputStream.java:47)
            at com.raphfrk.protocol.ProtocolOutputStream.<init>(ProtocolOutputStream.java:35)
            at com.raphfrk.craftproxyliter.LocalSocket.<init>(LocalSocket.java:205)
            at com.raphfrk.craftproxyliter.LoginManager.getUsername(LoginManager.java:94)
            at com.raphfrk.craftproxyliter.PassthroughConnection.run(PassthroughConnection.java:78)
    java.lang.OutOfMemoryError: unable to create new native thread
            at java.lang.Thread.start0(Native Method)
            at java.lang.Thread.start(Thread.java:691)
            at com.raphfrk.craftproxyliter.ProxyListener.run(ProxyListener.java:199)
         
     
    Exception in thread "Passthrough connection - 1329173449612" java.lang.OutOfMemoryError: unable to create new native thread
            at java.lang.Thread.start0(Native Method)
            at java.lang.Thread.start(Thread.java:691)
            at com.raphfrk.netutil.MaxLatencyBufferedOutputStream.<init>(MaxLatencyBufferedOutputStream.java:47)
            at com.raphfrk.protocol.ProtocolOutputStream.<init>(ProtocolOutputStream.java:35)
            at com.raphfrk.craftproxyliter.LocalSocket.<init>(LocalSocket.java:205)
            at com.raphfrk.craftproxyliter.LoginManager.getUsername(LoginManager.java:94)
            at com.raphfrk.craftproxyliter.PassthroughConnection.run(PassthroughConnection.java:78)
    Exception in thread "Passthrough connection - 1329173450626" java.lang.OutOfMemoryError: unable to create new native thread
            at java.lang.Thread.start0(Native Method)
            at java.lang.Thread.start(Thread.java:691)
            at com.raphfrk.netutil.MaxLatencyBufferedOutputStream.<init>(MaxLatencyBufferedOutputStream.java:47)
            at com.raphfrk.protocol.ProtocolOutputStream.<init>(ProtocolOutputStream.java:35)
            at com.raphfrk.craftproxyliter.LocalSocket.<init>(LocalSocket.java:205)
            at com.raphfrk.craftproxyliter.PassthroughConnection.run(PassthroughConnection.java:65)
    Exception in thread "Proxy Listener" java.lang.OutOfMemoryError: unable to create new native thread
            at java.lang.Thread.start0(Native Method)
            at java.lang.Thread.start(Thread.java:691)
            at com.raphfrk.craftproxyliter.ProxyListener.run(ProxyListener.java:199)
    And simultaneously to those, I get these in the server console:
    Code:
    ves_icall_System_Threading_Thread_Thread_internal: CreateThread error 0x0
    ves_icall_System_Threading_Thread_Thread_internal: CreateThread error 0x0
    ves_icall_System_Threading_Thread_Thread_internal: CreateThread error 0x0
    I'm also running CB++, I don't know if it could be related or it's just a bug in the current proxy version. The memory usage of the proxy gets quite high also.

    Thank you
     
  11. Offline

    Raphfrk

    The issue looks like it is just running out of memory. There was a bug a while back.

    If you start the proxy using

    Code:
    java -Dcom.sun.management.jmxremote  -Dcom.sun.management.jmxremote.port="9004"  -Dcom.sun.management.jmxremote.authenticate="false"  -Dcom.sun.management.jmxremote.ssl="false" -jar CraftProxyLiter.jar  20000 25565 adminname <your-username>
    
    then you can cause a heap dumping by using the /memdump command in game (after connecting with the username you provided on the command line).

    The last time it occured, it was fixed when they updated the RB.
     
  12. Offline

    Naviboi

    I got a question,
    What if I just download this plugin and put it in my folder, but still changing the default_serverip to my local ip,
    does it still reduce bandwith?

    Do the players, and me have to open the GUI and press connect to reduce bandwith? or can i simple just put it in my plugins folder.
     
  13. Offline

    Raphfrk

    The proxy has to be run by both the server and on the player's computer. The local version is what converts the cached data stream back to the normal stream, so the client can understand it.
     
  14. Offline

    Naviboi

    So it does not reduce bandwith if i have it and noone else has it?
     
  15. Offline

    Raphfrk

    Right. If someone connects to the proxy directly, then it can't cache the data, since the player's computer doesn't actually have a cache.
     
  16. Offline

    Naviboi

    Sweet, thanks
     
  17. Offline

    vanwed94

    [EDIT]
    Never Mind I can connect it just has a wierd MOTD
    [EDIT]
    I have a wierd problem i think I set it up for my own computer right following the instructions, port forwarded 20000, and now im using localhost:25564 but when im in the minecraft client and i type in localhost:25564 it says

    could someone help me if this is needed here is my CraftProxy config file
     
  18. Offline

    12sd

    Good day.
    We have a Java launcher dedicated to our server.
    I've tried several ways to launch it on client side.
    Such as:
    - executing command to launch:
    Code:
    Process p = Runtime.getRuntime().exec("java -jar /path/to/file/CraftProxyLiter.jar 25565 server.com:50100 local_cache auth_off");
    The same command in Terminal and then launching client, connecting it to localhost:25565 works perfect.
    In launcher it seems not to be launched.
    -building a proccess:
    Code:
    ProcessBuilder proxy = new ProcessBuilder ("java -jar /path/to/file/CraftProxyLiter.jar 25565 server.com:50100 local_cache auth_off");
    
    then starting it before client:
    Code:
    Process prox_p = proxy.start()
    if (prox_p == null) { System.exit(1); }
    Then goes code to launch minecraft.jar.
    In this way situation is the same - client launches, but connection refused - proxy didn't started correctly or didn't started at all.

    So we have a question - what we are doing wrong?
    Or is there any simple way to integrate proxy to launcher or make it as modloader mod?
     
  19. Offline

    rickky

    [INFO] Disconnecting jjdd [/127.0.0.1:63111]: Internal server error
    [WARNING] Failed to handle packet: java.lang.IllegalStateException: Failed to add player. net.minecraft.server.EntityPlayer@1dcd8(jjdd at 695.5,64.0,46.5) already is in chunk 43, 2
    java.lang.IllegalStateException: Failed to add player. net.minecraft.server.EntityPlayer@1dcd8(jjdd at 695.5,64.0,46.5) already is in chunk 43, 2
    at net.minecraft.server.PlayerInstance.a(PlayerInstance.java:36)
    at net.minecraft.server.PlayerManager.addPlayer(PlayerManager.java:81)
    at net.minecraft.server.ServerConfigurationManager.c(ServerConfigurationManager.java:141)
    at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:121)
    at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:87)
    at net.minecraft.server.Packet1Login.handle(Packet1Login.java:70)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:47)
    at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:61)
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:537)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:435)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
     
  20. Offline

    micdoodle8

    You plan on updating this to R5?
     
  21. Offline

    Simanova

    Its not recommended to go for R5, only a few plugins are compatible and minecraft 1.2 isnt out yet.
    So theres no reason to head for R5.
     
  22. Offline

    LEOcab

    I'm still confused about the whole R5/R6/1.2 issue... I just jumped from R4 to 1.2. :D
     
  23. Offline

    Shifteh

    Wait so does this work on 1.2.3?
     
  24. Offline

    zaptrem

    Hi, i was wondering dose this pluggin help with people who DONT have the client side? Or vise versa?
     
  25. Offline

    LEOcab

    Nope.

    Raphfrk , we can haz for 1.2.3? :D
     
  26. Offline

    AgentKid

    He appears to be MIA. He hasn't logged into IRC for more than a week, and hasn't logged in on bukkit.org or Spout Forums since the 25th of February.
     
  27. Offline

    strontkever

    OMG HES DEAD!!!!!! NOOO
     
  28. Offline

    Shifteh

    =/ I really need this plugin :p Any idea what he might be up to? A.K.A Will he return? :p
     
  29. Offline

    Simanova

    Absolutly normal, dont worry.
    This happens every time with Raphfrk, if a big update comes out.
     
  30. Offline

    LEOcab

    I got a bandwidth upgrade so I don't really need CP anymore, but Comcast and their damned 6 month deals... I won't be able to keep these speeds for long. I hope Raphfrk returns to us with a glorious update soon. :(
     
  31. Offline

    Raphfrk

    Added 1.2.3 compatibility. I was able to connect and nothing exploded, but haven't done any other testing.
     

Share This Page