highscore
#1
Posted 05 July 2012 - 05:12 PM
#2
Posted 05 July 2012 - 05:16 PM
On an android device you are going to need to make sure the device is connected to the internet. I would suggest not using a devices internet without first allowing the player to confirm it is ok. This is by no means a requirement, just a suggestion.
Edited by ChefDavid22, 05 July 2012 - 05:16 PM.
#3
Posted 05 July 2012 - 06:19 PM
The manifest already does that, when you install an app it shows wich permissions the app requires to run. Some developers clearify WHY is that permission required on the app's description page.I would suggest not using a devices internet without first allowing the player to confirm it is ok. This is by no means a requirement, just a suggestion.
The easiest way to add custom highscores tables in GameMaker is trough PHP; GM makes an http request to the PHP file on your server, wich handles the MySQL database.. This can be done even with basic php knowledge, you just have to know how http reuquests work.
#4
Posted 05 July 2012 - 09:15 PM
#5
Posted 06 July 2012 - 01:39 AM
Create event:
async_get = http_get('http://www.mysite.com/send.php?highscore=score&name=name');HTTP async event:
evid = ds_map_find_value(async_load, "id");
switch (evid) {
case async_get:
result = ds_map_find_value(async_load, "result");
show_message(result);
break;
}
for more info on how theese work, reffer to the manual; It holds everything you need to know and more Ps: Do notice theese functions are not async on windows, they are exclusively made for mobile platofrms.
#6
Posted 06 July 2012 - 01:43 AM
#7
Posted 06 July 2012 - 08:31 AM
This would require the app to include user and password to the mysql db which (I think) is a bad ideThe better answer is that Game Maker itself CAN connect to a mySQL DB. You just need to look into how.
Im not sure if .apk files can be decompiled but since .exe can be, I woulden't be suprised
#8
Posted 06 July 2012 - 01:56 PM
This would require the app to include user and password to the mysql db which (I think) is a bad ide
I'm curious why people say this. I've seen it said before. Isnt the username and password masked within the app or can it be seen by the user?
#9
Posted 06 July 2012 - 03:19 PM
It's not easy to find it but I think it can be done, at least that's the case with exe files.I'm curious why people say this. I've seen it said before. Isnt the username and password masked within the app or can it be seen by the user?
The safest way is to use a IP adress to connect to, that way you never release vital information
#10
Posted 06 July 2012 - 04:07 PM
This would require the app to include user and password to the mysql db which (I think) is a bad ide :tongue:
I'm curious why people say this. I've seen it said before. Isnt the username and password masked within the app or can it be seen by the user?
It depends on the level of effort by the developer. If you're using hard-coded strings in your application, they are most likely visible just by opening the executable in notepad.
For example, I often write tools in C# to make my job easier. Say I make a tool that I can use to connect to a specific database at any customer site. Say the username/password is the same for each instance of the database (don't look at me, it's the software vendor's bright idea). Say I provide myself a textbox to enter the name of the server. I can easily just concatenate hard coded data onto the server name. So maybe my code looks like:
string connString = "Data Source=" + ServerName.Text.Trim() + ";Initial Catalog=DatabaseName;User ID=user;Password=password;";
Now, if I open that exe up in notepad and look around, I could find the following at some point:
U s e r I D = u s e r ; P a s s w o r d = p a s s w o r d ;
Basically, the hardcoded strings are all visible with spaces between the letters. That is not good. A better solution would be to encrypt the sensitive data at design time. Then you'd just see a bunch of gobbledygook if you tried reading the executable. At runtime, you'd decrypt the string so that you could create the proper connection string. I don't do this for my personal tools as I already know the passwords and even if someone did get a hold of it, they aren't going to be able to do anything anyway without my RSA token and a valid state government VPN account.
Even when you do encrypt/decrypt as mentioned above, someone could always try reading the memory being used to find the decrypted value after it is decrypted. .Net actually has a SecureString class that automatically encrypts any data placed in it and wipes it from memory when it is no longer needed.
#11
Posted 06 July 2012 - 05:27 PM
Currently, the only platform where you can actually see the strings with little effort is HTML5, everything is obufscated, but you can still find strin if you know how the js works..
Better to do not take risks for your servers, use PHP, thats the sort of things php was made for.
#12
Posted 06 July 2012 - 05:31 PM
One day I'll have to try a game where I connect using it just so I can say I know how.
#13
Posted 06 July 2012 - 05:54 PM
$username="?";
$password="??";
$database="???";
$mysqli = mysqli_connect("localhost", $username, $password, $database);
$result = mysqli_query($mysqli, "SELECT name,score,id FROM table_scores" ) or die($mysqli->error);
$number = 0;
while ( $row = mysqli_fetch_assoc($result) and $number < 41) {
echo $row['name'] .'/'. $row['score'] .'/';
$number ++;
}
Edited by Manuel777, 06 July 2012 - 05:57 PM.
#14
Posted 06 July 2012 - 08:36 PM
Also, there are (obviously) so much information about PHP on the web which makes it even easier to learn.
#15
Posted 06 July 2012 - 08:45 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











