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

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

     
  1. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    This post has been edited 65 times. It was last edited by Raphfrk Jan 7, 2014.
  2.  
  3. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Had it get the compress/decompression gain backwards.
  4. Offline

    iffa

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Wait, I wont need a client mod for this?
  5. Offline

    blackvoid

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    The download link isnt working for me, cant connect to the server.
  6. Offline

    spunkiie

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Will this support/runs fine with 300+ players ?
  7. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Forgot to set the thread to watch. Was wondering why nobody responded, I thought it was at least worth responding to.

    No, the players run the proxy locally. They connect to the proxy and it connects to the actual server.

    So

    [[ MC Server <-> server-proxy-plugin ]] <-reduced bandwith-> [[ local proxy <-> Player's client ]]

    The local proxy caches the info, so the server plugin/proxy doesn't have to send as much data over the internet.

    I have tried to make it as easy as possible.

    The player just needs to double click on the .jar file, type in your server's address and press start.

    It is working now. I might have been uploading at the time or the site may have been having difficulties.

    Dunno, but didn't think there was any 300+ servers (around 100 was the limit).

    It improves bandwidth usage, but running the proxy uses CPU.

    I have to decompress the chunk data, scan it for cached matches and then re-compress it.

    It is threaded, so it should take advantage of a multi-core CPU.

    ---

    Anyway, I have updated. It now saves the cache to disk.

    Logging on uses around 80% less bandwidth than normal the second and later logins (and slight more for the first login).
  8. Offline

    ZachBora

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    So players use a local cache instead of downloading chunks from the server.
    - Does the server tell the proxy which chunks are "dirty" or will the proxy show unupdated chunks?
    - How many chunks are saved to the client? Does it keep ALL of them until minecraft is closed?
    - Can players without the .jar connect normaly to the server?
    - If I run both server and client on the same computer, does this improve something? (I wouldn't think so but it doesn't hurt to ask)
    MCbyWay likes this.
  9. Offline

    blackvoid

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Looks like my ISP is blocking it or something cause i could download it using a proxy.
  10. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Each chunk is sliced horizontally into 16 pieces. A hash is generated for each piece.

    The server just needs to remember these hashes. If it hits a hash that it knows the client has a block for, it just sends the hash.

    There is a (tiny) chance that two chunks sections would give the same hash by accident.

    So, the memory use is

    - server stores hashes for all active connections
    - client stores hashes + the actual block data for just its own connection

    The hash is 8 bytes and the chunk section is 16x16x8 = 2048 bytes, so the hashes are much smaller than the actual chunk section data.

    When the client connects the next time, it sends the server a list of hashes that it has.

    It saves them as "soft" references. This tells the garbage collector that they can be removed, but only if necessary.

    They are also backed up to disk, so the next time the player needs them they can be loaded.

    Also, both client and server can be set to limit the size of the cache. It defaults to 10MB, though I think it should be higher for the client.

    Yes, in fact, you could have 2 different ports if you want. The is no point in having the proxy handle players who aren't using the cache.

    No. In fact, it would make it worse. You would be compressing and decompressing the data for no reason.

    Weird.
  11. Offline

    Plague

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    post header is missing description, title is missing version
  12. Offline

    Plague

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I did that for you but did you read my entire post?
  13. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I thought you meant to add more info to the start? Was it just having a "description" heading?

    Also thanks for moving :).
  14. Offline

    raphael Letourneau

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Wait , I don't really understand how this works ( I'm french and my english isnt perfect ^-^ ) So I have to ''install'' this on my server and Portforward to 20000 ( TCP or BOTH ? ) my friends won't have to install this or to portforward ?
  15. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I would say you just need TCP forwarded. Also, the fowarding is only needed for the server, not for players.

    The defaults should work.

    Server
    Download the .jar and place it in your /plugins directory

    Players
    * Download the .jar
    * Place it in some directory
    * double click on it

    (you need Java installed)

    This will open a GUI. Enter the name of your server and press start.

    Run the minecraft client and connect to localhost:20001

    This will connect your client to the local proxy and onward to your server:20000

    I would love to know if people have tried this :).
  16. Offline

    raphael Letourneau

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Thanks for the Fast reply , On http://canihostaminecraftserver.com/ it told me that I could only host 2 players and me with my connection , Will ur plugin improve my server connection ? ( I will try it , I portforwarded and installed it but my friends will have to connect to localhost:20001 too ?. Last Question ^^ Do I still have tu run my bukkit on my old IP ( ex: my friends were loggin on minecraftxxxx.no-ip.org ? Thanks for that awesome pluggin and keep it up ! Ohhh We need to be premium ! :O is there a way to Put '' online-mod '' to offline ?
  17. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    It depends on why you can run 2.

    One option would be to double your upload and download speeds from what you typed in originally and see if that helps.

    If that helps, then the cache should help.

    No, they need to download the .jar file and run the proxy on their computer.

    Yes, your friends type in that address into the gui to connect.
  18. Offline

    raphael Letourneau

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Thanks I got it ! And for the premium account . Is there a way to turn the online mod off ? Just to play in LAN or things like that
  19. Offline

    Faust

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I got an error "Failed to verify name" this was however fixed by putting the server in offline mode, the server is on my local network so that might be the reason. I haven't tested it further, seeing as I'm on my way to bed.. Otherwise I've noticed a tad lower bandwidth usage..
    MCbyWay likes this.
  20. Offline

    Raphfrk

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    If you are playing on a LAN, then you probably don't need caching?
  21. Offline

    raphael Letourneau

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    So that means my friends have to buy the Game .
  22. Offline

    zoolder101

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    So do the players need ot download anything?
  23. Offline

    Darkwizard98

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    hey i was just wondering what does Backend server mean? probably a stupid question
  24. Offline

    ropng

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    i like it
    but no offline mode
    so i can't use it:p
  25. Offline

    MCbyWay

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    This. looks. EPIC 0.0

    Will try on my server today and report results 8D
  26. Offline

    MCbyWay

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Got a quick question, mind you I'm no Java programmer or anything XP

    But if these chunks are cached, does this mean that the chunks are saved locally?

    So if I were to say - Stand on one chunk and warp back to it later the load up of the 1st chunk would load up faster?

    Just wondering if this speeds up warps or basically areas in game that the player has already been to =o

    Then that gives a use to use this on lan?

    On another note I am attempting to test this locally and I keep getting the same error above even on offline mode and authentication disabled in the plugin xD

    I'll eep trying and report back tonight =D
  27. Offline

    MCbyWay

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    T

    They need to use the jar above to connect with caching otherwise they're just connecting normally, instructions are in the original post ^^
  28. Offline

    MCbyWay

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I'm trying to get this to work online but I noticed in the plugin settings file there is a auth section. switch it to false and see if that works.
  29. Offline

    MCbyWay

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    This is odd... I have a player willing to help me beta test outside lan later in the day, but i tried running on the same machine just as a simple test and this was the result I got:


    I replace my username and things here with censored for security purposes however it's rather confusing, from what I see my account has been authenticated at minecraft.net successfully so why am I still unable to connect at the "backend" server?

    Tried with build 36 and 37 of your plugin.

    Bukkit 740 installed with a plugin list if you need it.

    Edit:

    2nd attempt: The 1st time I ran the plugin client I set it to localhost at ip 20000. this time I tried 25565 and I get a weird Outdated server error 0.0

  30. Offline

    ZachBora

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I almost forgot, I'm using this string to start minecraft so I don't crash (it's a problem with nvidia cards it appears. Theres a whole thread about it on the minecraft support forums http://getsatisfaction.com/mojang/topics/bwod_black_window_of_death).

    How do I combine this with your jar?

    "C:\Program Files\Java\jre6\bin\java.exe" -Xmx512M -Xms512M -cp "D:\Minecraft\minecraft2.jar" net.minecraft.LauncherFrame
  31. Offline

    PsychoNecrosis

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @MCbyWay: See that shiny edit button below your posts?

    That's what we click on to avoid 5 back to back posts from 1 person. :p

    This plugin's a great idea, thanks Raph!

    Sadly I'm a LAN host, so no test info from me :)

Share This Page