[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

    Normal users can connect to the (server) proxy and it will just forward them.

    To get the chunk reduction, the proxy is needed to be run by both the client and server.
     
  3. Offline

    MaWe4585

    doesnt work.. what is wrong with my config?

    i have the server listening on 20000.
    the serverproxy has remote 20000 and local 25565 (switch them?no, other direction doesn't work at all)

    client withut proxy gets the same message as above and server also generates the same message
    client with proxy also gets the same message and server also generates the same message as above


    edit: oops my fault i overread the part of setup i thought just put the jar on the server and on the client and doubleclick it, would be much easier.

    it works with standalone version but i don't have that craftproxylite folder to edit any file so i can get it working with the other kind

    edit2: ok now there is the craftproxylite folder and the file, looks like it is working
     
  4. Offline

    Raphfrk

    Great, the folder doesn't get created until the plugin has been run once.
     
  5. Offline

    MaWe4585

    Sorry to bother you again :D
    I have a problem with the auth_off flag of the proxylite.txt file.

    as far as i understand when this is true users don't get checked via minecraft.net, is that correct?
    Now i turned it to false so that the get checked but i can't log in myself getting these messages:

    Connecting to : localhost 20000
    Attempting to connect to: localhost:20000
    Connection successful
    Connecting using proxy to server connection format
    Failed to verify username!
    Authing with (edited out because i don't know what hackers can do with this info)
    Auth successful
    Server login successful
    Client requested caching mode
    EOF reached
    Timeout
    Closed connection to server
    Closed connection to client

    The client only shows: failed to verify username
     
  6. Offline

    Raphfrk

    No, it means that the proxy doesn't do the checking. If the server is in online mode, then the server will still check.

    auth_off probably a bad choice of name.
     
  7. Offline

    MaWe4585

    oh, ok good to know :)
    still: it should work shouldn't it?

    edit: i found some strange messages in my log:

    2011-07-18 18:14:26 [INFO] (UserXYZ): Client requested caching mode
    2011-07-18 18:14:36 [SCHWERWIEGEND] Exception in thread "CompressionThread"
    2011-07-18 18:14:36 [SCHWERWIEGEND] java.util.concurrent.RejectedExecutionException
    2011-07-18 18:14:36 [SCHWERWIEGEND] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(Unknown Source)
    2011-07-18 18:14:36 [SCHWERWIEGEND] at java.util.concurrent.ThreadPoolExecutor.reject(Unknown Source)
    2011-07-18 18:14:36 [SCHWERWIEGEND] at java.util.concurrent.ThreadPoolExecutor.execute(Unknown Source)
    2011-07-18 18:14:36 [SCHWERWIEGEND] at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
    2011-07-18 18:14:36 [SCHWERWIEGEND] at com.raphfrk.compression.Compressor.compress(Compressor.java:177)
    2011-07-18 18:14:36 [INFO] IO ERROR
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [SCHWERWIEGEND] at com.raphfrk.craftproxyliter.CompressionManager$CompressionThread.run(CompressionManager.java:74)
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-18 18:14:36 [INFO] (UserXYZ): Unable to flush output stream
    2011-07-18 18:14:36 [INFO] (UserXYZ): Closed connection to server
    2011-07-18 18:14:36 [INFO] (UserXYZ): Closed connection to client
    2011-07-18 18:14:36 [INFO] UserXYZ lost connection: disconnect.endOfStream
     
  8. Offline

    Raphfrk

    The latest version should catch this exception.
     
  9. Offline

    Nam

    Binding to an IP address doesn't appear to work correctly. Specify an IP address/Port to listen to, and it listens to 0.0.0.0/PORT instead of IP/PORT. Can you please fix this. Otherwise, very useful. Thanks.
     
  10. Offline

    Raphfrk

    The listen to is supposed to be the qualified name of the server, not to give it what address to bind to. Granted by just giving it a port, it will work fine.

    If you set the listento to:

    main.proxy:12345,this.proxy.name:43210

    then you are telling the server that it is behind a proxy called main.proxy:12345. it would bind to port 43210 (and all IP addresses).

    If a proxy connects to main.proxy:12345 and asks to be connected to

    main.proxy:12345,second.proxy:43210,server-ip:port

    it would skip the first part (since it matches its own name) and connect to second.proxy:43210.

    second.proxy would ignore both the first 2 parts of the target, and would connect to sever-ip:port.

    This means that second.proxy has to make sense to the previous proxy, not necessarily the current proxy.

    Having said that, I could just add a check, it the listento is set to a domain name or IP, I could check if it is a local IP and if so, bind to that IP/port.

    Most (all?) people don't have multiple proxy layers.

    Anyway, I updated this.

    If you provide an IP, it will use it unless it isn't an IP address of one of the local interfaces.

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

    Nam

    Awesomeness, thank you very much, I will try the latest version later today.
     
  12. Offline

    Tueurdragon

    Hello,

    I installed craftproxy for automatic reconnection between server
    the plugin is installed and functional
    I just have a small problem with authentication, but when I enable the online mode on serverbukkit auth_off and false
    I can not log in anymore on the server with the proxy

    do you have a tip

    thank you very much

    regards
    Draco

    PS: Excuse me for my English, I'm french
     
  13. Offline

    Raphfrk

    Is the Bukkit server in offline mode? I assume you have set auth_off for the proxy?

    You should have authentication for the proxy OR the server, if you have it for both, it won't work.
     
  14. Offline

    Simanova

    Is it possible to remove the empty "CPL_Cache" from linux minecraft directory?
    This folder ist always empty and makes noch sense for me.

    Greetings
     
  15. Offline

    Raphfrk

    The CPL_Cache directory should be empty for the server and there is no loss in deleting all the files in it.

    In fact, if users are having disconnect trouble, one solution might be to wipe their cache directory, or setting their cache size smaller. The hashes are stored in memory, so the bigger the cache, the larger the memory use for the local part.
     
  16. Offline

    MaWe4585

    I'm currently getting this exception on my server after joining and destroying some dirt blocks:

    2011-07-25 19:58:10 [SCHWERWIEGEND] Exception in thread "CompressionThread"
    2011-07-25 19:58:10 [SCHWERWIEGEND] java.util.concurrent.RejectedExecutionException
    2011-07-25 19:58:10 [SCHWERWIEGEND] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(Unknown Source)
    2011-07-25 19:58:10 [SCHWERWIEGEND] at java.util.concurrent.ThreadPoolExecutor.reject(Unknown Source)
    2011-07-25 19:58:10 [SCHWERWIEGEND] at java.util.concurrent.ThreadPoolExecutor.execute(Unknown Source)
    2011-07-25 19:58:10 [SCHWERWIEGEND] at java.util.concurrent.AbstractExecutorService.submit(Unknown Source)
    2011-07-25 19:58:10 [SCHWERWIEGEND] at com.raphfrk.compression.Compressor.compress(Compressor.java:177)
    2011-07-25 19:58:10 [SCHWERWIEGEND] at com.raphfrk.craftproxyliter.CompressionManager$CompressionThread.run(CompressionManager.java:74)


    i don't know if it is craftproxy or bukkit, maybe you know what it means?
     
  17. Offline

    Raphfrk

    Hi, are you using the latest version of CraftProxy, I think I caught that exception in the latest code.
     
  18. Offline

    MaWe4585

    ok i updated it, currently i'm not getting the exception.
     
  19. Offline

    Raphfrk

    Great, is it working otherwise?
     
  20. Offline

    MaWe4585

    I just got this Exception when spawning 200 cows but i think that isn't your problem is it? xD:

    2011-07-26 19:41:50 [SCHWERWIEGEND] java.lang.NullPointerException
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.Chunk.a(Chunk.java:526)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.World.b(World.java:2001)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.World.getEntities(World.java:953)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.Entity.move(Entity.java:389)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.EntityLiving.a(EntityLiving.java:582)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.EntityLiving.v(EntityLiving.java:704)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.EntityLiving.m_(EntityLiving.java:218)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.World.entityJoinedWorld(World.java:1198)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.World.playerJoinedWorld(World.java:1180)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.World.cleanUp(World.java:1104)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:447)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    2011-07-26 19:41:50 [SCHWERWIEGEND] at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    2011-07-26 19:41:50 [SCHWERWIEGEND] Unexpected exception
    java.lang.NullPointerException
    at net.minecraft.server.Chunk.a(Chunk.java:526)
    at net.minecraft.server.World.b(World.java:2001)
    at net.minecraft.server.World.getEntities(World.java:953)
    at net.minecraft.server.Entity.move(Entity.java:389)
    at net.minecraft.server.EntityLiving.a(EntityLiving.java:582)
    at net.minecraft.server.EntityLiving.v(EntityLiving.java:704)
    at net.minecraft.server.EntityLiving.m_(EntityLiving.java:218)
    at net.minecraft.server.World.entityJoinedWorld(World.java:1198)
    at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
    at net.minecraft.server.World.playerJoinedWorld(World.java:1180)
    at net.minecraft.server.World.cleanUp(World.java:1104)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:447)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)


    mhmmm unexpected exception.. or others expected? oO
     
  21. Offline

    Raphfrk

    Does it happen even if you aren't using the proxy ?
     
  22. Offline

    MaWe4585

    Yes it appears even without Craftproxy, i connected NOT using CraftProxy on both client or server and it appeared.

    However sinc i installed verison 107 playing looks like this:

    2011-07-28 20:29:54 [INFO] Connection from myip/myport
    2011-07-28 20:29:54 [INFO] myip/myport (MaWe4585): Connecting to : localhost 20000
    2011-07-28 20:29:54 [INFO] myip/myport (MaWe4585): Attempting to connect to: localhost:20000
    2011-07-28 20:29:54 [INFO] myip/myport (MaWe4585): Connection successful
    2011-07-28 20:29:54 [INFO] myip/myport (MaWe4585): Connecting using proxy to server connection format
    2011-07-28 20:29:56 [INFO] MaWe4585 [/127.0.0.1:49332] logged in with entity id 22402 at ([world] 108.49675994421295, 45.0, -274.7333860159824)
    2011-07-28 20:29:56 [INFO] myip/myport (MaWe4585): Server login successful
    2011-07-28 20:29:56 [INFO] myip/myport (MaWe4585): Client requested caching mode
    2011-07-28 20:31:01 [WARNUNG] Can't keep up! Did the system time change, or is the server overloaded?
    2011-07-28 20:31:35 [INFO] Read timed out
    2011-07-28 20:31:35 [SCHWERWIEGEND] java.net.SocketException: Socket closed
    2011-07-28 20:31:35 [SCHWERWIEGEND] at java.net.SocketOutputStream.socketWrite(Unknown Source)
    2011-07-28 20:31:35 [SCHWERWIEGEND] at java.net.SocketOutputStream.write(Unknown Source)
    2011-07-28 20:31:35 [SCHWERWIEGEND] at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
    2011-07-28 20:31:35 [SCHWERWIEGEND] at java.io.BufferedOutputStream.flush(Unknown Source)
    2011-07-28 20:31:35 [SCHWERWIEGEND] at java.io.DataOutputStream.flush(Unknown Source)
    2011-07-28 20:31:35 [SCHWERWIEGEND] at net.minecraft.server.NetworkWriterThread.run(SourceFile:116)
    2011-07-28 20:31:35 [INFO] MaWe4585 lost connection: disconnect.endOfStream
    2011-07-28 20:31:39 [WARNUNG] Can't keep up! Did the system time change, or is the server overloaded?
    2011-07-28 20:32:51 [INFO] IO ERROR
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-28 20:32:51 [INFO] myip/myport (MaWe4585): Unable to flush output stream
    2011-07-28 20:32:51 [INFO] myip/myport (MaWe4585): Closed connection to server
    2011-07-28 20:32:51 [INFO] myip/myport (MaWe4585): Closed connection to client


    and that doesn't appear when i connect without CraftProxy.
    I don't do anything fancy there, i just dig a 1000*3*3 tunnel
    And i'm alone on the server at this time, and the 200 cows are dead. i already restarted the server (computer) but it still appears.
     
  23. Offline

    Raphfrk

    You are getting exceptions even without CraftProxy? That suggests that something else is the root cause.

    That is saying that the connection is timing out for some reason.

    Was the tunnel dug with some other plugin?
     
  24. Offline

    MaWe4585

    no just digging with stone pickaxes.
    i also get lags so that single blocks that are destroyed reappear which is only with craftproxy.
     
  25. Offline

    Raphfrk

    Hmm, does it happen on previous versions?
     
  26. Offline

    Phant0mX

    Ooh, this looks very useful! Does it conflict at all with BukkitContrib?
     
  27. Offline

    Raphfrk

    Is supports the Bukkit contrib packet structure.
     
  28. Offline

    Phant0mX

    Thanks!
     
  29. Offline

    MaWe4585

    it worked prior to 107 but don't know which version i had
     
  30. Offline

    Raphfrk

    Hmm, can you try version 102, I think that was the last version since the latest round of changes.
     
  31. Offline

    MaWe4585

    i played a while with 102 now. it took a while longer than with 107 but i also get the error:
    2011-07-30 19:54:49 [INFO] IO ERROR
    2011-07-30 19:54:49 [INFO] Fairness Manager Interrupted when waiting for timer to close
    2011-07-30 19:54:49 [INFO] (MaWe4585): Unable to flush output stream
    2011-07-30 19:54:49 [INFO] (MaWe4585): Closed connection to server
    2011-07-30 19:54:49 [INFO] (MaWe4585): Closed connection to client
    2011-07-30 19:54:49 [SCHWERWIEGEND] java.net.SocketException: Software caused connection abort: socket write error
    2011-07-30 19:54:49 [SCHWERWIEGEND] at java.net.SocketOutputStream.socketWrite0(Native Method)
    2011-07-30 19:54:49 [SCHWERWIEGEND] at java.net.SocketOutputStream.socketWrite(Unknown Source)
    2011-07-30 19:54:49 [SCHWERWIEGEND] at java.net.SocketOutputStream.write(Unknown Source)
    2011-07-30 19:54:49 [SCHWERWIEGEND] at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
    2011-07-30 19:54:49 [SCHWERWIEGEND] at java.io.BufferedOutputStream.flush(Unknown Source)
    2011-07-30 19:54:49 [SCHWERWIEGEND] at java.io.DataOutputStream.flush(Unknown Source)
    2011-07-30 19:54:49 [SCHWERWIEGEND] at net.minecraft.server.NetworkWriterThread.run(SourceFile:116)
    2011-07-30 19:54:49 [INFO] MaWe4585 lost connection: disconnect.endOfStream

    i try playing a while without proxy now maybe it isnt the proxy at all even though i get this message on the client:
    Disconnected by Server
    [CraftProxyLiter] Protocol stream closed
     

Share This Page