[INACTIVE][CHAT/INFO/WEB] ChatterCraft v0.9.3 [953]

Discussion in 'Inactive/Unsupported Plugins' started by helluvamatt, May 7, 2011.

  1. Offline

    helluvamatt

    Notice: I have ceased development on my plugins. If you wish to continue developing anything, feel free to fork the repository on GitHub!

    ChatterCraft
    Version: 0.9.3

    The ChatterCraft Web Addon is now included with FabianN's repack of Minecraft Overviewer. Get the latest Minecraft Overviewer at http://github.com/FabianN/Minecraft-Overviewer then grab the plugin JAR below.

    The ChatterCraft Web Addon included with FabianN's repack is OUT OF DATE. Feel free to download FabianN's Overviewer, but if you want to use ChatterCraft, you'll need to follow steps 1 and 2 of "To add ChatterCraft to Andrew Brown's ORIGINAL Minecraft Overviewer" below. Steps 3 - 6 are already done, all you need to do is replace the files in 'web_assets/chattercraft/' with the new ones in 'web/chattercraft/' of the ZIP file.

    Download ZIP (contains Latest JAR, example configuration, and Minecraft Overviewer add on)
    Download Stable JAR

    Testing Version: Download Testing JAR

    Source | Issues/TODO | Changelog (GitHub)

    To add ChatterCraft to Andrew Brown's ORIGINAL Minecraft Overviewer do the following:
    Show Spoiler

    1. Download the ZIP above
    2. Extract the contents of the 'web' folder to the 'web_assets' folder of your Minecraft Overviewer installation.
    3. Add a <link> tag for ChatterCraft's style sheet after the other style sheets <link> tags, but BEFORE the <script> tags in 'index.html':
      HTML:
      <link rel="stylesheet" type="text/css" href="chattercraft/chattercraft.css" />
    4. Add a <script> tag for ChatterCraft's script after the other <script> tags but BEFORE the </head> tag.
      HTML:
      <script type="text/javascript" src="chattercraft/chattercraft.js"></script>
    5. Locate the <body> tag, it may look like this:
      HTML:
      <body onload="overviewer.util.initialize()">
      Add a semicolon (;)after the '()' and then add 'chattercraft.init()'. It should look like this:
      HTML:
      <body onload="overviewer.util.initialize(); chattercraft.init()">
    6. One more thing to add, after the <div> tag for the map:
      HTML:
                           <div id="mcmap"></div>
                           <!-- ChatterCraft start -->
                           <div id="chattercraft">
                           <div id="chattercraft_loginwin"> 
                             			<label for="chattercraft_username_field">Username:</label> 
                             			<input type="text" id="chattercraft_username_field" /> 
                             			<a href="Javascript:;" onclick="chattercraft.set_username();" class="image-button">Login</a> 
                             		</div> 
                             		<div id="chattercraft_chatwin"> 
                             			<div id="chattercraft_status_message"></div> 
                             			<div id="chattercraft_messages"></div> 
                             			<div id="chattercraft_userlist"></div> 
                             		</div> 
                             		<div id="chattercraft_sendform"> 
                             			<input type="text" id="chattercraft_sendform-msg" name="msg" /> 
                             			<a href="Javascript:;" onclick="chattercraft.send_message();" class="image-button" id="chattercraft_send_button" >Send</a> 
                             		</div> 
                             	</div> 
                             	<!-- ChatterCraft end -->
      Please make sure the <div id="mcmap"></div> appears only once! I included it for clarity!
    The above instructions are for the original Minecraft Overviewer available here. If you get FabianN's version (here) ChatterCraft is already included! You will just need the JAR download below!

    Setting up the Bukkit Plugin
    Show Spoiler

    1. Download either the JAR only or the ZIP. The ZIP also contains the example configuration file below. You do not need the web stuff if you are using FabianN's version of Minecraft Overviewer.
    2. Move 'ChatterCraftPlugin.jar' into your plugins directory.
    3. Optionally, create a directory in your plugins directory called 'ChatterCraft' and put your config.yml inside it. See the configuration example and explanations below.
    4. Start CraftBukkit.
    5. Report problems with installation here. Please include the 'gibberish' from the log if the plugin throws errors. Pastebin links only, please!

    Features
    Show Spoiler

    • Chat with players on the server
    • Track locations of players on a Minecraft Overviewer map (requires you to set up and render a Minecraft Overview map)
    • Minequery replacement - compatible with Minestatus, etc.
    [​IMG]

    Configuration Example: ('%BUKKIT_HOME%/plugins/ChatterCraft/config.yml')
    Show Spoiler
    Code:
    port: 25566
    chat_enabled: true
    chat_tag: "&f<&b[WWW Portal] &c%u&f> "
    send_all_chats: true
    notify:
        signon: true
        signoff: true
    
    The above configuration is the default. If you do not provide a config.yml, these defaults will be used. Feel free to omit any options that you do not need.
    • port: Port number for the query server
    • chat_enabled: Enable or disable all WWW chat. Does not affect chat between in-game players.
    • chat_tag: The ENTIRE prefix to messages sent from the Web to users in-game. It is recommended that you include the username and something indicating that it was sent from the web. You can use the place holder '%u' for the username. Use '&' followed by a color code (0-9,a-f) to change the color of the text after that point. The default is the same as it has always been. Experiment to see what you like best. Make sure this is in quotes so the white space is handled properly.
    • send_all_chats: Whether or not to allow WWW users to see in-game chats.
    • notify.signon: Notify in-game users of a WWW user logging in.
    • notify.signoff: Notify in-game users of a WWW user disconnecting.

    Changelog (Minecraft Overviewer Addon)
    Version 1.5
    • ChatterCraft uses GET requests now instead of POST requests.
    Version 1.4
    • Updated buttons
    Version 1.3
    • Added player Info Windows
    • Changed player markers icon to be generated using the player's skin.
    Version 1.2
    • Added option to disable player location markers.
    Version 1.1
    • Added Press Enter to Send Message
    • Added Press Enter to Login
    Version 1.0
    • Fixed CSS glitches (scrollbar in wrong place, 1 pixel glitches).
    • Shrunk text size in chat.
    Version 0.9
    • Initial version.
    Changelog (Plugin)
    Version TESTING:
    • Create default plugin configuration file when a configuration file is not present.
    • Optionally log all chats (enabled by default, disable by adding 'log_all_chats: false' to your config file.
    Version 0.9.3
    • Fixed bug where ChatterCraft server was started before the config was loaded, causing it to ignore the settings in 'config.yml'.
    Version 0.9.2
    • Added option to change the chat prefix for chats being sent from the Web.
    Version 0.9.1
    • Added configuration
    Version 0.9
    • Initial release
     
  2. Offline

    neko259

    Thanks! I'll try to install it now.

    I can't insert the 'chat' button in my html file. Could you put this button and all related to it in one javascript and post it?

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

    SondreHG

    How do you get that pesky Minecraft Overviewer map :O? I really want one!
     
  4. Offline

    Zalastri

    Yeah, I'm fairly decent with the simpler linux stuff, and I can't really figure out how to install overviewer either. Is there an in depth tutorial for it?
     
  5. Offline

    SondreHG

    Quite annoying! Everyone have that type of map, but I dont :(! I want itt!!! NOW!
     
  6. Offline

    qwckstr12206

    i do not understand this plugin at all, doesnt come with instructions or anything
     
  7. Offline

    fugue2005

    overviewer map? what's that?
     
  8. Offline

    neko259

    That's a type of minecraft web map. It has some addons like online players list and positions, weather forecast, in-game time etc.
    And yes, I can't make this chat work without a javascript file. I'm not good in JS, so I ask your help, developer!
     
  9. Offline

    helluvamatt

    I just typed out a long response and Google Chrome lost it all. Never seen that before. Quite pissed off, if I'm honest.

    Here's the abbreviated version since I'm about to punch a hole through my very expensive monitor:

    To get your very own Minecraft Overviewer map, read this. You'll get the basic Google Maps interface. No extra stuff like chat or server status, etc.

    For that you'll need to be VERY familiar with web design, CSS, JavaScript and knowing jQuery helps. (You should learn it for kicks since it is amazing anyway.)

    Start by looking at the scripts from my site:
    jQuery (get the latest version, parses XML, manipulates the DOM, cures cancer, etc.)
    query.js (handles communication with the server)
    status.js (updates the status independently of the other functions)
    functions.js (Minecraft Overview utility functions)
    config.js (configuration, yours may differ, this stuff can be obtained from the Minecraft Overview output, it may be part of functions.js, I'm not sure, run-on sentence?)

    Here is the JavaScript that renders the Chat button on the map (note that CSS is used to make the button look good and comments have been added for clarity) This is found in functions.js
    Code:
    // Make a jQuery object representing the button container
    var chatControlContainer = $('<div id="chatControlContainer" class="control-container" title=\"Chat with players!\"></div>');
    // Make a jQuery object representing the button control (the actual button)
    var chatControl = $('<div id="chatControl" class="control"></div>');
    // Make a jQuery object representing the button label (the text on the button)
    var chatControlButton    = $('<div id="chatControlButton" class="control-button">Chat</div>');
    // Add the button to the container
    chatControl.append(chatControlButton);
    // Add the label to the button
    chatControlContainer.append(chatControl);
    // Give the button something to do when it is clicked (this is jQuery magic)
    chatControlButton.click(function() {
        // When chat is open, the button looks pressed down
        $(this).toggleClass('control-button-selected');
    
    Quick note about jQuery: jQuery identifies elements on a page similar to the way CSS does, a hash (#) in front of the word 'chattercraft' indicates that this jQuery object should represent ALL elements with the id of 'chattercraft'. Which hopefully is only one element.

    Code:
        // Show the chat window
        $('#chattercraft').slideToggle(400, function() {
            // When the animation is complete (400 ms later) make sure the chat window is the proper height to fit on the map
            // This function is somewhere else
            update_heights();
        });
    });
    // Add the DOM element to the map's control stack (Google Maps API)
    map.controls[google.maps.ControlPosition.TOP_RIGHT].push(chatControlContainer[0]);
    
    I suggest looking at my website and the HTML, JavaScript and CSS that runs it. You can copy it if you want. If any specific code does not make sense, just ask.
     
  10. Offline

    neko259

    Where do I add this "show the chat window" stuff?

    I have Fabian Overviewer and it doesn't have functions.js or others. I don't understand where to add this code. It would be nice if you added all of the chat related tools to one single file that can be easily integrated to html without modifying existing files.

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

    Seraph

    Why bother putting this up in Bukkit if you can't take the time to properly explain how to use it? I'm no troll, but seriously....
     
  12. Offline

    FabianN

    The big problem is that this is designed around an old version of overviewer. I'm not sure if the code is compatible with the current version and you just need to use the files which replaced functions.js and config.js instead, or if it would need a re-write. I will try to test this later, but no promises on when.

    Another thing I'm concerned about is how it is compatible and/or compares to the mapmarkers addon, since it does say that it puts player locations on the map.
    Any chance of a screen-shot of this add-on in action? I'd like to see how the players are rendered on the map.
     
  13. Offline

    helluvamatt

    You are all correct. This plugin was originally written in the hMod days with the "old" version of Minecraft Overviewer. I simply ported it to Bukkit, because I received at least 4 e-mails to do so. Honestly, I like FabianN's fork of Overviewer much better. My plugin has suffered from a bit of feature creep. So for the 1.0 release, I will remove everything EXCEPT for chat and create a single unified JavaScript that handles chatting, rendering the chat window, everything. You will be able to include the JavaScript with standard <script> tags and as long as you have a <div> element where you want the button and another <div> element where you want the chat window, the chat SHOULD work out of the box.
     
  14. Offline

    neko259

    The screenshot is at his site, http://minecraft.schneenet.com/
     
  15. Offline

    helluvamatt

    Progress made: http://minecraft.schneenet.com/new/map/

    Still need to add player locations in the JavaScript. I thought this was handled by MapMarkers, but it's easy enough to implement.
    EDIT: Player locations work properly. They use a generic hiking icon:[​IMG]If there is a way to make a marker icon out of the player avatar, that would be ideal.

    Here's how to add this to Minecraft Overview (FabianN's fork was used to develop this):

    1. Unzip this to an empty working directory. (Always get a new copy so you get the latest changes. Also, it contains all the JavaScripts, PHP server-side code, and CSS you need.)
    2. Add the 'chattercraft' directory to your 'web_assets' folder in the Minecraft Overviewer install or add it to the output folder after the rendering is finished.
    3. Add the following code to the <head> of the 'index.html' file in the output folder or 'web_assets' folder:
    Code:
    <!-- ChatterCraft --><link rel="stylesheet" href="chattercraft/chattercraft.css" type="text/css" />
    <!-- ChatterCraft --><script type="text/javascript" src="chattercraft/chattercraft.js"></script>
    
    4. Add the following code to the <body> of the 'index.html' file in the output folder or 'web_assets' folder:
    Code:
    <!-- ChatterCraft start -->
    <div id="chattercraft">
    	<div id="chattercraft_loginwin">
    		<label for="chattercraft_username_field">Username:</label>
    		<input type="text" id="chattercraft_username_field" />
    		<a href="Javascript:;" onclick="chattercraft.set_username();" class="image-button">Login</a>
    	</div>
    	<div id="chattercraft_chatwin">
    		<div id="chattercraft_status_message"></div>
    		<div id="chattercraft_messages"></div>
    		<div id="chattercraft_userlist"></div>
    	</div>
    	<div id="chattercraft_sendform">
    		<input type="text" id="chattercraft_sendform-msg" name="msg" />
    		<a href="Javascript:;" onclick="chattercraft.send_message();" class="image-button" id="chattercraft_send_button" >Send</a>
    	</div>
    </div>
    <script type="text/javascript">
    // Initialize ChatterCraft
    chattercraft.init();
    </script>
    <!-- ChatterCraft end -->
    
    Once all this is added, you should see a Chat button with all the other buttons at the top.
    Click it and the Chat Window will slide down. Type some relevant username, (like IRC this is not checked) and click Login. Assuming you have the plugin, it should say "Logged in successfully" in green. Then you can see another list of who is logged in. Type a message in the box at the bottom of the chat window and click Send. Only chat messages between the server players and WWW users sent since the page was loaded will be seen.
     
  16. Offline

    neko259

    How do you make that person on the green background marker?
     
  17. Offline

    helluvamatt

    Whoops, I forgot those images are stored locally.

    Download these images and put them in the output directory (and web_assets, where index.html is located, put them in both for good measure):
    hiking-tourism.png
    shadow-hiking-tourism.png

    If that doesn't work, PM me your public URL and I will personally take a look.

    I'm going to work on a way to generate the markers from the player avatar. I think that would be really cool.

    EDIT: It seems chat may be broken. I'm working on a fix that doesn't require hacking Overviewer code. You'll need to hack Overviewer, it's properly complicated, bear with me:

    1. Open up 'overviewer.js' (it's in the same directory as 'index.html') in Notepad++ or similar.
    2. OPTIONAL: Go to line 50. Read the comment. Notice we are adding a new feature.
    3. Go to line 60. Add a new line after
    Code:
    overviewer.util.createMapControls();
    
    with these contents:
    Code:
    chattercraft.init();
    
    4. Remove the entire <script> tag and contents all the way to </script> from 'index.html' after the ChatterCraft <div> elements:
    Code:
    <!-- ChatterCraft start -->
    <div id="chattercraft">
    	<div id="chattercraft_loginwin">
    		<label for="chattercraft_username_field">Username:</label>
    		<input type="text" id="chattercraft_username_field" />
    		<a href="Javascript:;" onclick="chattercraft.set_username();" class="image-button">Login</a>
    	</div>
    	<div id="chattercraft_chatwin">
    		<div id="chattercraft_status_message"></div>
    		<div id="chattercraft_messages"></div>
    		<div id="chattercraft_userlist"></div>
    	</div>
    	<div id="chattercraft_sendform">
    		<input type="text" id="chattercraft_sendform-msg" name="msg" />
    		<a href="Javascript:;" onclick="chattercraft.send_message();" class="image-button" id="chattercraft_send_button" >Send</a>
    	</div>
    </div>
    <!-- Script Tag Was Here, Remove it! -->
    <!-- ChatterCraft end -->
    
     
  18. Offline

    jaes84

    Im sorry, but i don't get this at all. I have added this to my index.html file, installed the plugin, the directory/config.yml doesn't exist, what am i doing wrong? Would you mind posting either your setup, or a better guide on how to do this
     
  19. Offline

    helluvamatt

    If ChatterCraft/config.yml does not exist, it will use the defaults. The example configuration in the OP shows what the defaults are. You will need PHP for the Minecraft Overviewer add on to work properly. If you PM me the public URL I will look at it and tell you what's going on.
     
  20. Offline

    neko259

    Do I need to disable minequery to use this plugin?

    Thanks, it works now. If it would be merged with overviewer, I would be very glad.
    I don't know why, but I receive duplicate messages from in-game players in web chat. Already fixed.
    And, two notifications:
    1. Chat symbols are too big for such a small chat window.
    2. Hitting 'enter' when sending message doesn't work. I have to hit 'send' button and it is not too comfortable.

    And, 3. Scrollbar in the chat is located just over the line between player list and chat. It's now quite pretty.

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

    helluvamatt

    Yes, you need to disable Minequery. Don't worry, since ChatterCraft is based on Minequery, you can still use Minestatus with ChatterCraft. Believe it or not, it IS compatible. If you use a config file for ChatterCraft, you can change the port that ChatterCraft uses and then they can be used together. You'll need to change the port in 'chatter.php' as well.

    What chat symbols are you speaking of?

    I will edit this post this evening when I get a fix out for the Press Enter to Send. I already know how to fix this, I'm just at work right now and this silly computer doesn't have a Remote Desktop Client. How screwed up is that?
     
  22. Offline

    neko259

    I mean the font in chat is too big. I don't think chat must be bigger than 10-12.
     
  23. Offline

    helluvamatt

    I fixed that now. And added press enter to send or login.
     
  24. Offline

    neko259

    Thanks very much! It works nice now.

    Oh, I would like to request a 'logout' button so that I could log out of the chat without closing the page.

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

    ctek

    Hi, really looking forward to trying this out but the download link for the .jar is broken, and I couldn't find the file on your github page.
    Thanks
     
  26. Offline

    neko259

    Confirm. It's 404 in the zip download.
     
  27. Offline

    helluvamatt

  28. Offline

    David T.

    Too bad I don't host my own server, it's hosted on servercraft.... they host it for me, so I don't think I can get this.
     
  29. Offline

    Treboran

    I'm having a bear of a time getting this to work on my server. I've made what appear to be the proper edits.

    URL for map is http://mc.galdor.net

    Would you mind taking a look at the source and see if I missed anything?

    netstat -al shows something listening on port 25566, so I'm thinking the plugin is working.

    Server is running on Craftbukkit 818

    Thanks!

    Marc
     
  30. Offline

    helluvamatt

    It seems your web server does not have PHP installed or configured properly. ChatterCraft uses a special PHP script (which you have in the right place -- "chattercraft/chatter.php") that acts as an intermediary between the ChatterCraft plugin on port 25566 and the Internet. This way you DON'T have to forward port 25566. Everything else looks good.
     

Share This Page