GithubHelp home page GithubHelp logo

frostysavemanager's Introduction

FrostySaveManager

An android save manager that provides the functionality of saving the data both locally as well as on PlayServices cloud. It keeps the save files in sync by recording the total time played on a certain save file and always selecting the latest file either from the cloud or from the local disk. The player will always get the latest save files even if he switches his device as long as he logs in with the same google account. Requires no internet connection for offline saves.

Getting Started

These instructions will get you started in integrating the save manager in your project.

Prerequisites

An android project with play services enabled and save games setup from the google play console. Message Packer which is a powerful binary serializer by neuecc which you can download from here https://github.com/neuecc/MessagePack-CSharp. Note: You can use the default unity binary formatter, however you will need to modify the code a little.

Installing

Installing the save manager is a matter of cloning the repo and pasting it inside your asset folder. Make sure to install the Message Packer too unless you want to modify the code and use some other serializer. Remeber to initizlie the play services with .EnableSavedGames() ForExample:

PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() .EnableSavedGames() .Build();

How to use FrostySaveManager

Writing a save game

For writing a save file just create an instance of the FrostWriter class with the T being the class you want to serialize. Then call the save method along with your preferred inputs. ForExample: FrostWrite _FrostWrite = new FrostWrite(); _FrostWrite.SaveTheGame(instance_to_serialize, SaveFileName);

Reading a saved game

For reading a save file just create an instance of the FrostRead class with the T being the class you want to deserialize. Then call the read method along with your preferred inputs. ForExample: FrostRead _FrostRead = new FrostRead(); _FrostRead.LoadTheGame(SaveFileName);

Comparing Local And Cloud Saves

Built With

  • Dropwizard - The web framework used
  • Maven - Dependency Management
  • ROME - Used to generate RSS Feeds

Authors

Acknowledgments

  • Hat tip to anyone whose code was used

frostysavemanager's People

Contributors

mobile94ever avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.