Online Highscores

DMV Online Highscores
By Dekita


mv_highscores-header.png

​
Introduction:

This system allows unlimited online highscore lists to be within your game. These lists can be ordered a number of ways. There isnt really much to say on what this does, cause I am fairly sure everyone knows what an online highscore list is... If you dont, this tpic really is not for you I'm afraid.

Features:

  • Unlimited Online Highscore Lists
  • Comes With Both The Client && Server Side Code
  • Uses POST Requests To Protect Against Internal System Structure Being Publicly Visible
  • Simple REST-like structure for the system (although its never seen due to using POST)
  • Simple SQL Injection Protection

How To Use:

I wrote a lengthy tutorial that is visible immediately from the download link. I dont intend to reiterate that information here.

Download:

HERE:

Dependencies:


FAQ:

None yet, but if I get any, they will also be added into the tutorial page.

Credits:

Dekita (www.dekyde.com)

Notes:

This system is not really 'newb-friendly'. It requires use of web servers, php, mysql and also, editing of the plugin javascript file. If you are new to these things, I would recommend you either get a friend who knows how to setup the system to help you, or begin reading a lot of the available information online regarding obtaining a server with php and mysql enabled on it.
Thank you. I don't have quite a use for this later but maybe I can do it for different things like how many times someone caught a fish or mined something 🙂
Loads of things could be done... Storing a list of the people who beat each stage in your game for example - to get some in game analytics of how folk play your game. Maybe keep a record of who had the most gold after boss 5, or maybe there is a maze challenge - why not store the results of who was fastest. 🙂
Does this implement SSL? If not, POST isn't really any more secure than a simple GET, and packet sniffing is super easy to perform to read the data structure being sent 🙂
SSL is something that would be implemented by the web server directly. You would just change the host path from http:// to https:// and it would perform a secure connection. 🙂
Are you sure that would work if MV is running locally though? The reason SSL is automatic on a server on hosted sites is because both are on a secure domain; the local environment is not by default secure in MV's node implementation.
I had not considered that to be honest - I dont have https atm, so couldnt even check it properly in that regard. I will take a look into it some more, but from the initial searching, node does support https, and also the creating of https servers from within the client. So I dont think it would be that much of an issue either way 🙂

On a side note: My extensive online research has led me to this statement...

Just to be absolutely unambiguous; XML HTTP requests work over https
exactly as they do over http. If they did not our QA department would
have said something by now as they test over https almost exclusively,
and our web applications use web services (and so XML HTTP requests) so
extensively that they would not do much if they did not work.
Here's a screenshot of the system in action!

Spoiler
8T3V9GP.png
While I had some help (okay, okay, Dekita did it all for me 😛 ), setting up the lists is pretty easy (IF you read the info on the download link) and the commands are super simple to use.

If you're a newb to the server stuff like me, don't let it intimidate you - I'm sure there are plenty of people around here willing to help.
Hi, i'm very excited to use this plugin, but if it's possible, i'll need help to add a little option:

I'll like to multiplicate the high-score by the difficukty set by this plugin : http://forums.rpgmakerweb.com/index.php?/topic/51575-ssg-difficulty-setting/
Is it possible ? Can you help me with that, or can you add it ? 🙂

If you need some info, just tell me.
You just have to multiply your value by the value held within the config manager.. eg: 

ConfigManager.difficultySo in the end, your highscore list customization section would look something like this:

Code:
    "Example": {       head: 'Example List Header',      posi: default_position,      post: {        sname: default_scorename,        score: "$gameVariables.value(1) * (ConfigManager.difficulty+1)",        extra: "''",      },    },
Can I use my own custom online server?
Thank you a lot, I'll test that as soon as possible 🙂
Can I use my own custom online server?
you are required to have your own server to utilize this system anyway. 🙂
I keep getting a "Loading..." window after uploading a deployed version. Then I got it to work, but it just looked like it returned squished text. I assume it's an error of some sort.
If you are seeing 'squished text', then yes, you are receiving incorrect data back from the request you are sending. 🙂


