Development Blog v0.20.12
Just thought I would say Merry Christmas to everyone.
Ok, I have been doing some huge thinking on ways to do this game and have come up with this.
And if we are support loads of players we are going to have to reduce the amount of MySQL Queries, so we will need to do some caching of some sort of our database records.
I looked into Memcache, Memcahed, MySQL Caching and so on, all having limitations with either the amount of data as well as the size of each data, so it seems that caching is out of the question here.
I also looked at MySQL's Memory Engine which by reading it sounded exactly what I wanted, sadly the performance was either the same as the InnoDB Engine or it was slightly slower which I thought was strange, however I may come back to try this again later on.
Now knowing the above I started looking into tmpfs and ramfs for a type of caching and for simplicity I chose tmpfs.
Using tmpfs will allow me to create a filesystem in a chunk of allocated ram, so it will be fast at reading and writing, which is exactly what I wanted.
So basically, every record in the database will be stored as a file in file folder fashion for simplicity,
So, when the server is started it loads all the required records from various tables and stores them individually in the required folders on the tmpfs partition and the game server will use that copy of the data.
There will be a scheduled background task that runs a Script that locks a record (i.e. tmpfs file), reads its content and if it's time to update then [update the database with its content], unlocks record (i.e. tmpfs file) move to next record and so on, this is done every 10 or so mins, so if the server crashes and needs rebooting all that will be lost is 10 or so mins of play.
I tried it last night loading up all 161 ship accounts that I had in the previous game that was run and it was fast, so this might be the right direction.
I was having some thoughts about lookups that return multiple records, like returning all the planet records that are located in sectors 35 to 97, in a SQL Query that would be simple, whereas my way I would have to for loop through folders to get the same result, it is doable, but I just wasn't expecting it that's all.
Well that's it for now, I hope you all have a nice new year.
Well I had a play with the 2 Pass Verification and it didn't go as planned.
It seems that the code that I got from GitHub is using Google's charts API for the QR Code generation which seems to be deprecated and on top of that the code was spread over loads of files, where as the new code I have found is all stored in a single file and is also easy to follow in the code.
So I looked else where and found some code that can create a QR Code either using a table (YUCK) and each cell is a pixel, or it uses the GD library to generate an image.
I have tried two Authenticators (The Google Authenticator and the Microsoft Authenticator) and both tests are the same; they both display a 6 digit code that changes every 30 seconds.
So I might use that code for the QR Code Generation along with my own TOTP (Time-based One-time Password Algorithm) code.
Well I have been thinking about this for a while now, but due to the current security issues I have seen on Sony's PSN where users have had their accounts hacked and Sony refusing to resolve the issue, I have therefore looked into a 2 Pass Verification.
I will be using Google's Authenticator for this feature.
At this point I haven't tested it yet, but I am sure it will be fine and work :P
Well I finally got around to added database support for the blogs, so now they are stored in the database.
So this will help edit blogs and support tags etc.
Well I thought it was time to setup a development blog, so that I can show how the progress is getting on. There may be some images, YouTube Videos and so on, but at this current time I am just in the planning stage, basically seeing what works and what doesn't.
At this current stage I am playing about with Smarty Template, Bootstrap 3, JQuery just to see how they work together. They seem to work ok, sadly there is an issue, Smarty Template can only load the page once, basically it loads it the once and if you want to change a huge chunk of its content the page needs to be reloaded.
Now by using Smarty Template we are able to parse information to the template file to only display certain information, like only display the admin section when an admin logs in and so on.