Live image to say what version I'm using?

Discussion in 'Archived: Plugin Requests' started by dark_hunter, Aug 1, 2011.

  1. Offline

    dark_hunter

    Is there a way to show a live image of the Bukkit version I'm using?
     
  2. Offline

    gbear605

    I'm sure there is some API code for what version, and that could write to file/sql server, that could then be read by php and placed on an image. I'm too busy to make it though.
     
  3. Offline

    DrAgonmoray

    I think getServer().getVersion() returns the craftbukkit.
     
  4. Offline

    gbear605

    So I guess you could have that write to a sql server, and then a php page read that.
     
  5. Offline

    dark_hunter

    I'm no Dev, think you could code a quick one for me?
     
  6. Offline

    DrAgonmoray

    the whole thing?
     
  7. Offline

    dark_hunter

    Up to you.
     
  8. Offline

    DrAgonmoray

    I'll code the version part for you.

    PHP:
    String version getServer().getVersion()


    Yaaaaaaay
     
    dak393 likes this.
  9. Offline

    dark_hunter

    Kk, thank you will look forward to it.
     
  10. Offline

    KoryuObihiro

    Wrote the following code block for anybody who wants to use it:

    Code:
    int oldestSupportedBuild = 1000;
    //Build check
    		Matcher matcher = Pattern.compile("b([0-9]+)jnks", Pattern.CASE_INSENSITIVE).matcher(getServer().getVersion());
    		if(matcher.group(1) != null && Integer.parseInt(matcher.group(1)) < oldestSupportedBuild)
    			log.warning("[" + getDescription().getName() + "] Detected Bukkit build " + matcher.group(1) + " - builds " + oldestSupportedBuild + " and older are not supported with this version. Please update your current Bukkit installation.");
    		System.console().readLine();
    
    I know that I could also just write my own string manipulation, but meh. Regexes make life lovely. :p
     

Share This Page