I can assure you though, this system works perfectly fine. I've been using similar server side code for years for vx ace.


Sorry for late reply.
Hello!

I tried to install the plugin. Unfortunately, it failed already at the point:


Adding A New Highscore List - Step 1: Creating The Database Table

Could you again explain in more detail how I have to do this step? Since I did not know myself what else to do, I have to now have step by step 'highlist1' copied to a separate table.

Get now but in the browser always the error message: List Id Given What Invalid !!

Even when calling about the RPG Maker MV is applied on my server an error file. Line 83 of api.php - List Id Given What Invalid !!.

Can you help me?


Sorry for my english is not my native language. ^^


That error message is being received because you are sending an invalid list identifier from rpg maker to your game server.


I can see in your client configuration file, that you are wanting to view a list for hammer_man. But hammer_man is not a valid list identifier. It is however, a valid database table name.


Within your mv configuration file, your highscore list setup should look like this:


//
// List Identifier: HammerManList
//
"HammerManList": {
head: 'My Custom Text',
posi: default_position,
post: {
sname: default_scorename,
score: "$gameVariables.value(10)",
extra: "''",
},
},


Then, within the listKustomization.php file, you setup the $listSettings identifier for HammerManList, like so:


$listSettings["HammerManList"]["name"] = "hammer_man";
$listSettings["HammerManList"]["type"] = "A";
$listSettings["HammerManList"]["show"] = 999;




Basically, everything you done was correct, except you were using the database table name from within the mv plugin file - where you should have been using 'DefaultList4', or set it to be more unique, like i have demonstrated above.


I hope this helps you and you are able to get your games highscore list working now. 😀
Hello and once Thanks for the reply.


I have now set everything as you have given it, but it does not work unfortunately. To control I put again at my settings.


As a side question, my domain would be: https://fenrir-spieleschmiede.de


A subdomain I use: http://hammer-man.fenrir-spieleschmiede.de


The address is thus a subdomain and only this main domain has SSL encryption, here is possibly the problem?


(Edith: I believe it is not. It was tested now under a domain and without SSL, the problem remains, unfortunately, exist.)



Under the link api.php I still get a: "List Id Given Was Invalid!!"


[17-Jun-2016 11:30:04 GMT] PHP Notice:  Undefined variable: dekList in /home/XYZ/ABC/api.php on line 83


In Maker MV does not respond to the plug-in-command: highscore view HammerManList
 


Other lists such as: highscore view highlist1
Can I otherwise do not call.



Did you have any idea what it could be?


Edith:


I'm not sure whether or not reference is helpful, I once commented to the query row 83 and now comes a new problem: "There was an error running the query []


[17-Jun-2016 14:50:15 GMT] PHP Notice:  Undefined index:  in /home/XYZ/ABC/api.php on line 86
[17-Jun-2016 14:50:15 GMT] PHP Notice:  Undefined variable: dekVerb in /home/XYZ/ABC/api.php on line 93
[17-Jun-2016 14:50:15 GMT] PHP Notice:  Undefined variable: dekVerb in /home/XYZ/ABC/api.php on line 94
[17-Jun-2016 14:50:15 GMT] PHP Notice:  Undefined variable: sqlQuery in /home/XYZ/ABC/api.php on line 103
[17-Jun-2016 14:50:15 GMT] PHP Warning:  mysqli::query(): Empty query in /home/XYZ/ABC/api.php on line 103


Problem_Highscore_2.jpg
I assume you have also set the sql database settings in the file for that?


It seems that somehow variables arent being defined that should be.. I have never had anyone complain about this issue before. 🙁


If you can upload a demo project for me, ill happily take a quick look at it and see if i can find any faults in the setup. 🙂
Excuse me the trouble and thanks for the help. I send them the project in a few minutes via PM.

Original thread: https://forums.rpgmakerweb.com/threads/online-highscores.50551/