Hello,
I have a client who I’m about to start a new, simple game for. Only they have their own API they want to integrate for stats using GET, POST, Retrieving, saving and resetting game states. I’m wondering if the below is possible once Unity packages a build. Here are the details:
For all games, we will keep track of activity time, points earned, and number of sessions played. Each of these parameters are consistent across all games and are saved individually.
Each game also has other data that needs to be tracked. It could be the user’s progress through an event, scores at different stages in the game, or medals/badges earned. All of this data needs to be serialized into one blob for saving in the “extra” field. We don’t care how the data is serialized as each game is responsible for serializing/unserializing its own data. We will return the data exactly as it was saved.
There is a method for resetting games. Game points, sessions played, and activity time are never reset, but in-game progress can be reset. The reset method essentially, empties the “extra” field, removing all serialized game state data.
Retrieving last game state
GET {Host}/api/v3/game_state/{game_id} Parameters:
user_id (int) Result (JSON string):
user_id (int)
game_id (int)
game_sessions_count (int)
game_time_seconds (int)
total_score (int)
extras (string) (empty if the game has never been played or has been reset)
Saving game state
POST {Host}/api/v3/game_state/{game_id}/save Parameters:
user_id (int)
new_points (int) activity_time_seconds (int) new_sessions (int)
extras (string)
Result (JSON string): user_id (int)
game_id (int) game_sessions_count (int) game_time_seconds (int) total_score (int)
Resetting game state
POST {Host}/api/v3/game_state/{game_id}/reset Parameters:
user_id (int)
reset (bool) Result (JSON string):
user_id (int)
game_id (int) game_sessions_count (int) game_time_seconds (int) total_score (int)
extras (string) (should be empty)
Thanks.
iossif
December 11, 2012, 10:06am
2
JSON, post and get usually are no problem with unity.
this could be a starting point: Unity - Scripting API: WWW