B:BD[
3.1093769] → [
3.1093770:1097493]
B:BD[
3.1097493] → [
2.1191:1372]
∅:D[
2.1372] → [
3.1097684:1097695]
B:BD[
3.1097684] → [
3.1097684:1097695]
B:BD[
3.1097695] → [
2.1373:1425]
∅:D[
2.1425] → [
3.1097749:1098280]
B:BD[
3.1097749] → [
3.1097749:1098280]
B:BD[
3.1098280] → [
2.1426:1463]
∅:D[
2.1463] → [
3.1098400:1098402]
B:BD[
3.1098400] → [
3.1098400:1098402]
B:BD[
3.1098512] → [
3.1098512:1099498]
B:BD[
3.1099498] → [
2.1464:1566]
∅:D[
2.1566] → [
3.1099498:1099563]
B:BD[
3.1099498] → [
3.1099498:1099563]
B:BD[
3.1099563] → [
2.1567:1658]
∅:D[
2.1658] → [
3.1099664:1099702]
B:BD[
3.1099664] → [
3.1099664:1099702]
B:BD[
3.1099702] → [
2.1659:1752]
∅:D[
2.1752] → [
3.1099797:1100850]
B:BD[
3.1099797] → [
3.1099797:1100850]
B:BD[
3.1100850] → [
2.1753:1840]
∅:D[
2.1840] → [
3.1100850:1100852]
B:BD[
3.1100850] → [
3.1100850:1100852]
B:BD[
3.1100852] → [
2.1841:2252]
∅:D[
2.2252] → [
3.1100852:1102038]
B:BD[
3.1100852] → [
3.1100852:1102038]
B:BD[
3.1102038] → [
2.2253:2504]
∅:D[
2.2504] → [
3.1102038:1102074]
B:BD[
3.1102038] → [
3.1102038:1102074]
B:BD[
3.1102074] → [
2.2505:2555]
∅:D[
2.2555] → [
3.1102109:1102181]
B:BD[
3.1102109] → [
3.1102109:1102181]
B:BD[
3.1102181] → [
2.2556:3224]
∅:D[
2.3224] → [
3.1102284:1102362]
B:BD[
3.1102284] → [
3.1102284:1102362]
B:BD[
3.1102362] → [
2.3225:3889]
∅:D[
2.3889] → [
3.1102965:1104687]
B:BD[
3.1102965] → [
3.1102965:1104687]
B:BD[
3.1104687] → [
2.3890:3964]
∅:D[
2.3964] → [
3.1104711:1104713]
B:BD[
3.1104711] → [
3.1104711:1104713]
B:BD[
3.1104713] → [
2.3965:3967]
∅:D[
2.3967] → [
3.1104713:1107547]
B:BD[
3.1104713] → [
3.1104713:1107547]
<?php
/**
*------
* BGA framework: © Gregory Isabelli <gisabelli@boardgamearena.com> & Emmanuel Colin <ecolin@boardgamearena.com>
* fabiantest implementation : © <Your name here> <Your email address here>
*
* This code has been produced on the BGA studio platform for use on http://boardgamearena.com.
* See http://en.boardgamearena.com/#!doc/Studio for more information.
* -----
*
* fabiantest.game.php
*
* This is the main file for your game logic.
*
* In this PHP file, you are going to defines the rules of the game.
*
*/
require_once( APP_GAMEMODULE_PATH.'module/table/table.game.php' );
class fabiantest extends Table
{
function __construct( )
{
// Your global variables labels:
// Here, you can assign labels to global variables you are using for this game.
// You can use any number of global variables with IDs between 10 and 99.
// If your game has options (variants), you also have to associate here a label to
// the corresponding ID in gameoptions.inc.php.
// Note: afterwards, you can get/set the global variables with getGameStateValue/setGameStateInitialValue/setGameStateValue
parent::__construct();
self::initGameStateLabels( array(
// P.I. is played over 3 "mini games". Here we store in which of these games we are. Valid values: 1, 2, 3
"minigame" => 10,
// "my_second_global_variable" => 11,
// "my_first_game_variant" => 100,
// "my_second_game_variant" => 101,
) );
$this->cards = self::getNew("module.common.deck");
$this->cards->init("card");
}
protected function getGameName( )
{
// Used for translations and stuff. Please do not modify.
return "fabiantest";
}
/*
setupNewGame:
This method is called only once, when a new game is launched.
In this method, you must setup the game according to the game rules, so that
the game is ready to be played.
*/
protected function setupNewGame( $players, $options = array() )
{
// Set the colors of the players with HTML color code
// The default below is red/green/blue/orange/brown
// The number of colors defined here must correspond to the maximum number of players allowed for the gams
$gameinfos = self::getGameinfos();
$default_colors = $gameinfos['player_colors'];
// Create players
// Note: if you added some extra field on "player" table in the database (dbmodel.sql), you can initialize it there.
$sql = "INSERT INTO player (player_id, player_color, player_canal, player_name, player_avatar) VALUES ";
$values = array();
foreach( $players as $player_id => $player )
{
$color = array_shift( $default_colors );
$values[] = "('".$player_id."','$color','".$player['player_canal']."','".addslashes( $player['player_name'] )."','".addslashes( $player['player_avatar'] )."')";
}
$sql .= implode( $values, ',' );
self::DbQuery( $sql );
self::reattributeColorsBasedOnPreferences( $players, $gameinfos['player_colors'] );
self::reloadPlayersBasicInfos();
/************ Start the game initialization *****/
// First create all the cards we have.
// - 36 Evidence cards
// - 12 Suspects
// - 10 Crimes
// - 14 Locations
// TODO: do we need all the cards as actual assets? Could
// be simple string-based information for the user.
// Create Evidence cards
$cards = array();
foreach ( $this->evidence_cards as $card_id => $card) {
$cards[] = array('type' => 'evidence', 'type_arg' => $card_id, 'nbr' => 1);
}
$this->cards->createCards($cards, 'deck');
// Init game statistics
// (note: statistics used in this file must be defined in your stats.inc.php file)
//self::initStat( 'table', 'table_teststat1', 0 ); // Init a table statistics
//self::initStat( 'player', 'player_teststat1', 0 ); // Init a player statistics (for all players)
// TODO: setup the initial game situation here
// We start with minigame number 1. There will be 3 minigames in total.
self::setGameStateInitialValue( 'minigame', 1 );
$this->startNewMinigame(1);
/************ End of the game initialization *****/
}
/*
getAllDatas:
Gather all informations about current game situation (visible by the current player).
The method is called each time the game interface is displayed to a player, ie:
_ when the game starts
_ when a player refreshes the game page (F5)
*/
protected function getAllDatas()
{
$result = array();
$current_player_id = self::getCurrentPlayerId(); // !! We must only return informations visible by this player !!
// Get information about players
// Note: you can retrieve some extra field you added for "player" table in "dbmodel.sql" if you need it.
$sql = "SELECT player_id id, player_score score FROM player ";
$result['players'] = self::getCollectionFromDb( $sql );
// Gather all information about current game situation (visible by player $current_player_id).
// Global / static information
$result['evidence_cards'] = $this->evidence_cards;
// Cards in player hand (the other player's case cards)
$result['hand'] = $this->cards->getCardsInLocation('hand', $current_player_id);
// Evidence cards on display
$result['evidence_display'] = $this->cards->getCardsInLocation('evidence_display');
return $result;
}
/*
getGameProgression:
Compute and return the current game progression.
The number returned must be an integer beween 0 (=the game just started) and
100 (= the game is finished or almost finished).
This method is called each time we are in a game state with the "updateGameProgression" property set to true
(see states.inc.php)
*/
function getGameProgression()
{
// TODO: compute and return the game progression
// The base percentage is based on the minigame we are in: 1=0%; 2=33%;
// 3=66%. For the in-minigame percentage we average over each user's
// progress (how many clues have they figured out yet, again:
// 0/33/66/100%).
return 0;
}
//////////////////////////////////////////////////////////////////////////////
//////////// Utility functions
////////////
/*
In this space, you can put any utility methods useful for your game logic
*/
function startNewMinigame($n) {
self::setGameStateValue('minigame', $n);
// Reset evidence cards
$this->cards->moveAllCardsInLocation(null, "deck");
$this->cards->shuffle('deck');
$this->cards->pickCardsForLocation($this->constants['EVIDENCE_DISPLAY_SIZE'], 'deck', 'evidence_display');
// TODO
// Select a new first player. In minigame 1 it's player_no 1, minigame 2 player_no 2 etc.
$this->activeNextPlayer();
}
//////////////////////////////////////////////////////////////////////////////
//////////// Player actions
////////////
/*
Each time a player is doing some game action, one of the methods below is called.
(note: each method below must match an input method in fabiantest.action.php)
*/
/*
Example:
function playCard( $card_id )
{
// Check that this is the player's turn and that it is a "possible action" at this game state (see states.inc.php)
self::checkAction( 'playCard' );
$player_id = self::getActivePlayerId();
// Add your game logic to play a card there
...
// Notify all players about the card played
self::notifyAllPlayers( "cardPlayed", clienttranslate( '${player_name} plays ${card_name}' ), array(
'player_id' => $player_id,
'player_name' => self::getActivePlayerName(),
'card_name' => $card_name,
'card_id' => $card_id
) );
}
*/
function selectEvidence($card_id) {
self::checkAction("selectEvidence");
$player_id = self::getActivePlayerId();
$currentCard = $this->cards->getCard($card_id);
if ($currentCard['location'] != "evidence_display") {
throw new BgaUserException(self::_("Card is not on display") . ": $card_id" . $currentCard['location']);
}
// TODO: implement rules
$evidenceIsUseful = boolval(rand(0, 1));
if ($evidenceIsUseful) {
// Put card on discard
$this->cards->insertCardOnExtremePosition($card_id, "discard", true);
self::notifyAllPlayers(
'evidenceSelected',
clienttranslate('${player_name} found a useful evidence: ${card_name}'), array (
'i18n' => array ('card_name'),
'card_id' => $card_id,
'useful' => true,
'player_id' => $player_id,
'player_name' => self::getActivePlayerName(),
'value' => $currentCard['type_arg'],
'card_name' => $currentCard['type_arg'],
));
} else {
// Put card in front of user to remember the "useless evidence".
$this->cards->moveCard($card_id, "player_display", $player_id);
self::notifyAllPlayers(
'evidenceSelected',
clienttranslate('${player_name} had no luck following evidence ${card_name}'), array (
'i18n' => array ('card_name'),
'useful' => false,
'card_id' => $card_id,
'player_id' => $player_id,
'player_name' => self::getActivePlayerName(),
'value' => $currentCard['type_arg'],
'card_name' => $currentCard['type_arg'],
));
}
// Next player
$this->gamestate->nextState('selectEvidence');
}
//////////////////////////////////////////////////////////////////////////////
//////////// Game state arguments
////////////
/*
Here, you can create methods defined as "game state arguments" (see "args" property in states.inc.php).
These methods function is to return some additional information that is specific to the current
game state.
*/
function argGiveCards() {
return array ();
}
/*
Example for game state "MyGameState":
function argMyGameState()
{
// Get some values from the current game situation in database...
// return values:
return array(
'variable1' => $value1,
'variable2' => $value2,
...
);
}
*/
//////////////////////////////////////////////////////////////////////////////
//////////// Game state actions
////////////
/*
Here, you can create methods defined as "game state actions" (see "action" property in states.inc.php).
The action method of state X is called everytime the current game state is set to X.
*/
function stNextPlayer() {
// Standard case (not the end of the trick)
// Draw a new card
$this->cards->pickCardForLocation("deck", "evidence_display");
$newCard = $this->cards->getCardOnTop("evidence_display");
self::notifyAllPlayers(
'newEvidence',
clienttranslate('New evidence…'), array (
'i18n' => array ('card_name'),
'card_id' => $newCard['id'],
));
// Case: Player solved
// Notify: {Player} solved ...
$player_id = self::activeNextPlayer();
self::giveExtraTime($player_id);
$this->gamestate->nextState('nextPlayer');
}
/*
Example for game state "MyGameState":
function stMyGameState()
{
// Do some stuff ...
// (very often) go to another gamestate
$this->gamestate->nextState( 'some_gamestate_transition' );
}
*/
//////////////////////////////////////////////////////////////////////////////
//////////// Zombie
////////////
/*
zombieTurn:
This method is called each time it is the turn of a player who has quit the game (= "zombie" player).
You can do whatever you want in order to make sure the turn of this player ends appropriately
(ex: pass).
*/
function zombieTurn( $state, $active_player )
{
$statename = $state['name'];
if ($state['type'] === "activeplayer") {
switch ($statename) {
default:
$this->gamestate->nextState( "zombiePass" );
break;
}
return;
}
if ($state['type'] === "multipleactiveplayer") {
// Make sure player is in a non blocking status for role turn
$this->gamestate->setPlayerNonMultiactive( $active_player, '' );
return;
}
throw new feException( "Zombie mode not supported at this game state: ".$statename );
}
///////////////////////////////////////////////////////////////////////////////////:
////////// DB upgrade
//////////
/*
upgradeTableDb:
You don't have to care about this until your game has been published on BGA.
Once your game is on BGA, this method is called everytime the system detects a game running with your old
Database scheme.
In this case, if you change your Database scheme, you just have to apply the needed changes in order to
update the game database and allow the game to continue to run with your new version.
*/
function upgradeTableDb( $from_version )
{
// $from_version is the current version of this game database, in numerical form.
// For example, if the game was running with a release of your game named "140430-1345",
// $from_version is equal to 1404301345
// Example:
// if( $from_version <= 1404301345 )
// {
// $sql = "ALTER TABLE xxxxxxx ....";
// self::DbQuery( $sql );
// }
// if( $from_version <= 1405061421 )
// {
// $sql = "CREATE TABLE xxxxxxx ....";
// self::DbQuery( $sql );
// }
// // Please add your future database scheme changes here
//
//
}
}
<?php
/**
*------
* BGA framework: © Gregory Isabelli <gisabelli@boardgamearena.com> & Emmanuel Colin <ecolin@boardgamearena.com>
* fabiantest implementation : © Fabian Neumann <fabian.neumann@posteo.de>
*
* This code has been produced on the BGA studio platform for use on http://boardgamearena.com.
* See http://en.boardgamearena.com/#!doc/Studio for more information.
* -----
*
* fabiantest.game.php
*
* This is the main file for your game logic.
*
* In this PHP file, you are going to defines the rules of the game.
*
*/
require_once( APP_GAMEMODULE_PATH.'module/table/table.game.php' );
class fabiantest extends Table
{
function __construct( )
{
// Your global variables labels:
// Here, you can assign labels to global variables you are using for this game.
// You can use any number of global variables with IDs between 10 and 99.
// If your game has options (variants), you also have to associate here a label to
// the corresponding ID in gameoptions.inc.php.
// Note: afterwards, you can get/set the global variables with getGameStateValue/setGameStateInitialValue/setGameStateValue
parent::__construct();
self::initGameStateLabels( array(
// P.I. is played over 3 "mini games". Here we store in which of these games we are. Valid values: 1, 2, 3
"minigame" => 10,
// "my_second_global_variable" => 11,
// "my_first_game_variant" => 100,
// "my_second_game_variant" => 101,
) );
$this->cards = self::getNew("module.common.deck");
$this->cards->init("card");
}
protected function getGameName( )
{
// Used for translations and stuff. Please do not modify.
return "fabiantest";
}
/*
setupNewGame:
This method is called only once, when a new game is launched.
In this method, you must setup the game according to the game rules, so that
the game is ready to be played.
*/
protected function setupNewGame( $players, $options = array() )
{
// Set the colors of the players with HTML color code
// The default below is red/green/blue/orange/brown
// The number of colors defined here must correspond to the maximum number of players allowed for the gams
$gameinfos = self::getGameinfos();
$default_colors = $gameinfos['player_colors'];
// Create players
// Note: if you added some extra field on "player" table in the database (dbmodel.sql), you can initialize it there.
$sql = "INSERT INTO player (player_id, player_color, player_canal, player_name, player_avatar) VALUES ";
$values = array();
foreach( $players as $player_id => $player )
{
$color = array_shift( $default_colors );
$values[] = "('".$player_id."','$color','".$player['player_canal']."','".addslashes( $player['player_name'] )."','".addslashes( $player['player_avatar'] )."')";
}
$sql .= implode( $values, ',' );
self::DbQuery( $sql );
self::reattributeColorsBasedOnPreferences( $players, $gameinfos['player_colors'] );
self::reloadPlayersBasicInfos();
/************ Start the game initialization *****/
// First create all the cards we have.
// - 36 Evidence cards
// - 12 Suspects
// - 10 Crimes
// - 14 Locations
// TODO: do we need all the cards as actual assets? Could
// be simple string-based information for the user.
// Create Evidence cards
$cards = array();
foreach ( $this->evidence_cards as $card_id => $card) {
$cards[] = array('type' => 'evidence', 'type_arg' => $card_id, 'nbr' => 1);
}
$this->cards->createCards($cards, 'deck');
// Init game statistics
// (note: statistics used in this file must be defined in your stats.inc.php file)
//self::initStat( 'table', 'table_teststat1', 0 ); // Init a table statistics
//self::initStat( 'player', 'player_teststat1', 0 ); // Init a player statistics (for all players)
// TODO: setup the initial game situation here
// We start with minigame number 1. There will be 3 minigames in total.
self::setGameStateInitialValue( 'minigame', 1 );
$this->startNewMinigame(1);
/************ End of the game initialization *****/
}
/*
getAllDatas:
Gather all informations about current game situation (visible by the current player).
The method is called each time the game interface is displayed to a player, ie:
_ when the game starts
_ when a player refreshes the game page (F5)
*/
protected function getAllDatas()
{
$result = array();
$current_player_id = self::getCurrentPlayerId(); // !! We must only return informations visible by this player !!
// Get information about players
// Note: you can retrieve some extra field you added for "player" table in "dbmodel.sql" if you need it.
$sql = "SELECT player_id id, player_score score FROM player ";
$result['players'] = self::getCollectionFromDb( $sql );
// Gather all information about current game situation (visible by player $current_player_id).
// Global / static information
$result['evidence_cards'] = $this->evidence_cards;
// Cards in player hand (the other player's case cards)
$result['hand'] = $this->cards->getCardsInLocation('hand', $current_player_id);
// Evidence cards on display
$result['evidence_display'] = $this->cards->getCardsInLocation('evidence_display');
$result['evidence_discard'] = $this->cards->getCardsInLocation('discard');
return $result;
}
/*
getGameProgression:
Compute and return the current game progression.
The number returned must be an integer beween 0 (=the game just started) and
100 (= the game is finished or almost finished).
This method is called each time we are in a game state with the "updateGameProgression" property set to true
(see states.inc.php)
*/
function getGameProgression()
{
// TODO: compute and return the game progression
// The base percentage is based on the minigame we are in: 1=0%; 2=33%;
// 3=66%. For the in-minigame percentage we average over each user's
// progress (how many clues have they figured out yet, again:
// 0/33/66/100%).
return 0;
}
//////////////////////////////////////////////////////////////////////////////
//////////// Utility functions
////////////
/*
In this space, you can put any utility methods useful for your game logic
*/
function startNewMinigame($n) {
self::setGameStateValue('minigame', $n);
// Reset evidence cards
$this->cards->moveAllCardsInLocation(null, "deck");
$this->cards->shuffle('deck');
$this->cards->pickCardsForLocation($this->constants['EVIDENCE_DISPLAY_SIZE'], 'deck', 'evidence_display');
// TODO
// Select a new first player. In minigame 1 it's player_no 1, minigame 2 player_no 2 etc.
$this->activeNextPlayer();
}
//////////////////////////////////////////////////////////////////////////////
//////////// Player actions
////////////
/*
Each time a player is doing some game action, one of the methods below is called.
(note: each method below must match an input method in fabiantest.action.php)
*/
/*
Example:
function playCard( $card_id )
{
// Check that this is the player's turn and that it is a "possible action" at this game state (see states.inc.php)
self::checkAction( 'playCard' );
$player_id = self::getActivePlayerId();
// Add your game logic to play a card there
...
// Notify all players about the card played
self::notifyAllPlayers( "cardPlayed", clienttranslate( '${player_name} plays ${card_name}' ), array(
'player_id' => $player_id,
'player_name' => self::getActivePlayerName(),
'card_name' => $card_name,
'card_id' => $card_id
) );
}
*/
function selectEvidence($card_id) {
self::checkAction("selectEvidence");
$player_id = self::getActivePlayerId();
$currentCard = $this->cards->getCard($card_id);
if ($currentCard['location'] != "evidence_display") {
throw new BgaUserException(self::_("Card is not on display") . ": $card_id" . $currentCard['location']);
}
// TODO: implement rules
$evidenceIsUseful = boolval(rand(0, 1));
if ($evidenceIsUseful) {
// Put card on discard
$this->cards->insertCardOnExtremePosition($card_id, "discard", true);
self::notifyAllPlayers(
'evidenceSelected',
clienttranslate('${player_name} found a useful evidence: ${card_name}'), array (
'i18n' => array ('card_name'),
'card_id' => $card_id,
'card_name' => $this->evidence_cards[$currentCard['type_arg']]['name'],
'card_type' => $currentCard['type_arg'],
'useful' => true,
'player_id' => $player_id,
'player_name' => self::getActivePlayerName(),
));
} else {
// Put card in front of user to remember the "useless evidence".
$this->cards->moveCard($card_id, "player_display", $player_id);
self::notifyAllPlayers(
'evidenceSelected',
clienttranslate('${player_name} had no luck following evidence ${card_name}'), array (
'i18n' => array ('card_name'),
'useful' => false,
'card_id' => $card_id,
'card_name' => $this->evidence_cards[$currentCard['type_arg']]['name'],
'card_type' => $currentCard['type_arg'],
'player_id' => $player_id,
'player_name' => self::getActivePlayerName(),
));
}
// Next player
$this->gamestate->nextState('selectEvidence');
}
//////////////////////////////////////////////////////////////////////////////
//////////// Game state arguments
////////////
/*
Here, you can create methods defined as "game state arguments" (see "args" property in states.inc.php).
These methods function is to return some additional information that is specific to the current
game state.
*/
function argGiveCards() {
return array ();
}
/*
Example for game state "MyGameState":
function argMyGameState()
{
// Get some values from the current game situation in database...
// return values:
return array(
'variable1' => $value1,
'variable2' => $value2,
...
);
}
*/
//////////////////////////////////////////////////////////////////////////////
//////////// Game state actions
////////////
/*
Here, you can create methods defined as "game state actions" (see "action" property in states.inc.php).
The action method of state X is called everytime the current game state is set to X.
*/
function stNextPlayer() {
// Standard case
// Draw a new card for evidence display
// While auto-reshuffle is still a mystery to me, check here manually.
if ($this->cards->countCardInLocation('deck') == 0
&& $this->cards->countCardInLocation('discard') > 0) {
$this->cards->moveAllCardsInLocation('discard', 'deck');
$this->cards->shuffle('deck');
}
if ($this->cards->countCardInLocation('deck') > 0) {
$newCard = $this->cards->pickCardForLocation("deck", "evidence_display");
self::notifyAllPlayers(
'newEvidence', '',
array(
'card_id' => $newCard['id'],
'card_type' => $newCard['type_arg'],
'discard_is_empty' => $this->cards->countCardInLocation('discard') == 0,
));
} else {
self::notifyAllPlayers(
'newEvidence', 'Deck and discard pile are exhausted.',
array(
'deck_is_empty' => $this->cards->countCardInLocation('discard') == 0,
'discard_is_empty' => $this->cards->countCardInLocation('discard') == 0,
));
}
// TODO: what happens, where there is now new card anymore? Neither in
// deck nor in discard? Next player is forced to do something else then.
// But this is implicit: no more cards, no more clicks on them. Solving
// is always the last ressort.
// Case: Player solved
// Notify: {Player} solved ...
$player_id = self::activeNextPlayer();
self::giveExtraTime($player_id);
$this->gamestate->nextState('nextPlayer');
}
/*
Example for game state "MyGameState":
function stMyGameState()
{
// Do some stuff ...
// (very often) go to another gamestate
$this->gamestate->nextState( 'some_gamestate_transition' );
}
*/
//////////////////////////////////////////////////////////////////////////////
//////////// Zombie
////////////
/*
zombieTurn:
This method is called each time it is the turn of a player who has quit the game (= "zombie" player).
You can do whatever you want in order to make sure the turn of this player ends appropriately
(ex: pass).
*/
function zombieTurn( $state, $active_player )
{
$statename = $state['name'];
if ($state['type'] === "activeplayer") {
switch ($statename) {
default:
$this->gamestate->nextState( "zombiePass" );
break;
}
return;
}
if ($state['type'] === "multipleactiveplayer") {
// Make sure player is in a non blocking status for role turn
$this->gamestate->setPlayerNonMultiactive( $active_player, '' );
return;
}
throw new feException( "Zombie mode not supported at this game state: ".$statename );
}
///////////////////////////////////////////////////////////////////////////////////:
////////// DB upgrade
//////////
/*
upgradeTableDb:
You don't have to care about this until your game has been published on BGA.
Once your game is on BGA, this method is called everytime the system detects a game running with your old
Database scheme.
In this case, if you change your Database scheme, you just have to apply the needed changes in order to
update the game database and allow the game to continue to run with your new version.
*/
function upgradeTableDb( $from_version )
{
// $from_version is the current version of this game database, in numerical form.
// For example, if the game was running with a release of your game named "140430-1345",
// $from_version is equal to 1404301345
// Example:
// if( $from_version <= 1404301345 )
// {
// $sql = "ALTER TABLE xxxxxxx ....";
// self::DbQuery( $sql );
// }
// if( $from_version <= 1405061421 )
// {
// $sql = "CREATE TABLE xxxxxxx ....";
// self::DbQuery( $sql );
// }
// // Please add your future database scheme changes here
//
//
}
}