Giter Club home page Giter Club logo

stat-rpg's Introduction

GetDotaStats Stat-RPG

###About###

  • This library allows mods to have persistent data over multiple plays. It would be most useful for RPGs.

Client --> Server

CREATE

Call this function just before a user creates a new character. Keep in mind that each user is allowed 6 save slots per mod, and that this function only generates an ID (it does not reserve it).

Field Name Field DataType Field Description
type String Always "CREATE", as thats this packet
modID String The modID allocated by GetDotaStats
steamID Long The SteamID of the owner of this save.

Client --> {"type":"CREATE","modID":"XXXXXXXXX","steamID":"1234"}

Server --> {"type":"create","result":"success","saveID":"1"}

SAVE

Call this function when you want to update the data saved for a specific saveID. The saveID is obtained from the LIST or CREATE functions. A save can only collide with other saves from the same user.

Field Name Field DataType Field Description
type String Always "SAVE"
modID String The modID allocated by GetDotaStats
steamID Long The SteamID of the owner of this save.
saveID Integer The unique save ID for this character, for this user.
jsonData JSON The data of this character save, in the form of a JSON array
metaData JSON The metaData of this character save. It can be anything including JSON. It could be as simple as a name that users can set for their saves, or as complicated as something that will help render a snapshot of a character. This field must be lean, so that the LIST does not waste bandwidth!

Client --> {"type":"SAVE","modID":"XXXXXXXXX","steamID":"1234","saveID":"1","jsonData":[{"test":"value","test2":"value2"}],"metaData":"example_character_save_name"}

Server --> {"type" : "save", "result" : "success"}

DELETE

Call this function when you want to delete a saveID. The saveID is obtained from the LIST or CREATE functions. A save can only collide with other saves from the same user.

Field Name Field DataType Field Description
type String Always "DELETE"
modID String The modID allocated by GetDotaStats
steamID Long The SteamID of the owner of this save.
saveID Integer The unique save ID for this character, for this user.

Client --> {"type":"DELETE","modID":"XXXXXXXXX","steamID":"1234","saveID":"1"}

Server --> {"type" : "delete", "result" : "success"}

LOAD

Call this function when you want to load a specific saveID. The saveID is obtained from the LIST or CREATE functions. A save can only collide with other saves from the same user.

Field Name Field DataType Field Description
type String Always "LOAD"
modID String The modID allocated by GetDotaStats
steamID Long The SteamID of the owner of this save.
saveID Integer The unique save ID for this character, for this user.

Client --> {"type":"LOAD","modID":"XXXXXXXXX","steamID":"1234","saveID":"1"}

Server --> {"type":"load","result":"success","jsonData":[{"test":"value","test2":"value2"}]}

LIST

Call this function at the start of the game to get a list of all of the user's saves for this mod.

Field Name Field DataType Field Description
type String Always "LIST"
modID String The modID allocated by GetDotaStats
steamID Long The SteamID of the owner of this save.

Client --> {"type":"LIST","modID":"XXXXXXXXX","steamID":"1234"}

Server --> {"type":"list","result":"success","jsonArray":[{"saveID":1,"metaData":"example_character_save_name","dateRecorded":"2015-03-25T02:08:53.000Z"},{"saveID":2,"metaData":"example_character_save_name","dateRecorded":"2015-03-25T02:19:56.000Z"},{"saveID":3,"metaData":"example_character_save_name","dateRecorded":"2015-03-25T02:20:01.000Z"},{"saveID":4,"metaData":"example_character_save_name","dateRecorded":"2015-03-25T02:20:06.000Z"}]}

Server --> Client

Always listen for the error and result fields. If error is populated, then something went wrong and you may want to indicate the raw error to the user in the client, otherwise you may want to communicate the result to the user (optional).

on success

Field Name Field DataType Field Description
result String String describing success, only useful for debugging

on failure

Field Name Field DataType Field Description
error String A string describing the error. Only useful for debugging purposes

create

Field Name Field DataType Field Description
type String Always "list"
saveID Integer The next saveID to use

save

Field Name Field DataType Field Description
type String Always "save"

delete

Field Name Field DataType Field Description
type String Always "delete"

load

Field Name Field DataType Field Description
type String Always "load"
jsonData JSON The data of this character save.

list (6 most recent for now)

Field Name Field DataType Field Description
type String Always "list"
jsonArray Array of JSON Contains an array of character meta-data and when it was saved

Ports

  • Live: 4446
  • Test: 4444

stat-rpg's People

Contributors

jimmydorry avatar sinz163 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

h8117239

stat-rpg's Issues

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.