HighScore Problem

So I am trying to create an Online HighScore system. The problem is that the way I am trying to do it can easily be exploited…

This is the functionality. Where there is "Player"will be an input text field, and the HighScore will be an get from the saved PlayerPrefs HighScore…
How can I make it so you can’t send the same info infnitely?

Well, you can’t.

There are approaches you can use to make it harder to cheat (send a hash along with the data, for instance) but none of it is 100% secure (the key for a hash can be read out of your compiled code by anyone who takes the time to look for it, for instance).

Basic sanity checking can help a lot. For instance, figure out your game’s maximum score-per-minute and discard any submissions that obviously flaunt it. Figure out the minimum time to beat your levels and ignore any submissions made in less than that time. If there are simple heuristics you can apply to identify obvious cheats, just discard all such data. At the end of the day, if cheating would take as long as just playing the game and ends up with indistinguishable results then who’s going to bother and what does it matter if they do?

well what is the most efficient way to implement Online High Scores ?
i want that if the player gets a score better than in the online highscores, to have the choice to send it, but in way i’ve thinked about it now he can just send the same score 100 times…something like you can use the send button every x number of minutes/ 1 time per day etc ?
I’m also thinking of letting the player choose the name just 1 time, but I’m not sure how I could do that. If i can do that, i can check if there’s already in the database an entry with the same name and score…
Any opinions?

?

Don’t let the player have anything to do with the highscore…send it in the background.

well yeah, but on the online leaderboard there must be a name…

It sounds like you aren’t having a problem with players faking a better score than they have, but just sending their legitimate high-score multiple times.

To fix this, you could save two playerpref variables, one for local high-score, and one for a high-score that you will send.

Only overwrite the sendable high-score within the game as you are playing, and once they send it, reset it to zero, so it won’t be over the threshold required to send.

You can still keep the local high-score, because it isn’t connected to the global leader-boards.

Sorry for asking but where exactly is the problem? Several players submitting the score with the same name so that your leaderBoard gets spammed with the same player/score or do the scores sum up for each player? If it’s a matter of spam - try checking the data on the server side to make sure that that you don’t get spammed. Either by replacing the score if it’s higher or asking for a different nickname…