sniko Posted January 5, 2014 Share Posted January 5, 2014 I came across GoInstant via Twitter, and I really wanted to have a play with their API - especially their live chat system, as it looked awesome! After tweeting about my excitement, they were quick to reply about how excited they were with what I could come up with. Although it's not as huge as I'd like it to be on this release, I wanted to get other developers to start playing around with their API in the MWG community. I also hope to extend this release much further, after I've released a project of mine soon this year. Below are a few screenshots of what I've accomplished in the short amount of time I set myself, which; Supports in-game usernames Supports in-game avatars I really hope to integrate GoInstant into McCodes a lot further, by; Offering a staff panel to open channels Banning people from the chat As in the chat won't render if they're banned [*] Allowing </commands> to be entered in the chat, such as; /join <channel> /leave <channel> /kick <user> /broadcast <message> This will include manipulation on both GoInstant and McCodes, which I feel is very achievable, having worked with the engine for roughly three years. If you've not looked at GoInstant before, this chat is real-time, and awesome! How to integrate it It's very simple to integrate, and I'll dump the code I use, so you can just "plugin-and-chat". Head over to GoInstant and register an account Create an application via the Dashboard Paste the following code into header.php in your McCodes files You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Make sure you change the following to your values; You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. And it's as easy as that! Quote Link to comment Share on other sites More sharing options...
Guest Posted January 5, 2014 Share Posted January 5, 2014 Just read your blog on the bus, very interesting. What made you go with it instead of Meteor or Node? Quote Link to comment Share on other sites More sharing options...
Dave Posted January 5, 2014 Share Posted January 5, 2014 Looks really interesting! Looks like they've done the majority of the hard work already so it's really just plugging it in. Just read your blog on the bus, very interesting. What made you go with it instead of Meteor or Node? I'm going to guess as this already includes a chat widget really cutting down on development time. Quote Link to comment Share on other sites More sharing options...
Revolution-NOTL Posted January 25, 2014 Share Posted January 25, 2014 (edited) Hey Sniko! I just tried this out on my game, the minute I added it. I got 4 users already talking! Thats actually better then my old chats I added. But I have few problems. For example, I don't know how to delete messages? Also if you can teach me to add staff colours (only the names), that would be great! [ATTACH=CONFIG]1293[/ATTACH] [ATTACH=CONFIG]1294[/ATTACH] Problem also, sometimes when people send messages, there messages are spaced out? [ATTACH=CONFIG]1295[/ATTACH] Edited January 25, 2014 by Revolution-NOTL Quote Link to comment Share on other sites More sharing options...
Guest Posted January 25, 2014 Share Posted January 25, 2014 (edited) Hey Sniko! I just tried this out on my game, the minute I added it. I got 4 users already talking! Thats actually better then my old chats I added. But I have few problems. For example, I don't know how to delete messages? Also if you can teach me to add staff colours, that would be great! [ATTACH=CONFIG]1293[/ATTACH] [ATTACH=CONFIG]1294[/ATTACH] Problem also, sometimes when people send messages, there messages are spaced out? [ATTACH=CONFIG]1295[/ATTACH] The spacing itself looks like a tab, maybe copy and pasted from notepad and regarding staff colors, try wrapping some color around the displayname on .join Edited January 25, 2014 by Guest Quote Link to comment Share on other sites More sharing options...
Dave Posted January 26, 2014 Share Posted January 26, 2014 The spacing itself looks like a tab, maybe copy and pasted from notepad and regarding staff colors, try wrapping some color around the displayname on .join More looks like the chat message element has a text-align: justify; on it. Try overriding the styles and see if you can stop that. Quote Link to comment Share on other sites More sharing options...
spikereloaded Posted January 26, 2014 Share Posted January 26, 2014 ive had a go at intergrating this, seems to be a little harder than i first thought. I can add in the <a href> links on the usernames, however they don't print as links, they print literally eg. desired outcome : Spikereloaded Actual outcome : <a href="viewuser.php?u=2">Spikereloaded</a> same will go for changing username colour. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. anyone see what i'm doing wrong? or is it more complex than just wrapping it in a tag? Quote Link to comment Share on other sites More sharing options...
Guest Posted January 26, 2014 Share Posted January 26, 2014 ive had a go at intergrating this, seems to be a little harder than i first thought. I can add in the <a href> links on the usernames, however they don't print as links, they print literally eg. desired outcome : Spikereloaded Actual outcome : <a href="viewuser.php?u=2">Spikereloaded</a> same will go for changing username colour. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. anyone see what i'm doing wrong? or is it more complex than just wrapping it in a tag? Looks like GoInstant escapes HTML then, makes sense for security purposes, not had a real look but there should be some way to bypass it. Quote Link to comment Share on other sites More sharing options...
Dayo Posted January 27, 2014 Share Posted January 27, 2014 are the usernames/user levels always passed via JavaScript, if so this could be a bad idea, people could impersonate yourself with little effort. as for colors https://developers.goinstant.com/v1/widgets/guides/colors.html, cant find any documentation on links Quote Link to comment Share on other sites More sharing options...
petercyr-goinstant Posted February 13, 2014 Share Posted February 13, 2014 Hey guys, This is good stuff! I'll try and answer as many of the questions right now but if you have any more, feel free to keep on posting here, tweet @goinstant, reach us directly or even through our docs. @Revolution-NOTL & @Dayo, as you linked above, you can set custom colors https://developers.goinstant.com/v1/widgets/guides/colors.html With regards to security and impersonation you can use JWTs to secure and enforce these things. Check out the JWT section on the colors page, https://developers.goinstant.com/v1/widgets/guides/colors.html#making-a-claim-in-the-jwt and I'd encourage you to checkout the section on Users and Authentication. https://developers.goinstant.com/v1/security_and_auth/guides/users_and_authentication.html#what-is-a-jwt? With user authentication and JWTs you could easily enforce usernames, avatars, colors, and more. We have a PHP Library to help you build your JWTs and authenticate your users which you can find here: https://developers.goinstant.com/v1/security_and_auth/libraries/php.html In PHP when you create the JWTs, you could set the color of admins to what ever you choose and prepend the display name with something to identify admins. This would now be part of the user and when the chat widget gets rendered, this information will automatically be in it without requiring more client side overrides. Quote Link to comment Share on other sites More sharing options...
sniko Posted February 13, 2014 Author Share Posted February 13, 2014 Hey guys, This is good stuff! I'll try and answer as many of the questions right now but if you have any more, feel free to keep on posting here, tweet @goinstant, reach us directly or even through our docs. @Revolution-NOTL & @Dayo, as you linked above, you can set custom colors https://developers.goinstant.com/v1/widgets/guides/colors.html With regards to security and impersonation you can use JWTs to secure and enforce these things. Check out the JWT section on the colors page, https://developers.goinstant.com/v1/widgets/guides/colors.html#making-a-claim-in-the-jwt and I'd encourage you to checkout the section on Users and Authentication. https://developers.goinstant.com/v1/security_and_auth/guides/users_and_authentication.html#what-is-a-jwt? With user authentication and JWTs you could easily enforce usernames, avatars, colors, and more. We have a PHP Library to help you build your JWTs and authenticate your users which you can find here: https://developers.goinstant.com/v1/security_and_auth/libraries/php.html In PHP when you create the JWTs, you could set the color of admins to what ever you choose and prepend the display name with something to identify admins. This would now be part of the user and when the chat widget gets rendered, this information will automatically be in it without requiring more client side overrides. This is true support! Great stuff @GoInstant. I do plan to make the improvements sometime soon - life is a little busy at the moment, but it'll tweet you once it's released! Quote Link to comment Share on other sites More sharing options...
DeathXXX Posted February 13, 2014 Share Posted February 13, 2014 can some one help me install this please Quote Link to comment Share on other sites More sharing options...
Raven1992 Posted February 13, 2014 Share Posted February 13, 2014 can some one help me install this please do it yerself Quote Link to comment Share on other sites More sharing options...
sniko Posted February 14, 2014 Author Share Posted February 14, 2014 can some one help me install this please What part do you need help with? do it yerself If you're going to offer (useless) "advice", at least spell correctly. 1 Quote Link to comment Share on other sites More sharing options...
Reecey12345 Posted February 26, 2014 Share Posted February 26, 2014 Hey Sniko, im glad you shared this with us! Im just in need of a set of commands now to Delete chat history and to ban users and whatever else works:) Quote Link to comment Share on other sites More sharing options...
Florian_ Posted April 30, 2014 Share Posted April 30, 2014 Great chat widget, I'm amazed at how good it actually is. Thanks for sharing this sniko, I'll be using this for sure! Quote Link to comment Share on other sites More sharing options...
peterisgb Posted May 1, 2014 Share Posted May 1, 2014 I like this, would a CSS code added in overide the default chatbox style. Quote Link to comment Share on other sites More sharing options...
ColdBlooded Posted May 1, 2014 Share Posted May 1, 2014 Great chat widget, I'm amazed at how good it actually is. Thanks for sharing this sniko, I'll be using this for sure! I'd be looking forward to see this functionality in your game during testing! Quote Link to comment Share on other sites More sharing options...
dnenb Posted May 1, 2014 Share Posted May 1, 2014 Nice work! Looking forward to seeing how it turns out :) Quote Link to comment Share on other sites More sharing options...
peterisgb Posted August 1, 2014 Share Posted August 1, 2014 This was good however i have some bad news. goinstant.com is closing. Read more here https://goinstant.com/blog/time-to-say-farewell Quote Link to comment Share on other sites More sharing options...
Oracle Posted August 8, 2014 Share Posted August 8, 2014 This is awesome Sniko Two thumbs up ~ ! Quote Link to comment Share on other sites More sharing options...
MyGunWars Posted August 8, 2014 Share Posted August 8, 2014 Now that they are closing down now what? Quote Link to comment Share on other sites More sharing options...
sniko Posted August 8, 2014 Author Share Posted August 8, 2014 This is awesome Sniko Two thumbs up ~ ! Thanks [MENTION=68479]Oracle[/MENTION]! Now that they are closing down now what? I'm planning of creating a guide to integrate pusher, and perhaps a tiny admin panel to accompany it, but nothing is set in stone, yet. Quote Link to comment Share on other sites More sharing options...
AnonymousUser Posted August 16, 2014 Share Posted August 16, 2014 Thanks [MENTION=68479]Oracle[/MENTION]! I'm planning of creating a guide to integrate pusher, and perhaps a tiny admin panel to accompany it, but nothing is set in stone, yet. Cant wait to see how it goes :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.