Package io.sockit.gameserver
Interface CompressibleData
public interface CompressibleData
This is the super interface for User Data that can be saved in the Server database
-
Method Summary
Modifier and Type Method Description void
fromCompressedJson(JsonObject jsonObject)
Initializes Data from compressed Json - converts compressed Json to Data.JsonObject
toCompressedJson()
Coverts the Data to compressed Json.JsonObject
toJson()
Coverts the Data to Json.
-
Method Details
-
toCompressedJson
JsonObject toCompressedJson()Coverts the Data to compressed Json. Called when the Data object is saved to the Game database. For example instead of long descriptive attribute names use short name. Eg. instead of {"firstName":"ashok","lastName":"patil"} you could use {"a":"ashok","b":"patil"}- Returns:
- JsonObject - the data as compressed Json
-
fromCompressedJson
Initializes Data from compressed Json - converts compressed Json to Data. Called when the Data object is retrieved from the Game database- Parameters:
jsonObject
- - The compressed Json from which the data will be initialized
-
toJson
JsonObject toJson()Coverts the Data to Json. Called when data needs to be passed to client- Returns:
- JsonObject - data as Json
-