Creating an in-game bug reporting system to create issues in a github repository

0 favourites
From the Asset Store
Quickly and easily add a Quake-like console to your games
  • Hey guys,

    I've been searching everywhere but I cannot find anything remotely that can help me with how I can do this.

    I want to be able to create an in-game feature where players do not have to sign up to github to post feedback issues like bug reports.

    I'm really struggling to find a start with how to do this.

    Can someone please show me how to do this or at least put me in the right direction?

  • Try looking up the GitHub API.

    You might be able to do something with iframes as well.

  • I have had a look, but it's very foreign to me and I have to learn a lot. I'm just not sure where to start.

  • Haven´t tried any of it but someone posted a nice step by step here: stackoverflow.com/questions/43046097/post-request-to-github-api

    So you would use AJAX to do all the requests.

    I personally would think of an easier way, unless it is mandatory for you that the issues are posted on github. For example, you can set up an email address that you send the bugreports to, or have a simple mysql database setup that adds a row for each new report. The coding needed for that is really basic, especially compared to dealing with a 3rd party API.

    Also I found this: fire.fundersclub.com You could use it with the mentioned send email approach and the issues will be posted on github. Haven´t tested it but it looks super simple.

  • Wow WackyToaster to the rescue! You found something that could very well do it! I completely missed this in my searches. I was constantly trying to check for api integration so I can incorporate ajax (still learning how to use this plugin since I have not used it before) somehow to connect to github to create an issue.

    I just tested fire.fundersclub.com and it works perfectly.

    Now I just have to design an in-game form in Construct which is easy but I am not exactly how to do the events to send an email. Is it possible?

  • I did find this:

    construct.net/en/tutorials/sending-email-construct2-1068

    There's a lot of web hosting and FTP though, but is there an easier way to do it?

  • There's a lot of web hosting and FTP though, but is there an easier way to do it?

    Hmm I don´t think so. The webhosting/FTP part isn´t as scary as it looks.

    Well maybe there is actually.

    Mailto link should do the trick. It is defenitely not as clean as having a form in game but it is the easiest way.

    Just in general, people can spam/troll with this feature if they feel like it. From personal experience, it didn´t happen actually (to my surprise). But there is still a chance you get a bad egg or two and your issue tracker will be filled with all sorts of garbage. ¯\_(ツ)_/¯

  • Thanks WackyToaster for finding an easy. I did try that and I just get a blank white screen whenever selecting chrome to open it.

    I am more inclined to go with the web host idea for ease of access, though, just waiting on some web hosting to be approved.

    In regards to trolling, I'll cross that bridge if I come to it. I can always delete spam issues and improve the contact method, but as I'm in early development with few people involved, I'm not worried and like you said you haven't had it happen, so maybe the human being isn't that bad. :P

    Edit: WackyToaster - The email guide I linked explains to export to html5 project. Is this required? Can't I just export it to nw.js and then request the URL for the c2mail.php file?

  • While Construct is (for the most part) a codeless environment, that doesn't preclude knowing some code. If you're going to want to change the way Construct works and acts, you'll need to know javascript. If you're wanting to interact with a server (like storing and retrieving user names, passwords, emails in a database and such) you'll be using Ajax requests. For that, PHP is probably the easiest language to learn and is reasonably fast. If you're going to need to interact with a server and you want speed, learning a higher level language like C# and playing with websockets is the way to go.

    For what you're wanting to do, PHP is going to be easiest way and here's why.

    When Ajax works with a server, it uses something called CORS - Cross Origin Resource Sharing.

    Basically, this means you can limit where all of the requests are coming from. If the request isn't on a list of allowed servers, an error is shot back. I seriously doubt if Git will allow Ajax requests directly from the C3 client.

    My approach to this would be to have C3 call a PHP script on my server. Then, have the PHP script use the Git API, interact with it to do whatever I needed and then, send a response back to the C3 client.

    Just my 2 cents.

  • Edit: WackyToaster - The email guide I linked explains to export to html5 project. Is this required? Can't I just export it to nw.js and then request the URL for the c2mail.php file?

    I seriously doubt that the email tutorial you posted is going to work. The main reason why is a lack of CORS headers. You have to tell the PHP script who is allowed to make the Ajax requests.

    header('Access-Control-Allow-Methods: "POST"'); $http_origin = $_SERVER['HTTP_ORIGIN']; if ($http_origin == "https://preview.construct.net" || $http_origin == "https://www.myserver.com") { header("Access-Control-Allow-Origin: $http_origin"); }

    In that example, the PHP gets the URL of the server making the requests. It then looks to see if it's one of the two that are allowed. If so, it then sends a header back saying, 'yes, you're allowed to talk to me' and the script runs.

    Without that header you're likely to get an Ajax error and the only way to really know what the error is is to look in the browser's console.

    Now, you can still probably do this with nw.js. But, that php file will have to be on your server and you'll have to replace myserver.com with your server's url.

  • I also looked at your other thread about sending an email. One thing you really need to add in to your events is an Ajax on "tag" error. That event will only tell you if an error occurred but it won't tell you what the error is. There, you need to look in the error list in the browser console.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Fengist Thank you for your input and your assistance, I really appreciate it. I already understand that I am going to have to learn some javascript and php in order to be successful here. I do know some javascript but I am still learning it and I have basically next to no knowledge in php currently.

    Initially speaking, I was already considering the fact that I will need a server with php files to speak with github's API. However, this is really raising the difficulty level for me because I have basically no experience in php, I am willing to learn to overcome this issue, but I wouldn't mind direct help of course.

    The email system that WackyToaster told me about here cuts my efforts in half in terms of working out 'an api to talk to github' since it is already there and setting up a little system to send an email does appear to be the easiest way to achieve this. Of course, there might be a better way, and I am willing to improve this as I gain more experience, but for now this will do.

    Yes, the biggest obstacle I have right now is telling my server to allow AJAX requests so I can use the php file on my server so the game can talk to the fire bot. At the moment, I am not comfortable putting my entire game on my server for it to simply make the AJAX requests, which will work, but that means my game is on the internet and I do not want to put it on the internet like that, and not yet, but yes I am stuck with how to make that possible without getting my server to allow AJAX requests from everywhere. Your suggestion seems to indicate that I do not have to do that, and I can just allow it from the game only perhaps?

    As this is very complicated for me, I am willing to speak on a different platform like Discord to make it easier if you have the time?

  • As this is very complicated for me, I am willing to speak on a different platform like Discord to make it easier if you have the time?

    That chunk of code that I posted is set up to recognize 2 servers. Either your website or the the C3 app/web editor. Put that code in front of any php file you plan to use.

    While I do upload my game periodically to test it, mostly I'm running from the C3 editor. That allows the ajax to access the php files on my web server.

    You'll note that it's only set up to accept Ajax posts:

    header('Access-Control-Allow-Methods: "POST"');

    If you want to use the Ajax get, you'll need to add it: , GET

    There are other things the Ajax plugin can do but I don't use them. They may use other methods. You can find a list here: developer.mozilla.org/en-US/docs/Web/HTTP/Methods

    As for discord, I do have it but I rarely get on. Sorry, but annoys the utter crap out of me with all the bloops, dings and other pointless noises.

    If you already know a bit about JS then PHP will come pretty easy. Just get netbeans ide which has great code completion and google anything you don't understand. There's gobs of references, examples and resources for php.

  • Thanks again Fengist for the extra information.

    I will try out what you said and see how I go.

    One other question: Does the CORS exception work the same from a desktop version (nw.js) of a construct project? I know you mentioned that it was probably possible. I'm just asking for better clarification because my game will be a desktop game.

    With Discord if you put yourself on "Do Not Disturb" status, you won't get any alerts or noises at all. It is indeed very distracting to be set on "Online" status while you are working on your projects. Most people I know that are busy or like to not be disturbed with all the alerts tend to permanently put themselves on this status. You can always check any unread messages whenever you have time. If you can add me on there - The Dark Lord#2044 is my tag, it would be great.

  • Thanks again Fengist for the extra information.

    I will try out what you said and see how I go.

    One other question: Does the CORS exception work the same from a desktop version (nw.js) of a construct project? I know you mentioned that it was probably possible. I'm just asking for better clarification because my game will be a desktop game.

    Well, I can't say for certain but I can tell you this:

    When I run the editor as an app it uses the construct.net as it's website. Since I work mostly on HTML5 exports, I can't really answer that. Once thing you can do to experiment is to take the $http_origin = $_SERVER['HTTP_ORIGIN'] and save that to a file on the server every time the php script is run. That should tell you what the scripts see as the origin.

    If this doesn't work then you're options are going to be a good bit more limited. You're going to have to work with websockets to exchange data. I've played around with one called Fleck which is written in C# and I have gotten C3 to exchange data with a Fleck server. There are a number of other websocket frameworks out there to play with. I've briefly looked into using the C3 multiplayer plugin to exchange data but it has one huge drawback, the server is just another client, and it has to be the first client in a 'room' for every other client to log into it.

    But, websockets come with a whole new level of programming and security.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)