This is a documentation for Board Game Arena: play board games online !
Table: Difference between revisions
Jump to navigation
Jump to search
Victoria La (talk | contribs) (initial page) |
mNo edit summary |
||
(24 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
This is reference for public and protected method defined in Table and its ancestors, this information obtained by using php reflection. | This is reference for public and protected method defined in Table and its ancestors, this information obtained by using php reflection. | ||
Most of these methods | Most of these methods are documented on various other wikis, this is just reference for completeness and in case you run into accidental overloading of undocumented functions... | ||
<span style="color:red">Its a long list please help with editing this wiki</span> | |||
If you need these method for IDE autocompletion and validation there is unofficial project that has stubs to documented methods: | |||
* https://github.com/elaskavaia/bga-sharedcode/blob/master/misc/module/table/table.game.php (if you want more stubs pull requests are welcome to this repository) | |||
== Class hierarchy == | == Class hierarchy == | ||
Line 8: | Line 13: | ||
** APP_DbObject | ** APP_DbObject | ||
*** APP_GameClass | *** APP_GameClass | ||
**** Table | **** Table - this is a class all games inherit | ||
**** [[Deck]] | **** [[Deck]] - db handling component for specific schema (deck) | ||
== Methods in the Table class == | == Methods in the Table class == | ||
;Table.getGameName | ;Table.getGameName | ||
:part of template, return game name, not to be modified by developer, not document on wiki | |||
;Table._ | ;Table._ | ||
:translation wrapper function, see [[Translations]] | |||
;Table.setTable | ;Table.setTable | ||
;Table.initTable | :method that sets up the php side, do not call or override | ||
;Table.initTable protected | |||
:This method is called by framework before every action (does nothing by default), unlike constructor this method has initialized state of the table so it can access db, undocumented as it has very limited use | |||
;Table.getAllTableDatas | ;Table.getAllTableDatas | ||
:undocumented | |||
;Table.getAllDatas | ;Table.getAllDatas | ||
:part of template, override, see [[Main game logic: yourgamename.game.php]] | |||
;Table.setupNewGameTable | ;Table.setupNewGameTable | ||
:undocumented | |||
;Table.setupNewGame | ;Table.setupNewGame | ||
;Table.getTableOptionsForGame | :part of template, override, see [[Main game logic: yourgamename.game.php]] | ||
;Table.getTableOptionsForGame static | |||
:undocumented | |||
;Table.getTableOptions | ;Table.getTableOptions | ||
;Table.getTablePreferencesForGame | :undocumented, likely return gameoptions (i.e. variants of the games) | ||
;Table.getTablePreferencesForGame static | |||
:undocumented | |||
;Table.getTablePreferences | ;Table.getTablePreferences | ||
;Table.getGameInfosForGame | :undocumented, likely return UI preferences (i.e. display tooltips or not) | ||
;Table.getGameInfosForGame static | |||
:undocuments, likely return $gameinfos from gameinfos.inc.php | |||
;Table.getGameOptionsInfos | ;Table.getGameOptionsInfos | ||
:undocumented | |||
;Table.start | ;Table.start | ||
:undocumented, likely starts the game, do not call | |||
;Table.stMakeEveryoneActive | |||
:this method can be used in state machine to make everybody active as "st" method of multiplayeractive state | |||
;Table.loadPlayersBasicInfos | ;Table.loadPlayersBasicInfos | ||
:very usefull function get players table, see [[Main game logic: yourgamename.game.php]] | |||
;Table.reloadPlayersBasicInfos | ;Table.reloadPlayersBasicInfos | ||
:reload players info, see [[Main game logic: yourgamename.game.php]] | |||
;Table.reattributeColorsBasedOnPreferences | ;Table.reattributeColorsBasedOnPreferences | ||
:change players colors, see [[Main game logic: yourgamename.game.php]] | |||
;Table.getBestColorFromColorPrefs | ;Table.getBestColorFromColorPrefs | ||
:undocumented, do not call, use to pick a color based on preference | |||
;Table.initSetupPlayersInfos | ;Table.initSetupPlayersInfos | ||
:undocumented | |||
;Table.getPlayersNumber | ;Table.getPlayersNumber | ||
:returns number of players, see [[Main game logic: yourgamename.game.php]] | |||
;Table.checkAction | ;Table.checkAction | ||
:check action on server, see [[Main game logic: yourgamename.game.php]] | |||
;Table.checkGameStart | ;Table.checkGameStart | ||
;Table.color_to_color_back | ;Table.color_to_color_back | ||
:@deprecated, undocumented | |||
;Table.initGameStateLabels | ;Table.initGameStateLabels | ||
;Table.setGameStateInitialValue | ;Table.setGameStateInitialValue | ||
:Set initial state of global, technically same as setGameStateValue see [[Main_game_logic:_yourgamename.game.php#Use_globals]] | |||
;Table.getGameStateValue | ;Table.getGameStateValue | ||
:get value of global see [[Main_game_logic:_yourgamename.game.php#Use_globals]] | |||
;Table.setGameStateValue | ;Table.setGameStateValue | ||
:set value of global see [[Main_game_logic:_yourgamename.game.php#Use_globals]] | |||
;Table.incGameStateValue | ;Table.incGameStateValue | ||
:increment value of global see [[Main_game_logic:_yourgamename.game.php#Use_globals]] | |||
;Table.is_testmode | ;Table.is_testmode | ||
:@deprecated | |||
;Table.testmodedatas | ;Table.testmodedatas | ||
:@deprecated | |||
;Table.applyTestModeDbFixture | ;Table.applyTestModeDbFixture | ||
;Table.getActivePlayerId | ;Table.getActivePlayerId | ||
:get active player id, see [[Main_game_logic:_yourgamename.game.php#Game_states_and_active_players]] | |||
;Table.getActivePlayerName | ;Table.getActivePlayerName | ||
:get active player name, see [[Main_game_logic:_yourgamename.game.php#Game_states_and_active_players]] | |||
;Table.getCurrentPlayerId | ;Table.getCurrentPlayerId | ||
:get current player id, see [[Main_game_logic:_yourgamename.game.php#Game_states_and_active_players]] | |||
;Table.getCurrentPlayerName | ;Table.getCurrentPlayerName | ||
:get currrent player name, see [[Main_game_logic:_yourgamename.game.php#Game_states_and_active_players]] | |||
;Table.getCurrentPlayerColor | ;Table.getCurrentPlayerColor | ||
:get current player color, see [[Main_game_logic:_yourgamename.game.php#Game_states_and_active_players]] | |||
;Table.getPlayerNameById | |||
:get the name by id, see [[Main_game_logic:_yourgamename.game.php#Accessing_player_information]] | |||
;Table.getPlayerColorById | |||
:get the color by id, see [[Main_game_logic:_yourgamename.game.php#Accessing_player_information]] | |||
;Table.getPlayerNoById | |||
:get 'player_no' (number) by id, see [[Main_game_logic:_yourgamename.game.php#Accessing_player_information]] | |||
;Table.isCurrentPlayerZombie | ;Table.isCurrentPlayerZombie | ||
;Table.getPlayerCount | ;Table.getPlayerCount | ||
:@deprecated, use getPlayersNumber, | |||
;Table.createNextPlayerTable | ;Table.createNextPlayerTable | ||
:Return linked table of player order using passed parameter, see [[Main_game_logic:_yourgamename.game.php#Players turn order]] | |||
;Table.getNextPlayerTable | ;Table.getNextPlayerTable | ||
:Return linked table of player order using natural players order, see [[Main_game_logic:_yourgamename.game.php#Players turn order]] | |||
;Table.createPrevPlayerTable | ;Table.createPrevPlayerTable | ||
:do not use | |||
;Table.getPrevPlayerTable | ;Table.getPrevPlayerTable | ||
:Return linked table of player order using natural players order reversed, see [[Main_game_logic:_yourgamename.game.php#Players turn order]] | |||
;Table.getPlayerAfter | ;Table.getPlayerAfter | ||
:get player after, see [[Main_game_logic:_yourgamename.game.php#Players turn order]] | |||
;Table.getPlayerBefore | ;Table.getPlayerBefore | ||
:get player before, see [[Main_game_logic:_yourgamename.game.php#Players turn order]] | |||
;Table.activeNextPlayer | ;Table.activeNextPlayer | ||
:Make the next player active in the natural player orde, see [[Main_game_logic:_yourgamename.game.php#Game states and active players]] | |||
;Table.activePrevPlayer | ;Table.activePrevPlayer | ||
:Make the prev player active in the natural player orde, see [[Main_game_logic:_yourgamename.game.php#Game states and active players]] | |||
;Table.forceEndOfGame | ;Table.forceEndOfGame | ||
:force to abandon game, normally its called when all players agree, but can be called to force people out when testing alpha or beta games and don't want to deal with update db and such (<code>$this->forceEndOfGame( $reason )</code>) | |||
;Table.giveExtraTime | ;Table.giveExtraTime | ||
:give extra time to a player, usually when turn require multiple player states, see [[Main_game_logic:_yourgamename.game.php#Reflexion_time]] | |||
;Table.checkZombieTurn | ;Table.checkZombieTurn | ||
;Table.skipPlayersOutOfTime | ;Table.skipPlayersOutOfTime | ||
:this is called by framework, do not use | |||
;Table.onPlayerHasBeenZombified | ;Table.onPlayerHasBeenZombified | ||
:called when some player has been zombified because he quits the game (or have been "skipped"), unlikely you need to override this method, if you do you have to take into account first player quit vs any other player quit, you must call super implementation in any case if you decide to override it | |||
;Table.forceAbandon | ;Table.forceAbandon | ||
:it may be possible for force to abandon game in some cases, for example in alpha games when new database schema requires update and you did not code this (because for alpha its waste of time) | |||
;Table.zombieBack | ;Table.zombieBack | ||
;Table.aiPlayer | ;Table.aiPlayer | ||
Line 75: | Line 132: | ||
;Table.aiError | ;Table.aiError | ||
;Table.say | ;Table.say | ||
:this function processes chat message, do not use for game purposes, for word games use dedicated control | |||
;Table.getGameProgression | ;Table.getGameProgression | ||
;Table.getStatTypesForGame | :part of template, override to return proper data, see [[Main_game_logic:_yourgamename.game.php]] and [[Your_game_state_machine:_states.inc.php]] | ||
;Table.getStatTypes | ;Table.getStatTypesForGame static | ||
;Table.getStatTypes | |||
:get the $stats_type array defined in stats.inc.php | |||
;Table.stat_type_id_to_name | ;Table.stat_type_id_to_name | ||
;Table.initStat | ;Table.initStat | ||
:initialize statistic https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Game_statistics | |||
;Table.getStat | ;Table.getStat | ||
:get statistic https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Game_statistics | |||
;Table.setStat | ;Table.setStat | ||
:set statistic https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Game_statistics | |||
;Table.setStatForAllPlayers | ;Table.setStatForAllPlayers | ||
:set player statistics for all players, not document, does not check params, have some bad side effects | |||
;Table.incStat | ;Table.incStat | ||
:inc statistic https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Game_statistics | |||
;Table.getStatFromResult | ;Table.getStatFromResult | ||
:helper function, do not use, should have been private for table class | |||
;Table.setStatOnResult | ;Table.setStatOnResult | ||
:helper function, do not use, should have been private for table class | |||
;Table.setStatOnResultForPlayer | ;Table.setStatOnResultForPlayer | ||
:helper function, do not use, should have been private for table class | |||
;Table.getStandardGameResultObject | ;Table.getStandardGameResultObject | ||
:helper function, do not use, should have been private for table class | |||
;Table.getGameRankInfos | ;Table.getGameRankInfos | ||
;Table.argGameEnd | ;Table.argGameEnd | ||
:framework end game function, do not call or override | |||
;Table.stGameEnd | ;Table.stGameEnd | ||
:framework end game function, do not call or override | |||
;Table.stTutorialStart | ;Table.stTutorialStart | ||
;Table.isSoloGame | ;Table.isSoloGame | ||
:return true if game is 1 player game or all other players are AI | |||
;Table.notifyAllPlayers | ;Table.notifyAllPlayers | ||
:notification function, see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php | |||
;Table.notifyPlayer | ;Table.notifyPlayer | ||
:notification function, see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php | |||
;Table.onEndAjaxAction | ;Table.onEndAjaxAction | ||
:can be overriden to be executed before end of ajax action, unclear why would anybody need that | |||
;Table.checkReturnState | ;Table.checkReturnState | ||
:framework internal check action, do not call or override | |||
;Table.sendNotifications | ;Table.sendNotifications | ||
:framework internal function, do not call or override | |||
;Table.getCurrentNotificationNextNo | ;Table.getCurrentNotificationNextNo | ||
;Table.getNotificationHistory | ;Table.getNotificationHistory | ||
;Table.debugChat | ;Table.debugChat | ||
:studio only - execute php code from chat, overriding won't work as it is called statically from table class | |||
;Table.timeout | ;Table.timeout | ||
:studio only - can call from chat console to zombify current player | |||
;Table.eliminatePlayer | ;Table.eliminatePlayer | ||
:eliminate player, https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php | |||
;Table.isAsync | ;Table.isAsync | ||
;Table.getTimeLimits | :return true if game is turn based, false if realtime, undocumented (why?) | ||
;Table.getTimeLimits static | |||
:internal framework function, do not call or override | |||
;Table.getAsyncTimeLimits | ;Table.getAsyncTimeLimits | ||
:return time limits for turn based games | |||
;Table.checkAsyncActivePlayersChange | ;Table.checkAsyncActivePlayersChange | ||
:framework internal check action, do not call or override | |||
;Table.upgradeTableDb | ;Table.upgradeTableDb | ||
:override to perform db upgrade, see game template, also some notes in https://en.doc.boardgamearena.com/Post-release_phase | |||
;Table.getReplayPoints | ;Table.getReplayPoints | ||
;Table.saveReplayPoint | ;Table.saveReplayPoint | ||
;Table.undoAndReplayInit | ;Table.undoAndReplayInit | ||
;Table.removeAutoIncrementFromTable | ;Table.removeAutoIncrementFromTable | ||
:@deprecated | |||
;Table.getFieldsListOfTable | ;Table.getFieldsListOfTable | ||
:do not use or override, framework internal method to return columns of table | |||
;Table.undoInit | ;Table.undoInit | ||
;Table.undoSavepoint | ;Table.undoSavepoint | ||
:Instruction to save database state after current transaction is complete [[Main game logic: yourgamename.game.php#Undo moves]] | |||
;Table.doUndoSavePoint | ;Table.doUndoSavePoint | ||
:do not call directly | |||
;Table.undoRestorePoint | ;Table.undoRestorePoint | ||
:Restore database from save point [[Main game logic: yourgamename.game.php#Undo moves]] | |||
;Table.showTutorial | ;Table.showTutorial | ||
:do not call directly | |||
;Table.seenTutorial | ;Table.seenTutorial | ||
:do not call directly | |||
;Table.activeTutorial | ;Table.activeTutorial | ||
:do not call directly | |||
;Table.forceGameTournamendEnd | ;Table.forceGameTournamendEnd | ||
:do not call directly | |||
;Table.showCursor | ;Table.showCursor | ||
;Table.showCursorClick | |||
:undocumented, probably to share the cursor for demo/training | |||
;Table.storeLegacyData | |||
:API for campain games see [[Main game logic: yourgamename.game.php#Legacy games API]] | |||
;Table.storeLegacyTeamData | |||
:API for campain games see [[Main game logic: yourgamename.game.php#Legacy games API]] | |||
;Table.retrieveLegacyData | |||
:API for campain games see [[Main game logic: yourgamename.game.php#Legacy games API]] | |||
;Table.retrieveLegacyTeamData | |||
:API for campain games see [[Main game logic: yourgamename.game.php#Legacy games API]] | |||
;Table.removeLegacyData | |||
:API for campain games see [[Main game logic: yourgamename.game.php#Legacy games API]] | |||
;Table.removeLegacyTeamData | |||
:API for campain games see [[Main game logic: yourgamename.game.php#Legacy games API]] | |||
== Methods in the APP_GameClass class == | |||
;APP_GameClass.getNewUnique | ;APP_GameClass.getNewUnique | ||
;APP_GameClass.getNew | ;APP_GameClass.getNew | ||
;APP_GameClass.notifyNow | ;APP_GameClass.notifyNow | ||
;APP_DbObject.ConnectDb | == Methods in the APP_DbObject class == | ||
;APP_DbObject.DbQuery | |||
;APP_DbObject.DbTraceTimeBefore | ;APP_DbObject.ConnectDb static | ||
;APP_DbObject.DbTraceTimeAfter | ;APP_DbObject.DbQuery static | ||
;APP_DbObject.DbGetLastId | :main query method, see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database | ||
;APP_DbObject.DbDumpQueryHistory | ;APP_DbObject.DbTraceTimeBefore static | ||
;APP_DbObject.DbAffectedRow | ;APP_DbObject.DbTraceTimeAfter static | ||
;APP_DbObject.DbStartTransaction | ;APP_DbObject.DbGetLastId static | ||
;APP_DbObject.DbCommit | ;APP_DbObject.DbDumpQueryHistory static | ||
;APP_DbObject.DbRollback | ;APP_DbObject.DbAffectedRow static | ||
;APP_DbObject.DbRestartTransaction | ;APP_DbObject.DbStartTransaction static | ||
;APP_DbObject.DbSelect | ;APP_DbObject.DbCommit static | ||
;APP_DbObject.CommitAllAndRestart | ;APP_DbObject.DbRollback static | ||
;APP_DbObject.DbRestartTransaction static | |||
;APP_DbObject.DbSelect static | |||
;APP_DbObject.CommitAllAndRestart static | |||
;APP_DbObject.setDeadlockMode | ;APP_DbObject.setDeadlockMode | ||
;APP_DbObject.isDeadlockModeRetry | ;APP_DbObject.isDeadlockModeRetry | ||
Line 147: | Line 258: | ||
;APP_DbObject.escapeStringForDB | ;APP_DbObject.escapeStringForDB | ||
;APP_DbObject.getCollectionFromDB | ;APP_DbObject.getCollectionFromDB | ||
:see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database | |||
;APP_DbObject.getNonEmptyCollectionFromDB | ;APP_DbObject.getNonEmptyCollectionFromDB | ||
;APP_DbObject.getDoubleKeyCollectionFromDB | ;APP_DbObject.getDoubleKeyCollectionFromDB | ||
:see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database | |||
;APP_DbObject.getUniqueValueFromDB | ;APP_DbObject.getUniqueValueFromDB | ||
;APP_DbObject.mysql_fetch_row | ;APP_DbObject.mysql_fetch_row | ||
Line 154: | Line 267: | ||
;APP_DbObject.mysql_query | ;APP_DbObject.mysql_query | ||
;APP_DbObject.getObjectFromDB | ;APP_DbObject.getObjectFromDB | ||
:see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database | |||
;APP_DbObject.getNonEmptyObjectFromDB | ;APP_DbObject.getNonEmptyObjectFromDB | ||
:see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database | |||
;APP_DbObject.getObjectListFromDB | ;APP_DbObject.getObjectListFromDB | ||
;APP_DbObject.getSelectedDb | :see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database | ||
;APP_DbObject.getSelectedDb static | |||
;APP_DbObject.sqlParsing | ;APP_DbObject.sqlParsing | ||
;APP_DbObject.DbUsePrefix | ;APP_DbObject.DbUsePrefix | ||
;APP_DbObject.applyPrefix | ;APP_DbObject.applyPrefix | ||
;APP_DbObject.cache_store | ;APP_DbObject.cache_store static | ||
;APP_DbObject.cache_add | ;APP_DbObject.cache_add static | ||
;APP_DbObject.cache_exists | ;APP_DbObject.cache_exists static | ||
;APP_DbObject.cache_fetch | ;APP_DbObject.cache_fetch static | ||
;APP_DbObject.cache_delete | ;APP_DbObject.cache_delete static | ||
;APP_DbObject.cache_rollback | ;APP_DbObject.cache_rollback static | ||
;APP_DbObject.cache_commit | ;APP_DbObject.cache_commit static | ||
;APP_DbObject.ensure_enough_time_since_last_action | ;APP_DbObject.ensure_enough_time_since_last_action | ||
;APP_DbObject.getMasterNodeDomain | ;APP_DbObject.getMasterNodeDomain | ||
Line 175: | Line 291: | ||
;APP_DbObject.bgaCallUrl | ;APP_DbObject.bgaCallUrl | ||
== Methods in the APP_Object class == | |||
;APP_Object.watch | ;APP_Object.watch | ||
:@deprecated, do not use (noop) | |||
;APP_Object.debug | ;APP_Object.debug | ||
:see https://en.doc.boardgamearena.com/Practical_debugging | |||
;APP_Object.trace | ;APP_Object.trace | ||
:see https://en.doc.boardgamearena.com/Practical_debugging | |||
;APP_Object.warn | ;APP_Object.warn | ||
:see https://en.doc.boardgamearena.com/Practical_debugging | |||
;APP_Object.error | ;APP_Object.error | ||
:see https://en.doc.boardgamearena.com/Practical_debugging | |||
;APP_Object.dump | ;APP_Object.dump | ||
:see https://en.doc.boardgamearena.com/Practical_debugging | |||
== Selected static methods in utility modules == | |||
;bga_rand | |||
:recommended for randomness (dice rolls, etc), see [[Main game logic: yourgamename.game.php#About random and randomness]] | |||
;shuffle_with_keys | |||
:shuffle array with keys (basically shuffle keys and keep linked values), it shuffle argument, does not return anything | |||
;totranslate | |||
:returns its argument, used for MARKING of string for server strings https://en.doc.boardgamearena.com/Translations | |||
;clienttranslate | |||
:returns its argument, used for MARKING of string for client strings https://en.doc.boardgamearena.com/Translations | |||
;_ | |||
:this is not the same as self::_, it is also translation function but only can translate mainsite strings, do not use in game code | |||
[[Category:Studio]] |
Latest revision as of 10:54, 2 October 2024
This is reference for public and protected method defined in Table and its ancestors, this information obtained by using php reflection.
Most of these methods are documented on various other wikis, this is just reference for completeness and in case you run into accidental overloading of undocumented functions...
Its a long list please help with editing this wiki
If you need these method for IDE autocompletion and validation there is unofficial project that has stubs to documented methods:
- https://github.com/elaskavaia/bga-sharedcode/blob/master/misc/module/table/table.game.php (if you want more stubs pull requests are welcome to this repository)
Class hierarchy
- APP_Object
- APP_DbObject
- APP_GameClass
- Table - this is a class all games inherit
- Deck - db handling component for specific schema (deck)
- APP_GameClass
- APP_DbObject
Methods in the Table class
- Table.getGameName
- part of template, return game name, not to be modified by developer, not document on wiki
- Table._
- translation wrapper function, see Translations
- Table.setTable
- method that sets up the php side, do not call or override
- Table.initTable protected
- This method is called by framework before every action (does nothing by default), unlike constructor this method has initialized state of the table so it can access db, undocumented as it has very limited use
- Table.getAllTableDatas
- undocumented
- Table.getAllDatas
- part of template, override, see Main game logic: yourgamename.game.php
- Table.setupNewGameTable
- undocumented
- Table.setupNewGame
- part of template, override, see Main game logic: yourgamename.game.php
- Table.getTableOptionsForGame static
- undocumented
- Table.getTableOptions
- undocumented, likely return gameoptions (i.e. variants of the games)
- Table.getTablePreferencesForGame static
- undocumented
- Table.getTablePreferences
- undocumented, likely return UI preferences (i.e. display tooltips or not)
- Table.getGameInfosForGame static
- undocuments, likely return $gameinfos from gameinfos.inc.php
- Table.getGameOptionsInfos
- undocumented
- Table.start
- undocumented, likely starts the game, do not call
- Table.stMakeEveryoneActive
- this method can be used in state machine to make everybody active as "st" method of multiplayeractive state
- Table.loadPlayersBasicInfos
- very usefull function get players table, see Main game logic: yourgamename.game.php
- Table.reloadPlayersBasicInfos
- reload players info, see Main game logic: yourgamename.game.php
- Table.reattributeColorsBasedOnPreferences
- change players colors, see Main game logic: yourgamename.game.php
- Table.getBestColorFromColorPrefs
- undocumented, do not call, use to pick a color based on preference
- Table.initSetupPlayersInfos
- undocumented
- Table.getPlayersNumber
- returns number of players, see Main game logic: yourgamename.game.php
- Table.checkAction
- check action on server, see Main game logic: yourgamename.game.php
- Table.checkGameStart
- Table.color_to_color_back
- @deprecated, undocumented
- Table.initGameStateLabels
- Table.setGameStateInitialValue
- Set initial state of global, technically same as setGameStateValue see Main_game_logic:_yourgamename.game.php#Use_globals
- Table.getGameStateValue
- get value of global see Main_game_logic:_yourgamename.game.php#Use_globals
- Table.setGameStateValue
- set value of global see Main_game_logic:_yourgamename.game.php#Use_globals
- Table.incGameStateValue
- increment value of global see Main_game_logic:_yourgamename.game.php#Use_globals
- Table.is_testmode
- @deprecated
- Table.testmodedatas
- @deprecated
- Table.applyTestModeDbFixture
- Table.getActivePlayerId
- get active player id, see Main_game_logic:_yourgamename.game.php#Game_states_and_active_players
- Table.getActivePlayerName
- get active player name, see Main_game_logic:_yourgamename.game.php#Game_states_and_active_players
- Table.getCurrentPlayerId
- get current player id, see Main_game_logic:_yourgamename.game.php#Game_states_and_active_players
- Table.getCurrentPlayerName
- get currrent player name, see Main_game_logic:_yourgamename.game.php#Game_states_and_active_players
- Table.getCurrentPlayerColor
- get current player color, see Main_game_logic:_yourgamename.game.php#Game_states_and_active_players
- Table.getPlayerNameById
- get the name by id, see Main_game_logic:_yourgamename.game.php#Accessing_player_information
- Table.getPlayerColorById
- get the color by id, see Main_game_logic:_yourgamename.game.php#Accessing_player_information
- Table.getPlayerNoById
- get 'player_no' (number) by id, see Main_game_logic:_yourgamename.game.php#Accessing_player_information
- Table.isCurrentPlayerZombie
- Table.getPlayerCount
- @deprecated, use getPlayersNumber,
- Table.createNextPlayerTable
- Return linked table of player order using passed parameter, see Main_game_logic:_yourgamename.game.php#Players turn order
- Table.getNextPlayerTable
- Return linked table of player order using natural players order, see Main_game_logic:_yourgamename.game.php#Players turn order
- Table.createPrevPlayerTable
- do not use
- Table.getPrevPlayerTable
- Return linked table of player order using natural players order reversed, see Main_game_logic:_yourgamename.game.php#Players turn order
- Table.getPlayerAfter
- get player after, see Main_game_logic:_yourgamename.game.php#Players turn order
- Table.getPlayerBefore
- get player before, see Main_game_logic:_yourgamename.game.php#Players turn order
- Table.activeNextPlayer
- Make the next player active in the natural player orde, see Main_game_logic:_yourgamename.game.php#Game states and active players
- Table.activePrevPlayer
- Make the prev player active in the natural player orde, see Main_game_logic:_yourgamename.game.php#Game states and active players
- Table.forceEndOfGame
- force to abandon game, normally its called when all players agree, but can be called to force people out when testing alpha or beta games and don't want to deal with update db and such (
$this->forceEndOfGame( $reason )
) - Table.giveExtraTime
- give extra time to a player, usually when turn require multiple player states, see Main_game_logic:_yourgamename.game.php#Reflexion_time
- Table.checkZombieTurn
- Table.skipPlayersOutOfTime
- this is called by framework, do not use
- Table.onPlayerHasBeenZombified
- called when some player has been zombified because he quits the game (or have been "skipped"), unlikely you need to override this method, if you do you have to take into account first player quit vs any other player quit, you must call super implementation in any case if you decide to override it
- Table.forceAbandon
- it may be possible for force to abandon game in some cases, for example in alpha games when new database schema requires update and you did not code this (because for alpha its waste of time)
- Table.zombieBack
- Table.aiPlayer
- Table.aiNotPlaying
- Table.aiError
- Table.say
- this function processes chat message, do not use for game purposes, for word games use dedicated control
- Table.getGameProgression
- part of template, override to return proper data, see Main_game_logic:_yourgamename.game.php and Your_game_state_machine:_states.inc.php
- Table.getStatTypesForGame static
- Table.getStatTypes
- get the $stats_type array defined in stats.inc.php
- Table.stat_type_id_to_name
- Table.initStat
- initialize statistic https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Game_statistics
- Table.getStat
- get statistic https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Game_statistics
- Table.setStat
- set statistic https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Game_statistics
- Table.setStatForAllPlayers
- set player statistics for all players, not document, does not check params, have some bad side effects
- Table.incStat
- inc statistic https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Game_statistics
- Table.getStatFromResult
- helper function, do not use, should have been private for table class
- Table.setStatOnResult
- helper function, do not use, should have been private for table class
- Table.setStatOnResultForPlayer
- helper function, do not use, should have been private for table class
- Table.getStandardGameResultObject
- helper function, do not use, should have been private for table class
- Table.getGameRankInfos
- Table.argGameEnd
- framework end game function, do not call or override
- Table.stGameEnd
- framework end game function, do not call or override
- Table.stTutorialStart
- Table.isSoloGame
- return true if game is 1 player game or all other players are AI
- Table.notifyAllPlayers
- notification function, see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php
- Table.notifyPlayer
- notification function, see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php
- Table.onEndAjaxAction
- can be overriden to be executed before end of ajax action, unclear why would anybody need that
- Table.checkReturnState
- framework internal check action, do not call or override
- Table.sendNotifications
- framework internal function, do not call or override
- Table.getCurrentNotificationNextNo
- Table.getNotificationHistory
- Table.debugChat
- studio only - execute php code from chat, overriding won't work as it is called statically from table class
- Table.timeout
- studio only - can call from chat console to zombify current player
- Table.eliminatePlayer
- eliminate player, https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php
- Table.isAsync
- return true if game is turn based, false if realtime, undocumented (why?)
- Table.getTimeLimits static
- internal framework function, do not call or override
- Table.getAsyncTimeLimits
- return time limits for turn based games
- Table.checkAsyncActivePlayersChange
- framework internal check action, do not call or override
- Table.upgradeTableDb
- override to perform db upgrade, see game template, also some notes in https://en.doc.boardgamearena.com/Post-release_phase
- Table.getReplayPoints
- Table.saveReplayPoint
- Table.undoAndReplayInit
- Table.removeAutoIncrementFromTable
- @deprecated
- Table.getFieldsListOfTable
- do not use or override, framework internal method to return columns of table
- Table.undoInit
- Table.undoSavepoint
- Instruction to save database state after current transaction is complete Main game logic: yourgamename.game.php#Undo moves
- Table.doUndoSavePoint
- do not call directly
- Table.undoRestorePoint
- Restore database from save point Main game logic: yourgamename.game.php#Undo moves
- Table.showTutorial
- do not call directly
- Table.seenTutorial
- do not call directly
- Table.activeTutorial
- do not call directly
- Table.forceGameTournamendEnd
- do not call directly
- Table.showCursor
- Table.showCursorClick
- undocumented, probably to share the cursor for demo/training
- Table.storeLegacyData
- API for campain games see Main game logic: yourgamename.game.php#Legacy games API
- Table.storeLegacyTeamData
- API for campain games see Main game logic: yourgamename.game.php#Legacy games API
- Table.retrieveLegacyData
- API for campain games see Main game logic: yourgamename.game.php#Legacy games API
- Table.retrieveLegacyTeamData
- API for campain games see Main game logic: yourgamename.game.php#Legacy games API
- Table.removeLegacyData
- API for campain games see Main game logic: yourgamename.game.php#Legacy games API
- Table.removeLegacyTeamData
- API for campain games see Main game logic: yourgamename.game.php#Legacy games API
Methods in the APP_GameClass class
- APP_GameClass.getNewUnique
- APP_GameClass.getNew
- APP_GameClass.notifyNow
Methods in the APP_DbObject class
- APP_DbObject.ConnectDb static
- APP_DbObject.DbQuery static
- main query method, see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database
- APP_DbObject.DbTraceTimeBefore static
- APP_DbObject.DbTraceTimeAfter static
- APP_DbObject.DbGetLastId static
- APP_DbObject.DbDumpQueryHistory static
- APP_DbObject.DbAffectedRow static
- APP_DbObject.DbStartTransaction static
- APP_DbObject.DbCommit static
- APP_DbObject.DbRollback static
- APP_DbObject.DbRestartTransaction static
- APP_DbObject.DbSelect static
- APP_DbObject.CommitAllAndRestart static
- APP_DbObject.setDeadlockMode
- APP_DbObject.isDeadlockModeRetry
- APP_DbObject.enableMultiQueries
- APP_DbObject.sendMultiQueries
- APP_DbObject.escapeStringForDB
- APP_DbObject.getCollectionFromDB
- see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database
- APP_DbObject.getNonEmptyCollectionFromDB
- APP_DbObject.getDoubleKeyCollectionFromDB
- see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database
- APP_DbObject.getUniqueValueFromDB
- APP_DbObject.mysql_fetch_row
- APP_DbObject.mysql_fetch_assoc
- APP_DbObject.mysql_query
- APP_DbObject.getObjectFromDB
- see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database
- APP_DbObject.getNonEmptyObjectFromDB
- see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database
- APP_DbObject.getObjectListFromDB
- see https://en.doc.boardgamearena.com/Main_game_logic:_yourgamename.game.php#Accessing_the_database
- APP_DbObject.getSelectedDb static
- APP_DbObject.sqlParsing
- APP_DbObject.DbUsePrefix
- APP_DbObject.applyPrefix
- APP_DbObject.cache_store static
- APP_DbObject.cache_add static
- APP_DbObject.cache_exists static
- APP_DbObject.cache_fetch static
- APP_DbObject.cache_delete static
- APP_DbObject.cache_rollback static
- APP_DbObject.cache_commit static
- APP_DbObject.ensure_enough_time_since_last_action
- APP_DbObject.getMasterNodeDomain
- APP_DbObject.getMasterNodeUrl
- APP_DbObject.masterNodeRequest
- APP_DbObject.gameserverNodeRequest
- APP_DbObject.gameserverNodeRequestNoTable
- APP_DbObject.bgaCallUrl
Methods in the APP_Object class
- APP_Object.watch
- @deprecated, do not use (noop)
- APP_Object.debug
- see https://en.doc.boardgamearena.com/Practical_debugging
- APP_Object.trace
- see https://en.doc.boardgamearena.com/Practical_debugging
- APP_Object.warn
- see https://en.doc.boardgamearena.com/Practical_debugging
- APP_Object.error
- see https://en.doc.boardgamearena.com/Practical_debugging
- APP_Object.dump
- see https://en.doc.boardgamearena.com/Practical_debugging
Selected static methods in utility modules
- bga_rand
- recommended for randomness (dice rolls, etc), see Main game logic: yourgamename.game.php#About random and randomness
- shuffle_with_keys
- shuffle array with keys (basically shuffle keys and keep linked values), it shuffle argument, does not return anything
- totranslate
- returns its argument, used for MARKING of string for server strings https://en.doc.boardgamearena.com/Translations
- clienttranslate
- returns its argument, used for MARKING of string for client strings https://en.doc.boardgamearena.com/Translations
- _
- this is not the same as self::_, it is also translation function but only can translate mainsite strings, do not use in game code