Skip to content

Data game

Sandra Monnier edited this page Nov 25, 2024 · 3 revisions

Game

Let’s dive into the data of game model, game and session.

See shared documentation

game model (scenario, model)

A game model defines everything to create a session.

It can be either a scenario or a model.

properties
  • id : Long
  • refId : String
  • createdBy : User
  • createdTime : Date
  • type : GmType (MODEL, REFERENCE, SCENARIO, PLAY)
  • basedOn : GameModel
  • status : Status
  • name : String
  • description : String
  • comments : String
  • uiversion : Integer (1 = YUI, 2 = React)
  • languages : List<GameModelLanguage>
  • items : List<VariableDescriptor> (at root level)
  • variableDescriptors : List<VariableDescriptor> (all)
  • libraries : List<GameModelContent>
  • pages : Map<String, JsonNode>
  • properties : GameModelProperties
  • games : List<Game>
  • privateInstances : List<VariableInstance>

game model properties

Advanced properties of a game model.

In Java, it is separated from the game model. In database, this data is part of the gamemodel table.

properties
  • freeForAll : Boolean (are players on their own or within a team)
  • iconUri : String
  • logID : String (xAPI id)
  • guestAllowed : Boolean
  • scriptUri : String (server script URI)
  • clientScriptUri : String
  • cssUri : String
  • pagesUri : String
  • websocket : String

game model content

A game model library.

It can be client, server or style.

properties
  • id : Long
  • refId : String
  • gameModel : GameModel
  • contentKey : String
  • libraryType : String
  • contentType : String
  • content : String
  • visibility : Visibility (INTERNAL, PROTECTED, INHERITED, PRIVATE)
  • version : Long

game model language

A game model language.

Only one occurence of a code pro game model.

properties
  • id : String
  • refId : String
  • gameModel: GameModel
  • lang : String
  • code : String
  • refName : String
  • active : boolean
  • visibility : Visibility
  • indexOrder : Integer (preference order)

game (session)

An session of a game model.

A dummy DebugGame is used when defining a game model.

properties
  • id : Long
  • refId : String
  • status : Status
  • createdBy : User
  • createdTime : Date
  • updatedTime : Date
  • access : GameAccess (OPEN, CLOSE)
  • name : String
  • token : String
  • gameModel : GameModel
  • preventPlayerCreatingTeams : Boolean
  • preventPlayerLeavingTeam : Boolean
  • gameTeams : GameTeams
  • invitations : List<InviteToJoinToken>
  • surveyInvitation : List<InviteToJoinToken>

game teams

A link between a game and its teams.

properties
  • id : Long
  • refId : String
  • game : Game
  • teams : List<Team>

team

A team of a game.

The name is unique for a game.

A dummy DebugTeam is used when defining a game model.

properties
  • id : Long
  • refId : String
  • createdBy : User
  • createdTime : Date
  • status : Status
  • gameTeams : GameTeams
  • declaredSize : Integer
  • name : String
  • notes : String
  • players : List<Player>
  • privateInstances : List<VariableInstance>
  • invitations : List<InviteToJoinToken>

player

A user playing a game in a team.

properties
  • id : Long
  • refId : String
  • version : Long
  • status : Status
  • team : Team
  • user : User
  • lang : String
  • joinTime : Date
  • privateInstances : List<VariableInstance>

game admin

Game info required for invoicing.

properties
  • id : Long
  • comments : String
  • createdtime : Date
  • creator : String
  • prevGameId : Long
  • prevGameModel : String
  • prevName : String
  • prevTeamCount : Integer
  • prevTeams : String
  • refId : String
  • status : Status
  • game : Game

Class diagrams

Game model definition

classDiagram

GameModel -- GameModel : based on
GameModel *-- GameModelLanguage
GameModel *-- Page
GameModel *-- GameModelContent : library
GameModel *-- GameModelProperties
GameModel *-- VariableDescriptor : only the root ones
GameModel *-- VariableDescriptor : all
Loading

Game model lifecycle (aka play a session)

classDiagram

GameModel *-- Game
Game *-- GameTeams
Game <|-- DebugGame
GameTeams *-- Team
Team *-- Player
Team <|-- DebugTeam
Player -- User

Loading

Variable instances

classDiagram

GameModel *-- VariableDescriptor
VariableDescriptor *-- AbstractScope 
AbstractScope <|-- GameModelScope
AbstractScope <|-- TeamScope
AbstractScope <|-- PlayerScope
VariableInstance *-- GameModel
VariableInstance *-- Team
VariableInstance *-- Player
VariableInstance *-- GameModelScope
VariableInstance *-- TeamScope
VariableInstance *-- PlayerScope
Loading

A variable descriptor also has a variable default instance. Which is used to initiate the live variable instances.

Invoicing data

classDiagram

GameModel *-- GameAdmin
Loading

Token

classDiagram

Game -- Token : survey invitation
Game -- Token : invitation
Team -- Token : invitation
Loading