BLOG | GAMES |
Sep 28, 2017Logging To A ServerWith Kradens Crypt to get crash logs from the team we had a janky setup where you have a text file that specifies a file path to drop the crash logs and that folder is a drop box folder. Something about the setup always got messed up and as we are gearing up for a closed beta on Kradens Crypt I want to have access crashes and performance issues of anyone playing the game so I setup a more robust system. First I made a database on my website that stores a version number, name, date, and log. Then a php script on the website allows us to insert into the table from a URL.
<?php
Just from here if you put the URL www.HernBlog.com/log.php?version=0&name=test&log=TESTLOG into your browser it would insert a row into the database. Next we write the code in the game to make and send a URL. Note that it runs in async mode as to not cause lag though we force synch mode if it's logging an exception because otherwise the program exits before the async thread can finish.
// The docs recommended using one HttpClient for the whole app for performance reasons, not sure if it matters.
I haven't bothered to do a security pass on it but if someone messes up the database it's not a big deal as most of the data will be stale and there should be fresh data coming in often. |
|