<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="tr">
	<id>https://tr.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sourisdudesert</id>
	<title>Board Game Arena - Kullanıcı katkıları [tr]</title>
	<link rel="self" type="application/atom+xml" href="https://tr.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sourisdudesert"/>
	<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/%C3%96zel:Katk%C4%B1lar/Sourisdudesert"/>
	<updated>2026-10-13T05:31:17Z</updated>
	<subtitle>Kullanıcı katkıları</subtitle>
	<generator>MediaWiki 1.39.0</generator>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Contact_us&amp;diff=3453</id>
		<title>Contact us</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Contact_us&amp;diff=3453"/>
		<updated>2025-06-30T16:00:01Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;border:3px solid red; background-color: #FF6666; color: white; font-weight:normal; padding: 1em;&amp;quot;&amp;gt;&lt;br /&gt;
This content is deprecated. Please refer to the up to date &amp;quot;Frequently Asked Questions&amp;quot; page at this address: https://boardgamearena.com/#!faq&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Game Arena&#039;&#039;&#039; is located in France.&lt;br /&gt;
&lt;br /&gt;
== Contact e-mail ==&lt;br /&gt;
&lt;br /&gt;
contact(at)boardgamearena.com&lt;br /&gt;
&lt;br /&gt;
We receive &#039;&#039;&#039;a lot&#039;&#039;&#039; of e-mails. Please do not send us an e-mail in any of these two cases:&lt;br /&gt;
&lt;br /&gt;
* If you want to report a bug, please do it in the [http://boardgamearena.com/#!bugs bug reporting system]&lt;br /&gt;
* If you want to report a player for violation of BGA policy, use the &amp;quot;report this player&amp;quot; button on his/her profile.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Game_interface_logic:_yourgamename.js&amp;diff=3386</id>
		<title>Game interface logic: yourgamename.js</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Game_interface_logic:_yourgamename.js&amp;diff=3386"/>
		<updated>2019-03-08T13:44:00Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* General tips */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the main file for your game interface. Here you will define:&lt;br /&gt;
&lt;br /&gt;
* Which actions on the page will generate calls to the server.&lt;br /&gt;
* What happens when you get a notification for a change from the server and how it will show in the browser. &lt;br /&gt;
&lt;br /&gt;
== File structure ==&lt;br /&gt;
&lt;br /&gt;
The details of how the file is structured are described below with comments on the code skeleton provided to you.&lt;br /&gt;
&lt;br /&gt;
Here is the basic structure:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;constructor&#039;&#039;&#039;: here you can define global variables for your whole interface.&lt;br /&gt;
* &#039;&#039;&#039;setup&#039;&#039;&#039;: this method is called when the page is refreshed, and sets up the game interface.&lt;br /&gt;
* &#039;&#039;&#039;onEnteringState&#039;&#039;&#039;: this method is called when entering a new game state. You can use it to customize the view for each game state.&lt;br /&gt;
* &#039;&#039;&#039;onLeavingState&#039;&#039;&#039;: this method is called when leaving a game state.&lt;br /&gt;
* &#039;&#039;&#039;onUpdateActionButtons&#039;&#039;&#039;: called when entering a new state, in order to add action buttons to the status bar.&lt;br /&gt;
* &#039;&#039;(utility methods)&#039;&#039;: this is where you can define your utility methods.&lt;br /&gt;
* &#039;&#039;(player&#039;s actions)&#039;&#039;: this is where you can write your handlers for player actions on the interface (example: click on an item).&lt;br /&gt;
* &#039;&#039;&#039;setupNotifications&#039;&#039;&#039;: this method associates notifications with notification handlers. For each game notification, you can trigger a javascript method to handle it and update the game interface.&lt;br /&gt;
* &#039;&#039;(notification handlers)&#039;&#039;: this is where you define the notifications handlers associated with notifications in &#039;&#039;&#039;setupNotifications&#039;&#039;&#039;, above.&lt;br /&gt;
&lt;br /&gt;
== General tips ==&lt;br /&gt;
&lt;br /&gt;
; this.player_id&lt;br /&gt;
: ID of the player on whose browser the code is running.&lt;br /&gt;
&lt;br /&gt;
; this.isSpectator&lt;br /&gt;
: Flag set to true if the user at the table is a spectator (not a player).&lt;br /&gt;
: Note: This is a variable, not a function.&lt;br /&gt;
: Note: If you want to hide an element from spectators, you should use [[Game_interface_stylesheet:_yourgamename.css#spectatorMode|CSS &#039;spectatorMode&#039; class]].&lt;br /&gt;
&lt;br /&gt;
; this.gamedatas&lt;br /&gt;
: Contains the initial set of data to init the game, created at game start or by game refresh (F5).&lt;br /&gt;
: You can update it as needed to keep an up-to-date reference of the game on the client side if you need it. (Most of the time this is unnecessary).&lt;br /&gt;
&lt;br /&gt;
; this.isCurrentPlayerActive()&lt;br /&gt;
: Returns true if the player on whose browser the code is running is currently active (it&#039;s his turn to play).&lt;br /&gt;
&lt;br /&gt;
; this.getActivePlayerId()&lt;br /&gt;
: Return the ID of the active player, or null if we are not in an &amp;quot;activeplayer&amp;quot; type state.&lt;br /&gt;
&lt;br /&gt;
; this.getActivePlayers()&lt;br /&gt;
: Return an array with the IDs of players who are currently active (or an empty array if there are none).&lt;br /&gt;
&lt;br /&gt;
; this.bRealtime&lt;br /&gt;
: Return true if the game is in realtime. Note that having a distinct behavior in realtime and turn-based should be exceptional.&lt;br /&gt;
&lt;br /&gt;
== Dojo framework ==&lt;br /&gt;
&lt;br /&gt;
BGA uses the [http://dojotoolkit.org/ Dojo Javascript framework].&lt;br /&gt;
&lt;br /&gt;
The Dojo framework allows us to do complex things more easily. The BGA framework uses Dojo extensively.&lt;br /&gt;
&lt;br /&gt;
To implement a game, you only need to use a few parts of the Dojo framework. All the Dojo methods you need are described on this page.&lt;br /&gt;
&lt;br /&gt;
== Shrinksafe minimization ==&lt;br /&gt;
&lt;br /&gt;
For performance reasons, when deploying a game the js code is minimized using Shrinksafe (based on ECMASCRIPT version 3). Some advanced syntax may not be compatible with this process. In particular:&lt;br /&gt;
* You should not use reserved keywords from the javascript language as variables.&lt;br /&gt;
* You should not declare default argument values in function declarations. The following syntax is invalid for Shrinksafe: &#039;&#039;&#039;function myFunc(requiredArg, optionalArg = &#039;defaultValue&#039;) {}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Accessing and manipulating the DOM ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$(&#039;some_html_element_id&#039;)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The $() function is used to get an HTML element using its &amp;quot;id&amp;quot; attribute.&lt;br /&gt;
&lt;br /&gt;
Example 1: modify the content of a &amp;quot;span&amp;quot; element:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
In your HTML code:&lt;br /&gt;
   &amp;lt;span id=&amp;quot;a_value_in_the_game_interface&amp;quot;&amp;gt;1234&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your Javascript code:&lt;br /&gt;
   $(&#039;a_value_in_the_game_interface&#039;).innerHTML = &amp;quot;9999&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: $() is the standard method to access some HTML element with the BGA Framework. You should not use the &#039;&#039;&#039;getElementById&#039;&#039;&#039; function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.style&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.style you can modify the CSS property of any HTML element in your interface.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Make an element disappear&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;display&#039;, &#039;none&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Give an element a 2px border&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;borderWidth&#039;, &#039;2px&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Change the background position of an element&lt;br /&gt;
     // (very practical when you are using CSS sprites to transform an element to another)&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;backgroundPosition&#039;, &#039;-20px -50px&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: you must always use dojo.style to modify the CSS properties of HTML elements.&lt;br /&gt;
&lt;br /&gt;
Note²: if you have to modify several CSS properties of an element, or if you have a complex CSS transformation to do, you should consider using dojo.addClass/dojo.removeClass (see below).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo CSS classes manipulation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In many situations, many small CSS property updates can be replaced by a CSS class change (i.e., you add a CSS class to your element instead of applying all modifications manually).&lt;br /&gt;
&lt;br /&gt;
Advantages are:&lt;br /&gt;
* All your CSS stuff remains in your CSS file.&lt;br /&gt;
* You can add/remove a list of CSS modifications with a simple function and without error.&lt;br /&gt;
* You can test whether you applied the CSS to an element with the &#039;&#039;&#039;dojo.hasClass&#039;&#039;&#039; method.&lt;br /&gt;
&lt;br /&gt;
Example from &#039;&#039;Reversi&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // We add &amp;quot;possibleMove&amp;quot; to an element&lt;br /&gt;
    dojo.addClass( &#039;square_&#039;+x+&#039;_&#039;+y, &#039;possibleMove&#039; );&lt;br /&gt;
&lt;br /&gt;
    // In our CSS file, the class is defined as:&lt;br /&gt;
    .possibleMove {&lt;br /&gt;
      background-color: white;&lt;br /&gt;
      opacity: 0.2;&lt;br /&gt;
      filter:alpha(opacity=20); /* For IE8 and earlier */  &lt;br /&gt;
      cursor: pointer;  &lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     // So we&#039;ve applied 4 CSS property changes in one line of code.&lt;br /&gt;
&lt;br /&gt;
     // ... and when we need to check if a square is a possible move on the client side:&lt;br /&gt;
     if( dojo.hasClass( &#039;square_&#039;+x+&#039;_&#039;+y, &#039;possibleMove&#039; ) )&lt;br /&gt;
     { ... }&lt;br /&gt;
&lt;br /&gt;
     // ... and if we want to remove all possible moves in one line of code (see &amp;quot;dojo.query&amp;quot; method):&lt;br /&gt;
     dojo.query( &#039;.possibleMove&#039; ).removeClass( &#039;possibleMove&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conclusion: We encourage you to use &#039;&#039;&#039;dojo.addClass&#039;&#039;&#039;, &#039;&#039;&#039;dojo.removeClass&#039;&#039;&#039; and &#039;&#039;&#039;dojo.hasClass&#039;&#039;&#039; to make your life easier :)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.query&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.query, you can query a bunch of HTML elements with a single function, with a &amp;quot;CSS selector&amp;quot; style.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // All elements with class &amp;quot;possibleMove&amp;quot;:&lt;br /&gt;
     var elements = dojo.query( &#039;.possibleMove&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Count number of tokens (i.e., elements of class &amp;quot;token&amp;quot;) on the board (i.e., the element with id &amp;quot;board&amp;quot;):&lt;br /&gt;
     dojo.query( &#039;#board .token&#039; ).length;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But what is really cool with dojo.query is that you can combine it with almost all methods above.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Trigger a method when the mouse enter in any element with class &amp;quot;meeple&amp;quot;:&lt;br /&gt;
     dojo.query( &#039;.meeple&#039; ).connect( &#039;onmouseenter&#039;, this, &#039;myMethodToTrigger&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Hide all meeples who are on the board&lt;br /&gt;
     dojo.query( &#039;#board .meeple&#039; ).style( &#039;display&#039;, &#039;none&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.place&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
dojo.place is the best function to insert HTML code somewhere in your game interface without breaking something. It is much better to use than the &#039;&#039;&#039;innerHTML=&#039;&#039;&#039; method if you must insert HTML tags and not only values.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Insert your HTML code as a child of a container element&lt;br /&gt;
     dojo.place( &amp;quot;&amp;lt;your html code&amp;gt;&amp;quot;, &amp;quot;your_container_element_id&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
     // Replace the container element with your new html&lt;br /&gt;
     dojo.place( &amp;quot;&amp;lt;your html code&amp;gt;&amp;quot;, &amp;quot;your_container_element_id&amp;quot;, &amp;quot;replace&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The third parameter of dojo.place can take various interesting value.&lt;br /&gt;
&lt;br /&gt;
values possibles :&lt;br /&gt;
&lt;br /&gt;
&amp;quot;replace&amp;quot; : (see description above).&lt;br /&gt;
&lt;br /&gt;
&amp;quot;first&amp;quot; : Places the node as a child of the reference node. The node is placed as the first child.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;last&amp;quot; : Places the node as a child of the reference node. The node is placed as the last child.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;before&amp;quot; : places the node right before the reference node.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;last (value by default) &amp;quot; : places the node right after the reference node.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;only&amp;quot; : replaces all children of the reference node with the node.&lt;br /&gt;
&lt;br /&gt;
positif integer : This parameter can be a positif integer. In this case, the node will be placed as a child of the reference node with this number (counting from 0). If the number is more than number of children, the node will be appended to the reference node making it the last child. &lt;br /&gt;
&lt;br /&gt;
See also full doc on dojo.place : [http://dojotoolkit.org/reference-guide/1.7/dojo/place.]&lt;br /&gt;
&lt;br /&gt;
Usually, when you want to insert some piece of HTML in your game interface, you should use &amp;quot;[[Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl#Javascript_templates|Javascript templates]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addStyleToClass: function( cssClassName, cssProperty, propertyValue )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as dojo.style(), but for all the nodes set with the specified cssClassName&lt;br /&gt;
&lt;br /&gt;
=== Animations ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dojo Animations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA animations is based on Dojo Animation ([http://dojotoolkit.org/documentation/tutorials/1.8/animation/ see tutorial here]).&lt;br /&gt;
&lt;br /&gt;
However, most of the time, you can just use methods below, which are built on top of Dojo Animation.&lt;br /&gt;
&lt;br /&gt;
Note: one interesting method from Dojo that could be useful from time to time is &amp;quot;Dojo.Animation&amp;quot;. It allows you to make any CSS property &amp;quot;slide&amp;quot; from one value to another.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObject( mobile_obj, target_obj, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use slideToObject to &amp;quot;slide&amp;quot; an element to a target position.&lt;br /&gt;
&lt;br /&gt;
Sliding element on the game area is the recommended and the most used way to animate your game interface. Using slides allow players to figure out what is happening on the game, as if they were playing with the real boardgame.&lt;br /&gt;
&lt;br /&gt;
The parameters are:&lt;br /&gt;
* mobile_obj: the ID of the object to move. This object must be &amp;quot;relative&amp;quot; or &amp;quot;absolute&amp;quot; positioned.&lt;br /&gt;
* target_obj: the ID of the target object. This object must be &amp;quot;relative&amp;quot; or &amp;quot;absolute&amp;quot; positioned. Note that it is not mandatory that mobile_obj and target_obj have the same size. If their size are different, the system slides the center of mobile_obj to the center of target_obj.&lt;br /&gt;
* duration: (optional) defines the duration in millisecond of the slide. The default is 500 milliseconds.&lt;br /&gt;
* delay: (optional). If you defines a delay, the slide will start only after this delay. This is particularly useful when you want to slide several object from the same position to the same position: you can give a 0ms delay to the first object, a 100ms delay to the second one, a 200ms delay to the third one, ... this way they won&#039;t be superposed during the slide.&lt;br /&gt;
&lt;br /&gt;
BE CAREFUL: The method returns an dojo.fx animation, so you can combine it with other animation if you want to. It means that you have to call the &amp;quot;play()&amp;quot; method, otherwise the animation WON&#039;T START.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.slideToObject( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot; ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObjectPos( mobile_obj, target_obj, target_x, target_y, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method does exactly the same as &amp;quot;slideToObject&amp;quot;, except than you can specify some (x,y) coordinates. This way, &amp;quot;mobile_obj&amp;quot; will slide to the specified x,y position relatively to &amp;quot;target_obj&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example: slide a token to some place on the board, 10 pixels to the bottom:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.slideToObjectPos( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot;, 0, 10 ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideTemporaryObject( mobile_obj_html, mobile_obj_parent, from, to, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is useful when you want to slide a temporary HTML object from one place to another. As this object does not exists before the animation and won&#039;t remain after, it could be complex to create this object (with dojo.place), to place it at its origin (with placeOnObject) to slide it (with slideToObject) and to make it disappear at the end.&lt;br /&gt;
&lt;br /&gt;
slideTemporaryObject does all of this for you:&lt;br /&gt;
* mobile_obj_html is a piece of HTML code that represent the object to slide.&lt;br /&gt;
* mobile_obj_parent is the ID of an HTML element of your interface that will be the parent of this temporary HTML object.&lt;br /&gt;
* from is the ID of the origin of the slide.&lt;br /&gt;
* to is the ID of the target of the slide.&lt;br /&gt;
* duration/delay works exactly like in &amp;quot;slideToObject&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.slideTemporaryObject( &#039;&amp;lt;div class=&amp;quot;token_icon&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&#039;, &#039;tokens&#039;, &#039;my_origin_div&#039;, &#039;my_target_div&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObjectAndDestroy: function( node, to, time, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is a handy shortcut to slide an existing HTML object to some place then destroy it upon arrival. It can be used for example to move a victory token or a card from the board to the player panel to show that the player earns it, then destroy it when we don&#039;t need to keep it visible on the player panel.&lt;br /&gt;
&lt;br /&gt;
It works the same as this.slideToObject and takes the same arguments. &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.slideToObjectAndDestroy( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot;, 1000, 0 );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.fadeOutAndDestroy( node, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function fade out the target HTML node, then destroy it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.fadeOutAndDestroy( &amp;quot;a_card_that_must_disappear&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CAREFUL: the HTML node still exists until during few milliseconds, until the fadeOut has been completed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rotating elements&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can check here [http://jimfulton.info/demos/dojo-animated-rotate.html an example of use] of Dojo to make an element rotate.&lt;br /&gt;
&lt;br /&gt;
This example combines &amp;quot;Dojo.Animation&amp;quot; method and a CSS3 property that allow you to rotate the element.&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: to asses browser compatibility, you must select the CSS property to use just like in the example (see sourcecode below):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        var transform;&lt;br /&gt;
        dojo.forEach(&lt;br /&gt;
            [&#039;transform&#039;, &#039;WebkitTransform&#039;, &#039;msTransform&#039;,&lt;br /&gt;
             &#039;MozTransform&#039;, &#039;OTransform&#039;],&lt;br /&gt;
            function (name) {&lt;br /&gt;
                if (typeof dojo.body().style[name] != &#039;undefined&#039;) {&lt;br /&gt;
                    transform = name;&lt;br /&gt;
                }&lt;br /&gt;
            });&lt;br /&gt;
        // ... and then use &amp;quot;transform&amp;quot; as the name of your CSS property for rotation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Moving elements ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.placeOnObject( mobile_obj, target_obj )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
placeOnObject works exactly like &amp;quot;slideToObject&amp;quot;, except that the effect is immediate.&lt;br /&gt;
&lt;br /&gt;
This is not really an animation, but placeOnObject is frequently used before starting an animation.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // (We just created an object &amp;quot;my_new_token&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  // Place the new token on current player board&lt;br /&gt;
  this.placeOnObject( &amp;quot;my_new_token&amp;quot;, &amp;quot;overall_player_board_&amp;quot;+this.player_id );&lt;br /&gt;
  &lt;br /&gt;
  // Then slide it to its position on the board&lt;br /&gt;
  this.slideToObject( &amp;quot;my_new_token&amp;quot;, &amp;quot;a_place_on_board&amp;quot; ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.placeOnObjectPos( mobile_obj, target_obj, target_x, target_y )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method works exactly like placeOnObject, except than you can specify some (x,y) coordinates. This way, &amp;quot;mobile_obj&amp;quot; will be placed to the specified x,y position relatively to &amp;quot;target_obj&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.attachToNewParent( mobile_obj, target_obj )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With this method, you change the HTML parent of &amp;quot;mobile_obj&amp;quot; element. &amp;quot;target_obj&amp;quot; is the new parent of this element. The beauty of &lt;br /&gt;
attachToNewParent is that the mobile_obj element DOES NOT MOVE during this process.&lt;br /&gt;
&lt;br /&gt;
Note: what happens is that the method calculate a relative position of mobile_obj to make sure it does not move after the HTML parent changes.&lt;br /&gt;
&lt;br /&gt;
Why using this method?&lt;br /&gt;
&lt;br /&gt;
Changing the HTML parent of an element can be useful for the following reasons:&lt;br /&gt;
* When the HTML parent moves, all its child are moving with them. If some game elements is no more linked with a parent HTML object, you may want to attach it to another place.&lt;br /&gt;
* The z_order (vertical order of display) depends on the position in the DOM, so you may need to change the parent of some game elements when they are moving in your game area.&lt;br /&gt;
&lt;br /&gt;
CAREFUL: this function destroys original object and places a clone onto a new parent, this will break all references to this HTML element (ex: dojo.connect).&lt;br /&gt;
&lt;br /&gt;
== Players input ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.connect&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Used to associate a player event with one of your notification method.&lt;br /&gt;
&lt;br /&gt;
Example: associate a click on an element (&amp;quot;my_element&amp;quot;) with one of our method (&amp;quot;onClickOnMyElement&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      dojo.connect( $(&#039;my_element&#039;), &#039;onclick&#039;, this, &#039;onClickOnMyElement&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: this is the only possible correct way to associate a player input event to your code, and you must not use anything else.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.checkAction( &amp;quot;my_action_name&amp;quot; )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usage: checkAction: function( action, nomessage )&lt;br /&gt;
&lt;br /&gt;
Check if player can do the specified action by taking into account:&lt;br /&gt;
* current game state&lt;br /&gt;
* interface locking (a player can&#039;t do any action if an action is already in progress)&lt;br /&gt;
&lt;br /&gt;
return true if action is authorized (ie: the action is listed as a &amp;quot;possibleaction&amp;quot; in current game state).&lt;br /&gt;
&lt;br /&gt;
return false and display an error message if not (display no message if nomessage parameter is true). The displayed error message could be either &amp;quot;This move is not allowed at this moment&amp;quot; or &amp;quot;An action is already in progress&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  function onClickOnGameElement( evt )&lt;br /&gt;
  {&lt;br /&gt;
     if( this.checkAction( &amp;quot;my_action&amp;quot; ) )&lt;br /&gt;
     {&lt;br /&gt;
        // Do the action&lt;br /&gt;
     }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.ajaxcall( url, parameters, obj_callback, callback, callback_error )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method must be used to send a player input to the game server.&lt;br /&gt;
&lt;br /&gt;
* url: the url of the action to perform. For a game, it must be: &amp;quot;/&amp;lt;mygame&amp;gt;/&amp;lt;mygame&amp;gt;/myAction.html&amp;quot;&lt;br /&gt;
* parameters: an array of parameter to send to the game server. Note that &amp;quot;lock:true&amp;quot; must always be specified in this list of parameter in order the interface can be locked during the server call.&lt;br /&gt;
* obj_callback: must be set to &amp;quot;this&amp;quot;.&lt;br /&gt;
* callback: a function to trigger when the server returns and everything went fine.&lt;br /&gt;
* callback_error: (optional and rarely used) a function to trigger when the server returns an error.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.ajaxcall( &#039;/mygame/mygame/myaction.html&#039;, { lock: true, &lt;br /&gt;
   arg1: myarg1, &lt;br /&gt;
   arg2: myarg2, &lt;br /&gt;
   ...&lt;br /&gt;
}, this, function( result ) {&lt;br /&gt;
   // Do some stuff after a successful call&lt;br /&gt;
} );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restricted arguments names (please don&#039;t use them):&lt;br /&gt;
* &amp;quot;action&amp;quot;&lt;br /&gt;
* &amp;quot;module&amp;quot;&lt;br /&gt;
* &amp;quot;class&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.confirmationDialog()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Display a confirmation dialog with a yes/no choice.&lt;br /&gt;
&lt;br /&gt;
We advice you to NOT use this function unless the player action is really critical and could ruins the game, because it slows down the game and upset players.&lt;br /&gt;
&lt;br /&gt;
Usage: this.confirmationDialog( &amp;quot;Question to displayed&amp;quot;, callback_function_if_click_on_yes );&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.confirmationDialog( _(&#039;Are you sure to use this bonus (points penalty at the end of the game) ?&#039;),&lt;br /&gt;
                         dojo.hitch( this, function() {&lt;br /&gt;
                           this.ajaxcall( &#039;/seasons/seasons/useBonus.html&#039;,&lt;br /&gt;
                                { id:bonus_id, lock:true }, this, function( result ) {} );&lt;br /&gt;
                        } ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; addEventToClass: function( cssClassName, eventName, functionName )&lt;br /&gt;
: Same as dojo.connect(), but for all the nodes set with the specified cssClassName&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addActionButton( id, label, method, (opt)destination, (opt)blinking, (opt)color )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use this method to add an action button in the main action status bar.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* id: an element ID that should be unique in your HTML DOM document.&lt;br /&gt;
* label: the text of the button. Should be translatable (use _() function).&lt;br /&gt;
* method: the name of your method that must be triggered when the player clicks on this button.&lt;br /&gt;
* destination (optional): deprecated, do not use this. Use &#039;&#039;&#039;null&#039;&#039;&#039; as value if you need to specify other arguments.&lt;br /&gt;
* blinking (optional): if set to &#039;&#039;&#039;true&#039;&#039;&#039;, the button is going blink to catch player&#039;s attention. Please don&#039;t abuse of blinking button.&lt;br /&gt;
* color: could be &#039;&#039;&#039;blue&#039;&#039;&#039; (default), &#039;&#039;&#039;red&#039;&#039;&#039; or &#039;&#039;&#039;gray&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You should only use this method in your &amp;quot;onUpdateActionButtons&amp;quot; method. Usually, you use it like this (from Hears example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onUpdateActionButtons: function( stateName, args ) {&lt;br /&gt;
                      &lt;br /&gt;
            if (this.isCurrentPlayerActive()) {            &lt;br /&gt;
                switch( stateName ) {&lt;br /&gt;
                case &#039;giveCards&#039;:&lt;br /&gt;
                    this.addActionButton( &#039;giveCards_button&#039;, _(&#039;Give selected cards&#039;), &#039;onGiveCards&#039; ); &lt;br /&gt;
                    break;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        },   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, we are adding a &amp;quot;Give selected cards&amp;quot; button in the case we are on game state &amp;quot;giveCards&amp;quot;. When player clicks on this button, it triggers our &amp;quot;onGiveCards&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Example using blinking red button:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     this.addActionButton( &#039;commit_button&#039;, _(&#039;Confirm&#039;), &#039;onConfirm&#039;, null, true, &#039;red&#039;); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: at least in studio example above will make button huge, because it sets it display of blinking things to &#039;&#039;&#039;block&#039;&#039;&#039;, &lt;br /&gt;
if you don&#039;t like it you have to change css display value&lt;br /&gt;
of the button to inline-block (the id of the button is the first argument, i.e &#039;commit_button&#039; in example above)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Notifications ==&lt;br /&gt;
&lt;br /&gt;
When something happens on the server side, your game interface Javascript logic received a notification.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how you can handle these notifications on the client side.&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to notifications ===&lt;br /&gt;
&lt;br /&gt;
Your Javascript &amp;quot;setupNotifications&amp;quot; method is the place where you can subscribe to notifications from your PHP code.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how you associate one of your Javascript method to a notification &amp;quot;playDisc&amp;quot; (from Reversi example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   // In setupNotifications method:&lt;br /&gt;
   dojo.subscribe( &#039;playDisc&#039;, this, &amp;quot;notif_playDisc&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the &amp;quot;playDisc&amp;quot; corresponds to the name of the notification you define it in your PHP code, in your &amp;quot;notifyAllPlayers&amp;quot; or &amp;quot;notifyPlayer&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Then, you have to define your &amp;quot;notif_playDisc&amp;quot; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        notif_playDisc: function( notif )&lt;br /&gt;
        {&lt;br /&gt;
            // Remove current possible moves (makes the board more clear)&lt;br /&gt;
            dojo.query( &#039;.possibleMove&#039; ).removeClass( &#039;possibleMove&#039; );        &lt;br /&gt;
        &lt;br /&gt;
            this.addDiscOnBoard( notif.args.x, notif.args.y, notif.args.player_id );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a notification handler like our &amp;quot;notif_playDisc&amp;quot; method, you can access to all notifications arguments with &amp;quot;notif.args&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // If you did this on PHP side:&lt;br /&gt;
    self::notifyAllPlayers( &amp;quot;myNotification&amp;quot;, &#039;&#039;, array( &amp;quot;myArgument&amp;quot; =&amp;gt; 3 ) );&lt;br /&gt;
&lt;br /&gt;
    // On Javascript side, you can access the &amp;quot;myArgument&amp;quot; like this:&lt;br /&gt;
    notif_myNotification: function( notif )&lt;br /&gt;
    {&lt;br /&gt;
       alert( &amp;quot;myArgument = &amp;quot; + notif.args.myArgument );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Synchronous notifications ===&lt;br /&gt;
&lt;br /&gt;
When several notifications are received by your game interface, these notifications are processed immediately, one after the other, in the same exact order they have been generated in your PHP game logic.&lt;br /&gt;
&lt;br /&gt;
However, sometimes, you need to give some time to the players to figure out what happened on the game before jumping to the next notification. Indeed, in many games, they are a lot of automatic actions, and the computer is going to resolve all these actions very fast if you don&#039;t tell it not to do so.&lt;br /&gt;
&lt;br /&gt;
As an example, for Reversi, when someone is playing a disc, we want to wait 500 milliseconds before doing anything else in order the opponent player can figure out what move has been played.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how we do this, right after our subscription:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       dojo.subscribe( &#039;playDisc&#039;, this, &amp;quot;notif_playDisc&amp;quot; );&lt;br /&gt;
       this.notifqueue.setSynchronous( &#039;playDisc&#039;, 500 );   // Wait 500 milliseconds after executing the playDisc handler&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Pre-defined notification types ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;tableWindow&#039;&#039;&#039; - This defines notification to display [[Game_interface_logic:_yourgamename.js#Scoring_dialogs|Scoring Dialogs]], see below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;message&#039;&#039;&#039; - This defines notification that shows on players log and have no other effect&lt;br /&gt;
&lt;br /&gt;
   // You can call this on php side without doing anything on client side&lt;br /&gt;
    self::notifyAllPlayers( &#039;message&#039;, &#039;hello&#039;, array( ) );&lt;br /&gt;
&lt;br /&gt;
== Tooltips ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltip( nodeId, _( helpString ), _( actionString ), delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add a simple text tooltip to the DOM node.&lt;br /&gt;
&lt;br /&gt;
Specify &#039;helpString&#039; to display some information about &amp;quot;what is this game element?&amp;quot;.&lt;br /&gt;
Specify &#039;actionString&#039; to display some information about &amp;quot;what happens when I click on this element?&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You must specify both helpString and actionString. Most of the time, you should use only one and specify a void string (&amp;quot;&amp;quot;) for the other one.&lt;br /&gt;
&lt;br /&gt;
Usually, _() must be used for the text to be marked for translation.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Delay&amp;quot; is an optional parameter. Usually, it is primarily used to specify a zero delay for some game element when the tooltip gives really important information for the game - but remember: no essential information must be placed in tooltips as they won&#039;t be displayed in some browsers (see [[BGA_Studio_Guidelines|Guidelines]]).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.addTooltip( &#039;cardcount&#039;, _(&#039;Number of cards in hand&#039;), &#039;&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipHtml( nodeId, html, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an HTML tooltip to the DOM node (for more elaborate content such as presenting a bigger version of a card).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipToClass( cssClass, _( helpString ), _( actionString ), delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add a simple text tooltip to all the DOM nodes set with this cssClass. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT: all concerned nodes must have IDs to get tooltips.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipHtmlToClass( cssClass, html, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an HTML tooltip to to all the DOM nodes set with this cssClass (for more elaborate content such as presenting a bigger version of a card).&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: all concerned nodes must have IDs to get tooltips&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.removeTooltip( nodeId )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove a tooltip from the DOM node.&lt;br /&gt;
&lt;br /&gt;
== Dialogs, warning messages, confirmation dialogs, ... ==&lt;br /&gt;
&lt;br /&gt;
=== Warning messages ===&lt;br /&gt;
&lt;br /&gt;
Sometimes, there is something important that is happening on the game and you have to make sure all players get the message. Most of the time, the evolution of the game situation or the game log is enough, but sometimes you need something more visible.&lt;br /&gt;
&lt;br /&gt;
Ex: someone fulfill one of the end of the game condition, so this is the last turn.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.showMessage( msg, type )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
showMessage shows a message in a big rectangular area on the top of the screen of current player.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;msg&amp;quot; is the string to display. It should be translated.&lt;br /&gt;
* &amp;quot;type&amp;quot; can be set to &amp;quot;info&amp;quot; or &amp;quot;error&amp;quot;. If set to &amp;quot;info&amp;quot;, the message will be an informative message on a white background. If set to &amp;quot;error&amp;quot;, the message will be an error message on a red background.&lt;br /&gt;
&lt;br /&gt;
Important: the normal way to inform players about the progression of the game is the game log. &amp;quot;showMessage&amp;quot; is intrusive and should not be used often.&lt;br /&gt;
&lt;br /&gt;
=== Confirmation dialog ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;confirmationDialog( message, yesHandler, noHandler )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When an important action with a lot of consequences is triggered by the player, you may want to propose a confirmation dialog.&lt;br /&gt;
&lt;br /&gt;
CAREFUL: the general guidelines of BGA is to AVOID the use of confirmation dialog. Confirmation dialogs slow down the game and bother players. The players knows that they have to pay attention about each move when they are playing online.&lt;br /&gt;
&lt;br /&gt;
The situation where you should use a confirmation dialog are the following:&lt;br /&gt;
* It must not happen very often during a game.&lt;br /&gt;
* It must be linked to an action that can really &amp;quot;kill a game&amp;quot; if the player do not pay attention.&lt;br /&gt;
* It must be something that can be done by mistake (ex: a link on the action status bar).&lt;br /&gt;
&lt;br /&gt;
How to display a confirmation dialog:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        this.confirmationDialog( _(&#039;Are you sure you want to bake the pie?&#039;), dojo.hitch( this, function() {&lt;br /&gt;
            this.bakeThePie();&lt;br /&gt;
        } ) ); &lt;br /&gt;
        return; // nothing should be called or done after calling this, all action must be done in the handler  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Multiple choice dialog ===&lt;br /&gt;
You can use this dialog to give user a choice with small amount of options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        var keys = [1,5,10];&lt;br /&gt;
        this.multipleChoiceDialog(&lt;br /&gt;
          _(&#039;How many bugs to fix?&amp;quot;), keys, &lt;br /&gt;
            dojo.hitch(this, function(choice) {&lt;br /&gt;
                            var bugchoice = keys[choice];&lt;br /&gt;
                            console.log(&#039;dialog callback with &#039;+bugchoice);&lt;br /&gt;
                            this.ajaxcall( &#039;/mygame/mygame/fixBugs.html&#039;, { bugs: bugchoice}, this, function( result ) {} );                        }));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dialogs ===&lt;br /&gt;
&lt;br /&gt;
As a general rule, you shouldn&#039;t use dialogs windows.&lt;br /&gt;
&lt;br /&gt;
BGA guidelines specify that all game elements should be displayed on the main screen. Players can eventually scroll down to see game elements they don&#039;t need to see anytime, and you may eventually create anchors to move between game area section. Of course dialogs windows are very practical, but the thing is: all players know how to scroll down, and not all players know how to show up your dialog window. In addition, when the dialog shows up, players can&#039;t access the other game components.&lt;br /&gt;
&lt;br /&gt;
Sometimes although, you need to display a dialog window. Here is how you do this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Create the new dialog over the play zone. You should store the handler in a member variable to access it later&lt;br /&gt;
  this.myDlg = new ebg.popindialog();&lt;br /&gt;
  this.myDlg.create( &#039;myDialogUniqueId, &#039;left-side&#039; );&lt;br /&gt;
  this.myDlg.setTitle( _(&amp;quot;my dialog title to translate&amp;quot;) );&lt;br /&gt;
  this.myDlg.setMaxWidth( 500 ); // Optional&lt;br /&gt;
  &lt;br /&gt;
  // Create the HTML of my dialog. &lt;br /&gt;
  // The best practice here is to use [[Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl#Javascript_templates|Javascript templates]]&lt;br /&gt;
  var html = this.format_block( &#039;jstpl_myDialogTemplate&#039;, { &lt;br /&gt;
                arg1: myArg1,&lt;br /&gt;
                arg2: myArg2,&lt;br /&gt;
                ...&lt;br /&gt;
            } );  &lt;br /&gt;
&lt;br /&gt;
  // Show the dialog&lt;br /&gt;
  this.myDlg.setContent( html );&lt;br /&gt;
  this.myDlg.show();&lt;br /&gt;
  &lt;br /&gt;
  // Now that the dialog has been displayed, you can connect your method to some dialog elements&lt;br /&gt;
  // Example, a &amp;quot;close&amp;quot; button:&lt;br /&gt;
  dojo.connect( $(&#039;closeDlg&#039;), &#039;onclick&#039;, this, function(evt){&lt;br /&gt;
                evt.preventDefault();&lt;br /&gt;
                this.myDlg.destroy();&lt;br /&gt;
            } );&lt;br /&gt;
&lt;br /&gt;
=== Scoring dialogs ===&lt;br /&gt;
&lt;br /&gt;
Sometimes at the end of a round you want to display a big table that details the points wins in each section of the game.&lt;br /&gt;
&lt;br /&gt;
Example: in Hearts game, we display at the end of each round the number of &amp;quot;heart&amp;quot; cards collected by each player, the player who collected the Queen of Spades, and the total number of points loose by each player.&lt;br /&gt;
&lt;br /&gt;
Scoring dialogs are managed entirely on &#039;&#039;&#039;PHP side&#039;&#039;&#039;, but they are described here as their effects are visible only on client side.&lt;br /&gt;
&lt;br /&gt;
Displaying a scoring dialog is quite simple and is using a special notification type: &amp;quot;tableWindow&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // on PHP side:&lt;br /&gt;
  $this-&amp;gt;notifyAllPlayers( &amp;quot;tableWindow&amp;quot;, &#039;&#039;, array(&lt;br /&gt;
            &amp;quot;id&amp;quot; =&amp;gt; &#039;finalScoring&#039;,&lt;br /&gt;
            &amp;quot;title&amp;quot; =&amp;gt; clienttranslate(&amp;quot;Title of the scoring dialog&amp;quot;),&lt;br /&gt;
            &amp;quot;table&amp;quot; =&amp;gt; $table&lt;br /&gt;
        ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;table&amp;quot; argument is a 2 dimensional PHP array that describe the table you want to display, line by line and column by column.&lt;br /&gt;
&lt;br /&gt;
Example: display an 3x3 array of strings&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $table = array(&lt;br /&gt;
      array( &amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, &amp;quot;three&amp;quot; ),    // This is my first line&lt;br /&gt;
      array( &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot; ),    // This is my second line&lt;br /&gt;
      array( &amp;quot;seven&amp;quot;, &amp;quot;height&amp;quot;, &amp;quot;nine&amp;quot; )    // This is my third line&lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see above, in each &amp;quot;cell&amp;quot; of your array you can display a simple string value. But you can also display a complex value with a template and associated arguments like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $table = array(&lt;br /&gt;
      array( &amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, array( &amp;quot;str&amp;quot; =&amp;gt; &amp;quot;a string with an ${argument}&amp;quot;, &amp;quot;args&amp;quot; =&amp;gt; array( &#039;argument&#039; =&amp;gt; &#039;argument_value&#039; )  ) ),&lt;br /&gt;
      array( &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot; ), &lt;br /&gt;
      array( &amp;quot;seven&amp;quot;, &amp;quot;height&amp;quot;, &amp;quot;nine&amp;quot; )&lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is especially useful when you want to display player names with colors. Example from &amp;quot;Hearts&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $firstRow = array( &#039;&#039; );&lt;br /&gt;
        foreach( $players as $player_id =&amp;gt; $player )&lt;br /&gt;
        {&lt;br /&gt;
            $firstRow[] = array( &#039;str&#039; =&amp;gt; &#039;${player_name}&#039;,&lt;br /&gt;
                                 &#039;args&#039; =&amp;gt; array( &#039;player_name&#039; =&amp;gt; $player[&#039;player_name&#039;] ),&lt;br /&gt;
                                 &#039;type&#039; =&amp;gt; &#039;header&#039;&lt;br /&gt;
                               );&lt;br /&gt;
        }&lt;br /&gt;
        $table[] = $firstRow;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use three extra attributes in the parameter array for the notification:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $this-&amp;gt;notifyAllPlayers( &amp;quot;tableWindow&amp;quot;, &#039;&#039;, array(&lt;br /&gt;
            &amp;quot;id&amp;quot; =&amp;gt; &#039;finalScoring&#039;,&lt;br /&gt;
            &amp;quot;title&amp;quot; =&amp;gt; clienttranslate(&amp;quot;Title of the scoring dialog&amp;quot;),&lt;br /&gt;
            &amp;quot;table&amp;quot; =&amp;gt; $table,&lt;br /&gt;
            &amp;quot;header&amp;quot; =&amp;gt; array(&#039;str&#039; =&amp;gt; clienttranslate(&#039;Table header with parameter ${number}&#039;),&lt;br /&gt;
                                 &#039;args&#039; =&amp;gt; array( &#039;number&#039; =&amp;gt; 3 ),&lt;br /&gt;
                               ),&lt;br /&gt;
            &amp;quot;footer&amp;quot; =&amp;gt; &#039;&amp;lt;div&amp;gt;Some footer&amp;lt;/div&amp;gt;&#039;,&lt;br /&gt;
            &amp;quot;closing&amp;quot; =&amp;gt; clienttranslate( &amp;quot;Closing button label&amp;quot; )&lt;br /&gt;
        ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;header&#039;&#039;&#039;: the content for this parameter will display before the table (also, the html will be parsed and player names will be colored according to the current game colors). &lt;br /&gt;
*&#039;&#039;&#039;footer&#039;&#039;&#039;: the content for this parameter will display after the table (no parsing for coloring the player names)&lt;br /&gt;
*&#039;&#039;&#039;closing&#039;&#039;&#039;: if this parameter is used, a button will be displayed with this label at the bottom of the popup and will allow players to close it (more easily than by clicking the top right &#039;cross&#039; icon).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scoring animated display ===&lt;br /&gt;
&lt;br /&gt;
Sometimes (Terra Mystica final scoring for example), you may want to display a score value over an element to make the scoring easier to follow for the players.&lt;br /&gt;
You can do it with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.displayScoring( anchor_id, color, score );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Speech bubble ===&lt;br /&gt;
&lt;br /&gt;
For better interactivity in some games (Love Letter for example), you may use comic book style speech bubbles to express the players voices.&lt;br /&gt;
This is done with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.showBubble( anchor_id, text, delay, duration, custom_class )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
delay in milliseconds is optional (default 0)&lt;br /&gt;
&lt;br /&gt;
duration in milliseconds is optional (default 3000)&lt;br /&gt;
&lt;br /&gt;
custom_class is optional, if you need to override the default bubble style&lt;br /&gt;
&lt;br /&gt;
== Update players score ==&lt;br /&gt;
&lt;br /&gt;
Increase a player score (with a positive or negative number):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this.scoreCtrl[ player_id ].incValue( score_delta );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set a player score to a specific value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this.scoreCtrl[ player_id ].setValue( new_score );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Players panels ==&lt;br /&gt;
&lt;br /&gt;
=== Adding stuff to player&#039;s panel ===&lt;br /&gt;
&lt;br /&gt;
At first, create a new &amp;quot;JS template&amp;quot; string in your template (tpl) file:&lt;br /&gt;
&lt;br /&gt;
(from Gomoku example)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var jstpl_player_board = &#039;\&amp;lt;div class=&amp;quot;cp_board&amp;quot;&amp;gt;\&lt;br /&gt;
    &amp;lt;div id=&amp;quot;stoneicon_p${id}&amp;quot; class=&amp;quot;gmk_stoneicon gmk_stoneicon_${color}&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;span id=&amp;quot;stonecount_p${id}&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;\&lt;br /&gt;
&amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you add this piece of code in your JS file to add this template to each player panel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            // Setting up player boards&lt;br /&gt;
            for( var player_id in gamedatas.players )&lt;br /&gt;
            {&lt;br /&gt;
                var player = gamedatas.players[player_id];&lt;br /&gt;
                         &lt;br /&gt;
                // Setting up players boards if needed&lt;br /&gt;
                var player_board_div = $(&#039;player_board_&#039;+player_id);&lt;br /&gt;
                dojo.place( this.format_block(&#039;jstpl_player_board&#039;, player ), player_board_div );&lt;br /&gt;
            }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the code above is of course from your &amp;quot;setup&amp;quot; function in your Javascript).&lt;br /&gt;
&lt;br /&gt;
Very often, you have to distinguish current player and others players. In this case, you just have to create another JS template (ex: jstpl_otherplayer_board) and use it when &amp;quot;player_id&amp;quot; is different than &amp;quot;this.player_id&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Player&#039;s panel disabling/enabling ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.disablePlayerPanel( player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Disable given player panel (the panel background become gray).&lt;br /&gt;
&lt;br /&gt;
Usually, this is used to signal that this played passes, or will be inactive during a while.&lt;br /&gt;
&lt;br /&gt;
Note that the only effect of this is visual. There are no consequences on the behaviour of the panel itself.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.enablePlayerPanel( player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable a player panel that has been disabled before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.enableAllPlayerPanels()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable all player panels that has been disabled before.&lt;br /&gt;
&lt;br /&gt;
== Image loading ==&lt;br /&gt;
&lt;br /&gt;
See also [[Game_art:_img_directory]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be careful&#039;&#039;&#039;: by default, ALL images of your img directory are loaded on a player&#039;s browser when he loads the game. For this reason, don&#039;t let in your img directory images that are not useful, otherwise it&#039;s going to slowdown the game load.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dontPreloadImage( image_file_name )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using dontPreloadImage, you tell the interface to not preload a specific image in your img directory.&lt;br /&gt;
&lt;br /&gt;
Example of use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.dontPreloadImage( &#039;cards.png&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is particularly useful if for example you have 2 different themes for a game. To accelerate the loading of the game, you can specify to not preload images corresponding to the other theme.&lt;br /&gt;
&lt;br /&gt;
Another example of use: in &amp;quot;Gosu&amp;quot; game with Kamakor extension, you play with 5 sets of cards among 10 available. Cards images are organized by sets, and we only preload the images corresponding to the 5 current sets with &#039;&#039;&#039;ensureSpecificGameImageLoading( image_file_names_array )&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// By default, do not preload anything&lt;br /&gt;
this.dontPreloadImage( &#039;cards.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan1.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan2.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan3.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan4.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan5.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan6.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan7.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan8.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan9.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan10.png&#039; );&lt;br /&gt;
var to_preload = [];&lt;br /&gt;
for( i in this.gamedatas.clans )&lt;br /&gt;
{&lt;br /&gt;
	var clan_id = this.gamedatas.clans[i];&lt;br /&gt;
	to_preload.push( &#039;clan&#039;+clan_id+&#039;.png&#039; );&lt;br /&gt;
}&lt;br /&gt;
if( to_preload.length == 5 )&lt;br /&gt;
{&lt;br /&gt;
	this.ensureSpecificGameImageLoading( to_preload );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You don&#039;t need to specify to not preload game box images (game_box.png, game_box75.png...) since they are not preloaded by default.&lt;br /&gt;
&lt;br /&gt;
== Other useful stuff ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.hitch&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.hitch, you can create a callback function that will run with your game object context whatever happen.&lt;br /&gt;
&lt;br /&gt;
Typical example: display a BGA confirmation dialog with a callback function created with dojo.hitch:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        this.confirmationDialog( _(&#039;Are you sure you want to make this?&#039;), dojo.hitch( this, function() {&lt;br /&gt;
            this.ajaxcall( &#039;/mygame/mygame/makeThis.html&#039;, { lock:true }, this, function( result ) {} );&lt;br /&gt;
        } ) );   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, using dojo.hitch, we ensure that the &amp;quot;this&amp;quot; object will be set when the callback is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; updateCounters(counters)&lt;br /&gt;
: Useful for updating game counters in the player panel (such as resources). &lt;br /&gt;
: &#039;counters&#039; arg is an associative array [counter_name_value =&amp;gt; [ &#039;counter_name&#039; =&amp;gt; counter_name_value, &#039;counter_value&#039; =&amp;gt; counter_value_value], ... ]&lt;br /&gt;
: All counters must be referenced in this.gamedatas.counters and will be updated.&lt;br /&gt;
: DOM objects referenced by &#039;counter_name&#039; will have their innerHTML updated with &#039;counter_value&#039;.&lt;br /&gt;
&lt;br /&gt;
== BGA GUI components ==&lt;br /&gt;
&lt;br /&gt;
BGA framework provides some useful ready-to-use components for the game interface:&lt;br /&gt;
&lt;br /&gt;
[[Studio#BGA_Studio_game_components_reference]]&lt;br /&gt;
&lt;br /&gt;
Note that each time you are using an additional component, you must declare it at the top of your Javascript file in the list of modules used.&lt;br /&gt;
&lt;br /&gt;
Example if you are using &amp;quot;ebg.stock&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/stock&amp;quot;  /// &amp;lt;=== we are using ebg.stock module&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Game_interface_logic:_yourgamename.js&amp;diff=3385</id>
		<title>Game interface logic: yourgamename.js</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Game_interface_logic:_yourgamename.js&amp;diff=3385"/>
		<updated>2019-03-08T13:43:50Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* General tips */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the main file for your game interface. Here you will define:&lt;br /&gt;
&lt;br /&gt;
* Which actions on the page will generate calls to the server.&lt;br /&gt;
* What happens when you get a notification for a change from the server and how it will show in the browser. &lt;br /&gt;
&lt;br /&gt;
== File structure ==&lt;br /&gt;
&lt;br /&gt;
The details of how the file is structured are described below with comments on the code skeleton provided to you.&lt;br /&gt;
&lt;br /&gt;
Here is the basic structure:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;constructor&#039;&#039;&#039;: here you can define global variables for your whole interface.&lt;br /&gt;
* &#039;&#039;&#039;setup&#039;&#039;&#039;: this method is called when the page is refreshed, and sets up the game interface.&lt;br /&gt;
* &#039;&#039;&#039;onEnteringState&#039;&#039;&#039;: this method is called when entering a new game state. You can use it to customize the view for each game state.&lt;br /&gt;
* &#039;&#039;&#039;onLeavingState&#039;&#039;&#039;: this method is called when leaving a game state.&lt;br /&gt;
* &#039;&#039;&#039;onUpdateActionButtons&#039;&#039;&#039;: called when entering a new state, in order to add action buttons to the status bar.&lt;br /&gt;
* &#039;&#039;(utility methods)&#039;&#039;: this is where you can define your utility methods.&lt;br /&gt;
* &#039;&#039;(player&#039;s actions)&#039;&#039;: this is where you can write your handlers for player actions on the interface (example: click on an item).&lt;br /&gt;
* &#039;&#039;&#039;setupNotifications&#039;&#039;&#039;: this method associates notifications with notification handlers. For each game notification, you can trigger a javascript method to handle it and update the game interface.&lt;br /&gt;
* &#039;&#039;(notification handlers)&#039;&#039;: this is where you define the notifications handlers associated with notifications in &#039;&#039;&#039;setupNotifications&#039;&#039;&#039;, above.&lt;br /&gt;
&lt;br /&gt;
== General tips ==&lt;br /&gt;
&lt;br /&gt;
; this.player_id&lt;br /&gt;
: ID of the player on whose browser the code is running.&lt;br /&gt;
&lt;br /&gt;
; this.isSpectator&lt;br /&gt;
: Flag set to true if the user at the table is a spectator (not a player).&lt;br /&gt;
: Note: This is a variable, not a function.&lt;br /&gt;
: Note: If you want to hide an element from spectators, you should use [[Game_interface_stylesheet:_yourgamename.css#spectatorMode|CSS &#039;spectatorMode&#039; class]].&lt;br /&gt;
&lt;br /&gt;
; this.gamedatas&lt;br /&gt;
: Contains the initial set of data to init the game, created at game start or by game refresh (F5).&lt;br /&gt;
: You can update it as needed to keep an up-to-date reference of the game on the client side if you need it. (Most of the time this is unnecessary).&lt;br /&gt;
&lt;br /&gt;
; this.isCurrentPlayerActive()&lt;br /&gt;
: Returns true if the player on whose browser the code is running is currently active (it&#039;s his turn to play).&lt;br /&gt;
&lt;br /&gt;
; this.getActivePlayerId()&lt;br /&gt;
: Return the ID of the active player, or null if we are not in an &amp;quot;activeplayer&amp;quot; type state.&lt;br /&gt;
&lt;br /&gt;
; this.getActivePlayers()&lt;br /&gt;
: Return an array with the IDs of players who are currently active (or an empty array if there are none).&lt;br /&gt;
&lt;br /&gt;
: this.bRealtime&lt;br /&gt;
: Return true if the game is in realtime. Note that having a distinct behavior in realtime and turn-based should be exceptional.&lt;br /&gt;
&lt;br /&gt;
== Dojo framework ==&lt;br /&gt;
&lt;br /&gt;
BGA uses the [http://dojotoolkit.org/ Dojo Javascript framework].&lt;br /&gt;
&lt;br /&gt;
The Dojo framework allows us to do complex things more easily. The BGA framework uses Dojo extensively.&lt;br /&gt;
&lt;br /&gt;
To implement a game, you only need to use a few parts of the Dojo framework. All the Dojo methods you need are described on this page.&lt;br /&gt;
&lt;br /&gt;
== Shrinksafe minimization ==&lt;br /&gt;
&lt;br /&gt;
For performance reasons, when deploying a game the js code is minimized using Shrinksafe (based on ECMASCRIPT version 3). Some advanced syntax may not be compatible with this process. In particular:&lt;br /&gt;
* You should not use reserved keywords from the javascript language as variables.&lt;br /&gt;
* You should not declare default argument values in function declarations. The following syntax is invalid for Shrinksafe: &#039;&#039;&#039;function myFunc(requiredArg, optionalArg = &#039;defaultValue&#039;) {}&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Accessing and manipulating the DOM ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;$(&#039;some_html_element_id&#039;)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The $() function is used to get an HTML element using its &amp;quot;id&amp;quot; attribute.&lt;br /&gt;
&lt;br /&gt;
Example 1: modify the content of a &amp;quot;span&amp;quot; element:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
In your HTML code:&lt;br /&gt;
   &amp;lt;span id=&amp;quot;a_value_in_the_game_interface&amp;quot;&amp;gt;1234&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In your Javascript code:&lt;br /&gt;
   $(&#039;a_value_in_the_game_interface&#039;).innerHTML = &amp;quot;9999&amp;quot;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: $() is the standard method to access some HTML element with the BGA Framework. You should not use the &#039;&#039;&#039;getElementById&#039;&#039;&#039; function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.style&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.style you can modify the CSS property of any HTML element in your interface.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Make an element disappear&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;display&#039;, &#039;none&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Give an element a 2px border&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;borderWidth&#039;, &#039;2px&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Change the background position of an element&lt;br /&gt;
     // (very practical when you are using CSS sprites to transform an element to another)&lt;br /&gt;
     dojo.style( &#039;my_element&#039;, &#039;backgroundPosition&#039;, &#039;-20px -50px&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: you must always use dojo.style to modify the CSS properties of HTML elements.&lt;br /&gt;
&lt;br /&gt;
Note²: if you have to modify several CSS properties of an element, or if you have a complex CSS transformation to do, you should consider using dojo.addClass/dojo.removeClass (see below).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo CSS classes manipulation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In many situations, many small CSS property updates can be replaced by a CSS class change (i.e., you add a CSS class to your element instead of applying all modifications manually).&lt;br /&gt;
&lt;br /&gt;
Advantages are:&lt;br /&gt;
* All your CSS stuff remains in your CSS file.&lt;br /&gt;
* You can add/remove a list of CSS modifications with a simple function and without error.&lt;br /&gt;
* You can test whether you applied the CSS to an element with the &#039;&#039;&#039;dojo.hasClass&#039;&#039;&#039; method.&lt;br /&gt;
&lt;br /&gt;
Example from &#039;&#039;Reversi&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // We add &amp;quot;possibleMove&amp;quot; to an element&lt;br /&gt;
    dojo.addClass( &#039;square_&#039;+x+&#039;_&#039;+y, &#039;possibleMove&#039; );&lt;br /&gt;
&lt;br /&gt;
    // In our CSS file, the class is defined as:&lt;br /&gt;
    .possibleMove {&lt;br /&gt;
      background-color: white;&lt;br /&gt;
      opacity: 0.2;&lt;br /&gt;
      filter:alpha(opacity=20); /* For IE8 and earlier */  &lt;br /&gt;
      cursor: pointer;  &lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     // So we&#039;ve applied 4 CSS property changes in one line of code.&lt;br /&gt;
&lt;br /&gt;
     // ... and when we need to check if a square is a possible move on the client side:&lt;br /&gt;
     if( dojo.hasClass( &#039;square_&#039;+x+&#039;_&#039;+y, &#039;possibleMove&#039; ) )&lt;br /&gt;
     { ... }&lt;br /&gt;
&lt;br /&gt;
     // ... and if we want to remove all possible moves in one line of code (see &amp;quot;dojo.query&amp;quot; method):&lt;br /&gt;
     dojo.query( &#039;.possibleMove&#039; ).removeClass( &#039;possibleMove&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Conclusion: We encourage you to use &#039;&#039;&#039;dojo.addClass&#039;&#039;&#039;, &#039;&#039;&#039;dojo.removeClass&#039;&#039;&#039; and &#039;&#039;&#039;dojo.hasClass&#039;&#039;&#039; to make your life easier :)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.query&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.query, you can query a bunch of HTML elements with a single function, with a &amp;quot;CSS selector&amp;quot; style.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // All elements with class &amp;quot;possibleMove&amp;quot;:&lt;br /&gt;
     var elements = dojo.query( &#039;.possibleMove&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Count number of tokens (i.e., elements of class &amp;quot;token&amp;quot;) on the board (i.e., the element with id &amp;quot;board&amp;quot;):&lt;br /&gt;
     dojo.query( &#039;#board .token&#039; ).length;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But what is really cool with dojo.query is that you can combine it with almost all methods above.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Trigger a method when the mouse enter in any element with class &amp;quot;meeple&amp;quot;:&lt;br /&gt;
     dojo.query( &#039;.meeple&#039; ).connect( &#039;onmouseenter&#039;, this, &#039;myMethodToTrigger&#039; );&lt;br /&gt;
&lt;br /&gt;
     // Hide all meeples who are on the board&lt;br /&gt;
     dojo.query( &#039;#board .meeple&#039; ).style( &#039;display&#039;, &#039;none&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.place&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
dojo.place is the best function to insert HTML code somewhere in your game interface without breaking something. It is much better to use than the &#039;&#039;&#039;innerHTML=&#039;&#039;&#039; method if you must insert HTML tags and not only values.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     // Insert your HTML code as a child of a container element&lt;br /&gt;
     dojo.place( &amp;quot;&amp;lt;your html code&amp;gt;&amp;quot;, &amp;quot;your_container_element_id&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
     // Replace the container element with your new html&lt;br /&gt;
     dojo.place( &amp;quot;&amp;lt;your html code&amp;gt;&amp;quot;, &amp;quot;your_container_element_id&amp;quot;, &amp;quot;replace&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The third parameter of dojo.place can take various interesting value.&lt;br /&gt;
&lt;br /&gt;
values possibles :&lt;br /&gt;
&lt;br /&gt;
&amp;quot;replace&amp;quot; : (see description above).&lt;br /&gt;
&lt;br /&gt;
&amp;quot;first&amp;quot; : Places the node as a child of the reference node. The node is placed as the first child.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;last&amp;quot; : Places the node as a child of the reference node. The node is placed as the last child.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;before&amp;quot; : places the node right before the reference node.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;last (value by default) &amp;quot; : places the node right after the reference node.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;only&amp;quot; : replaces all children of the reference node with the node.&lt;br /&gt;
&lt;br /&gt;
positif integer : This parameter can be a positif integer. In this case, the node will be placed as a child of the reference node with this number (counting from 0). If the number is more than number of children, the node will be appended to the reference node making it the last child. &lt;br /&gt;
&lt;br /&gt;
See also full doc on dojo.place : [http://dojotoolkit.org/reference-guide/1.7/dojo/place.]&lt;br /&gt;
&lt;br /&gt;
Usually, when you want to insert some piece of HTML in your game interface, you should use &amp;quot;[[Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl#Javascript_templates|Javascript templates]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;addStyleToClass: function( cssClassName, cssProperty, propertyValue )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as dojo.style(), but for all the nodes set with the specified cssClassName&lt;br /&gt;
&lt;br /&gt;
=== Animations ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dojo Animations&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA animations is based on Dojo Animation ([http://dojotoolkit.org/documentation/tutorials/1.8/animation/ see tutorial here]).&lt;br /&gt;
&lt;br /&gt;
However, most of the time, you can just use methods below, which are built on top of Dojo Animation.&lt;br /&gt;
&lt;br /&gt;
Note: one interesting method from Dojo that could be useful from time to time is &amp;quot;Dojo.Animation&amp;quot;. It allows you to make any CSS property &amp;quot;slide&amp;quot; from one value to another.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObject( mobile_obj, target_obj, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use slideToObject to &amp;quot;slide&amp;quot; an element to a target position.&lt;br /&gt;
&lt;br /&gt;
Sliding element on the game area is the recommended and the most used way to animate your game interface. Using slides allow players to figure out what is happening on the game, as if they were playing with the real boardgame.&lt;br /&gt;
&lt;br /&gt;
The parameters are:&lt;br /&gt;
* mobile_obj: the ID of the object to move. This object must be &amp;quot;relative&amp;quot; or &amp;quot;absolute&amp;quot; positioned.&lt;br /&gt;
* target_obj: the ID of the target object. This object must be &amp;quot;relative&amp;quot; or &amp;quot;absolute&amp;quot; positioned. Note that it is not mandatory that mobile_obj and target_obj have the same size. If their size are different, the system slides the center of mobile_obj to the center of target_obj.&lt;br /&gt;
* duration: (optional) defines the duration in millisecond of the slide. The default is 500 milliseconds.&lt;br /&gt;
* delay: (optional). If you defines a delay, the slide will start only after this delay. This is particularly useful when you want to slide several object from the same position to the same position: you can give a 0ms delay to the first object, a 100ms delay to the second one, a 200ms delay to the third one, ... this way they won&#039;t be superposed during the slide.&lt;br /&gt;
&lt;br /&gt;
BE CAREFUL: The method returns an dojo.fx animation, so you can combine it with other animation if you want to. It means that you have to call the &amp;quot;play()&amp;quot; method, otherwise the animation WON&#039;T START.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.slideToObject( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot; ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObjectPos( mobile_obj, target_obj, target_x, target_y, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method does exactly the same as &amp;quot;slideToObject&amp;quot;, except than you can specify some (x,y) coordinates. This way, &amp;quot;mobile_obj&amp;quot; will slide to the specified x,y position relatively to &amp;quot;target_obj&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example: slide a token to some place on the board, 10 pixels to the bottom:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.slideToObjectPos( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot;, 0, 10 ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideTemporaryObject( mobile_obj_html, mobile_obj_parent, from, to, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is useful when you want to slide a temporary HTML object from one place to another. As this object does not exists before the animation and won&#039;t remain after, it could be complex to create this object (with dojo.place), to place it at its origin (with placeOnObject) to slide it (with slideToObject) and to make it disappear at the end.&lt;br /&gt;
&lt;br /&gt;
slideTemporaryObject does all of this for you:&lt;br /&gt;
* mobile_obj_html is a piece of HTML code that represent the object to slide.&lt;br /&gt;
* mobile_obj_parent is the ID of an HTML element of your interface that will be the parent of this temporary HTML object.&lt;br /&gt;
* from is the ID of the origin of the slide.&lt;br /&gt;
* to is the ID of the target of the slide.&lt;br /&gt;
* duration/delay works exactly like in &amp;quot;slideToObject&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.slideTemporaryObject( &#039;&amp;lt;div class=&amp;quot;token_icon&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&#039;, &#039;tokens&#039;, &#039;my_origin_div&#039;, &#039;my_target_div&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.slideToObjectAndDestroy: function( node, to, time, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is a handy shortcut to slide an existing HTML object to some place then destroy it upon arrival. It can be used for example to move a victory token or a card from the board to the player panel to show that the player earns it, then destroy it when we don&#039;t need to keep it visible on the player panel.&lt;br /&gt;
&lt;br /&gt;
It works the same as this.slideToObject and takes the same arguments. &lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.slideToObjectAndDestroy( &amp;quot;some_token&amp;quot;, &amp;quot;some_place_on_board&amp;quot;, 1000, 0 );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.fadeOutAndDestroy( node, duration, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This function fade out the target HTML node, then destroy it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.fadeOutAndDestroy( &amp;quot;a_card_that_must_disappear&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CAREFUL: the HTML node still exists until during few milliseconds, until the fadeOut has been completed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rotating elements&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can check here [http://jimfulton.info/demos/dojo-animated-rotate.html an example of use] of Dojo to make an element rotate.&lt;br /&gt;
&lt;br /&gt;
This example combines &amp;quot;Dojo.Animation&amp;quot; method and a CSS3 property that allow you to rotate the element.&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: to asses browser compatibility, you must select the CSS property to use just like in the example (see sourcecode below):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        var transform;&lt;br /&gt;
        dojo.forEach(&lt;br /&gt;
            [&#039;transform&#039;, &#039;WebkitTransform&#039;, &#039;msTransform&#039;,&lt;br /&gt;
             &#039;MozTransform&#039;, &#039;OTransform&#039;],&lt;br /&gt;
            function (name) {&lt;br /&gt;
                if (typeof dojo.body().style[name] != &#039;undefined&#039;) {&lt;br /&gt;
                    transform = name;&lt;br /&gt;
                }&lt;br /&gt;
            });&lt;br /&gt;
        // ... and then use &amp;quot;transform&amp;quot; as the name of your CSS property for rotation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Moving elements ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.placeOnObject( mobile_obj, target_obj )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
placeOnObject works exactly like &amp;quot;slideToObject&amp;quot;, except that the effect is immediate.&lt;br /&gt;
&lt;br /&gt;
This is not really an animation, but placeOnObject is frequently used before starting an animation.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // (We just created an object &amp;quot;my_new_token&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  // Place the new token on current player board&lt;br /&gt;
  this.placeOnObject( &amp;quot;my_new_token&amp;quot;, &amp;quot;overall_player_board_&amp;quot;+this.player_id );&lt;br /&gt;
  &lt;br /&gt;
  // Then slide it to its position on the board&lt;br /&gt;
  this.slideToObject( &amp;quot;my_new_token&amp;quot;, &amp;quot;a_place_on_board&amp;quot; ).play();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.placeOnObjectPos( mobile_obj, target_obj, target_x, target_y )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method works exactly like placeOnObject, except than you can specify some (x,y) coordinates. This way, &amp;quot;mobile_obj&amp;quot; will be placed to the specified x,y position relatively to &amp;quot;target_obj&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.attachToNewParent( mobile_obj, target_obj )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With this method, you change the HTML parent of &amp;quot;mobile_obj&amp;quot; element. &amp;quot;target_obj&amp;quot; is the new parent of this element. The beauty of &lt;br /&gt;
attachToNewParent is that the mobile_obj element DOES NOT MOVE during this process.&lt;br /&gt;
&lt;br /&gt;
Note: what happens is that the method calculate a relative position of mobile_obj to make sure it does not move after the HTML parent changes.&lt;br /&gt;
&lt;br /&gt;
Why using this method?&lt;br /&gt;
&lt;br /&gt;
Changing the HTML parent of an element can be useful for the following reasons:&lt;br /&gt;
* When the HTML parent moves, all its child are moving with them. If some game elements is no more linked with a parent HTML object, you may want to attach it to another place.&lt;br /&gt;
* The z_order (vertical order of display) depends on the position in the DOM, so you may need to change the parent of some game elements when they are moving in your game area.&lt;br /&gt;
&lt;br /&gt;
CAREFUL: this function destroys original object and places a clone onto a new parent, this will break all references to this HTML element (ex: dojo.connect).&lt;br /&gt;
&lt;br /&gt;
== Players input ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.connect&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Used to associate a player event with one of your notification method.&lt;br /&gt;
&lt;br /&gt;
Example: associate a click on an element (&amp;quot;my_element&amp;quot;) with one of our method (&amp;quot;onClickOnMyElement&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      dojo.connect( $(&#039;my_element&#039;), &#039;onclick&#039;, this, &#039;onClickOnMyElement&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: this is the only possible correct way to associate a player input event to your code, and you must not use anything else.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.checkAction( &amp;quot;my_action_name&amp;quot; )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Usage: checkAction: function( action, nomessage )&lt;br /&gt;
&lt;br /&gt;
Check if player can do the specified action by taking into account:&lt;br /&gt;
* current game state&lt;br /&gt;
* interface locking (a player can&#039;t do any action if an action is already in progress)&lt;br /&gt;
&lt;br /&gt;
return true if action is authorized (ie: the action is listed as a &amp;quot;possibleaction&amp;quot; in current game state).&lt;br /&gt;
&lt;br /&gt;
return false and display an error message if not (display no message if nomessage parameter is true). The displayed error message could be either &amp;quot;This move is not allowed at this moment&amp;quot; or &amp;quot;An action is already in progress&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  function onClickOnGameElement( evt )&lt;br /&gt;
  {&lt;br /&gt;
     if( this.checkAction( &amp;quot;my_action&amp;quot; ) )&lt;br /&gt;
     {&lt;br /&gt;
        // Do the action&lt;br /&gt;
     }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.ajaxcall( url, parameters, obj_callback, callback, callback_error )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method must be used to send a player input to the game server.&lt;br /&gt;
&lt;br /&gt;
* url: the url of the action to perform. For a game, it must be: &amp;quot;/&amp;lt;mygame&amp;gt;/&amp;lt;mygame&amp;gt;/myAction.html&amp;quot;&lt;br /&gt;
* parameters: an array of parameter to send to the game server. Note that &amp;quot;lock:true&amp;quot; must always be specified in this list of parameter in order the interface can be locked during the server call.&lt;br /&gt;
* obj_callback: must be set to &amp;quot;this&amp;quot;.&lt;br /&gt;
* callback: a function to trigger when the server returns and everything went fine.&lt;br /&gt;
* callback_error: (optional and rarely used) a function to trigger when the server returns an error.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.ajaxcall( &#039;/mygame/mygame/myaction.html&#039;, { lock: true, &lt;br /&gt;
   arg1: myarg1, &lt;br /&gt;
   arg2: myarg2, &lt;br /&gt;
   ...&lt;br /&gt;
}, this, function( result ) {&lt;br /&gt;
   // Do some stuff after a successful call&lt;br /&gt;
} );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restricted arguments names (please don&#039;t use them):&lt;br /&gt;
* &amp;quot;action&amp;quot;&lt;br /&gt;
* &amp;quot;module&amp;quot;&lt;br /&gt;
* &amp;quot;class&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.confirmationDialog()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Display a confirmation dialog with a yes/no choice.&lt;br /&gt;
&lt;br /&gt;
We advice you to NOT use this function unless the player action is really critical and could ruins the game, because it slows down the game and upset players.&lt;br /&gt;
&lt;br /&gt;
Usage: this.confirmationDialog( &amp;quot;Question to displayed&amp;quot;, callback_function_if_click_on_yes );&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.confirmationDialog( _(&#039;Are you sure to use this bonus (points penalty at the end of the game) ?&#039;),&lt;br /&gt;
                         dojo.hitch( this, function() {&lt;br /&gt;
                           this.ajaxcall( &#039;/seasons/seasons/useBonus.html&#039;,&lt;br /&gt;
                                { id:bonus_id, lock:true }, this, function( result ) {} );&lt;br /&gt;
                        } ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; addEventToClass: function( cssClassName, eventName, functionName )&lt;br /&gt;
: Same as dojo.connect(), but for all the nodes set with the specified cssClassName&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addActionButton( id, label, method, (opt)destination, (opt)blinking, (opt)color )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can use this method to add an action button in the main action status bar.&lt;br /&gt;
&lt;br /&gt;
Arguments:&lt;br /&gt;
* id: an element ID that should be unique in your HTML DOM document.&lt;br /&gt;
* label: the text of the button. Should be translatable (use _() function).&lt;br /&gt;
* method: the name of your method that must be triggered when the player clicks on this button.&lt;br /&gt;
* destination (optional): deprecated, do not use this. Use &#039;&#039;&#039;null&#039;&#039;&#039; as value if you need to specify other arguments.&lt;br /&gt;
* blinking (optional): if set to &#039;&#039;&#039;true&#039;&#039;&#039;, the button is going blink to catch player&#039;s attention. Please don&#039;t abuse of blinking button.&lt;br /&gt;
* color: could be &#039;&#039;&#039;blue&#039;&#039;&#039; (default), &#039;&#039;&#039;red&#039;&#039;&#039; or &#039;&#039;&#039;gray&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
You should only use this method in your &amp;quot;onUpdateActionButtons&amp;quot; method. Usually, you use it like this (from Hears example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        onUpdateActionButtons: function( stateName, args ) {&lt;br /&gt;
                      &lt;br /&gt;
            if (this.isCurrentPlayerActive()) {            &lt;br /&gt;
                switch( stateName ) {&lt;br /&gt;
                case &#039;giveCards&#039;:&lt;br /&gt;
                    this.addActionButton( &#039;giveCards_button&#039;, _(&#039;Give selected cards&#039;), &#039;onGiveCards&#039; ); &lt;br /&gt;
                    break;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        },   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, we are adding a &amp;quot;Give selected cards&amp;quot; button in the case we are on game state &amp;quot;giveCards&amp;quot;. When player clicks on this button, it triggers our &amp;quot;onGiveCards&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Example using blinking red button:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     this.addActionButton( &#039;commit_button&#039;, _(&#039;Confirm&#039;), &#039;onConfirm&#039;, null, true, &#039;red&#039;); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: at least in studio example above will make button huge, because it sets it display of blinking things to &#039;&#039;&#039;block&#039;&#039;&#039;, &lt;br /&gt;
if you don&#039;t like it you have to change css display value&lt;br /&gt;
of the button to inline-block (the id of the button is the first argument, i.e &#039;commit_button&#039; in example above)&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Notifications ==&lt;br /&gt;
&lt;br /&gt;
When something happens on the server side, your game interface Javascript logic received a notification.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how you can handle these notifications on the client side.&lt;br /&gt;
&lt;br /&gt;
=== Subscribe to notifications ===&lt;br /&gt;
&lt;br /&gt;
Your Javascript &amp;quot;setupNotifications&amp;quot; method is the place where you can subscribe to notifications from your PHP code.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how you associate one of your Javascript method to a notification &amp;quot;playDisc&amp;quot; (from Reversi example):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   // In setupNotifications method:&lt;br /&gt;
   dojo.subscribe( &#039;playDisc&#039;, this, &amp;quot;notif_playDisc&amp;quot; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the &amp;quot;playDisc&amp;quot; corresponds to the name of the notification you define it in your PHP code, in your &amp;quot;notifyAllPlayers&amp;quot; or &amp;quot;notifyPlayer&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
Then, you have to define your &amp;quot;notif_playDisc&amp;quot; method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        notif_playDisc: function( notif )&lt;br /&gt;
        {&lt;br /&gt;
            // Remove current possible moves (makes the board more clear)&lt;br /&gt;
            dojo.query( &#039;.possibleMove&#039; ).removeClass( &#039;possibleMove&#039; );        &lt;br /&gt;
        &lt;br /&gt;
            this.addDiscOnBoard( notif.args.x, notif.args.y, notif.args.player_id );&lt;br /&gt;
        },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a notification handler like our &amp;quot;notif_playDisc&amp;quot; method, you can access to all notifications arguments with &amp;quot;notif.args&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    // If you did this on PHP side:&lt;br /&gt;
    self::notifyAllPlayers( &amp;quot;myNotification&amp;quot;, &#039;&#039;, array( &amp;quot;myArgument&amp;quot; =&amp;gt; 3 ) );&lt;br /&gt;
&lt;br /&gt;
    // On Javascript side, you can access the &amp;quot;myArgument&amp;quot; like this:&lt;br /&gt;
    notif_myNotification: function( notif )&lt;br /&gt;
    {&lt;br /&gt;
       alert( &amp;quot;myArgument = &amp;quot; + notif.args.myArgument );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Synchronous notifications ===&lt;br /&gt;
&lt;br /&gt;
When several notifications are received by your game interface, these notifications are processed immediately, one after the other, in the same exact order they have been generated in your PHP game logic.&lt;br /&gt;
&lt;br /&gt;
However, sometimes, you need to give some time to the players to figure out what happened on the game before jumping to the next notification. Indeed, in many games, they are a lot of automatic actions, and the computer is going to resolve all these actions very fast if you don&#039;t tell it not to do so.&lt;br /&gt;
&lt;br /&gt;
As an example, for Reversi, when someone is playing a disc, we want to wait 500 milliseconds before doing anything else in order the opponent player can figure out what move has been played.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s how we do this, right after our subscription:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       dojo.subscribe( &#039;playDisc&#039;, this, &amp;quot;notif_playDisc&amp;quot; );&lt;br /&gt;
       this.notifqueue.setSynchronous( &#039;playDisc&#039;, 500 );   // Wait 500 milliseconds after executing the playDisc handler&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Pre-defined notification types ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;tableWindow&#039;&#039;&#039; - This defines notification to display [[Game_interface_logic:_yourgamename.js#Scoring_dialogs|Scoring Dialogs]], see below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;message&#039;&#039;&#039; - This defines notification that shows on players log and have no other effect&lt;br /&gt;
&lt;br /&gt;
   // You can call this on php side without doing anything on client side&lt;br /&gt;
    self::notifyAllPlayers( &#039;message&#039;, &#039;hello&#039;, array( ) );&lt;br /&gt;
&lt;br /&gt;
== Tooltips ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltip( nodeId, _( helpString ), _( actionString ), delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add a simple text tooltip to the DOM node.&lt;br /&gt;
&lt;br /&gt;
Specify &#039;helpString&#039; to display some information about &amp;quot;what is this game element?&amp;quot;.&lt;br /&gt;
Specify &#039;actionString&#039; to display some information about &amp;quot;what happens when I click on this element?&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You must specify both helpString and actionString. Most of the time, you should use only one and specify a void string (&amp;quot;&amp;quot;) for the other one.&lt;br /&gt;
&lt;br /&gt;
Usually, _() must be used for the text to be marked for translation.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Delay&amp;quot; is an optional parameter. Usually, it is primarily used to specify a zero delay for some game element when the tooltip gives really important information for the game - but remember: no essential information must be placed in tooltips as they won&#039;t be displayed in some browsers (see [[BGA_Studio_Guidelines|Guidelines]]).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.addTooltip( &#039;cardcount&#039;, _(&#039;Number of cards in hand&#039;), &#039;&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipHtml( nodeId, html, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an HTML tooltip to the DOM node (for more elaborate content such as presenting a bigger version of a card).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipToClass( cssClass, _( helpString ), _( actionString ), delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add a simple text tooltip to all the DOM nodes set with this cssClass. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT: all concerned nodes must have IDs to get tooltips.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.addTooltipHtmlToClass( cssClass, html, delay )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Add an HTML tooltip to to all the DOM nodes set with this cssClass (for more elaborate content such as presenting a bigger version of a card).&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: all concerned nodes must have IDs to get tooltips&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.removeTooltip( nodeId )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Remove a tooltip from the DOM node.&lt;br /&gt;
&lt;br /&gt;
== Dialogs, warning messages, confirmation dialogs, ... ==&lt;br /&gt;
&lt;br /&gt;
=== Warning messages ===&lt;br /&gt;
&lt;br /&gt;
Sometimes, there is something important that is happening on the game and you have to make sure all players get the message. Most of the time, the evolution of the game situation or the game log is enough, but sometimes you need something more visible.&lt;br /&gt;
&lt;br /&gt;
Ex: someone fulfill one of the end of the game condition, so this is the last turn.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.showMessage( msg, type )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
showMessage shows a message in a big rectangular area on the top of the screen of current player.&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;msg&amp;quot; is the string to display. It should be translated.&lt;br /&gt;
* &amp;quot;type&amp;quot; can be set to &amp;quot;info&amp;quot; or &amp;quot;error&amp;quot;. If set to &amp;quot;info&amp;quot;, the message will be an informative message on a white background. If set to &amp;quot;error&amp;quot;, the message will be an error message on a red background.&lt;br /&gt;
&lt;br /&gt;
Important: the normal way to inform players about the progression of the game is the game log. &amp;quot;showMessage&amp;quot; is intrusive and should not be used often.&lt;br /&gt;
&lt;br /&gt;
=== Confirmation dialog ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;confirmationDialog( message, yesHandler, noHandler )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When an important action with a lot of consequences is triggered by the player, you may want to propose a confirmation dialog.&lt;br /&gt;
&lt;br /&gt;
CAREFUL: the general guidelines of BGA is to AVOID the use of confirmation dialog. Confirmation dialogs slow down the game and bother players. The players knows that they have to pay attention about each move when they are playing online.&lt;br /&gt;
&lt;br /&gt;
The situation where you should use a confirmation dialog are the following:&lt;br /&gt;
* It must not happen very often during a game.&lt;br /&gt;
* It must be linked to an action that can really &amp;quot;kill a game&amp;quot; if the player do not pay attention.&lt;br /&gt;
* It must be something that can be done by mistake (ex: a link on the action status bar).&lt;br /&gt;
&lt;br /&gt;
How to display a confirmation dialog:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        this.confirmationDialog( _(&#039;Are you sure you want to bake the pie?&#039;), dojo.hitch( this, function() {&lt;br /&gt;
            this.bakeThePie();&lt;br /&gt;
        } ) ); &lt;br /&gt;
        return; // nothing should be called or done after calling this, all action must be done in the handler  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Multiple choice dialog ===&lt;br /&gt;
You can use this dialog to give user a choice with small amount of options:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        var keys = [1,5,10];&lt;br /&gt;
        this.multipleChoiceDialog(&lt;br /&gt;
          _(&#039;How many bugs to fix?&amp;quot;), keys, &lt;br /&gt;
            dojo.hitch(this, function(choice) {&lt;br /&gt;
                            var bugchoice = keys[choice];&lt;br /&gt;
                            console.log(&#039;dialog callback with &#039;+bugchoice);&lt;br /&gt;
                            this.ajaxcall( &#039;/mygame/mygame/fixBugs.html&#039;, { bugs: bugchoice}, this, function( result ) {} );                        }));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Dialogs ===&lt;br /&gt;
&lt;br /&gt;
As a general rule, you shouldn&#039;t use dialogs windows.&lt;br /&gt;
&lt;br /&gt;
BGA guidelines specify that all game elements should be displayed on the main screen. Players can eventually scroll down to see game elements they don&#039;t need to see anytime, and you may eventually create anchors to move between game area section. Of course dialogs windows are very practical, but the thing is: all players know how to scroll down, and not all players know how to show up your dialog window. In addition, when the dialog shows up, players can&#039;t access the other game components.&lt;br /&gt;
&lt;br /&gt;
Sometimes although, you need to display a dialog window. Here is how you do this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Create the new dialog over the play zone. You should store the handler in a member variable to access it later&lt;br /&gt;
  this.myDlg = new ebg.popindialog();&lt;br /&gt;
  this.myDlg.create( &#039;myDialogUniqueId, &#039;left-side&#039; );&lt;br /&gt;
  this.myDlg.setTitle( _(&amp;quot;my dialog title to translate&amp;quot;) );&lt;br /&gt;
  this.myDlg.setMaxWidth( 500 ); // Optional&lt;br /&gt;
  &lt;br /&gt;
  // Create the HTML of my dialog. &lt;br /&gt;
  // The best practice here is to use [[Game_layout:_view_and_template:_yourgamename.view.php_and_yourgamename_yourgamename.tpl#Javascript_templates|Javascript templates]]&lt;br /&gt;
  var html = this.format_block( &#039;jstpl_myDialogTemplate&#039;, { &lt;br /&gt;
                arg1: myArg1,&lt;br /&gt;
                arg2: myArg2,&lt;br /&gt;
                ...&lt;br /&gt;
            } );  &lt;br /&gt;
&lt;br /&gt;
  // Show the dialog&lt;br /&gt;
  this.myDlg.setContent( html );&lt;br /&gt;
  this.myDlg.show();&lt;br /&gt;
  &lt;br /&gt;
  // Now that the dialog has been displayed, you can connect your method to some dialog elements&lt;br /&gt;
  // Example, a &amp;quot;close&amp;quot; button:&lt;br /&gt;
  dojo.connect( $(&#039;closeDlg&#039;), &#039;onclick&#039;, this, function(evt){&lt;br /&gt;
                evt.preventDefault();&lt;br /&gt;
                this.myDlg.destroy();&lt;br /&gt;
            } );&lt;br /&gt;
&lt;br /&gt;
=== Scoring dialogs ===&lt;br /&gt;
&lt;br /&gt;
Sometimes at the end of a round you want to display a big table that details the points wins in each section of the game.&lt;br /&gt;
&lt;br /&gt;
Example: in Hearts game, we display at the end of each round the number of &amp;quot;heart&amp;quot; cards collected by each player, the player who collected the Queen of Spades, and the total number of points loose by each player.&lt;br /&gt;
&lt;br /&gt;
Scoring dialogs are managed entirely on &#039;&#039;&#039;PHP side&#039;&#039;&#039;, but they are described here as their effects are visible only on client side.&lt;br /&gt;
&lt;br /&gt;
Displaying a scoring dialog is quite simple and is using a special notification type: &amp;quot;tableWindow&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  // on PHP side:&lt;br /&gt;
  $this-&amp;gt;notifyAllPlayers( &amp;quot;tableWindow&amp;quot;, &#039;&#039;, array(&lt;br /&gt;
            &amp;quot;id&amp;quot; =&amp;gt; &#039;finalScoring&#039;,&lt;br /&gt;
            &amp;quot;title&amp;quot; =&amp;gt; clienttranslate(&amp;quot;Title of the scoring dialog&amp;quot;),&lt;br /&gt;
            &amp;quot;table&amp;quot; =&amp;gt; $table&lt;br /&gt;
        ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;table&amp;quot; argument is a 2 dimensional PHP array that describe the table you want to display, line by line and column by column.&lt;br /&gt;
&lt;br /&gt;
Example: display an 3x3 array of strings&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $table = array(&lt;br /&gt;
      array( &amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, &amp;quot;three&amp;quot; ),    // This is my first line&lt;br /&gt;
      array( &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot; ),    // This is my second line&lt;br /&gt;
      array( &amp;quot;seven&amp;quot;, &amp;quot;height&amp;quot;, &amp;quot;nine&amp;quot; )    // This is my third line&lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see above, in each &amp;quot;cell&amp;quot; of your array you can display a simple string value. But you can also display a complex value with a template and associated arguments like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $table = array(&lt;br /&gt;
      array( &amp;quot;one&amp;quot;, &amp;quot;two&amp;quot;, array( &amp;quot;str&amp;quot; =&amp;gt; &amp;quot;a string with an ${argument}&amp;quot;, &amp;quot;args&amp;quot; =&amp;gt; array( &#039;argument&#039; =&amp;gt; &#039;argument_value&#039; )  ) ),&lt;br /&gt;
      array( &amp;quot;four&amp;quot;, &amp;quot;five&amp;quot;, &amp;quot;six&amp;quot; ), &lt;br /&gt;
      array( &amp;quot;seven&amp;quot;, &amp;quot;height&amp;quot;, &amp;quot;nine&amp;quot; )&lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is especially useful when you want to display player names with colors. Example from &amp;quot;Hearts&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $firstRow = array( &#039;&#039; );&lt;br /&gt;
        foreach( $players as $player_id =&amp;gt; $player )&lt;br /&gt;
        {&lt;br /&gt;
            $firstRow[] = array( &#039;str&#039; =&amp;gt; &#039;${player_name}&#039;,&lt;br /&gt;
                                 &#039;args&#039; =&amp;gt; array( &#039;player_name&#039; =&amp;gt; $player[&#039;player_name&#039;] ),&lt;br /&gt;
                                 &#039;type&#039; =&amp;gt; &#039;header&#039;&lt;br /&gt;
                               );&lt;br /&gt;
        }&lt;br /&gt;
        $table[] = $firstRow;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use three extra attributes in the parameter array for the notification:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   $this-&amp;gt;notifyAllPlayers( &amp;quot;tableWindow&amp;quot;, &#039;&#039;, array(&lt;br /&gt;
            &amp;quot;id&amp;quot; =&amp;gt; &#039;finalScoring&#039;,&lt;br /&gt;
            &amp;quot;title&amp;quot; =&amp;gt; clienttranslate(&amp;quot;Title of the scoring dialog&amp;quot;),&lt;br /&gt;
            &amp;quot;table&amp;quot; =&amp;gt; $table,&lt;br /&gt;
            &amp;quot;header&amp;quot; =&amp;gt; array(&#039;str&#039; =&amp;gt; clienttranslate(&#039;Table header with parameter ${number}&#039;),&lt;br /&gt;
                                 &#039;args&#039; =&amp;gt; array( &#039;number&#039; =&amp;gt; 3 ),&lt;br /&gt;
                               ),&lt;br /&gt;
            &amp;quot;footer&amp;quot; =&amp;gt; &#039;&amp;lt;div&amp;gt;Some footer&amp;lt;/div&amp;gt;&#039;,&lt;br /&gt;
            &amp;quot;closing&amp;quot; =&amp;gt; clienttranslate( &amp;quot;Closing button label&amp;quot; )&lt;br /&gt;
        ) ); &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;header&#039;&#039;&#039;: the content for this parameter will display before the table (also, the html will be parsed and player names will be colored according to the current game colors). &lt;br /&gt;
*&#039;&#039;&#039;footer&#039;&#039;&#039;: the content for this parameter will display after the table (no parsing for coloring the player names)&lt;br /&gt;
*&#039;&#039;&#039;closing&#039;&#039;&#039;: if this parameter is used, a button will be displayed with this label at the bottom of the popup and will allow players to close it (more easily than by clicking the top right &#039;cross&#039; icon).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scoring animated display ===&lt;br /&gt;
&lt;br /&gt;
Sometimes (Terra Mystica final scoring for example), you may want to display a score value over an element to make the scoring easier to follow for the players.&lt;br /&gt;
You can do it with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.displayScoring( anchor_id, color, score );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Speech bubble ===&lt;br /&gt;
&lt;br /&gt;
For better interactivity in some games (Love Letter for example), you may use comic book style speech bubbles to express the players voices.&lt;br /&gt;
This is done with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   this.showBubble( anchor_id, text, delay, duration, custom_class )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
delay in milliseconds is optional (default 0)&lt;br /&gt;
&lt;br /&gt;
duration in milliseconds is optional (default 3000)&lt;br /&gt;
&lt;br /&gt;
custom_class is optional, if you need to override the default bubble style&lt;br /&gt;
&lt;br /&gt;
== Update players score ==&lt;br /&gt;
&lt;br /&gt;
Increase a player score (with a positive or negative number):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this.scoreCtrl[ player_id ].incValue( score_delta );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set a player score to a specific value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this.scoreCtrl[ player_id ].setValue( new_score );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Players panels ==&lt;br /&gt;
&lt;br /&gt;
=== Adding stuff to player&#039;s panel ===&lt;br /&gt;
&lt;br /&gt;
At first, create a new &amp;quot;JS template&amp;quot; string in your template (tpl) file:&lt;br /&gt;
&lt;br /&gt;
(from Gomoku example)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var jstpl_player_board = &#039;\&amp;lt;div class=&amp;quot;cp_board&amp;quot;&amp;gt;\&lt;br /&gt;
    &amp;lt;div id=&amp;quot;stoneicon_p${id}&amp;quot; class=&amp;quot;gmk_stoneicon gmk_stoneicon_${color}&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;span id=&amp;quot;stonecount_p${id}&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;\&lt;br /&gt;
&amp;lt;/div&amp;gt;&#039;;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you add this piece of code in your JS file to add this template to each player panel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            // Setting up player boards&lt;br /&gt;
            for( var player_id in gamedatas.players )&lt;br /&gt;
            {&lt;br /&gt;
                var player = gamedatas.players[player_id];&lt;br /&gt;
                         &lt;br /&gt;
                // Setting up players boards if needed&lt;br /&gt;
                var player_board_div = $(&#039;player_board_&#039;+player_id);&lt;br /&gt;
                dojo.place( this.format_block(&#039;jstpl_player_board&#039;, player ), player_board_div );&lt;br /&gt;
            }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Note: the code above is of course from your &amp;quot;setup&amp;quot; function in your Javascript).&lt;br /&gt;
&lt;br /&gt;
Very often, you have to distinguish current player and others players. In this case, you just have to create another JS template (ex: jstpl_otherplayer_board) and use it when &amp;quot;player_id&amp;quot; is different than &amp;quot;this.player_id&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Player&#039;s panel disabling/enabling ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.disablePlayerPanel( player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Disable given player panel (the panel background become gray).&lt;br /&gt;
&lt;br /&gt;
Usually, this is used to signal that this played passes, or will be inactive during a while.&lt;br /&gt;
&lt;br /&gt;
Note that the only effect of this is visual. There are no consequences on the behaviour of the panel itself.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.enablePlayerPanel( player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable a player panel that has been disabled before.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;this.enableAllPlayerPanels()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enable all player panels that has been disabled before.&lt;br /&gt;
&lt;br /&gt;
== Image loading ==&lt;br /&gt;
&lt;br /&gt;
See also [[Game_art:_img_directory]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be careful&#039;&#039;&#039;: by default, ALL images of your img directory are loaded on a player&#039;s browser when he loads the game. For this reason, don&#039;t let in your img directory images that are not useful, otherwise it&#039;s going to slowdown the game load.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dontPreloadImage( image_file_name )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using dontPreloadImage, you tell the interface to not preload a specific image in your img directory.&lt;br /&gt;
&lt;br /&gt;
Example of use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
this.dontPreloadImage( &#039;cards.png&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is particularly useful if for example you have 2 different themes for a game. To accelerate the loading of the game, you can specify to not preload images corresponding to the other theme.&lt;br /&gt;
&lt;br /&gt;
Another example of use: in &amp;quot;Gosu&amp;quot; game with Kamakor extension, you play with 5 sets of cards among 10 available. Cards images are organized by sets, and we only preload the images corresponding to the 5 current sets with &#039;&#039;&#039;ensureSpecificGameImageLoading( image_file_names_array )&#039;&#039;&#039;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// By default, do not preload anything&lt;br /&gt;
this.dontPreloadImage( &#039;cards.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan1.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan2.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan3.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan4.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan5.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan6.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan7.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan8.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan9.png&#039; );&lt;br /&gt;
this.dontPreloadImage( &#039;clan10.png&#039; );&lt;br /&gt;
var to_preload = [];&lt;br /&gt;
for( i in this.gamedatas.clans )&lt;br /&gt;
{&lt;br /&gt;
	var clan_id = this.gamedatas.clans[i];&lt;br /&gt;
	to_preload.push( &#039;clan&#039;+clan_id+&#039;.png&#039; );&lt;br /&gt;
}&lt;br /&gt;
if( to_preload.length == 5 )&lt;br /&gt;
{&lt;br /&gt;
	this.ensureSpecificGameImageLoading( to_preload );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You don&#039;t need to specify to not preload game box images (game_box.png, game_box75.png...) since they are not preloaded by default.&lt;br /&gt;
&lt;br /&gt;
== Other useful stuff ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dojo.hitch&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With dojo.hitch, you can create a callback function that will run with your game object context whatever happen.&lt;br /&gt;
&lt;br /&gt;
Typical example: display a BGA confirmation dialog with a callback function created with dojo.hitch:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        this.confirmationDialog( _(&#039;Are you sure you want to make this?&#039;), dojo.hitch( this, function() {&lt;br /&gt;
            this.ajaxcall( &#039;/mygame/mygame/makeThis.html&#039;, { lock:true }, this, function( result ) {} );&lt;br /&gt;
        } ) );   &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the example above, using dojo.hitch, we ensure that the &amp;quot;this&amp;quot; object will be set when the callback is called.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; updateCounters(counters)&lt;br /&gt;
: Useful for updating game counters in the player panel (such as resources). &lt;br /&gt;
: &#039;counters&#039; arg is an associative array [counter_name_value =&amp;gt; [ &#039;counter_name&#039; =&amp;gt; counter_name_value, &#039;counter_value&#039; =&amp;gt; counter_value_value], ... ]&lt;br /&gt;
: All counters must be referenced in this.gamedatas.counters and will be updated.&lt;br /&gt;
: DOM objects referenced by &#039;counter_name&#039; will have their innerHTML updated with &#039;counter_value&#039;.&lt;br /&gt;
&lt;br /&gt;
== BGA GUI components ==&lt;br /&gt;
&lt;br /&gt;
BGA framework provides some useful ready-to-use components for the game interface:&lt;br /&gt;
&lt;br /&gt;
[[Studio#BGA_Studio_game_components_reference]]&lt;br /&gt;
&lt;br /&gt;
Note that each time you are using an additional component, you must declare it at the top of your Javascript file in the list of modules used.&lt;br /&gt;
&lt;br /&gt;
Example if you are using &amp;quot;ebg.stock&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
define([&lt;br /&gt;
    &amp;quot;dojo&amp;quot;,&amp;quot;dojo/_base/declare&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/core/gamegui&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/counter&amp;quot;,&lt;br /&gt;
    &amp;quot;ebg/stock&amp;quot;  /// &amp;lt;=== we are using ebg.stock module&lt;br /&gt;
],&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=3346</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=3346"/>
		<updated>2019-02-05T12:00:49Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Penalty Grid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General Rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Conflict of Interest ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the involved parties (accuser or accused player). Playing online with the involved parties does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: knowing them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players have the right to appeal against the moderation decision by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email how the moderator did not follow the BGA Moderation Policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the Moderation Policy hasn&#039;t been violated, BGA admins will double the penalty.&lt;br /&gt;
&lt;br /&gt;
=== Penalty Grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should follow the Penalty Grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalty:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player&#039;s wrong action can be qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* in case there is provocation, the penalty may be be reduced a little, and the author of the provocation may receive a warning, BUT as everyone should keep quiet and polite even if they are are provoked, this is up to the individual moderator.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
It is the moderator&#039;s job to determine the correct penalty in this case, considering the fact that the player had been warned by the first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider it a relapse, only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering that it&#039;s a lot of work to analyze reports about players, who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special Urgency Ban Procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== Private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
Note: In case a moderator discovers that this is obviously not a private joke, and that something must be reported, the moderator is allowed to create a report for the case. However, in this case, this moderator is not allowed to judge the report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 12 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, every report should be judge in a 4 weeks delay.&lt;br /&gt;
&lt;br /&gt;
=== Player Profile Influence ===&lt;br /&gt;
&lt;br /&gt;
The player&#039;s profile IS taken into account to determine if the player is guilty or not guilty. Moderators give more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player&#039;s profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered for a long time / has a lot of games played.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
You should also take into account the profile of the reporting player (report author) : a bad reputation and/or an important number of reports already judged as &amp;quot;not guilty&amp;quot; should incite you to be very careful with this player report.&lt;br /&gt;
&lt;br /&gt;
=== Incomplete Reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty Grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish for 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish for 30 days for small insults and insanity, forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: explicit sexual content, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (explicit sexual content, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
&lt;br /&gt;
Please also read: [[#Details_on_Avatar_policy]]&lt;br /&gt;
&lt;br /&gt;
 | Avatar immediate removal + Forbid to chat or publish between 3 days and forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Same as insult + Report author must explain that a username change is mandatory from &amp;quot;Preferences / Account / Account Management / Change my username. If there is another report 48 hours after the first one with no name change (or another insulting username) =&amp;gt; ban forever.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Forbid to chat or publish 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | As 99% of kingmaking reports are not accurate enough, we are not ignoring Kingmaking report (and now there are closed automatically). Instead, we&#039;ve add a &amp;quot;Kingmaking / team play&amp;quot; red thumb category, and we must incite players to use this (Red Thumbs) instead of report these players to moderation.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong intent to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. It is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP address, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
To detect multiple accounts, you should focus on ELO boosting, which is the reason of the multiple accounts 99% of the time. You should look at player game history, for a given game, and look at frequent opponents with a very good / perfect win rate.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Spam / advertising / inappropriate links&lt;br /&gt;
 | The player is using BGA for advertising. In particular: links not related to the purpose of the page, advertising for other online boardgaming websites, spam, ... &lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Translation stealing / vandalism&lt;br /&gt;
 | The player is writing inappropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their allotted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== Details on Avatar policy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is strictly forbidden is basically everything that may hurt a minor child or is forbidden by the laws:&lt;br /&gt;
* Sexually explicit content (ex: porn, genitals pictures, ...).&lt;br /&gt;
* Extreme violence or shocking images.&lt;br /&gt;
* Explicit reference to drugs,&lt;br /&gt;
* Offensive/vulgar content,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following categories are also forbidden, but we may tolerate some of them depending on the context (see below):&lt;br /&gt;
* Advertisements:&lt;br /&gt;
** As a rule of thumb, advertisement is forbidden.&lt;br /&gt;
** However, if it refers to a &amp;quot;cult brand&amp;quot; with no intention to provide a real advertisement (ex: football team), or if the reference to the brand is not obvious or discrete (ex: joke on Apple logo), it may be tolerated.&lt;br /&gt;
** Advertisement for board games publishers / board games in general is authorized.&lt;br /&gt;
** Advertisement for another online gaming service is strictly forbidden.&lt;br /&gt;
* &amp;quot;Sexy&amp;quot; images:&lt;br /&gt;
** If the main purpose of the image is &amp;quot;to be sexy&amp;quot; or &amp;quot;erotic&amp;quot;, it is forbidden.&lt;br /&gt;
** However, if the image is a fictional character that is considered sexy (ex: some heroïc fantasy character, super hero, ...), it may be tolerated.&lt;br /&gt;
* Politics / Religion / opinions:&lt;br /&gt;
** Images that refers to extreme positions / provocative ideas are of course forbidden (ex: nazi or other racists symbols).&lt;br /&gt;
** For the others: as a rule of thumb, players should avoid using their avatar to advertise for politics/religion or any other king of opinion. However, if the image is clearly non-shocking for a vast majority of BGA players, it should probably be tolerated.&lt;br /&gt;
* Text on image: our policy about BGA usernames also applied to the text on avatar images.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=3345</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=3345"/>
		<updated>2019-02-05T11:57:20Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General Rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Conflict of Interest ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the involved parties (accuser or accused player). Playing online with the involved parties does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: knowing them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players have the right to appeal against the moderation decision by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email how the moderator did not follow the BGA Moderation Policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the Moderation Policy hasn&#039;t been violated, BGA admins will double the penalty.&lt;br /&gt;
&lt;br /&gt;
=== Penalty Grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should follow the Penalty Grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalty:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player&#039;s wrong action can be qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* in case there is provocation, the penalty may be be reduced a little, and the author of the provocation may receive a warning, BUT as everyone should keep quiet and polite even if they are are provoked, this is up to the individual moderator.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
It is the moderator&#039;s job to determine the correct penalty in this case, considering the fact that the player had been warned by the first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider it a relapse, only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering that it&#039;s a lot of work to analyze reports about players, who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special Urgency Ban Procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== Private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
Note: In case a moderator discovers that this is obviously not a private joke, and that something must be reported, the moderator is allowed to create a report for the case. However, in this case, this moderator is not allowed to judge the report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 12 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, every report should be judge in a 4 weeks delay.&lt;br /&gt;
&lt;br /&gt;
=== Player Profile Influence ===&lt;br /&gt;
&lt;br /&gt;
The player&#039;s profile IS taken into account to determine if the player is guilty or not guilty. Moderators give more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player&#039;s profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered for a long time / has a lot of games played.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
You should also take into account the profile of the reporting player (report author) : a bad reputation and/or an important number of reports already judged as &amp;quot;not guilty&amp;quot; should incite you to be very careful with this player report.&lt;br /&gt;
&lt;br /&gt;
=== Incomplete Reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty Grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish for 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish for 30 days for small insults and insanity, forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: explicit sexual content, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (explicit sexual content, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Forbid to chat or publish between 3 days and forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Same as insult + Report author must explain that a username change is mandatory from &amp;quot;Preferences / Account / Account Management / Change my username. If there is another report 48 hours after the first one with no name change (or another insulting username) =&amp;gt; ban forever.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Forbid to chat or publish 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | As 99% of kingmaking reports are not accurate enough, we are not ignoring Kingmaking report (and now there are closed automatically). Instead, we&#039;ve add a &amp;quot;Kingmaking / team play&amp;quot; red thumb category, and we must incite players to use this (Red Thumbs) instead of report these players to moderation.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong intent to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. It is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP address, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
To detect multiple accounts, you should focus on ELO boosting, which is the reason of the multiple accounts 99% of the time. You should look at player game history, for a given game, and look at frequent opponents with a very good / perfect win rate.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Spam / advertising / inappropriate links&lt;br /&gt;
 | The player is using BGA for advertising. In particular: links not related to the purpose of the page, advertising for other online boardgaming websites, spam, ... &lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Translation stealing / vandalism&lt;br /&gt;
 | The player is writing inappropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their allotted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Details on Avatar policy ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is strictly forbidden is basically everything that may hurt a minor child or is forbidden by the laws:&lt;br /&gt;
* Sexually explicit content (ex: porn, genitals pictures, ...).&lt;br /&gt;
* Extreme violence or shocking images.&lt;br /&gt;
* Explicit reference to drugs,&lt;br /&gt;
* Offensive/vulgar content,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following categories are also forbidden, but we may tolerate some of them depending on the context (see below):&lt;br /&gt;
* Advertisements:&lt;br /&gt;
** As a rule of thumb, advertisement is forbidden.&lt;br /&gt;
** However, if it refers to a &amp;quot;cult brand&amp;quot; with no intention to provide a real advertisement (ex: football team), or if the reference to the brand is not obvious or discrete (ex: joke on Apple logo), it may be tolerated.&lt;br /&gt;
** Advertisement for board games publishers / board games in general is authorized.&lt;br /&gt;
** Advertisement for another online gaming service is strictly forbidden.&lt;br /&gt;
* &amp;quot;Sexy&amp;quot; images:&lt;br /&gt;
** If the main purpose of the image is &amp;quot;to be sexy&amp;quot; or &amp;quot;erotic&amp;quot;, it is forbidden.&lt;br /&gt;
** However, if the image is a fictional character that is considered sexy (ex: some heroïc fantasy character, super hero, ...), it may be tolerated.&lt;br /&gt;
* Politics / Religion / opinions:&lt;br /&gt;
** Images that refers to extreme positions / provocative ideas are of course forbidden (ex: nazi or other racists symbols).&lt;br /&gt;
** For the others: as a rule of thumb, players should avoid using their avatar to advertise for politics/religion or any other king of opinion. However, if the image is clearly non-shocking for a vast majority of BGA players, it should probably be tolerated.&lt;br /&gt;
* Text on image: our policy about BGA usernames also applied to the text on avatar images.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=3333</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=3333"/>
		<updated>2019-01-21T16:14:11Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Penalty Grid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General Rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Conflict of Interest ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the involved parties (accuser or accused player). Playing online with the involved parties does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: knowing them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players have the right to appeal against the moderation decision by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email how the moderator did not follow the BGA Moderation Policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the Moderation Policy hasn&#039;t been violated, BGA admins will double the penalty.&lt;br /&gt;
&lt;br /&gt;
=== Penalty Grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should follow the Penalty Grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalty:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player&#039;s wrong action can be qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* in case there is provocation, the penalty may be be reduced a little, and the author of the provocation may receive a warning, BUT as everyone should keep quiet and polite even if they are are provoked, this is up to the individual moderator.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
It is the moderator&#039;s job to determine the correct penalty in this case, considering the fact that the player had been warned by the first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider it a relapse, only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering that it&#039;s a lot of work to analyze reports about players, who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special Urgency Ban Procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== Private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
Note: In case a moderator discovers that this is obviously not a private joke, and that something must be reported, the moderator is allowed to create a report for the case. However, in this case, this moderator is not allowed to judge the report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 12 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, every report should be judge in a 4 weeks delay.&lt;br /&gt;
&lt;br /&gt;
=== Player Profile Influence ===&lt;br /&gt;
&lt;br /&gt;
The player&#039;s profile IS taken into account to determine if the player is guilty or not guilty. Moderators give more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player&#039;s profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered for a long time / has a lot of games played.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
You should also take into account the profile of the reporting player (report author) : a bad reputation and/or an important number of reports already judged as &amp;quot;not guilty&amp;quot; should incite you to be very careful with this player report.&lt;br /&gt;
&lt;br /&gt;
=== Incomplete Reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty Grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish for 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish for 30 days for small insults and insanity, forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: explicit sexual content, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (explicit sexual content, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Forbid to chat or publish between 3 days and forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Same as insult + Report author must explain that a username change is mandatory from &amp;quot;Preferences / Account / Account Management / Change my username. If there is another report 48 hours after the first one with no name change (or another insulting username) =&amp;gt; ban forever.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Forbid to chat or publish 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | As 99% of kingmaking reports are not accurate enough, we are not ignoring Kingmaking report (and now there are closed automatically). Instead, we&#039;ve add a &amp;quot;Kingmaking / team play&amp;quot; red thumb category, and we must incite players to use this (Red Thumbs) instead of report these players to moderation.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong intent to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. It is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP address, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
To detect multiple accounts, you should focus on ELO boosting, which is the reason of the multiple accounts 99% of the time. You should look at player game history, for a given game, and look at frequent opponents with a very good / perfect win rate.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Spam / advertising / inappropriate links&lt;br /&gt;
 | The player is using BGA for advertising. In particular: links not related to the purpose of the page, advertising for other online boardgaming websites, spam, ... &lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Translation stealing / vandalism&lt;br /&gt;
 | The player is writing inappropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their allotted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=3269</id>
		<title>Moderationpolicy</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Moderationpolicy&amp;diff=3269"/>
		<updated>2018-11-14T17:18:17Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Penalty Grid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== General Rules ==&lt;br /&gt;
&lt;br /&gt;
=== Beyond Reasonable Doubt ===&lt;br /&gt;
&lt;br /&gt;
In case there is any possible doubt, a player should be considered not guilty.&lt;br /&gt;
&lt;br /&gt;
=== Conflict of Interest ===&lt;br /&gt;
&lt;br /&gt;
Moderators must not process reports if they know the involved parties (accuser or accused player). Playing online with the involved parties does not mean to &amp;quot;know&amp;quot; them. &amp;quot;Know&amp;quot; means: knowing them personally or playing with them online very regularly.&lt;br /&gt;
&lt;br /&gt;
=== Appeal ===&lt;br /&gt;
&lt;br /&gt;
Players have the right to appeal against the moderation decision by forwarding received moderation email to &amp;quot;contact@boardgamearena.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;&#039;MUST&#039;&#039;&#039; explain in the email how the moderator did not follow the BGA Moderation Policy. If the explanation is not convincing, the email will be ignored. If the player is obviously guilty and if the Moderation Policy hasn&#039;t been violated, BGA admins will double the penalty.&lt;br /&gt;
&lt;br /&gt;
=== Penalty Grid ===&lt;br /&gt;
&lt;br /&gt;
Moderators should follow the Penalty Grid as much as possible. However, they have the right to adjust the penalty depending on the gravity of the case. The following situation can lead moderators to increase the penalty:&lt;br /&gt;
* the player has been reported several times for the same type of case.&lt;br /&gt;
* the player&#039;s wrong action can be qualified by one or several of the following terms: racism, xenophobia, homophobia, sexism, and as a rule of thumb any type of discrimination against a particular category of people.&lt;br /&gt;
* in case there is provocation, the penalty may be be reduced a little, and the author of the provocation may receive a warning, BUT as everyone should keep quiet and polite even if they are are provoked, this is up to the individual moderator.&lt;br /&gt;
&lt;br /&gt;
=== Relapse ===&lt;br /&gt;
&lt;br /&gt;
In case there is a relapse, the penalty increases exponentially.&lt;br /&gt;
&lt;br /&gt;
It is the moderator&#039;s job to determine the correct penalty in this case, considering the fact that the player had been warned by the first penalty.&lt;br /&gt;
&lt;br /&gt;
Moderators should consider it a relapse, only if the new wrong action occurs AFTER the previous penalty has been applied and the associated moderation email has been sent.&lt;br /&gt;
&lt;br /&gt;
Considering that it&#039;s a lot of work to analyze reports about players, who do the same action again and again, the &amp;quot;ban forever&amp;quot; penalty can be applied to any case if the player relapses.&lt;br /&gt;
&lt;br /&gt;
=== Special Urgency Ban Procedure ===&lt;br /&gt;
&lt;br /&gt;
Whatever the case type, moderators has the right to ban a player from the website (forever) if this player set up a situation that is out of control and must be stopped within hours. This special procedure should only be used if there is an immediate danger for the community (ex: vandalism, flow of insults, massive spam, ...).&lt;br /&gt;
&lt;br /&gt;
=== Private jokes ===&lt;br /&gt;
&lt;br /&gt;
If a wrong action happened in a private circle (ex: at a game table, with no spectators), and if none of the present players reported the action, the moderator must consider this was a &amp;quot;private joke&amp;quot; and must not apply any penalty. In the contrary, if the wrong action is public (ex: post/comment on the wall), the moderator may consider this as a wrong action even if there is no report.&lt;br /&gt;
&lt;br /&gt;
Note: In case a moderator discovers that this is obviously not a private joke, and that something must be reported, the moderator is allowed to create a report for the case. However, in this case, this moderator is not allowed to judge the report.&lt;br /&gt;
&lt;br /&gt;
=== Prescription ===&lt;br /&gt;
&lt;br /&gt;
For operational reason, a report that is older than 12 weeks may be closed by moderators because it is too old.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, every report should be judge in a 4 weeks delay.&lt;br /&gt;
&lt;br /&gt;
=== Player Profile Influence ===&lt;br /&gt;
&lt;br /&gt;
The player&#039;s profile IS taken into account to determine if the player is guilty or not guilty. Moderators give more credit to players with a good profile than the other.&lt;br /&gt;
&lt;br /&gt;
The player&#039;s profile is NOT taken into account when choosing the penalty if the player is found guilty.&lt;br /&gt;
&lt;br /&gt;
Good profile elements are:&lt;br /&gt;
* A good thumb up / thumb down ratio.&lt;br /&gt;
* Player is registered for a long time / has a lot of games played.&lt;br /&gt;
* Players is involved in the website (ex: realized translations).&lt;br /&gt;
* Player is supporting BGA (member of the club).&lt;br /&gt;
&lt;br /&gt;
You should also take into account the profile of the reporting player (report author) : a bad reputation and/or an important number of reports already judged as &amp;quot;not guilty&amp;quot; should incite you to be very careful with this player report.&lt;br /&gt;
&lt;br /&gt;
=== Incomplete Reports ===&lt;br /&gt;
&lt;br /&gt;
Analyzing reports takes a lot of time, and many reports are received. If any needed information is missing in the report, moderators may (and most of the time, should) close the report.&lt;br /&gt;
&lt;br /&gt;
== Penalty Grid ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable alternance centre&amp;quot;&lt;br /&gt;
|+ Titre&lt;br /&gt;
 |-&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Category&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Case type&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Details&lt;br /&gt;
 ! scope=&amp;quot;col&amp;quot; | Standard penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults during a game, on table chat&lt;br /&gt;
 | Must be present in the report: table ID, and the insults terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish for 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on general chat&lt;br /&gt;
 | Must be present in the report: the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish for 30 days for small insults and insanity, forever for real insults. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Insults&lt;br /&gt;
 | Insults on public space (wall, forum, comments...)&lt;br /&gt;
 | Must be present in the report: where to find the insult, the insult terms. If the insult is not in English, or if the insult is not obvious, the report author must specify why this is insulting.&lt;br /&gt;
 | Forbid to chat or publish 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Aggressive attitude&lt;br /&gt;
 | Aggressive attitude during a game: can&#039;t wait the other player, provocation, ...&lt;br /&gt;
 | As a rule of thumb: as long as there is no insult, this is not an issue: thumb down are the solution. BUT, if the player is really borderline and should be warned, a moderation action is needed.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should explain that this is a small warning, and that a change of attitude is needed.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate avatar: explicit sexual content, extreme violence, advertising...&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Avatar is really inappropriate in 3 cases:&lt;br /&gt;
1°) It can hurt underage players (explicit sexual content, extreme violence)&lt;br /&gt;
2°) This is advertisement / this violate some intellectual property&lt;br /&gt;
3°) The avatar contains a reference that discriminate a group of people (ex: nazi cross)&lt;br /&gt;
 | Avatar immediate removal + Forbid to chat or publish between 3 days and forever depending on the gravity. In any case: the player should be warn that this is the last warning before ban. If the player obviously don&#039;t measure the meaning of the avatar, the penalty can be reduced.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Avatar&lt;br /&gt;
 | Inappropriate username&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Username are inappropriate when this is obviously an insult for many people. Moderators shouldn&#039;t moderate a username that is insulting by accident in a language that is not widely used on BGA.&lt;br /&gt;
 | Same as insult + Report author must explain that a username change is mandatory from &amp;quot;Preferences / Account / Account Management / Change my username. If there is another report 48 hours after the first one with no name change (or another insulting username) =&amp;gt; ban forever.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Table description&lt;br /&gt;
 | Inappropriate table description&lt;br /&gt;
 | If needed, report author should explain why this is inappropriate. Table description is inappropriate when it contains insults, insanity, or tend to discriminate a group of people. &lt;br /&gt;
 | Forbid to chat or publish 3 days for small insults and insanity, 30 days for real insults. Smaller penalty (ex: 1 day) can be applied if this was obviously a stupid joke. In any case: the player should be warn that this is the last warning before ban.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Kingmaking&lt;br /&gt;
 | Kingmaking action during a game&lt;br /&gt;
 | The report must contains SEVERAL table id of game with 3+ players (the CANNOT be any kingmaking on 2 players games), the exact moves numbers, and the exact explanation why this is a kingmaking action. To declare a player guilty, the player must have played an obvious move against his own interest, and it has to be a good player (clues: his ELO, number of game played, ...). As the difference between a mistake and a kingmaking action is very tight, one kingmaking report is not enough to find a player guilty: only players who regularly play against their interest should be found guilty. Note that 99% of kingmaking reports are not accurate enough, contains not enough information, and are closed because of this.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Bug exploit&lt;br /&gt;
 | Exploit a known bug during a game&lt;br /&gt;
 | The bug must have been reported in the forum, and an exact reference to this bug must be in the report, with the table id and the move number. Minor bugs that can be considered as &amp;quot;variants&amp;quot; are NOT concerned (ex: pick 4 cards instead of 3). Bugs that violate the spirit of the game are concerned.&lt;br /&gt;
 | No penalty applies: if there is a bug that has been widely used for a game, a global ELO reset (or an ELO adjustment for players who exploited the bug) will be done. &lt;br /&gt;
 |-&lt;br /&gt;
 ! Private information&lt;br /&gt;
 | Some player gives some private information during the game&lt;br /&gt;
 | Players have the right to pretend things during a game. As these infos could be true or false, and could be exploited by other players too, moderators should be cautious when judging these cases. This case concerns players that had a strong intent to kill the pleasure of the game by giving some private information during the game.&lt;br /&gt;
 | -1 to -10 reputation penalty. Moderators should warn the player that this is a only small warning. Relapses can lead to higher reputation points penalties.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Multiple accounts&lt;br /&gt;
 | A player is using multiple accounts (most of the time: to boost his ELO rank)&lt;br /&gt;
 | The report must contains the usernames of all intimidated accounts, and the reason why the report author think that multiple accounts are used. It is very difficult to find out if different accounts corresponds to different person. For example: BGA accepts that multiple players plays from the same IP address, to allow people from the same family to play at the same table. In addition, some players are using multiple accounts, but these accounts are not playing together (which is acceptable). Strong tools are available for moderators to detect multiple accounts that are used the wrong way.&lt;br /&gt;
To detect multiple accounts, you should focus on ELO boosting, which is the reason of the multiple accounts 99% of the time. You should look at player game history, for a given game, and look at frequent opponents with a very good / perfect win rate.&lt;br /&gt;
 | For secondary accounts: ban forever. For main account: ELO reseted to 1500 / ELO penalty for all games.&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Spam / advertising / inappropriate links&lt;br /&gt;
 | The player is using BGA for advertising. In particular: links not related to the purpose of the page, advertising for other online boardgaming websites, spam, ... &lt;br /&gt;
 | &lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Translation stealing / vandalism&lt;br /&gt;
 | The player is writing inappropriate / poor quality translations (or writes a lot of very minor modifications to someone else translation) to gain free club membership, &lt;br /&gt;
 | Immediate ban from the website (to avoid vandalism).&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player is slow to play&lt;br /&gt;
 | Players have the right to think as long as they do not go over their allotted time. If the player is slow on purpose, the good answer is: thumb down.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
 ! Something else&lt;br /&gt;
 | Player quit the game before the end&lt;br /&gt;
 | In this case, player automatically gets a ELO penalty + a red mark on his profile. There is no need to do something else.&lt;br /&gt;
 | No penalty&lt;br /&gt;
 |-&lt;br /&gt;
&lt;br /&gt;
 |}&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=3224</id>
		<title>Main game logic: yourgamename.game.php</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=3224"/>
		<updated>2018-10-10T09:22:21Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* About random and randomness */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the main file for your game logic. Here you initialize the game, persist data, implement the rules and notify the client interface of changes.&lt;br /&gt;
&lt;br /&gt;
== File Structure ==&lt;br /&gt;
&lt;br /&gt;
The details of how the file is structured are described directly with comments in the code skeleton provided to you.&lt;br /&gt;
 &lt;br /&gt;
Here is the basic structure:&lt;br /&gt;
&lt;br /&gt;
* EmptyGame (constructor): where you define global variables.&lt;br /&gt;
* setupNewGame: initial setup of the game.&lt;br /&gt;
* getAllDatas: where you retrieve all game data during a complete reload of the game.&lt;br /&gt;
* getGameProgression: where you compute the game progression indicator.&lt;br /&gt;
* Utility functions: your utility functions.&lt;br /&gt;
* Player actions: the entry points for players actions. &lt;br /&gt;
* Game state arguments: methods to return additional data on specific game states ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#args more info here]).&lt;br /&gt;
* Game state actions: the logic to run when entering a new game state ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#action more info here]).&lt;br /&gt;
* zombieTurn: what to do it&#039;s the turn of a zombie player.&lt;br /&gt;
&lt;br /&gt;
== Accessing player information ==&lt;br /&gt;
&lt;br /&gt;
; getPlayersNumber()&lt;br /&gt;
: Returns the number of players playing at the table&lt;br /&gt;
: Note: doesn&#039;t work in setupNewGame so use count($players) instead&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerId()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot;, whatever what is the current state type.&lt;br /&gt;
: Note: it does NOT mean that this player is active right now, because state type could be &amp;quot;game&amp;quot; or &amp;quot;multiplayer&amp;quot;&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerName()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot; name&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; loadPlayersBasicInfos()&lt;br /&gt;
: Get an associative array with generic data about players (ie: not game specific data).&lt;br /&gt;
: The key of the associative array is the player id. The returned table is cached, so ok to call multiple times without performance concerns.&lt;br /&gt;
: The content of each value is:&lt;br /&gt;
: * player_name - the name of the player&lt;br /&gt;
: * player_color (ex: ff0000) - the color code of the player&lt;br /&gt;
: * player_no - the position of the player at the start of the game in natural table order, i.e. 1,2,3&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerId()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot;. The current player is the one from which the action originated (the one who send the request).&lt;br /&gt;
: &#039;&#039;&#039;Be careful&#039;&#039;&#039;: It is not always the active player.&lt;br /&gt;
: In general, you shouldn&#039;t use this method, unless you are in &amp;quot;multiplayer&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerName()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; name&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerColor()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; color&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; isCurrentPlayerZombie()&lt;br /&gt;
: Check the &amp;quot;current_player&amp;quot; zombie status. If true, player is zombie, i.e. left or was kicked out of the game.&lt;br /&gt;
&lt;br /&gt;
== Accessing the database ==&lt;br /&gt;
&lt;br /&gt;
The main game logic should be the only point from which you should access the game database. You access your database using SQL queries with the methods below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA uses [http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-transactions.html database transactions]. This means that your database changes WON&#039;T BE APPLIED to the database until your request ends normally. Using transactions is in fact very useful for you; at any time, if your game logic detects that something is wrong (example: a disallowed move), you just have to throw an exception and all changes to the game situation will be removed.&lt;br /&gt;
&lt;br /&gt;
; DbQuery( $sql )&lt;br /&gt;
: This is the generic method to access the database.&lt;br /&gt;
: It can execute any type of SELECT/UPDATE/DELETE/REPLACE query on the database.&lt;br /&gt;
: You should use it for UPDATE/DELETE/REPLACE queries. For SELECT queries, the specialized methods below are much better.&lt;br /&gt;
&lt;br /&gt;
; getUniqueValueFromDB( $sql )&lt;br /&gt;
: Returns a unique value from DB or null if no value is found.&lt;br /&gt;
: $sql must be a SELECT query.&lt;br /&gt;
: Raise an exception if more than 1 row is returned.&lt;br /&gt;
&lt;br /&gt;
; getCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Returns an associative array of rows for a sql SELECT query.&lt;br /&gt;
: The key of the resulting associative array is the first field specified in the SELECT query.&lt;br /&gt;
: The value of the resulting associative array if an associative array with all the field specified in the SELECT query and associated values.&lt;br /&gt;
: First column must be a primary or alternate key.&lt;br /&gt;
: The resulting collection can be empty.&lt;br /&gt;
: If you specified $bSingleValue=true and if your SQL query request 2 fields A and B, the method returns an associative array &amp;quot;A=&amp;gt;B&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 1235 =&amp;gt; array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; &#039;myuser0&#039;,&lt;br /&gt;
 1235 =&amp;gt; &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyCollectionFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if the collection is empty&lt;br /&gt;
&lt;br /&gt;
; getObjectFromDB( $sql )&lt;br /&gt;
: Returns one row for the sql SELECT query as an associative array or null if there is no result&lt;br /&gt;
: Raise an exception if the query return more than one row&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player WHERE player_id=&#039;$player_id&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
  &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 &lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyObjectFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if no row is found&lt;br /&gt;
&lt;br /&gt;
; getObjectListFromDB( $sql, $bUniqueValue=false )&lt;br /&gt;
: Return an array of rows for a sql SELECT query.&lt;br /&gt;
: the result if the same than &amp;quot;getCollectionFromDB&amp;quot; except that the result is a simple array (and not an associative array).&lt;br /&gt;
: The result can be empty.&lt;br /&gt;
: If you specified $bUniqueValue=true and if your SQL query request 1 field, the method returns directly an array of values.&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 &#039;myuser0&#039;,&lt;br /&gt;
 &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getDoubleKeyCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Return an associative array of associative array, from a SQL SELECT query.&lt;br /&gt;
: First array level correspond to first column specified in SQL query.&lt;br /&gt;
: Second array level correspond to second column specified in SQL query.&lt;br /&gt;
: If bSingleValue = true, keep only third column on result&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; DbGetLastId()&lt;br /&gt;
: Return the PRIMARY key of the last inserted row (see PHP mysql_insert_id function).&lt;br /&gt;
&lt;br /&gt;
; DbAffectedRow()&lt;br /&gt;
: Return the number of row affected by the last operation&lt;br /&gt;
&lt;br /&gt;
; escapeStringForDB( $string )&lt;br /&gt;
: You must use this function on every string type data in your database that contains unsafe data.&lt;br /&gt;
: (unsafe = can be modified by a player).&lt;br /&gt;
: This method makes sure that no SQL injection will be done through the string used.&lt;br /&gt;
: Note: if you using standard types in ajax actions, like AT_alphanum it is sanitized before arrival,&lt;br /&gt;
: this is only needed if you manage to get unchecked string, like in the games where user has to enter text as a response.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: see Editing [[Game database model: dbmodel.sql]] to know how to define your database model.&lt;br /&gt;
&lt;br /&gt;
== Use globals ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, you have to keep a single integer value that is global to your game, and you don&#039;t want to create a DB table specifically for it.&lt;br /&gt;
&lt;br /&gt;
Using a BGA framework &amp;quot;global&amp;quot;, you can do such a thing. Your value will be stored in the &amp;quot;global&amp;quot; table in database, and you can access it with simple methods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initGameStateLabels&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is located at the beginning of your game logic. This is the place you defines the globals used in your game logic, by assigning them IDs.&lt;br /&gt;
&lt;br /&gt;
You can define up to 79 globals, with IDs from 10 to 89. You must NOT use globals outside this range as globals are used by other components of the framework.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        self::initGameStateLabels( array( &lt;br /&gt;
                &amp;quot;my_first_global_variable&amp;quot; =&amp;gt; 10,&lt;br /&gt;
                &amp;quot;my_second_global_variable&amp;quot; =&amp;gt; 11&lt;br /&gt;
        ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateInitialValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Init your global value. Must be called before any use of your global, so you should call this method from your &amp;quot;setupNewGame&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getGameStateValue( $value_label )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Retrieve the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incGameStateValue( $value_label, $increment )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment the current value of a global. If increment is negative, decrement the value of the global.&lt;br /&gt;
&lt;br /&gt;
Return the final value of the global.&lt;br /&gt;
&lt;br /&gt;
== Game states and active players ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Activate player handling ===&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;activeNextPlayer()&lt;br /&gt;
: Make the next player active in the natural player order.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;activePrevPlayer()&lt;br /&gt;
: Make the previous player active (in the natural player order).&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;changeActivePlayer( $player_id )&lt;br /&gt;
: You can call this method to make any player active.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;getActivePlayerId()&lt;br /&gt;
: Return the &amp;quot;active_player&amp;quot; id&lt;br /&gt;
: Note: it does NOT mean that this player is active right now, because state type could be &amp;quot;game&amp;quot; or &amp;quot;multiplayer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Multiactivate player handling ===&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setAllPlayersMultiactive()&lt;br /&gt;
: All playing players are made active. Update notification is sent to all players (triggers onUpdateActionButtons).&lt;br /&gt;
: Usually, you use this method at the beginning (ex: &amp;quot;st&amp;quot; action method) of a multiplayer game state when all players have to do some action.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setAllPlayersNonMultiactive( $next_state )&lt;br /&gt;
: All playing players are made inactive. Transition to next state&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayersMultiactive( $players, $next_state, $bExclusive = false )&lt;br /&gt;
: Make a specific list of players active during a multiactive gamestate. Update notification is sent to all players who&#039;s state changed.&lt;br /&gt;
: &amp;quot;players&amp;quot; is the array of player id that should be made active.&lt;br /&gt;
: If &amp;quot;exclusive&amp;quot; parameter is not set or false it doesn&#039;t deactivate other previously active players. If its set to true, the players who will be multiactive at the end are only these in &amp;quot;$layers&amp;quot; array&lt;br /&gt;
&lt;br /&gt;
: In case &amp;quot;players&amp;quot; is empty, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
: returns true if state transition happened, false otherwise&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayerNonMultiactive( $player_id, $next_state )&lt;br /&gt;
: During a multiactive game state, make the specified player inactive.&lt;br /&gt;
: Usually, you call this method during a multiactive game state after a player did his action.&lt;br /&gt;
: If this player was the last active player, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
: returns true if state transition happened, false otherwise&lt;br /&gt;
&lt;br /&gt;
;  $this-&amp;gt;gamestate-&amp;gt;updateMultiactiveOrNextState( $next_state_if_none )&lt;br /&gt;
: Sends update notification about multiplayer changes. All multiactive set* functions above do that, however if you want to change state manually using db queries for complex calculations, you have to call this yourself after. Do not call this if you calling one of the other setters above.&lt;br /&gt;
Example: you have player teams and you want to activate all players in one team&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $sql = &amp;quot;UPDATE player SET player_is_multiactive=&#039;0&#039;&amp;quot;;&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        $sql = &amp;quot;UPDATE player SET player_is_multiactive=&#039;1&#039; WHERE player_id=&#039;$player_id&#039; AND player_team=&#039;$team_no&#039;&amp;quot;;&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        &lt;br /&gt;
        $this-&amp;gt;gamestate-&amp;gt;updateMultiactiveOrNextState( &#039;error&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;getActivePlayerList()&lt;br /&gt;
: With this method you can retrieve the list of the active player at any time.&lt;br /&gt;
: During a &amp;quot;game&amp;quot; type gamestate, it will return a void array.&lt;br /&gt;
: During a &amp;quot;activeplayer&amp;quot; type gamestate, it will return an array with one value (the active player id).&lt;br /&gt;
: During a &amp;quot;multipleactiveplayer&amp;quot; type gamestate, it will return an array of the active players id.&lt;br /&gt;
: Note: you should only use this method is the latter case.&lt;br /&gt;
&lt;br /&gt;
=== States functions ===&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;nextState( $transition )&lt;br /&gt;
: Change current state to a new state. Important: parameter $transition is the name of the transition, and NOT the name of the target game state, see [[Your game state machine: states.inc.php]] for more information about states.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;checkAction( $actionName, $bThrowException=true )&lt;br /&gt;
: Check if action is valid regarding current game state (exception if fails).&lt;br /&gt;
: The action is valid if it is listed as a &amp;quot;possibleactions&amp;quot; in the current game state (see game state description).&lt;br /&gt;
: This method MUST be called in the first place in ALL your PHP methods that handle players action, in order to make sure a player can&#039;t do an action when the rules disallow it at this moment of the game.&lt;br /&gt;
: if &amp;quot;bThrowException&amp;quot; is set to &amp;quot;false&amp;quot;, the function return false in case of failure instead of throwing and exception. This is useful when several actions are possible in order to test each of them without throwing exceptions.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;checkPossibleAction( $action )&lt;br /&gt;
: (rarely used)&lt;br /&gt;
: This works exactly like &amp;quot;checkAction&amp;quot;, except that it do NOT check if current player is active.&lt;br /&gt;
: This is used specifically in certain game states when you want to authorize some additional actions for players that are not active at the moment.&lt;br /&gt;
: Example: in Libertalia game, you want to authorize players to change their mind about card played. They are of course not active at the time they change their mind, so you cannot use &amp;quot;checkAction&amp;quot; and use &amp;quot;checkPossibleAction&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;state()&lt;br /&gt;
: Get an associative array of current game state attributes, see [[Your game state machine: states.inc.php]] for state attributes.&lt;br /&gt;
  $state=$this-&amp;gt;gamestate-&amp;gt;state(); if( $state[&#039;name&#039;] == &#039;myGameState&#039; ) {...}&lt;br /&gt;
&lt;br /&gt;
== Players turn order ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getNextPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return an associative array which associate each player with the next player around the table.&lt;br /&gt;
&lt;br /&gt;
In addition, key 0 is associated to the first player to play.&lt;br /&gt;
&lt;br /&gt;
Example: if three player with ID 1, 2 and 3 are around the table, in this order, the method returns:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   array( &lt;br /&gt;
    1 =&amp;gt; 2, &lt;br /&gt;
    2 =&amp;gt; 3, &lt;br /&gt;
    3 =&amp;gt; 1, &lt;br /&gt;
    0 =&amp;gt; 1 &lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPrevPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, but the associative array associate the previous player around the table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerAfter( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing after given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerBefore( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing before given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
Note: There is no API to modify this order, if you have custom player order you have to maintain it in your database&lt;br /&gt;
and have custom function to access it.&lt;br /&gt;
&lt;br /&gt;
== Notify players ==&lt;br /&gt;
&lt;br /&gt;
To understand notifications, please read [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance] first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notifications are sent at the very end of the request, when it ends normally. It means that if you throw an exception for any reason (ex: move not allowed), no notifications will be sent to players.&lt;br /&gt;
Notifications sent between the game start (setupNewGame) and the end of the &amp;quot;action&amp;quot; method of the first active state will never reach their destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyAllPlayers( $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send a notification to all players of the game.&lt;br /&gt;
&lt;br /&gt;
* notification_type:&lt;br /&gt;
A string that defines the type of your notification.&lt;br /&gt;
&lt;br /&gt;
Your game interface Javascript logic will use this to know what is the type of the received notification (and to trigger the corresponding method).&lt;br /&gt;
&lt;br /&gt;
* notification_log:&lt;br /&gt;
A string that defines what is to be displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
You can use an empty string here (&amp;quot;&amp;quot;). In this case, nothing is displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
If you define a real string here, you should use &amp;quot;clienttranslate&amp;quot; method to make sure it can be translate.&lt;br /&gt;
&lt;br /&gt;
You can use arguments in your notification_log strings, that refers to values defines in the &amp;quot;notification_args&amp;quot; argument (see below). &lt;br /&gt;
Note: Make sure you only use single quotes (&#039;), otherwise PHP will try to interpolate the variable and will ignore the values in the args array.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* notification_args:&lt;br /&gt;
The arguments of your notifications, as an associative array.&lt;br /&gt;
&lt;br /&gt;
This array will be transmitted to the game interface logic, in order the game interface can be updated.&lt;br /&gt;
&lt;br /&gt;
Complete notifyAllPlayers example (from &amp;quot;Reversi&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::notifyAllPlayers( &amp;quot;playDisc&amp;quot;, clienttranslate( &#039;${player_name} plays a disc and turns over ${returned_nbr} disc(s)&#039; ),&lt;br /&gt;
 array(&lt;br /&gt;
        &#039;player_id&#039; =&amp;gt; $player_id,&lt;br /&gt;
        &#039;player_name&#039; =&amp;gt; self::getActivePlayerName(),&lt;br /&gt;
        &#039;returned_nbr&#039; =&amp;gt; count( $turnedOverDiscs ),&lt;br /&gt;
        &#039;x&#039; =&amp;gt; $x,&lt;br /&gt;
        &#039;y&#039; =&amp;gt; $y&lt;br /&gt;
     ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see in the example above the use of the &amp;quot;clienttranslate&amp;quot; method, and the use of 2 arguments &amp;quot;player_name&amp;quot; and &amp;quot;returned_nbr&amp;quot; in the notification log.&lt;br /&gt;
&lt;br /&gt;
Important: NO private data must be sent with this method, as a cheater could see it even it is not used explicitly by the game interface logic. If you want to send private information to a player, please use notifyPlayer below.&lt;br /&gt;
&lt;br /&gt;
Note: you CAN use some HTML inside your notification log, however it not recommended for many reasons:&lt;br /&gt;
* Its bad architecture, ui elements leak into server now you have to manage ui in many places&lt;br /&gt;
* If you decided to change something in ui in future version, old games reply and tutorials may not work, since they use stored notifications&lt;br /&gt;
* When you read log preview for old games its unreadable (this is log before you enter the game reply, useful for troubleshooting or game analysis)&lt;br /&gt;
* Its more data to transfer and store in db&lt;br /&gt;
* Its nightmare for translators, at least don&#039;t put HTML tags inside the &amp;quot;clienttranslate&amp;quot; method. You can use a notification argument instead, and provide your HTML through this argument.&lt;br /&gt;
&lt;br /&gt;
If you still want to have pretty pictures in the log check this [[BGA_Studio_Cookbook#Inject_images_and_styled_html_in_the_log]].&lt;br /&gt;
&lt;br /&gt;
If your notification contains some phrases that build programmatically you may need to use recursive notifications. In this case the argument can be not only the string but&lt;br /&gt;
an array itself, which contains &#039;log&#039; and &#039;args&#039;, i.e.&lt;br /&gt;
&lt;br /&gt;
  $this-&amp;gt;notifyAllPlayers(&#039;playerLog&#039;,clienttranslate(&#039;Game moves ${token_name_rec}&#039;),&lt;br /&gt;
                   [&#039;token_name_rec&#039;=&amp;gt;[&#039;log&#039;=&amp;gt;&#039;${token_name} #${token_number}&#039;,&lt;br /&gt;
                                       &#039;args&#039;=&amp;gt; [&#039;token_name&#039;=&amp;gt;clienttranslate(&#039;Boo&#039;), &#039;token_number&#039;=&amp;gt;$number, &#039;i18n&#039;=&amp;gt;[&#039;token_name&#039;] ]&lt;br /&gt;
                                      ]&lt;br /&gt;
                   ]);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyPlayer( $player_id, $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, except that the notification is sent to one player only.&lt;br /&gt;
&lt;br /&gt;
This method must be used each time some private information must be transmitted to a player.&lt;br /&gt;
&lt;br /&gt;
Important: the variable for player name must be ${player_name} in order to be highlighted with the player color in the game log&lt;br /&gt;
&lt;br /&gt;
== About random and randomness ==&lt;br /&gt;
&lt;br /&gt;
A large number of board games rely on random, most often based on dice, cards shuffling, picking some item in a bag, and so on. This is very important to ensure a high level of randomness for each of these situations.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s are a list of techniques you should use in these situations, from the best to the worst.&lt;br /&gt;
&lt;br /&gt;
=== Dices and bga_rand ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bga_rand( min, max )&#039;&#039;&#039; &lt;br /&gt;
This is a BGA framework function that provides you a random number between &amp;quot;min&amp;quot; and &amp;quot;max&amp;quot; (included), using the best available random method available on the system.&lt;br /&gt;
&lt;br /&gt;
This is the preferred function you should use, because we are updating it when a better method is introduced.&lt;br /&gt;
&lt;br /&gt;
At now, bga_rand is based on the PHP function &amp;quot;random_int&amp;quot;, which ensure a cryptographic level of randomness.&lt;br /&gt;
&lt;br /&gt;
In particular, it is &#039;&#039;&#039;mandatory&#039;&#039;&#039; to use it for all &#039;&#039;&#039;dice throw&#039;&#039;&#039; (ie: games using other methods for dice throwing will be rejected by BGA during review).&lt;br /&gt;
&lt;br /&gt;
Note: rand() and mt_rand() are deprecated on BGA and should not be used anymore, as their randomness is not as good as &amp;quot;bga_rand&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== shuffle and cards shuffling ===&lt;br /&gt;
&lt;br /&gt;
To shuffle items, like a pile of cards, the best way is to use the BGA PHP [[Deck]] component and to use &amp;quot;shuffle&amp;quot; method. This ensure you that the best available shuffling method is used, and that if in the future we improve it your game will be up to date.&lt;br /&gt;
&lt;br /&gt;
At now, the Deck component shuffle method is based on PHP &amp;quot;shuffle&amp;quot; method, which has a quite good randomness (even it is not as good as bga_rand). In consequence, we accept other shuffling methods during reviews, as long as their are based on PHP &amp;quot;shuffle&amp;quot; function (or similar, like &amp;quot;array_rand&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== Other methods ===&lt;br /&gt;
&lt;br /&gt;
Mysql &amp;quot;RAND()&amp;quot; function has not enough randomness to be a valid method to get a random element on BGA. This function has been used in some existing games and has given acceptable results, but now it should be avoided and you should use other methods instead.&lt;br /&gt;
&lt;br /&gt;
== Game statistics ==&lt;br /&gt;
&lt;br /&gt;
There are 2 types of statistics:&lt;br /&gt;
* a &amp;quot;player&amp;quot; statistic is a statistic associated to a player&lt;br /&gt;
* a &amp;quot;table&amp;quot; statistics is a statistic not associated to a player (global statistic for this game).&lt;br /&gt;
&lt;br /&gt;
See [[Game statistics: stats.inc.php]] to see how you defines statistics for your game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initStat( $table_or_player, $name, $value, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a statistic entry  with a default value.&lt;br /&gt;
This method must be called for each statistics of your game, in your setupNewGame method.&lt;br /&gt;
&lt;br /&gt;
&#039;$table_or_player&#039; must be set to &amp;quot;table&amp;quot; if this is a table statistics, or &amp;quot;player&amp;quot; if this is a player statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;$name&#039; is the name of your statistics, as it has been defined in your stats.inc.php file.&lt;br /&gt;
&lt;br /&gt;
&#039;$value&#039; is the initial value of the statistics. If this is a player statistics and if the player is not specified by &amp;quot;$player_id&amp;quot; argument, the value is set for ALL players.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setStat( $value, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set a statistic $name to $value.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is not specified, setStat consider it is a TABLE statistic.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is specified, setStat consider it is a PLAYER statistic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incStat( $delta, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment (or decrement) specified statistic value by $delta value. Same behavior as setStat function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getStat( $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the value of statistic specified by $name. Useful when creating derivative statistics such as average.&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Manage player scores and Tie breaker ==&lt;br /&gt;
&lt;br /&gt;
=== Normal scoring ===&lt;br /&gt;
&lt;br /&gt;
At the end of the game, players automatically get a rank depending on their score: the player with the biggest score is #1, the player with the second biggest score is #2, and so on...&lt;br /&gt;
&lt;br /&gt;
During the game, you update player&#039;s score directly by updating &amp;quot;player_score&amp;quot; field of &amp;quot;player&amp;quot; table in database.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  // +2 points to active player&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=player_score+2 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Set score of active player to 5&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=5 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: don&#039;t forget to notify the client side in order the score control can be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
=== Tie breaker ===&lt;br /&gt;
&lt;br /&gt;
Tie breaker is used when two players get the same score at the end of a game.&lt;br /&gt;
&lt;br /&gt;
Tie breaker is using &amp;quot;player_score_aux&amp;quot; field of &amp;quot;player&amp;quot; table. It is updated exactly like the &amp;quot;player_score&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
Tie breaker score is displayed only for players who are tied at the end of the game. Most of the time, it is not supposed to be displayed explicitly during the game.&lt;br /&gt;
&lt;br /&gt;
When you are using &amp;quot;player_score_aux&amp;quot; functionality, you must describe the formula to use in your gameinfos.inc.php file like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         &#039;tie_breaker_description&#039; =&amp;gt; totranslate(&amp;quot;Describe here your tie breaker formula&amp;quot;),&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This description will be used as a tooltip to explain to players how this auxiliary score has been calculated.&lt;br /&gt;
&lt;br /&gt;
=== Co-operative game ===&lt;br /&gt;
&lt;br /&gt;
To make everyone lose in full-coop game:&lt;br /&gt;
&lt;br /&gt;
Add the following in gameinfos.inc.php :&lt;br /&gt;
&#039;is_coop&#039; =&amp;gt; 1, // full cooperative&lt;br /&gt;
&lt;br /&gt;
And score zero to everyone.&lt;br /&gt;
&lt;br /&gt;
=== Semi-coop ===&lt;br /&gt;
&lt;br /&gt;
If the game is not full-coop, then everyone lose = everyone is tie. I.e. set score to 0 to everybody.&lt;br /&gt;
&lt;br /&gt;
=== One winner only ===&lt;br /&gt;
If you need to one person to win and everybody else to lose, set the scores so that the winner has the best score, and the other players have the same (lower) score. Then add the following lines to gameinfos.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// If in the game, all losers are equal (no score to rank them or explicit in the rules that losers are not ranked between them), set this to true &lt;br /&gt;
// The game end result will display &amp;quot;Winner&amp;quot; for the 1st player and &amp;quot;Loser&amp;quot; for all other players&lt;br /&gt;
&#039;losers_not_ranked&#039; =&amp;gt; true,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quantum and Coup are implemented like this, as you can see here:&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=quantum&amp;amp;section=lastresults&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=coupcitystate&amp;amp;section=lastresults&lt;br /&gt;
&lt;br /&gt;
=== Solo ===&lt;br /&gt;
&lt;br /&gt;
If game supports solo variant, a negative score means defeat, a positive score means victory.&lt;br /&gt;
&lt;br /&gt;
=== Player elimination ===&lt;br /&gt;
&lt;br /&gt;
In some games, this is useful to eliminate a player from the game in order he/she can start another game without waiting for the current game end.&lt;br /&gt;
&lt;br /&gt;
This case should be rare. Please don&#039;t use player elimination feature if some player just has to wait the last 10% of the game for game end. This feature should be used only in games where players are eliminated all along the game (typical examples: &amp;quot;Perudo&amp;quot; or &amp;quot;The Werewolves of Miller&#039;s Hollow&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
* Player to eliminate should NOT be active anymore (preferably use the feature in a &amp;quot;game&amp;quot; type game state).&lt;br /&gt;
* In your PHP code:&lt;br /&gt;
  self::eliminatePlayer( &amp;lt;player_to_eliminate_id&amp;gt; );&lt;br /&gt;
* the player is informed in a dialog box that he no longer have to played and can start another game if he/she wants too (whith buttons &amp;quot;stay at this table&amp;quot; &amp;quot;quit table and back to main site&amp;quot;). In any case, the player is free to tart&amp;amp;join another table from now.&lt;br /&gt;
* When your game is over, all players who have been eliminated before receive a &amp;quot;notification&amp;quot; (the small &amp;quot;!&amp;quot; icon on the top right of the BGA interface) that indicate them that &amp;quot;the game has ended&amp;quot; and invite them to review the game results.&lt;br /&gt;
&lt;br /&gt;
=== Scoring Helper functions ===&lt;br /&gt;
&lt;br /&gt;
    // get score&lt;br /&gt;
    function dbGetScore($player_id) {&lt;br /&gt;
        return $this-&amp;gt;getUniqueValueFromDB(&amp;quot;SELECT player_score FROM player WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // set score&lt;br /&gt;
    function dbSetScore($player_id, $count) {&lt;br /&gt;
        $this-&amp;gt;DbQuery(&amp;quot;UPDATE player SET player_score=&#039;$count&#039; WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // set aux score (tie breaker)&lt;br /&gt;
    function dbSetAuxScore($player_id, $score) {&lt;br /&gt;
        $this-&amp;gt;DbQuery(&amp;quot;UPDATE player SET player_score_aux=$score WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // increment score (can be negative too)&lt;br /&gt;
    function dbIncScore($player_id, $inc) {&lt;br /&gt;
        $count = $this-&amp;gt;dbGetScore($player_id);&lt;br /&gt;
        if ($inc != 0) {&lt;br /&gt;
            $count += $inc;&lt;br /&gt;
            $this-&amp;gt;dbSetScore($player_id, $count);&lt;br /&gt;
        }&lt;br /&gt;
        return $count;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
== Reflexion time ==&lt;br /&gt;
&lt;br /&gt;
; function giveExtraTime( $player_id, $specific_time=null )&lt;br /&gt;
: Give standard extra time to this player.&lt;br /&gt;
: Standard extra time depends on the speed of the game (small with &amp;quot;slow&amp;quot; game option, bigger with other options).&lt;br /&gt;
: You can also specify an exact time to add, in seconds, with the &amp;quot;specified_time&amp;quot; argument (rarely used).&lt;br /&gt;
&lt;br /&gt;
== Managing errors and exceptions ==&lt;br /&gt;
&lt;br /&gt;
Note: when you throw an exception, all database changes and all notifications are cancelled immediately. This way, the game situation that existed before the request is completely restored.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaUserException ( $error_message)&lt;br /&gt;
: Base class to notify a user error&lt;br /&gt;
: You must throw this exception when a player wants to do something that he is not allowed to do.&lt;br /&gt;
: The error message will be shown to the player as a &amp;quot;red message&amp;quot;, so it must be translated.&lt;br /&gt;
: Throwing such an exception is NOT considered a bug, so it is not traced in BGA error logs.&lt;br /&gt;
&lt;br /&gt;
Example from Gomoku:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     throw new BgaUserException( self::_(&amp;quot;There is already a stone on this intersection, you can&#039;t play there&amp;quot;) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; throw new BgaVisibleSystemException ( $error_message)&lt;br /&gt;
: You must throw this exception when you detect something that is not supposed to happened in your code.&lt;br /&gt;
: The error message is shown to the user as an &amp;quot;Unexpected error&amp;quot;, in order that he can report it in the forum.&lt;br /&gt;
: The error message is logged in BGA error logs. If it happens regularly, we will report it to you.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaSystemException ( $error_message)&lt;br /&gt;
: Base class to notify a system exception. The message will be hidden from the user, but show in the logs. Use this if the message contains technical information.&lt;br /&gt;
: You shouldn&#039;t use this type of exception except if you think the information shown could be critical. Indeed: a generic error message will be shown to the user, so it&#039;s going to be difficult for you to see what happened.&lt;br /&gt;
&lt;br /&gt;
== Zombie mode ==&lt;br /&gt;
&lt;br /&gt;
When a player leaves a game for any reason (expelled, quit), he becomes a &amp;quot;zombie player&amp;quot;. In this case, the results of the game won&#039;t count for statistics, but this is cool if the other players can finish the game anyway. That&#039;s why zombie mode exists: allow the other player to finish the game, even if the situation is not ideal.&lt;br /&gt;
&lt;br /&gt;
While developing your zombie mode, keep in mind that:&lt;br /&gt;
* Do not refer to the rules, because this situation is not planned by the rules.&lt;br /&gt;
* Try to figure that you are playing with your friends and one of them has to leave: how can we finish the game without killing the spirit of the game?&lt;br /&gt;
* The idea is NOT to develop an artificial intelligence for the game.&lt;br /&gt;
&lt;br /&gt;
Most of the time, the best thing to do when it is zombie player turn is to jump immediately to a state where he is not active anymore. For example, if he is in a game state where he has a choice between playing A and playing B, the best thing to do is NOT to choose A or B, but to pass. So, even if there&#039;s no &amp;quot;pass&amp;quot; action in the rules, add a &amp;quot;zombiepass&amp;quot; transitition in your game state and use it.&lt;br /&gt;
&lt;br /&gt;
Each time a zombie player must play, your &amp;quot;zombieTurn&amp;quot; method is called.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* $state: the name of the current game state.&lt;br /&gt;
* $active_player: the id of the active player.&lt;br /&gt;
&lt;br /&gt;
Most of the time, your zombieTurn method looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    function zombieTurn( $state, $active_player )&lt;br /&gt;
    {&lt;br /&gt;
    	$statename = $state[&#039;name&#039;];&lt;br /&gt;
&lt;br /&gt;
        if( $statename == &#039;myFirstGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my2ndGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my3rdGameState&#039;&lt;br /&gt;
               ....&lt;br /&gt;
           )&lt;br /&gt;
        {&lt;br /&gt;
            $this-&amp;gt;gamestate-&amp;gt;nextState( &amp;quot;zombiePass&amp;quot; );&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            throw new BgaVisibleSystemException( &amp;quot;Zombie mode not supported at this game state: &amp;quot;.$statename );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that in the example above, all corresponding game state should implement &amp;quot;zombiePass&amp;quot; as a transition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Player color preferences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BGA players (Club members) may now choose their preferred color for playing. For example, if they are used to play green for every board game, they can select &amp;quot;green&amp;quot; in their BGA preferences page.&lt;br /&gt;
&lt;br /&gt;
Making your game compatible with colors preferences is very easy and requires only 1 line of PHP and 1 configuration change :&lt;br /&gt;
&lt;br /&gt;
On your gameinfos.inc.php file, add the following lines :&lt;br /&gt;
&lt;br /&gt;
  // Favorite colors support : if set to &amp;quot;true&amp;quot;, support attribution of favorite colors based on player&#039;s preferences (see reattributeColorsBasedOnPreferences PHP method)&lt;br /&gt;
  &#039;favorite_colors_support&#039; =&amp;gt; true,&lt;br /&gt;
&lt;br /&gt;
Then, on your main &amp;lt;your_game&amp;gt;.game.php file, find the &amp;quot;reloadPlayersBasicInfos&amp;quot; call in your &amp;quot;setupNewGame&amp;quot; method and replace :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
By :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reattributeColorsBasedOnPreferences( $players, array(  /* LIST HERE THE AVAILABLE COLORS OF YOUR GAME INSTEAD OF THESE ONES */&amp;quot;ff0000&amp;quot;, &amp;quot;008000&amp;quot;, &amp;quot;0000ff&amp;quot;, &amp;quot;ffa500&amp;quot;, &amp;quot;773300&amp;quot; ) );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;reattributeColorsBasedOnPreferences&amp;quot; method reattributes all colors, taking into account players color preferences and available colors.&lt;br /&gt;
&lt;br /&gt;
Note that you must update the colors to indicate the colors available for your game.&lt;br /&gt;
&lt;br /&gt;
2 important remarks :&lt;br /&gt;
* for some games (ex : Chess), the color has an influence on a mechanism of the game, most of the time by giving a special advantage to a player (ex : Starting the game). Color preference mechanism must NOT be used in such a case.&lt;br /&gt;
* your logic should NEVER consider that the first player has the color X, that the second player has the color Y, and so on. If this is the case, your game will NOT be compatible with reattributeColorsBasedOnPreferences as this method attribute colors to players based on their preferences and not based as their order at the table.&lt;br /&gt;
&lt;br /&gt;
Colours currently listed as a choice in preferences:&lt;br /&gt;
&lt;br /&gt;
* #ff0000 Red&lt;br /&gt;
* #008000 Green&lt;br /&gt;
* #0000ff Blue&lt;br /&gt;
* #ffa500 Yellow&lt;br /&gt;
* #000000 Black&lt;br /&gt;
* #ffffff White&lt;br /&gt;
&lt;br /&gt;
== Debugging and Tracing ==&lt;br /&gt;
&lt;br /&gt;
To debug php code you can use some tracing functions available from the parent class such as debug, trace, error, warn, dump.&lt;br /&gt;
  &lt;br /&gt;
  self::debug(&amp;quot;Ahh!&amp;quot;);&lt;br /&gt;
  self::dump(&#039;my_var&#039;,$my_var);&lt;br /&gt;
&lt;br /&gt;
See [[Practical_debugging]] section for complete information about debugging interfaces and where to find logs.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=3223</id>
		<title>Main game logic: yourgamename.game.php</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=3223"/>
		<updated>2018-10-10T09:19:11Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* bga_rand */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the main file for your game logic. Here you initialize the game, persist data, implement the rules and notify the client interface of changes.&lt;br /&gt;
&lt;br /&gt;
== File Structure ==&lt;br /&gt;
&lt;br /&gt;
The details of how the file is structured are described directly with comments in the code skeleton provided to you.&lt;br /&gt;
 &lt;br /&gt;
Here is the basic structure:&lt;br /&gt;
&lt;br /&gt;
* EmptyGame (constructor): where you define global variables.&lt;br /&gt;
* setupNewGame: initial setup of the game.&lt;br /&gt;
* getAllDatas: where you retrieve all game data during a complete reload of the game.&lt;br /&gt;
* getGameProgression: where you compute the game progression indicator.&lt;br /&gt;
* Utility functions: your utility functions.&lt;br /&gt;
* Player actions: the entry points for players actions. &lt;br /&gt;
* Game state arguments: methods to return additional data on specific game states ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#args more info here]).&lt;br /&gt;
* Game state actions: the logic to run when entering a new game state ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#action more info here]).&lt;br /&gt;
* zombieTurn: what to do it&#039;s the turn of a zombie player.&lt;br /&gt;
&lt;br /&gt;
== Accessing player information ==&lt;br /&gt;
&lt;br /&gt;
; getPlayersNumber()&lt;br /&gt;
: Returns the number of players playing at the table&lt;br /&gt;
: Note: doesn&#039;t work in setupNewGame so use count($players) instead&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerId()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot;, whatever what is the current state type.&lt;br /&gt;
: Note: it does NOT mean that this player is active right now, because state type could be &amp;quot;game&amp;quot; or &amp;quot;multiplayer&amp;quot;&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerName()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot; name&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; loadPlayersBasicInfos()&lt;br /&gt;
: Get an associative array with generic data about players (ie: not game specific data).&lt;br /&gt;
: The key of the associative array is the player id. The returned table is cached, so ok to call multiple times without performance concerns.&lt;br /&gt;
: The content of each value is:&lt;br /&gt;
: * player_name - the name of the player&lt;br /&gt;
: * player_color (ex: ff0000) - the color code of the player&lt;br /&gt;
: * player_no - the position of the player at the start of the game in natural table order, i.e. 1,2,3&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerId()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot;. The current player is the one from which the action originated (the one who send the request).&lt;br /&gt;
: &#039;&#039;&#039;Be careful&#039;&#039;&#039;: It is not always the active player.&lt;br /&gt;
: In general, you shouldn&#039;t use this method, unless you are in &amp;quot;multiplayer&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerName()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; name&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerColor()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; color&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; isCurrentPlayerZombie()&lt;br /&gt;
: Check the &amp;quot;current_player&amp;quot; zombie status. If true, player is zombie, i.e. left or was kicked out of the game.&lt;br /&gt;
&lt;br /&gt;
== Accessing the database ==&lt;br /&gt;
&lt;br /&gt;
The main game logic should be the only point from which you should access the game database. You access your database using SQL queries with the methods below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA uses [http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-transactions.html database transactions]. This means that your database changes WON&#039;T BE APPLIED to the database until your request ends normally. Using transactions is in fact very useful for you; at any time, if your game logic detects that something is wrong (example: a disallowed move), you just have to throw an exception and all changes to the game situation will be removed.&lt;br /&gt;
&lt;br /&gt;
; DbQuery( $sql )&lt;br /&gt;
: This is the generic method to access the database.&lt;br /&gt;
: It can execute any type of SELECT/UPDATE/DELETE/REPLACE query on the database.&lt;br /&gt;
: You should use it for UPDATE/DELETE/REPLACE queries. For SELECT queries, the specialized methods below are much better.&lt;br /&gt;
&lt;br /&gt;
; getUniqueValueFromDB( $sql )&lt;br /&gt;
: Returns a unique value from DB or null if no value is found.&lt;br /&gt;
: $sql must be a SELECT query.&lt;br /&gt;
: Raise an exception if more than 1 row is returned.&lt;br /&gt;
&lt;br /&gt;
; getCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Returns an associative array of rows for a sql SELECT query.&lt;br /&gt;
: The key of the resulting associative array is the first field specified in the SELECT query.&lt;br /&gt;
: The value of the resulting associative array if an associative array with all the field specified in the SELECT query and associated values.&lt;br /&gt;
: First column must be a primary or alternate key.&lt;br /&gt;
: The resulting collection can be empty.&lt;br /&gt;
: If you specified $bSingleValue=true and if your SQL query request 2 fields A and B, the method returns an associative array &amp;quot;A=&amp;gt;B&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 1235 =&amp;gt; array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; &#039;myuser0&#039;,&lt;br /&gt;
 1235 =&amp;gt; &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyCollectionFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if the collection is empty&lt;br /&gt;
&lt;br /&gt;
; getObjectFromDB( $sql )&lt;br /&gt;
: Returns one row for the sql SELECT query as an associative array or null if there is no result&lt;br /&gt;
: Raise an exception if the query return more than one row&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player WHERE player_id=&#039;$player_id&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
  &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 &lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyObjectFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if no row is found&lt;br /&gt;
&lt;br /&gt;
; getObjectListFromDB( $sql, $bUniqueValue=false )&lt;br /&gt;
: Return an array of rows for a sql SELECT query.&lt;br /&gt;
: the result if the same than &amp;quot;getCollectionFromDB&amp;quot; except that the result is a simple array (and not an associative array).&lt;br /&gt;
: The result can be empty.&lt;br /&gt;
: If you specified $bUniqueValue=true and if your SQL query request 1 field, the method returns directly an array of values.&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 &#039;myuser0&#039;,&lt;br /&gt;
 &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getDoubleKeyCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Return an associative array of associative array, from a SQL SELECT query.&lt;br /&gt;
: First array level correspond to first column specified in SQL query.&lt;br /&gt;
: Second array level correspond to second column specified in SQL query.&lt;br /&gt;
: If bSingleValue = true, keep only third column on result&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; DbGetLastId()&lt;br /&gt;
: Return the PRIMARY key of the last inserted row (see PHP mysql_insert_id function).&lt;br /&gt;
&lt;br /&gt;
; DbAffectedRow()&lt;br /&gt;
: Return the number of row affected by the last operation&lt;br /&gt;
&lt;br /&gt;
; escapeStringForDB( $string )&lt;br /&gt;
: You must use this function on every string type data in your database that contains unsafe data.&lt;br /&gt;
: (unsafe = can be modified by a player).&lt;br /&gt;
: This method makes sure that no SQL injection will be done through the string used.&lt;br /&gt;
: Note: if you using standard types in ajax actions, like AT_alphanum it is sanitized before arrival,&lt;br /&gt;
: this is only needed if you manage to get unchecked string, like in the games where user has to enter text as a response.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: see Editing [[Game database model: dbmodel.sql]] to know how to define your database model.&lt;br /&gt;
&lt;br /&gt;
== Use globals ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, you have to keep a single integer value that is global to your game, and you don&#039;t want to create a DB table specifically for it.&lt;br /&gt;
&lt;br /&gt;
Using a BGA framework &amp;quot;global&amp;quot;, you can do such a thing. Your value will be stored in the &amp;quot;global&amp;quot; table in database, and you can access it with simple methods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initGameStateLabels&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is located at the beginning of your game logic. This is the place you defines the globals used in your game logic, by assigning them IDs.&lt;br /&gt;
&lt;br /&gt;
You can define up to 79 globals, with IDs from 10 to 89. You must NOT use globals outside this range as globals are used by other components of the framework.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        self::initGameStateLabels( array( &lt;br /&gt;
                &amp;quot;my_first_global_variable&amp;quot; =&amp;gt; 10,&lt;br /&gt;
                &amp;quot;my_second_global_variable&amp;quot; =&amp;gt; 11&lt;br /&gt;
        ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateInitialValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Init your global value. Must be called before any use of your global, so you should call this method from your &amp;quot;setupNewGame&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getGameStateValue( $value_label )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Retrieve the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incGameStateValue( $value_label, $increment )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment the current value of a global. If increment is negative, decrement the value of the global.&lt;br /&gt;
&lt;br /&gt;
Return the final value of the global.&lt;br /&gt;
&lt;br /&gt;
== Game states and active players ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Activate player handling ===&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;activeNextPlayer()&lt;br /&gt;
: Make the next player active in the natural player order.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;activePrevPlayer()&lt;br /&gt;
: Make the previous player active (in the natural player order).&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;changeActivePlayer( $player_id )&lt;br /&gt;
: You can call this method to make any player active.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;getActivePlayerId()&lt;br /&gt;
: Return the &amp;quot;active_player&amp;quot; id&lt;br /&gt;
: Note: it does NOT mean that this player is active right now, because state type could be &amp;quot;game&amp;quot; or &amp;quot;multiplayer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Multiactivate player handling ===&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setAllPlayersMultiactive()&lt;br /&gt;
: All playing players are made active. Update notification is sent to all players (triggers onUpdateActionButtons).&lt;br /&gt;
: Usually, you use this method at the beginning (ex: &amp;quot;st&amp;quot; action method) of a multiplayer game state when all players have to do some action.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setAllPlayersNonMultiactive( $next_state )&lt;br /&gt;
: All playing players are made inactive. Transition to next state&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayersMultiactive( $players, $next_state, $bExclusive = false )&lt;br /&gt;
: Make a specific list of players active during a multiactive gamestate. Update notification is sent to all players who&#039;s state changed.&lt;br /&gt;
: &amp;quot;players&amp;quot; is the array of player id that should be made active.&lt;br /&gt;
: If &amp;quot;exclusive&amp;quot; parameter is not set or false it doesn&#039;t deactivate other previously active players. If its set to true, the players who will be multiactive at the end are only these in &amp;quot;$layers&amp;quot; array&lt;br /&gt;
&lt;br /&gt;
: In case &amp;quot;players&amp;quot; is empty, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
: returns true if state transition happened, false otherwise&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayerNonMultiactive( $player_id, $next_state )&lt;br /&gt;
: During a multiactive game state, make the specified player inactive.&lt;br /&gt;
: Usually, you call this method during a multiactive game state after a player did his action.&lt;br /&gt;
: If this player was the last active player, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
: returns true if state transition happened, false otherwise&lt;br /&gt;
&lt;br /&gt;
;  $this-&amp;gt;gamestate-&amp;gt;updateMultiactiveOrNextState( $next_state_if_none )&lt;br /&gt;
: Sends update notification about multiplayer changes. All multiactive set* functions above do that, however if you want to change state manually using db queries for complex calculations, you have to call this yourself after. Do not call this if you calling one of the other setters above.&lt;br /&gt;
Example: you have player teams and you want to activate all players in one team&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $sql = &amp;quot;UPDATE player SET player_is_multiactive=&#039;0&#039;&amp;quot;;&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        $sql = &amp;quot;UPDATE player SET player_is_multiactive=&#039;1&#039; WHERE player_id=&#039;$player_id&#039; AND player_team=&#039;$team_no&#039;&amp;quot;;&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        &lt;br /&gt;
        $this-&amp;gt;gamestate-&amp;gt;updateMultiactiveOrNextState( &#039;error&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;getActivePlayerList()&lt;br /&gt;
: With this method you can retrieve the list of the active player at any time.&lt;br /&gt;
: During a &amp;quot;game&amp;quot; type gamestate, it will return a void array.&lt;br /&gt;
: During a &amp;quot;activeplayer&amp;quot; type gamestate, it will return an array with one value (the active player id).&lt;br /&gt;
: During a &amp;quot;multipleactiveplayer&amp;quot; type gamestate, it will return an array of the active players id.&lt;br /&gt;
: Note: you should only use this method is the latter case.&lt;br /&gt;
&lt;br /&gt;
=== States functions ===&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;nextState( $transition )&lt;br /&gt;
: Change current state to a new state. Important: parameter $transition is the name of the transition, and NOT the name of the target game state, see [[Your game state machine: states.inc.php]] for more information about states.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;checkAction( $actionName, $bThrowException=true )&lt;br /&gt;
: Check if action is valid regarding current game state (exception if fails).&lt;br /&gt;
: The action is valid if it is listed as a &amp;quot;possibleactions&amp;quot; in the current game state (see game state description).&lt;br /&gt;
: This method MUST be called in the first place in ALL your PHP methods that handle players action, in order to make sure a player can&#039;t do an action when the rules disallow it at this moment of the game.&lt;br /&gt;
: if &amp;quot;bThrowException&amp;quot; is set to &amp;quot;false&amp;quot;, the function return false in case of failure instead of throwing and exception. This is useful when several actions are possible in order to test each of them without throwing exceptions.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;checkPossibleAction( $action )&lt;br /&gt;
: (rarely used)&lt;br /&gt;
: This works exactly like &amp;quot;checkAction&amp;quot;, except that it do NOT check if current player is active.&lt;br /&gt;
: This is used specifically in certain game states when you want to authorize some additional actions for players that are not active at the moment.&lt;br /&gt;
: Example: in Libertalia game, you want to authorize players to change their mind about card played. They are of course not active at the time they change their mind, so you cannot use &amp;quot;checkAction&amp;quot; and use &amp;quot;checkPossibleAction&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;state()&lt;br /&gt;
: Get an associative array of current game state attributes, see [[Your game state machine: states.inc.php]] for state attributes.&lt;br /&gt;
  $state=$this-&amp;gt;gamestate-&amp;gt;state(); if( $state[&#039;name&#039;] == &#039;myGameState&#039; ) {...}&lt;br /&gt;
&lt;br /&gt;
== Players turn order ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getNextPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return an associative array which associate each player with the next player around the table.&lt;br /&gt;
&lt;br /&gt;
In addition, key 0 is associated to the first player to play.&lt;br /&gt;
&lt;br /&gt;
Example: if three player with ID 1, 2 and 3 are around the table, in this order, the method returns:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   array( &lt;br /&gt;
    1 =&amp;gt; 2, &lt;br /&gt;
    2 =&amp;gt; 3, &lt;br /&gt;
    3 =&amp;gt; 1, &lt;br /&gt;
    0 =&amp;gt; 1 &lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPrevPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, but the associative array associate the previous player around the table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerAfter( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing after given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerBefore( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing before given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
Note: There is no API to modify this order, if you have custom player order you have to maintain it in your database&lt;br /&gt;
and have custom function to access it.&lt;br /&gt;
&lt;br /&gt;
== Notify players ==&lt;br /&gt;
&lt;br /&gt;
To understand notifications, please read [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance] first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notifications are sent at the very end of the request, when it ends normally. It means that if you throw an exception for any reason (ex: move not allowed), no notifications will be sent to players.&lt;br /&gt;
Notifications sent between the game start (setupNewGame) and the end of the &amp;quot;action&amp;quot; method of the first active state will never reach their destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyAllPlayers( $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send a notification to all players of the game.&lt;br /&gt;
&lt;br /&gt;
* notification_type:&lt;br /&gt;
A string that defines the type of your notification.&lt;br /&gt;
&lt;br /&gt;
Your game interface Javascript logic will use this to know what is the type of the received notification (and to trigger the corresponding method).&lt;br /&gt;
&lt;br /&gt;
* notification_log:&lt;br /&gt;
A string that defines what is to be displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
You can use an empty string here (&amp;quot;&amp;quot;). In this case, nothing is displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
If you define a real string here, you should use &amp;quot;clienttranslate&amp;quot; method to make sure it can be translate.&lt;br /&gt;
&lt;br /&gt;
You can use arguments in your notification_log strings, that refers to values defines in the &amp;quot;notification_args&amp;quot; argument (see below). &lt;br /&gt;
Note: Make sure you only use single quotes (&#039;), otherwise PHP will try to interpolate the variable and will ignore the values in the args array.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* notification_args:&lt;br /&gt;
The arguments of your notifications, as an associative array.&lt;br /&gt;
&lt;br /&gt;
This array will be transmitted to the game interface logic, in order the game interface can be updated.&lt;br /&gt;
&lt;br /&gt;
Complete notifyAllPlayers example (from &amp;quot;Reversi&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::notifyAllPlayers( &amp;quot;playDisc&amp;quot;, clienttranslate( &#039;${player_name} plays a disc and turns over ${returned_nbr} disc(s)&#039; ),&lt;br /&gt;
 array(&lt;br /&gt;
        &#039;player_id&#039; =&amp;gt; $player_id,&lt;br /&gt;
        &#039;player_name&#039; =&amp;gt; self::getActivePlayerName(),&lt;br /&gt;
        &#039;returned_nbr&#039; =&amp;gt; count( $turnedOverDiscs ),&lt;br /&gt;
        &#039;x&#039; =&amp;gt; $x,&lt;br /&gt;
        &#039;y&#039; =&amp;gt; $y&lt;br /&gt;
     ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see in the example above the use of the &amp;quot;clienttranslate&amp;quot; method, and the use of 2 arguments &amp;quot;player_name&amp;quot; and &amp;quot;returned_nbr&amp;quot; in the notification log.&lt;br /&gt;
&lt;br /&gt;
Important: NO private data must be sent with this method, as a cheater could see it even it is not used explicitly by the game interface logic. If you want to send private information to a player, please use notifyPlayer below.&lt;br /&gt;
&lt;br /&gt;
Note: you CAN use some HTML inside your notification log, however it not recommended for many reasons:&lt;br /&gt;
* Its bad architecture, ui elements leak into server now you have to manage ui in many places&lt;br /&gt;
* If you decided to change something in ui in future version, old games reply and tutorials may not work, since they use stored notifications&lt;br /&gt;
* When you read log preview for old games its unreadable (this is log before you enter the game reply, useful for troubleshooting or game analysis)&lt;br /&gt;
* Its more data to transfer and store in db&lt;br /&gt;
* Its nightmare for translators, at least don&#039;t put HTML tags inside the &amp;quot;clienttranslate&amp;quot; method. You can use a notification argument instead, and provide your HTML through this argument.&lt;br /&gt;
&lt;br /&gt;
If you still want to have pretty pictures in the log check this [[BGA_Studio_Cookbook#Inject_images_and_styled_html_in_the_log]].&lt;br /&gt;
&lt;br /&gt;
If your notification contains some phrases that build programmatically you may need to use recursive notifications. In this case the argument can be not only the string but&lt;br /&gt;
an array itself, which contains &#039;log&#039; and &#039;args&#039;, i.e.&lt;br /&gt;
&lt;br /&gt;
  $this-&amp;gt;notifyAllPlayers(&#039;playerLog&#039;,clienttranslate(&#039;Game moves ${token_name_rec}&#039;),&lt;br /&gt;
                   [&#039;token_name_rec&#039;=&amp;gt;[&#039;log&#039;=&amp;gt;&#039;${token_name} #${token_number}&#039;,&lt;br /&gt;
                                       &#039;args&#039;=&amp;gt; [&#039;token_name&#039;=&amp;gt;clienttranslate(&#039;Boo&#039;), &#039;token_number&#039;=&amp;gt;$number, &#039;i18n&#039;=&amp;gt;[&#039;token_name&#039;] ]&lt;br /&gt;
                                      ]&lt;br /&gt;
                   ]);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyPlayer( $player_id, $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, except that the notification is sent to one player only.&lt;br /&gt;
&lt;br /&gt;
This method must be used each time some private information must be transmitted to a player.&lt;br /&gt;
&lt;br /&gt;
Important: the variable for player name must be ${player_name} in order to be highlighted with the player color in the game log&lt;br /&gt;
&lt;br /&gt;
== About random and randomness ==&lt;br /&gt;
&lt;br /&gt;
A large number of board games rely on random, most often based on dice, cards shuffling, picking some item in a bag, and so on. This is very important to ensure a high level of randomness for each of these situations.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s are a list of techniques you should use in these situations, from the best to the worst.&lt;br /&gt;
&lt;br /&gt;
=== Dices and bga_rand ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bga_rand( min, max )&#039;&#039;&#039; &lt;br /&gt;
This is a BGA framework function that provides you a random number between &amp;quot;min&amp;quot; and &amp;quot;max&amp;quot; (included), using the best available random method available on the system.&lt;br /&gt;
&lt;br /&gt;
This is the preferred function you should use, because we are updating it when a better method is introduced.&lt;br /&gt;
&lt;br /&gt;
At now, bga_rand is based on the PHP function &amp;quot;random_int&amp;quot;, which ensure a cryptographic level of randomness.&lt;br /&gt;
&lt;br /&gt;
In particular, it is &#039;&#039;&#039;mandatory&#039;&#039;&#039; to use it for all &#039;&#039;&#039;dice throw&#039;&#039;&#039; (ie: games using other methods for dice throwing will be rejected by BGA during review).&lt;br /&gt;
&lt;br /&gt;
Note: rand() and mt_rand() are deprecated on BGA and should not be used anymore, as their randomness is not as good as &amp;quot;bga_rand&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== shuffle and cards shuffling ===&lt;br /&gt;
&lt;br /&gt;
To shuffle items, like a pile of cards, the best way is to use the BGA PHP [[Deck]] component and to use &amp;quot;shuffle&amp;quot; method. This ensure you that the best available shuffling method is used, and that if in the future we improve it your game will be up to date.&lt;br /&gt;
&lt;br /&gt;
At now, the Deck component shuffle method is based on PHP &amp;quot;shuffle&amp;quot; method, which has a quite good randomness (even it is not as good as bga_rand). In consequence, we accept other shuffling methods during reviews, as long as their are based on PHP &amp;quot;shuffle&amp;quot; function (or similar, like &amp;quot;array_rand&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Game statistics ==&lt;br /&gt;
&lt;br /&gt;
There are 2 types of statistics:&lt;br /&gt;
* a &amp;quot;player&amp;quot; statistic is a statistic associated to a player&lt;br /&gt;
* a &amp;quot;table&amp;quot; statistics is a statistic not associated to a player (global statistic for this game).&lt;br /&gt;
&lt;br /&gt;
See [[Game statistics: stats.inc.php]] to see how you defines statistics for your game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initStat( $table_or_player, $name, $value, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a statistic entry  with a default value.&lt;br /&gt;
This method must be called for each statistics of your game, in your setupNewGame method.&lt;br /&gt;
&lt;br /&gt;
&#039;$table_or_player&#039; must be set to &amp;quot;table&amp;quot; if this is a table statistics, or &amp;quot;player&amp;quot; if this is a player statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;$name&#039; is the name of your statistics, as it has been defined in your stats.inc.php file.&lt;br /&gt;
&lt;br /&gt;
&#039;$value&#039; is the initial value of the statistics. If this is a player statistics and if the player is not specified by &amp;quot;$player_id&amp;quot; argument, the value is set for ALL players.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setStat( $value, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set a statistic $name to $value.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is not specified, setStat consider it is a TABLE statistic.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is specified, setStat consider it is a PLAYER statistic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incStat( $delta, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment (or decrement) specified statistic value by $delta value. Same behavior as setStat function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getStat( $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the value of statistic specified by $name. Useful when creating derivative statistics such as average.&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Manage player scores and Tie breaker ==&lt;br /&gt;
&lt;br /&gt;
=== Normal scoring ===&lt;br /&gt;
&lt;br /&gt;
At the end of the game, players automatically get a rank depending on their score: the player with the biggest score is #1, the player with the second biggest score is #2, and so on...&lt;br /&gt;
&lt;br /&gt;
During the game, you update player&#039;s score directly by updating &amp;quot;player_score&amp;quot; field of &amp;quot;player&amp;quot; table in database.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  // +2 points to active player&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=player_score+2 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Set score of active player to 5&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=5 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: don&#039;t forget to notify the client side in order the score control can be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
=== Tie breaker ===&lt;br /&gt;
&lt;br /&gt;
Tie breaker is used when two players get the same score at the end of a game.&lt;br /&gt;
&lt;br /&gt;
Tie breaker is using &amp;quot;player_score_aux&amp;quot; field of &amp;quot;player&amp;quot; table. It is updated exactly like the &amp;quot;player_score&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
Tie breaker score is displayed only for players who are tied at the end of the game. Most of the time, it is not supposed to be displayed explicitly during the game.&lt;br /&gt;
&lt;br /&gt;
When you are using &amp;quot;player_score_aux&amp;quot; functionality, you must describe the formula to use in your gameinfos.inc.php file like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         &#039;tie_breaker_description&#039; =&amp;gt; totranslate(&amp;quot;Describe here your tie breaker formula&amp;quot;),&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This description will be used as a tooltip to explain to players how this auxiliary score has been calculated.&lt;br /&gt;
&lt;br /&gt;
=== Co-operative game ===&lt;br /&gt;
&lt;br /&gt;
To make everyone lose in full-coop game:&lt;br /&gt;
&lt;br /&gt;
Add the following in gameinfos.inc.php :&lt;br /&gt;
&#039;is_coop&#039; =&amp;gt; 1, // full cooperative&lt;br /&gt;
&lt;br /&gt;
And score zero to everyone.&lt;br /&gt;
&lt;br /&gt;
=== Semi-coop ===&lt;br /&gt;
&lt;br /&gt;
If the game is not full-coop, then everyone lose = everyone is tie. I.e. set score to 0 to everybody.&lt;br /&gt;
&lt;br /&gt;
=== One winner only ===&lt;br /&gt;
If you need to one person to win and everybody else to lose, set the scores so that the winner has the best score, and the other players have the same (lower) score. Then add the following lines to gameinfos.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// If in the game, all losers are equal (no score to rank them or explicit in the rules that losers are not ranked between them), set this to true &lt;br /&gt;
// The game end result will display &amp;quot;Winner&amp;quot; for the 1st player and &amp;quot;Loser&amp;quot; for all other players&lt;br /&gt;
&#039;losers_not_ranked&#039; =&amp;gt; true,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quantum and Coup are implemented like this, as you can see here:&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=quantum&amp;amp;section=lastresults&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=coupcitystate&amp;amp;section=lastresults&lt;br /&gt;
&lt;br /&gt;
=== Solo ===&lt;br /&gt;
&lt;br /&gt;
If game supports solo variant, a negative score means defeat, a positive score means victory.&lt;br /&gt;
&lt;br /&gt;
=== Player elimination ===&lt;br /&gt;
&lt;br /&gt;
In some games, this is useful to eliminate a player from the game in order he/she can start another game without waiting for the current game end.&lt;br /&gt;
&lt;br /&gt;
This case should be rare. Please don&#039;t use player elimination feature if some player just has to wait the last 10% of the game for game end. This feature should be used only in games where players are eliminated all along the game (typical examples: &amp;quot;Perudo&amp;quot; or &amp;quot;The Werewolves of Miller&#039;s Hollow&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
* Player to eliminate should NOT be active anymore (preferably use the feature in a &amp;quot;game&amp;quot; type game state).&lt;br /&gt;
* In your PHP code:&lt;br /&gt;
  self::eliminatePlayer( &amp;lt;player_to_eliminate_id&amp;gt; );&lt;br /&gt;
* the player is informed in a dialog box that he no longer have to played and can start another game if he/she wants too (whith buttons &amp;quot;stay at this table&amp;quot; &amp;quot;quit table and back to main site&amp;quot;). In any case, the player is free to tart&amp;amp;join another table from now.&lt;br /&gt;
* When your game is over, all players who have been eliminated before receive a &amp;quot;notification&amp;quot; (the small &amp;quot;!&amp;quot; icon on the top right of the BGA interface) that indicate them that &amp;quot;the game has ended&amp;quot; and invite them to review the game results.&lt;br /&gt;
&lt;br /&gt;
=== Scoring Helper functions ===&lt;br /&gt;
&lt;br /&gt;
    // get score&lt;br /&gt;
    function dbGetScore($player_id) {&lt;br /&gt;
        return $this-&amp;gt;getUniqueValueFromDB(&amp;quot;SELECT player_score FROM player WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // set score&lt;br /&gt;
    function dbSetScore($player_id, $count) {&lt;br /&gt;
        $this-&amp;gt;DbQuery(&amp;quot;UPDATE player SET player_score=&#039;$count&#039; WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // set aux score (tie breaker)&lt;br /&gt;
    function dbSetAuxScore($player_id, $score) {&lt;br /&gt;
        $this-&amp;gt;DbQuery(&amp;quot;UPDATE player SET player_score_aux=$score WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // increment score (can be negative too)&lt;br /&gt;
    function dbIncScore($player_id, $inc) {&lt;br /&gt;
        $count = $this-&amp;gt;dbGetScore($player_id);&lt;br /&gt;
        if ($inc != 0) {&lt;br /&gt;
            $count += $inc;&lt;br /&gt;
            $this-&amp;gt;dbSetScore($player_id, $count);&lt;br /&gt;
        }&lt;br /&gt;
        return $count;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
== Reflexion time ==&lt;br /&gt;
&lt;br /&gt;
; function giveExtraTime( $player_id, $specific_time=null )&lt;br /&gt;
: Give standard extra time to this player.&lt;br /&gt;
: Standard extra time depends on the speed of the game (small with &amp;quot;slow&amp;quot; game option, bigger with other options).&lt;br /&gt;
: You can also specify an exact time to add, in seconds, with the &amp;quot;specified_time&amp;quot; argument (rarely used).&lt;br /&gt;
&lt;br /&gt;
== Managing errors and exceptions ==&lt;br /&gt;
&lt;br /&gt;
Note: when you throw an exception, all database changes and all notifications are cancelled immediately. This way, the game situation that existed before the request is completely restored.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaUserException ( $error_message)&lt;br /&gt;
: Base class to notify a user error&lt;br /&gt;
: You must throw this exception when a player wants to do something that he is not allowed to do.&lt;br /&gt;
: The error message will be shown to the player as a &amp;quot;red message&amp;quot;, so it must be translated.&lt;br /&gt;
: Throwing such an exception is NOT considered a bug, so it is not traced in BGA error logs.&lt;br /&gt;
&lt;br /&gt;
Example from Gomoku:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     throw new BgaUserException( self::_(&amp;quot;There is already a stone on this intersection, you can&#039;t play there&amp;quot;) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; throw new BgaVisibleSystemException ( $error_message)&lt;br /&gt;
: You must throw this exception when you detect something that is not supposed to happened in your code.&lt;br /&gt;
: The error message is shown to the user as an &amp;quot;Unexpected error&amp;quot;, in order that he can report it in the forum.&lt;br /&gt;
: The error message is logged in BGA error logs. If it happens regularly, we will report it to you.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaSystemException ( $error_message)&lt;br /&gt;
: Base class to notify a system exception. The message will be hidden from the user, but show in the logs. Use this if the message contains technical information.&lt;br /&gt;
: You shouldn&#039;t use this type of exception except if you think the information shown could be critical. Indeed: a generic error message will be shown to the user, so it&#039;s going to be difficult for you to see what happened.&lt;br /&gt;
&lt;br /&gt;
== Zombie mode ==&lt;br /&gt;
&lt;br /&gt;
When a player leaves a game for any reason (expelled, quit), he becomes a &amp;quot;zombie player&amp;quot;. In this case, the results of the game won&#039;t count for statistics, but this is cool if the other players can finish the game anyway. That&#039;s why zombie mode exists: allow the other player to finish the game, even if the situation is not ideal.&lt;br /&gt;
&lt;br /&gt;
While developing your zombie mode, keep in mind that:&lt;br /&gt;
* Do not refer to the rules, because this situation is not planned by the rules.&lt;br /&gt;
* Try to figure that you are playing with your friends and one of them has to leave: how can we finish the game without killing the spirit of the game?&lt;br /&gt;
* The idea is NOT to develop an artificial intelligence for the game.&lt;br /&gt;
&lt;br /&gt;
Most of the time, the best thing to do when it is zombie player turn is to jump immediately to a state where he is not active anymore. For example, if he is in a game state where he has a choice between playing A and playing B, the best thing to do is NOT to choose A or B, but to pass. So, even if there&#039;s no &amp;quot;pass&amp;quot; action in the rules, add a &amp;quot;zombiepass&amp;quot; transitition in your game state and use it.&lt;br /&gt;
&lt;br /&gt;
Each time a zombie player must play, your &amp;quot;zombieTurn&amp;quot; method is called.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* $state: the name of the current game state.&lt;br /&gt;
* $active_player: the id of the active player.&lt;br /&gt;
&lt;br /&gt;
Most of the time, your zombieTurn method looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    function zombieTurn( $state, $active_player )&lt;br /&gt;
    {&lt;br /&gt;
    	$statename = $state[&#039;name&#039;];&lt;br /&gt;
&lt;br /&gt;
        if( $statename == &#039;myFirstGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my2ndGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my3rdGameState&#039;&lt;br /&gt;
               ....&lt;br /&gt;
           )&lt;br /&gt;
        {&lt;br /&gt;
            $this-&amp;gt;gamestate-&amp;gt;nextState( &amp;quot;zombiePass&amp;quot; );&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            throw new BgaVisibleSystemException( &amp;quot;Zombie mode not supported at this game state: &amp;quot;.$statename );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that in the example above, all corresponding game state should implement &amp;quot;zombiePass&amp;quot; as a transition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Player color preferences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BGA players (Club members) may now choose their preferred color for playing. For example, if they are used to play green for every board game, they can select &amp;quot;green&amp;quot; in their BGA preferences page.&lt;br /&gt;
&lt;br /&gt;
Making your game compatible with colors preferences is very easy and requires only 1 line of PHP and 1 configuration change :&lt;br /&gt;
&lt;br /&gt;
On your gameinfos.inc.php file, add the following lines :&lt;br /&gt;
&lt;br /&gt;
  // Favorite colors support : if set to &amp;quot;true&amp;quot;, support attribution of favorite colors based on player&#039;s preferences (see reattributeColorsBasedOnPreferences PHP method)&lt;br /&gt;
  &#039;favorite_colors_support&#039; =&amp;gt; true,&lt;br /&gt;
&lt;br /&gt;
Then, on your main &amp;lt;your_game&amp;gt;.game.php file, find the &amp;quot;reloadPlayersBasicInfos&amp;quot; call in your &amp;quot;setupNewGame&amp;quot; method and replace :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
By :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reattributeColorsBasedOnPreferences( $players, array(  /* LIST HERE THE AVAILABLE COLORS OF YOUR GAME INSTEAD OF THESE ONES */&amp;quot;ff0000&amp;quot;, &amp;quot;008000&amp;quot;, &amp;quot;0000ff&amp;quot;, &amp;quot;ffa500&amp;quot;, &amp;quot;773300&amp;quot; ) );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;reattributeColorsBasedOnPreferences&amp;quot; method reattributes all colors, taking into account players color preferences and available colors.&lt;br /&gt;
&lt;br /&gt;
Note that you must update the colors to indicate the colors available for your game.&lt;br /&gt;
&lt;br /&gt;
2 important remarks :&lt;br /&gt;
* for some games (ex : Chess), the color has an influence on a mechanism of the game, most of the time by giving a special advantage to a player (ex : Starting the game). Color preference mechanism must NOT be used in such a case.&lt;br /&gt;
* your logic should NEVER consider that the first player has the color X, that the second player has the color Y, and so on. If this is the case, your game will NOT be compatible with reattributeColorsBasedOnPreferences as this method attribute colors to players based on their preferences and not based as their order at the table.&lt;br /&gt;
&lt;br /&gt;
Colours currently listed as a choice in preferences:&lt;br /&gt;
&lt;br /&gt;
* #ff0000 Red&lt;br /&gt;
* #008000 Green&lt;br /&gt;
* #0000ff Blue&lt;br /&gt;
* #ffa500 Yellow&lt;br /&gt;
* #000000 Black&lt;br /&gt;
* #ffffff White&lt;br /&gt;
&lt;br /&gt;
== Debugging and Tracing ==&lt;br /&gt;
&lt;br /&gt;
To debug php code you can use some tracing functions available from the parent class such as debug, trace, error, warn, dump.&lt;br /&gt;
  &lt;br /&gt;
  self::debug(&amp;quot;Ahh!&amp;quot;);&lt;br /&gt;
  self::dump(&#039;my_var&#039;,$my_var);&lt;br /&gt;
&lt;br /&gt;
See [[Practical_debugging]] section for complete information about debugging interfaces and where to find logs.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=3222</id>
		<title>Main game logic: yourgamename.game.php</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=3222"/>
		<updated>2018-10-10T09:18:57Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* About random and randomness */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the main file for your game logic. Here you initialize the game, persist data, implement the rules and notify the client interface of changes.&lt;br /&gt;
&lt;br /&gt;
== File Structure ==&lt;br /&gt;
&lt;br /&gt;
The details of how the file is structured are described directly with comments in the code skeleton provided to you.&lt;br /&gt;
 &lt;br /&gt;
Here is the basic structure:&lt;br /&gt;
&lt;br /&gt;
* EmptyGame (constructor): where you define global variables.&lt;br /&gt;
* setupNewGame: initial setup of the game.&lt;br /&gt;
* getAllDatas: where you retrieve all game data during a complete reload of the game.&lt;br /&gt;
* getGameProgression: where you compute the game progression indicator.&lt;br /&gt;
* Utility functions: your utility functions.&lt;br /&gt;
* Player actions: the entry points for players actions. &lt;br /&gt;
* Game state arguments: methods to return additional data on specific game states ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#args more info here]).&lt;br /&gt;
* Game state actions: the logic to run when entering a new game state ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#action more info here]).&lt;br /&gt;
* zombieTurn: what to do it&#039;s the turn of a zombie player.&lt;br /&gt;
&lt;br /&gt;
== Accessing player information ==&lt;br /&gt;
&lt;br /&gt;
; getPlayersNumber()&lt;br /&gt;
: Returns the number of players playing at the table&lt;br /&gt;
: Note: doesn&#039;t work in setupNewGame so use count($players) instead&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerId()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot;, whatever what is the current state type.&lt;br /&gt;
: Note: it does NOT mean that this player is active right now, because state type could be &amp;quot;game&amp;quot; or &amp;quot;multiplayer&amp;quot;&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerName()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot; name&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; loadPlayersBasicInfos()&lt;br /&gt;
: Get an associative array with generic data about players (ie: not game specific data).&lt;br /&gt;
: The key of the associative array is the player id. The returned table is cached, so ok to call multiple times without performance concerns.&lt;br /&gt;
: The content of each value is:&lt;br /&gt;
: * player_name - the name of the player&lt;br /&gt;
: * player_color (ex: ff0000) - the color code of the player&lt;br /&gt;
: * player_no - the position of the player at the start of the game in natural table order, i.e. 1,2,3&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerId()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot;. The current player is the one from which the action originated (the one who send the request).&lt;br /&gt;
: &#039;&#039;&#039;Be careful&#039;&#039;&#039;: It is not always the active player.&lt;br /&gt;
: In general, you shouldn&#039;t use this method, unless you are in &amp;quot;multiplayer&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerName()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; name&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerColor()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; color&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; isCurrentPlayerZombie()&lt;br /&gt;
: Check the &amp;quot;current_player&amp;quot; zombie status. If true, player is zombie, i.e. left or was kicked out of the game.&lt;br /&gt;
&lt;br /&gt;
== Accessing the database ==&lt;br /&gt;
&lt;br /&gt;
The main game logic should be the only point from which you should access the game database. You access your database using SQL queries with the methods below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA uses [http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-transactions.html database transactions]. This means that your database changes WON&#039;T BE APPLIED to the database until your request ends normally. Using transactions is in fact very useful for you; at any time, if your game logic detects that something is wrong (example: a disallowed move), you just have to throw an exception and all changes to the game situation will be removed.&lt;br /&gt;
&lt;br /&gt;
; DbQuery( $sql )&lt;br /&gt;
: This is the generic method to access the database.&lt;br /&gt;
: It can execute any type of SELECT/UPDATE/DELETE/REPLACE query on the database.&lt;br /&gt;
: You should use it for UPDATE/DELETE/REPLACE queries. For SELECT queries, the specialized methods below are much better.&lt;br /&gt;
&lt;br /&gt;
; getUniqueValueFromDB( $sql )&lt;br /&gt;
: Returns a unique value from DB or null if no value is found.&lt;br /&gt;
: $sql must be a SELECT query.&lt;br /&gt;
: Raise an exception if more than 1 row is returned.&lt;br /&gt;
&lt;br /&gt;
; getCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Returns an associative array of rows for a sql SELECT query.&lt;br /&gt;
: The key of the resulting associative array is the first field specified in the SELECT query.&lt;br /&gt;
: The value of the resulting associative array if an associative array with all the field specified in the SELECT query and associated values.&lt;br /&gt;
: First column must be a primary or alternate key.&lt;br /&gt;
: The resulting collection can be empty.&lt;br /&gt;
: If you specified $bSingleValue=true and if your SQL query request 2 fields A and B, the method returns an associative array &amp;quot;A=&amp;gt;B&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 1235 =&amp;gt; array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; &#039;myuser0&#039;,&lt;br /&gt;
 1235 =&amp;gt; &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyCollectionFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if the collection is empty&lt;br /&gt;
&lt;br /&gt;
; getObjectFromDB( $sql )&lt;br /&gt;
: Returns one row for the sql SELECT query as an associative array or null if there is no result&lt;br /&gt;
: Raise an exception if the query return more than one row&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player WHERE player_id=&#039;$player_id&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
  &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 &lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyObjectFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if no row is found&lt;br /&gt;
&lt;br /&gt;
; getObjectListFromDB( $sql, $bUniqueValue=false )&lt;br /&gt;
: Return an array of rows for a sql SELECT query.&lt;br /&gt;
: the result if the same than &amp;quot;getCollectionFromDB&amp;quot; except that the result is a simple array (and not an associative array).&lt;br /&gt;
: The result can be empty.&lt;br /&gt;
: If you specified $bUniqueValue=true and if your SQL query request 1 field, the method returns directly an array of values.&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 &#039;myuser0&#039;,&lt;br /&gt;
 &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getDoubleKeyCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Return an associative array of associative array, from a SQL SELECT query.&lt;br /&gt;
: First array level correspond to first column specified in SQL query.&lt;br /&gt;
: Second array level correspond to second column specified in SQL query.&lt;br /&gt;
: If bSingleValue = true, keep only third column on result&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; DbGetLastId()&lt;br /&gt;
: Return the PRIMARY key of the last inserted row (see PHP mysql_insert_id function).&lt;br /&gt;
&lt;br /&gt;
; DbAffectedRow()&lt;br /&gt;
: Return the number of row affected by the last operation&lt;br /&gt;
&lt;br /&gt;
; escapeStringForDB( $string )&lt;br /&gt;
: You must use this function on every string type data in your database that contains unsafe data.&lt;br /&gt;
: (unsafe = can be modified by a player).&lt;br /&gt;
: This method makes sure that no SQL injection will be done through the string used.&lt;br /&gt;
: Note: if you using standard types in ajax actions, like AT_alphanum it is sanitized before arrival,&lt;br /&gt;
: this is only needed if you manage to get unchecked string, like in the games where user has to enter text as a response.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: see Editing [[Game database model: dbmodel.sql]] to know how to define your database model.&lt;br /&gt;
&lt;br /&gt;
== Use globals ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, you have to keep a single integer value that is global to your game, and you don&#039;t want to create a DB table specifically for it.&lt;br /&gt;
&lt;br /&gt;
Using a BGA framework &amp;quot;global&amp;quot;, you can do such a thing. Your value will be stored in the &amp;quot;global&amp;quot; table in database, and you can access it with simple methods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initGameStateLabels&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is located at the beginning of your game logic. This is the place you defines the globals used in your game logic, by assigning them IDs.&lt;br /&gt;
&lt;br /&gt;
You can define up to 79 globals, with IDs from 10 to 89. You must NOT use globals outside this range as globals are used by other components of the framework.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        self::initGameStateLabels( array( &lt;br /&gt;
                &amp;quot;my_first_global_variable&amp;quot; =&amp;gt; 10,&lt;br /&gt;
                &amp;quot;my_second_global_variable&amp;quot; =&amp;gt; 11&lt;br /&gt;
        ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateInitialValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Init your global value. Must be called before any use of your global, so you should call this method from your &amp;quot;setupNewGame&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getGameStateValue( $value_label )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Retrieve the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incGameStateValue( $value_label, $increment )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment the current value of a global. If increment is negative, decrement the value of the global.&lt;br /&gt;
&lt;br /&gt;
Return the final value of the global.&lt;br /&gt;
&lt;br /&gt;
== Game states and active players ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Activate player handling ===&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;activeNextPlayer()&lt;br /&gt;
: Make the next player active in the natural player order.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;activePrevPlayer()&lt;br /&gt;
: Make the previous player active (in the natural player order).&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;changeActivePlayer( $player_id )&lt;br /&gt;
: You can call this method to make any player active.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;getActivePlayerId()&lt;br /&gt;
: Return the &amp;quot;active_player&amp;quot; id&lt;br /&gt;
: Note: it does NOT mean that this player is active right now, because state type could be &amp;quot;game&amp;quot; or &amp;quot;multiplayer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Multiactivate player handling ===&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setAllPlayersMultiactive()&lt;br /&gt;
: All playing players are made active. Update notification is sent to all players (triggers onUpdateActionButtons).&lt;br /&gt;
: Usually, you use this method at the beginning (ex: &amp;quot;st&amp;quot; action method) of a multiplayer game state when all players have to do some action.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setAllPlayersNonMultiactive( $next_state )&lt;br /&gt;
: All playing players are made inactive. Transition to next state&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayersMultiactive( $players, $next_state, $bExclusive = false )&lt;br /&gt;
: Make a specific list of players active during a multiactive gamestate. Update notification is sent to all players who&#039;s state changed.&lt;br /&gt;
: &amp;quot;players&amp;quot; is the array of player id that should be made active.&lt;br /&gt;
: If &amp;quot;exclusive&amp;quot; parameter is not set or false it doesn&#039;t deactivate other previously active players. If its set to true, the players who will be multiactive at the end are only these in &amp;quot;$layers&amp;quot; array&lt;br /&gt;
&lt;br /&gt;
: In case &amp;quot;players&amp;quot; is empty, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
: returns true if state transition happened, false otherwise&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayerNonMultiactive( $player_id, $next_state )&lt;br /&gt;
: During a multiactive game state, make the specified player inactive.&lt;br /&gt;
: Usually, you call this method during a multiactive game state after a player did his action.&lt;br /&gt;
: If this player was the last active player, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
: returns true if state transition happened, false otherwise&lt;br /&gt;
&lt;br /&gt;
;  $this-&amp;gt;gamestate-&amp;gt;updateMultiactiveOrNextState( $next_state_if_none )&lt;br /&gt;
: Sends update notification about multiplayer changes. All multiactive set* functions above do that, however if you want to change state manually using db queries for complex calculations, you have to call this yourself after. Do not call this if you calling one of the other setters above.&lt;br /&gt;
Example: you have player teams and you want to activate all players in one team&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $sql = &amp;quot;UPDATE player SET player_is_multiactive=&#039;0&#039;&amp;quot;;&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        $sql = &amp;quot;UPDATE player SET player_is_multiactive=&#039;1&#039; WHERE player_id=&#039;$player_id&#039; AND player_team=&#039;$team_no&#039;&amp;quot;;&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        &lt;br /&gt;
        $this-&amp;gt;gamestate-&amp;gt;updateMultiactiveOrNextState( &#039;error&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;getActivePlayerList()&lt;br /&gt;
: With this method you can retrieve the list of the active player at any time.&lt;br /&gt;
: During a &amp;quot;game&amp;quot; type gamestate, it will return a void array.&lt;br /&gt;
: During a &amp;quot;activeplayer&amp;quot; type gamestate, it will return an array with one value (the active player id).&lt;br /&gt;
: During a &amp;quot;multipleactiveplayer&amp;quot; type gamestate, it will return an array of the active players id.&lt;br /&gt;
: Note: you should only use this method is the latter case.&lt;br /&gt;
&lt;br /&gt;
=== States functions ===&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;nextState( $transition )&lt;br /&gt;
: Change current state to a new state. Important: parameter $transition is the name of the transition, and NOT the name of the target game state, see [[Your game state machine: states.inc.php]] for more information about states.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;checkAction( $actionName, $bThrowException=true )&lt;br /&gt;
: Check if action is valid regarding current game state (exception if fails).&lt;br /&gt;
: The action is valid if it is listed as a &amp;quot;possibleactions&amp;quot; in the current game state (see game state description).&lt;br /&gt;
: This method MUST be called in the first place in ALL your PHP methods that handle players action, in order to make sure a player can&#039;t do an action when the rules disallow it at this moment of the game.&lt;br /&gt;
: if &amp;quot;bThrowException&amp;quot; is set to &amp;quot;false&amp;quot;, the function return false in case of failure instead of throwing and exception. This is useful when several actions are possible in order to test each of them without throwing exceptions.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;checkPossibleAction( $action )&lt;br /&gt;
: (rarely used)&lt;br /&gt;
: This works exactly like &amp;quot;checkAction&amp;quot;, except that it do NOT check if current player is active.&lt;br /&gt;
: This is used specifically in certain game states when you want to authorize some additional actions for players that are not active at the moment.&lt;br /&gt;
: Example: in Libertalia game, you want to authorize players to change their mind about card played. They are of course not active at the time they change their mind, so you cannot use &amp;quot;checkAction&amp;quot; and use &amp;quot;checkPossibleAction&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;state()&lt;br /&gt;
: Get an associative array of current game state attributes, see [[Your game state machine: states.inc.php]] for state attributes.&lt;br /&gt;
  $state=$this-&amp;gt;gamestate-&amp;gt;state(); if( $state[&#039;name&#039;] == &#039;myGameState&#039; ) {...}&lt;br /&gt;
&lt;br /&gt;
== Players turn order ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getNextPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return an associative array which associate each player with the next player around the table.&lt;br /&gt;
&lt;br /&gt;
In addition, key 0 is associated to the first player to play.&lt;br /&gt;
&lt;br /&gt;
Example: if three player with ID 1, 2 and 3 are around the table, in this order, the method returns:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   array( &lt;br /&gt;
    1 =&amp;gt; 2, &lt;br /&gt;
    2 =&amp;gt; 3, &lt;br /&gt;
    3 =&amp;gt; 1, &lt;br /&gt;
    0 =&amp;gt; 1 &lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPrevPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, but the associative array associate the previous player around the table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerAfter( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing after given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerBefore( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing before given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
Note: There is no API to modify this order, if you have custom player order you have to maintain it in your database&lt;br /&gt;
and have custom function to access it.&lt;br /&gt;
&lt;br /&gt;
== Notify players ==&lt;br /&gt;
&lt;br /&gt;
To understand notifications, please read [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance] first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notifications are sent at the very end of the request, when it ends normally. It means that if you throw an exception for any reason (ex: move not allowed), no notifications will be sent to players.&lt;br /&gt;
Notifications sent between the game start (setupNewGame) and the end of the &amp;quot;action&amp;quot; method of the first active state will never reach their destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyAllPlayers( $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send a notification to all players of the game.&lt;br /&gt;
&lt;br /&gt;
* notification_type:&lt;br /&gt;
A string that defines the type of your notification.&lt;br /&gt;
&lt;br /&gt;
Your game interface Javascript logic will use this to know what is the type of the received notification (and to trigger the corresponding method).&lt;br /&gt;
&lt;br /&gt;
* notification_log:&lt;br /&gt;
A string that defines what is to be displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
You can use an empty string here (&amp;quot;&amp;quot;). In this case, nothing is displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
If you define a real string here, you should use &amp;quot;clienttranslate&amp;quot; method to make sure it can be translate.&lt;br /&gt;
&lt;br /&gt;
You can use arguments in your notification_log strings, that refers to values defines in the &amp;quot;notification_args&amp;quot; argument (see below). &lt;br /&gt;
Note: Make sure you only use single quotes (&#039;), otherwise PHP will try to interpolate the variable and will ignore the values in the args array.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* notification_args:&lt;br /&gt;
The arguments of your notifications, as an associative array.&lt;br /&gt;
&lt;br /&gt;
This array will be transmitted to the game interface logic, in order the game interface can be updated.&lt;br /&gt;
&lt;br /&gt;
Complete notifyAllPlayers example (from &amp;quot;Reversi&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::notifyAllPlayers( &amp;quot;playDisc&amp;quot;, clienttranslate( &#039;${player_name} plays a disc and turns over ${returned_nbr} disc(s)&#039; ),&lt;br /&gt;
 array(&lt;br /&gt;
        &#039;player_id&#039; =&amp;gt; $player_id,&lt;br /&gt;
        &#039;player_name&#039; =&amp;gt; self::getActivePlayerName(),&lt;br /&gt;
        &#039;returned_nbr&#039; =&amp;gt; count( $turnedOverDiscs ),&lt;br /&gt;
        &#039;x&#039; =&amp;gt; $x,&lt;br /&gt;
        &#039;y&#039; =&amp;gt; $y&lt;br /&gt;
     ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see in the example above the use of the &amp;quot;clienttranslate&amp;quot; method, and the use of 2 arguments &amp;quot;player_name&amp;quot; and &amp;quot;returned_nbr&amp;quot; in the notification log.&lt;br /&gt;
&lt;br /&gt;
Important: NO private data must be sent with this method, as a cheater could see it even it is not used explicitly by the game interface logic. If you want to send private information to a player, please use notifyPlayer below.&lt;br /&gt;
&lt;br /&gt;
Note: you CAN use some HTML inside your notification log, however it not recommended for many reasons:&lt;br /&gt;
* Its bad architecture, ui elements leak into server now you have to manage ui in many places&lt;br /&gt;
* If you decided to change something in ui in future version, old games reply and tutorials may not work, since they use stored notifications&lt;br /&gt;
* When you read log preview for old games its unreadable (this is log before you enter the game reply, useful for troubleshooting or game analysis)&lt;br /&gt;
* Its more data to transfer and store in db&lt;br /&gt;
* Its nightmare for translators, at least don&#039;t put HTML tags inside the &amp;quot;clienttranslate&amp;quot; method. You can use a notification argument instead, and provide your HTML through this argument.&lt;br /&gt;
&lt;br /&gt;
If you still want to have pretty pictures in the log check this [[BGA_Studio_Cookbook#Inject_images_and_styled_html_in_the_log]].&lt;br /&gt;
&lt;br /&gt;
If your notification contains some phrases that build programmatically you may need to use recursive notifications. In this case the argument can be not only the string but&lt;br /&gt;
an array itself, which contains &#039;log&#039; and &#039;args&#039;, i.e.&lt;br /&gt;
&lt;br /&gt;
  $this-&amp;gt;notifyAllPlayers(&#039;playerLog&#039;,clienttranslate(&#039;Game moves ${token_name_rec}&#039;),&lt;br /&gt;
                   [&#039;token_name_rec&#039;=&amp;gt;[&#039;log&#039;=&amp;gt;&#039;${token_name} #${token_number}&#039;,&lt;br /&gt;
                                       &#039;args&#039;=&amp;gt; [&#039;token_name&#039;=&amp;gt;clienttranslate(&#039;Boo&#039;), &#039;token_number&#039;=&amp;gt;$number, &#039;i18n&#039;=&amp;gt;[&#039;token_name&#039;] ]&lt;br /&gt;
                                      ]&lt;br /&gt;
                   ]);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyPlayer( $player_id, $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, except that the notification is sent to one player only.&lt;br /&gt;
&lt;br /&gt;
This method must be used each time some private information must be transmitted to a player.&lt;br /&gt;
&lt;br /&gt;
Important: the variable for player name must be ${player_name} in order to be highlighted with the player color in the game log&lt;br /&gt;
&lt;br /&gt;
== About random and randomness ==&lt;br /&gt;
&lt;br /&gt;
A large number of board games rely on random, most often based on dice, cards shuffling, picking some item in a bag, and so on. This is very important to ensure a high level of randomness for each of these situations.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s are a list of techniques you should use in these situations, from the best to the worst.&lt;br /&gt;
&lt;br /&gt;
=== bga_rand ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bga_rand( min, max )&#039;&#039;&#039; &lt;br /&gt;
This is a BGA framework function that provides you a random number between &amp;quot;min&amp;quot; and &amp;quot;max&amp;quot; (included), using the best available random method available on the system.&lt;br /&gt;
&lt;br /&gt;
This is the preferred function you should use, because we are updating it when a better method is introduced.&lt;br /&gt;
&lt;br /&gt;
At now, bga_rand is based on the PHP function &amp;quot;random_int&amp;quot;, which ensure a cryptographic level of randomness.&lt;br /&gt;
&lt;br /&gt;
In particular, it is &#039;&#039;&#039;mandatory&#039;&#039;&#039; to use it for all &#039;&#039;&#039;dice throw&#039;&#039;&#039; (ie: games using other methods for dice throwing will be rejected by BGA during review).&lt;br /&gt;
&lt;br /&gt;
Note: rand() and mt_rand() are deprecated on BGA and should not be used anymore, as their randomness is not as good as &amp;quot;bga_rand&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== shuffle and cards shuffling ===&lt;br /&gt;
&lt;br /&gt;
To shuffle items, like a pile of cards, the best way is to use the BGA PHP [[Deck]] component and to use &amp;quot;shuffle&amp;quot; method. This ensure you that the best available shuffling method is used, and that if in the future we improve it your game will be up to date.&lt;br /&gt;
&lt;br /&gt;
At now, the Deck component shuffle method is based on PHP &amp;quot;shuffle&amp;quot; method, which has a quite good randomness (even it is not as good as bga_rand). In consequence, we accept other shuffling methods during reviews, as long as their are based on PHP &amp;quot;shuffle&amp;quot; function (or similar, like &amp;quot;array_rand&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Game statistics ==&lt;br /&gt;
&lt;br /&gt;
There are 2 types of statistics:&lt;br /&gt;
* a &amp;quot;player&amp;quot; statistic is a statistic associated to a player&lt;br /&gt;
* a &amp;quot;table&amp;quot; statistics is a statistic not associated to a player (global statistic for this game).&lt;br /&gt;
&lt;br /&gt;
See [[Game statistics: stats.inc.php]] to see how you defines statistics for your game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initStat( $table_or_player, $name, $value, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a statistic entry  with a default value.&lt;br /&gt;
This method must be called for each statistics of your game, in your setupNewGame method.&lt;br /&gt;
&lt;br /&gt;
&#039;$table_or_player&#039; must be set to &amp;quot;table&amp;quot; if this is a table statistics, or &amp;quot;player&amp;quot; if this is a player statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;$name&#039; is the name of your statistics, as it has been defined in your stats.inc.php file.&lt;br /&gt;
&lt;br /&gt;
&#039;$value&#039; is the initial value of the statistics. If this is a player statistics and if the player is not specified by &amp;quot;$player_id&amp;quot; argument, the value is set for ALL players.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setStat( $value, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set a statistic $name to $value.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is not specified, setStat consider it is a TABLE statistic.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is specified, setStat consider it is a PLAYER statistic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incStat( $delta, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment (or decrement) specified statistic value by $delta value. Same behavior as setStat function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getStat( $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the value of statistic specified by $name. Useful when creating derivative statistics such as average.&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Manage player scores and Tie breaker ==&lt;br /&gt;
&lt;br /&gt;
=== Normal scoring ===&lt;br /&gt;
&lt;br /&gt;
At the end of the game, players automatically get a rank depending on their score: the player with the biggest score is #1, the player with the second biggest score is #2, and so on...&lt;br /&gt;
&lt;br /&gt;
During the game, you update player&#039;s score directly by updating &amp;quot;player_score&amp;quot; field of &amp;quot;player&amp;quot; table in database.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  // +2 points to active player&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=player_score+2 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Set score of active player to 5&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=5 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: don&#039;t forget to notify the client side in order the score control can be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
=== Tie breaker ===&lt;br /&gt;
&lt;br /&gt;
Tie breaker is used when two players get the same score at the end of a game.&lt;br /&gt;
&lt;br /&gt;
Tie breaker is using &amp;quot;player_score_aux&amp;quot; field of &amp;quot;player&amp;quot; table. It is updated exactly like the &amp;quot;player_score&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
Tie breaker score is displayed only for players who are tied at the end of the game. Most of the time, it is not supposed to be displayed explicitly during the game.&lt;br /&gt;
&lt;br /&gt;
When you are using &amp;quot;player_score_aux&amp;quot; functionality, you must describe the formula to use in your gameinfos.inc.php file like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         &#039;tie_breaker_description&#039; =&amp;gt; totranslate(&amp;quot;Describe here your tie breaker formula&amp;quot;),&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This description will be used as a tooltip to explain to players how this auxiliary score has been calculated.&lt;br /&gt;
&lt;br /&gt;
=== Co-operative game ===&lt;br /&gt;
&lt;br /&gt;
To make everyone lose in full-coop game:&lt;br /&gt;
&lt;br /&gt;
Add the following in gameinfos.inc.php :&lt;br /&gt;
&#039;is_coop&#039; =&amp;gt; 1, // full cooperative&lt;br /&gt;
&lt;br /&gt;
And score zero to everyone.&lt;br /&gt;
&lt;br /&gt;
=== Semi-coop ===&lt;br /&gt;
&lt;br /&gt;
If the game is not full-coop, then everyone lose = everyone is tie. I.e. set score to 0 to everybody.&lt;br /&gt;
&lt;br /&gt;
=== One winner only ===&lt;br /&gt;
If you need to one person to win and everybody else to lose, set the scores so that the winner has the best score, and the other players have the same (lower) score. Then add the following lines to gameinfos.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// If in the game, all losers are equal (no score to rank them or explicit in the rules that losers are not ranked between them), set this to true &lt;br /&gt;
// The game end result will display &amp;quot;Winner&amp;quot; for the 1st player and &amp;quot;Loser&amp;quot; for all other players&lt;br /&gt;
&#039;losers_not_ranked&#039; =&amp;gt; true,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quantum and Coup are implemented like this, as you can see here:&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=quantum&amp;amp;section=lastresults&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=coupcitystate&amp;amp;section=lastresults&lt;br /&gt;
&lt;br /&gt;
=== Solo ===&lt;br /&gt;
&lt;br /&gt;
If game supports solo variant, a negative score means defeat, a positive score means victory.&lt;br /&gt;
&lt;br /&gt;
=== Player elimination ===&lt;br /&gt;
&lt;br /&gt;
In some games, this is useful to eliminate a player from the game in order he/she can start another game without waiting for the current game end.&lt;br /&gt;
&lt;br /&gt;
This case should be rare. Please don&#039;t use player elimination feature if some player just has to wait the last 10% of the game for game end. This feature should be used only in games where players are eliminated all along the game (typical examples: &amp;quot;Perudo&amp;quot; or &amp;quot;The Werewolves of Miller&#039;s Hollow&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
* Player to eliminate should NOT be active anymore (preferably use the feature in a &amp;quot;game&amp;quot; type game state).&lt;br /&gt;
* In your PHP code:&lt;br /&gt;
  self::eliminatePlayer( &amp;lt;player_to_eliminate_id&amp;gt; );&lt;br /&gt;
* the player is informed in a dialog box that he no longer have to played and can start another game if he/she wants too (whith buttons &amp;quot;stay at this table&amp;quot; &amp;quot;quit table and back to main site&amp;quot;). In any case, the player is free to tart&amp;amp;join another table from now.&lt;br /&gt;
* When your game is over, all players who have been eliminated before receive a &amp;quot;notification&amp;quot; (the small &amp;quot;!&amp;quot; icon on the top right of the BGA interface) that indicate them that &amp;quot;the game has ended&amp;quot; and invite them to review the game results.&lt;br /&gt;
&lt;br /&gt;
=== Scoring Helper functions ===&lt;br /&gt;
&lt;br /&gt;
    // get score&lt;br /&gt;
    function dbGetScore($player_id) {&lt;br /&gt;
        return $this-&amp;gt;getUniqueValueFromDB(&amp;quot;SELECT player_score FROM player WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // set score&lt;br /&gt;
    function dbSetScore($player_id, $count) {&lt;br /&gt;
        $this-&amp;gt;DbQuery(&amp;quot;UPDATE player SET player_score=&#039;$count&#039; WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // set aux score (tie breaker)&lt;br /&gt;
    function dbSetAuxScore($player_id, $score) {&lt;br /&gt;
        $this-&amp;gt;DbQuery(&amp;quot;UPDATE player SET player_score_aux=$score WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // increment score (can be negative too)&lt;br /&gt;
    function dbIncScore($player_id, $inc) {&lt;br /&gt;
        $count = $this-&amp;gt;dbGetScore($player_id);&lt;br /&gt;
        if ($inc != 0) {&lt;br /&gt;
            $count += $inc;&lt;br /&gt;
            $this-&amp;gt;dbSetScore($player_id, $count);&lt;br /&gt;
        }&lt;br /&gt;
        return $count;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
== Reflexion time ==&lt;br /&gt;
&lt;br /&gt;
; function giveExtraTime( $player_id, $specific_time=null )&lt;br /&gt;
: Give standard extra time to this player.&lt;br /&gt;
: Standard extra time depends on the speed of the game (small with &amp;quot;slow&amp;quot; game option, bigger with other options).&lt;br /&gt;
: You can also specify an exact time to add, in seconds, with the &amp;quot;specified_time&amp;quot; argument (rarely used).&lt;br /&gt;
&lt;br /&gt;
== Managing errors and exceptions ==&lt;br /&gt;
&lt;br /&gt;
Note: when you throw an exception, all database changes and all notifications are cancelled immediately. This way, the game situation that existed before the request is completely restored.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaUserException ( $error_message)&lt;br /&gt;
: Base class to notify a user error&lt;br /&gt;
: You must throw this exception when a player wants to do something that he is not allowed to do.&lt;br /&gt;
: The error message will be shown to the player as a &amp;quot;red message&amp;quot;, so it must be translated.&lt;br /&gt;
: Throwing such an exception is NOT considered a bug, so it is not traced in BGA error logs.&lt;br /&gt;
&lt;br /&gt;
Example from Gomoku:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     throw new BgaUserException( self::_(&amp;quot;There is already a stone on this intersection, you can&#039;t play there&amp;quot;) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; throw new BgaVisibleSystemException ( $error_message)&lt;br /&gt;
: You must throw this exception when you detect something that is not supposed to happened in your code.&lt;br /&gt;
: The error message is shown to the user as an &amp;quot;Unexpected error&amp;quot;, in order that he can report it in the forum.&lt;br /&gt;
: The error message is logged in BGA error logs. If it happens regularly, we will report it to you.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaSystemException ( $error_message)&lt;br /&gt;
: Base class to notify a system exception. The message will be hidden from the user, but show in the logs. Use this if the message contains technical information.&lt;br /&gt;
: You shouldn&#039;t use this type of exception except if you think the information shown could be critical. Indeed: a generic error message will be shown to the user, so it&#039;s going to be difficult for you to see what happened.&lt;br /&gt;
&lt;br /&gt;
== Zombie mode ==&lt;br /&gt;
&lt;br /&gt;
When a player leaves a game for any reason (expelled, quit), he becomes a &amp;quot;zombie player&amp;quot;. In this case, the results of the game won&#039;t count for statistics, but this is cool if the other players can finish the game anyway. That&#039;s why zombie mode exists: allow the other player to finish the game, even if the situation is not ideal.&lt;br /&gt;
&lt;br /&gt;
While developing your zombie mode, keep in mind that:&lt;br /&gt;
* Do not refer to the rules, because this situation is not planned by the rules.&lt;br /&gt;
* Try to figure that you are playing with your friends and one of them has to leave: how can we finish the game without killing the spirit of the game?&lt;br /&gt;
* The idea is NOT to develop an artificial intelligence for the game.&lt;br /&gt;
&lt;br /&gt;
Most of the time, the best thing to do when it is zombie player turn is to jump immediately to a state where he is not active anymore. For example, if he is in a game state where he has a choice between playing A and playing B, the best thing to do is NOT to choose A or B, but to pass. So, even if there&#039;s no &amp;quot;pass&amp;quot; action in the rules, add a &amp;quot;zombiepass&amp;quot; transitition in your game state and use it.&lt;br /&gt;
&lt;br /&gt;
Each time a zombie player must play, your &amp;quot;zombieTurn&amp;quot; method is called.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* $state: the name of the current game state.&lt;br /&gt;
* $active_player: the id of the active player.&lt;br /&gt;
&lt;br /&gt;
Most of the time, your zombieTurn method looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    function zombieTurn( $state, $active_player )&lt;br /&gt;
    {&lt;br /&gt;
    	$statename = $state[&#039;name&#039;];&lt;br /&gt;
&lt;br /&gt;
        if( $statename == &#039;myFirstGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my2ndGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my3rdGameState&#039;&lt;br /&gt;
               ....&lt;br /&gt;
           )&lt;br /&gt;
        {&lt;br /&gt;
            $this-&amp;gt;gamestate-&amp;gt;nextState( &amp;quot;zombiePass&amp;quot; );&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            throw new BgaVisibleSystemException( &amp;quot;Zombie mode not supported at this game state: &amp;quot;.$statename );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that in the example above, all corresponding game state should implement &amp;quot;zombiePass&amp;quot; as a transition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Player color preferences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BGA players (Club members) may now choose their preferred color for playing. For example, if they are used to play green for every board game, they can select &amp;quot;green&amp;quot; in their BGA preferences page.&lt;br /&gt;
&lt;br /&gt;
Making your game compatible with colors preferences is very easy and requires only 1 line of PHP and 1 configuration change :&lt;br /&gt;
&lt;br /&gt;
On your gameinfos.inc.php file, add the following lines :&lt;br /&gt;
&lt;br /&gt;
  // Favorite colors support : if set to &amp;quot;true&amp;quot;, support attribution of favorite colors based on player&#039;s preferences (see reattributeColorsBasedOnPreferences PHP method)&lt;br /&gt;
  &#039;favorite_colors_support&#039; =&amp;gt; true,&lt;br /&gt;
&lt;br /&gt;
Then, on your main &amp;lt;your_game&amp;gt;.game.php file, find the &amp;quot;reloadPlayersBasicInfos&amp;quot; call in your &amp;quot;setupNewGame&amp;quot; method and replace :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
By :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reattributeColorsBasedOnPreferences( $players, array(  /* LIST HERE THE AVAILABLE COLORS OF YOUR GAME INSTEAD OF THESE ONES */&amp;quot;ff0000&amp;quot;, &amp;quot;008000&amp;quot;, &amp;quot;0000ff&amp;quot;, &amp;quot;ffa500&amp;quot;, &amp;quot;773300&amp;quot; ) );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;reattributeColorsBasedOnPreferences&amp;quot; method reattributes all colors, taking into account players color preferences and available colors.&lt;br /&gt;
&lt;br /&gt;
Note that you must update the colors to indicate the colors available for your game.&lt;br /&gt;
&lt;br /&gt;
2 important remarks :&lt;br /&gt;
* for some games (ex : Chess), the color has an influence on a mechanism of the game, most of the time by giving a special advantage to a player (ex : Starting the game). Color preference mechanism must NOT be used in such a case.&lt;br /&gt;
* your logic should NEVER consider that the first player has the color X, that the second player has the color Y, and so on. If this is the case, your game will NOT be compatible with reattributeColorsBasedOnPreferences as this method attribute colors to players based on their preferences and not based as their order at the table.&lt;br /&gt;
&lt;br /&gt;
Colours currently listed as a choice in preferences:&lt;br /&gt;
&lt;br /&gt;
* #ff0000 Red&lt;br /&gt;
* #008000 Green&lt;br /&gt;
* #0000ff Blue&lt;br /&gt;
* #ffa500 Yellow&lt;br /&gt;
* #000000 Black&lt;br /&gt;
* #ffffff White&lt;br /&gt;
&lt;br /&gt;
== Debugging and Tracing ==&lt;br /&gt;
&lt;br /&gt;
To debug php code you can use some tracing functions available from the parent class such as debug, trace, error, warn, dump.&lt;br /&gt;
  &lt;br /&gt;
  self::debug(&amp;quot;Ahh!&amp;quot;);&lt;br /&gt;
  self::dump(&#039;my_var&#039;,$my_var);&lt;br /&gt;
&lt;br /&gt;
See [[Practical_debugging]] section for complete information about debugging interfaces and where to find logs.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=3221</id>
		<title>Main game logic: yourgamename.game.php</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=3221"/>
		<updated>2018-10-10T09:05:58Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Game statistics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This is the main file for your game logic. Here you initialize the game, persist data, implement the rules and notify the client interface of changes.&lt;br /&gt;
&lt;br /&gt;
== File Structure ==&lt;br /&gt;
&lt;br /&gt;
The details of how the file is structured are described directly with comments in the code skeleton provided to you.&lt;br /&gt;
 &lt;br /&gt;
Here is the basic structure:&lt;br /&gt;
&lt;br /&gt;
* EmptyGame (constructor): where you define global variables.&lt;br /&gt;
* setupNewGame: initial setup of the game.&lt;br /&gt;
* getAllDatas: where you retrieve all game data during a complete reload of the game.&lt;br /&gt;
* getGameProgression: where you compute the game progression indicator.&lt;br /&gt;
* Utility functions: your utility functions.&lt;br /&gt;
* Player actions: the entry points for players actions. &lt;br /&gt;
* Game state arguments: methods to return additional data on specific game states ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#args more info here]).&lt;br /&gt;
* Game state actions: the logic to run when entering a new game state ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#action more info here]).&lt;br /&gt;
* zombieTurn: what to do it&#039;s the turn of a zombie player.&lt;br /&gt;
&lt;br /&gt;
== Accessing player information ==&lt;br /&gt;
&lt;br /&gt;
; getPlayersNumber()&lt;br /&gt;
: Returns the number of players playing at the table&lt;br /&gt;
: Note: doesn&#039;t work in setupNewGame so use count($players) instead&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerId()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot;, whatever what is the current state type.&lt;br /&gt;
: Note: it does NOT mean that this player is active right now, because state type could be &amp;quot;game&amp;quot; or &amp;quot;multiplayer&amp;quot;&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerName()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot; name&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; loadPlayersBasicInfos()&lt;br /&gt;
: Get an associative array with generic data about players (ie: not game specific data).&lt;br /&gt;
: The key of the associative array is the player id. The returned table is cached, so ok to call multiple times without performance concerns.&lt;br /&gt;
: The content of each value is:&lt;br /&gt;
: * player_name - the name of the player&lt;br /&gt;
: * player_color (ex: ff0000) - the color code of the player&lt;br /&gt;
: * player_no - the position of the player at the start of the game in natural table order, i.e. 1,2,3&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerId()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot;. The current player is the one from which the action originated (the one who send the request).&lt;br /&gt;
: &#039;&#039;&#039;Be careful&#039;&#039;&#039;: It is not always the active player.&lt;br /&gt;
: In general, you shouldn&#039;t use this method, unless you are in &amp;quot;multiplayer&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerName()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; name&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerColor()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; color&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; isCurrentPlayerZombie()&lt;br /&gt;
: Check the &amp;quot;current_player&amp;quot; zombie status. If true, player is zombie, i.e. left or was kicked out of the game.&lt;br /&gt;
&lt;br /&gt;
== Accessing the database ==&lt;br /&gt;
&lt;br /&gt;
The main game logic should be the only point from which you should access the game database. You access your database using SQL queries with the methods below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA uses [http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-transactions.html database transactions]. This means that your database changes WON&#039;T BE APPLIED to the database until your request ends normally. Using transactions is in fact very useful for you; at any time, if your game logic detects that something is wrong (example: a disallowed move), you just have to throw an exception and all changes to the game situation will be removed.&lt;br /&gt;
&lt;br /&gt;
; DbQuery( $sql )&lt;br /&gt;
: This is the generic method to access the database.&lt;br /&gt;
: It can execute any type of SELECT/UPDATE/DELETE/REPLACE query on the database.&lt;br /&gt;
: You should use it for UPDATE/DELETE/REPLACE queries. For SELECT queries, the specialized methods below are much better.&lt;br /&gt;
&lt;br /&gt;
; getUniqueValueFromDB( $sql )&lt;br /&gt;
: Returns a unique value from DB or null if no value is found.&lt;br /&gt;
: $sql must be a SELECT query.&lt;br /&gt;
: Raise an exception if more than 1 row is returned.&lt;br /&gt;
&lt;br /&gt;
; getCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Returns an associative array of rows for a sql SELECT query.&lt;br /&gt;
: The key of the resulting associative array is the first field specified in the SELECT query.&lt;br /&gt;
: The value of the resulting associative array if an associative array with all the field specified in the SELECT query and associated values.&lt;br /&gt;
: First column must be a primary or alternate key.&lt;br /&gt;
: The resulting collection can be empty.&lt;br /&gt;
: If you specified $bSingleValue=true and if your SQL query request 2 fields A and B, the method returns an associative array &amp;quot;A=&amp;gt;B&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 1235 =&amp;gt; array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; &#039;myuser0&#039;,&lt;br /&gt;
 1235 =&amp;gt; &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyCollectionFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if the collection is empty&lt;br /&gt;
&lt;br /&gt;
; getObjectFromDB( $sql )&lt;br /&gt;
: Returns one row for the sql SELECT query as an associative array or null if there is no result&lt;br /&gt;
: Raise an exception if the query return more than one row&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player WHERE player_id=&#039;$player_id&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
  &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 &lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyObjectFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if no row is found&lt;br /&gt;
&lt;br /&gt;
; getObjectListFromDB( $sql, $bUniqueValue=false )&lt;br /&gt;
: Return an array of rows for a sql SELECT query.&lt;br /&gt;
: the result if the same than &amp;quot;getCollectionFromDB&amp;quot; except that the result is a simple array (and not an associative array).&lt;br /&gt;
: The result can be empty.&lt;br /&gt;
: If you specified $bUniqueValue=true and if your SQL query request 1 field, the method returns directly an array of values.&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 &#039;myuser0&#039;,&lt;br /&gt;
 &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getDoubleKeyCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Return an associative array of associative array, from a SQL SELECT query.&lt;br /&gt;
: First array level correspond to first column specified in SQL query.&lt;br /&gt;
: Second array level correspond to second column specified in SQL query.&lt;br /&gt;
: If bSingleValue = true, keep only third column on result&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; DbGetLastId()&lt;br /&gt;
: Return the PRIMARY key of the last inserted row (see PHP mysql_insert_id function).&lt;br /&gt;
&lt;br /&gt;
; DbAffectedRow()&lt;br /&gt;
: Return the number of row affected by the last operation&lt;br /&gt;
&lt;br /&gt;
; escapeStringForDB( $string )&lt;br /&gt;
: You must use this function on every string type data in your database that contains unsafe data.&lt;br /&gt;
: (unsafe = can be modified by a player).&lt;br /&gt;
: This method makes sure that no SQL injection will be done through the string used.&lt;br /&gt;
: Note: if you using standard types in ajax actions, like AT_alphanum it is sanitized before arrival,&lt;br /&gt;
: this is only needed if you manage to get unchecked string, like in the games where user has to enter text as a response.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: see Editing [[Game database model: dbmodel.sql]] to know how to define your database model.&lt;br /&gt;
&lt;br /&gt;
== Use globals ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, you have to keep a single integer value that is global to your game, and you don&#039;t want to create a DB table specifically for it.&lt;br /&gt;
&lt;br /&gt;
Using a BGA framework &amp;quot;global&amp;quot;, you can do such a thing. Your value will be stored in the &amp;quot;global&amp;quot; table in database, and you can access it with simple methods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initGameStateLabels&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is located at the beginning of your game logic. This is the place you defines the globals used in your game logic, by assigning them IDs.&lt;br /&gt;
&lt;br /&gt;
You can define up to 79 globals, with IDs from 10 to 89. You must NOT use globals outside this range as globals are used by other components of the framework.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        self::initGameStateLabels( array( &lt;br /&gt;
                &amp;quot;my_first_global_variable&amp;quot; =&amp;gt; 10,&lt;br /&gt;
                &amp;quot;my_second_global_variable&amp;quot; =&amp;gt; 11&lt;br /&gt;
        ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateInitialValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Init your global value. Must be called before any use of your global, so you should call this method from your &amp;quot;setupNewGame&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getGameStateValue( $value_label )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Retrieve the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incGameStateValue( $value_label, $increment )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment the current value of a global. If increment is negative, decrement the value of the global.&lt;br /&gt;
&lt;br /&gt;
Return the final value of the global.&lt;br /&gt;
&lt;br /&gt;
== Game states and active players ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Activate player handling ===&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;activeNextPlayer()&lt;br /&gt;
: Make the next player active in the natural player order.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;activePrevPlayer()&lt;br /&gt;
: Make the previous player active (in the natural player order).&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;changeActivePlayer( $player_id )&lt;br /&gt;
: You can call this method to make any player active.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;getActivePlayerId()&lt;br /&gt;
: Return the &amp;quot;active_player&amp;quot; id&lt;br /&gt;
: Note: it does NOT mean that this player is active right now, because state type could be &amp;quot;game&amp;quot; or &amp;quot;multiplayer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Multiactivate player handling ===&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setAllPlayersMultiactive()&lt;br /&gt;
: All playing players are made active. Update notification is sent to all players (triggers onUpdateActionButtons).&lt;br /&gt;
: Usually, you use this method at the beginning (ex: &amp;quot;st&amp;quot; action method) of a multiplayer game state when all players have to do some action.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setAllPlayersNonMultiactive( $next_state )&lt;br /&gt;
: All playing players are made inactive. Transition to next state&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayersMultiactive( $players, $next_state, $bExclusive = false )&lt;br /&gt;
: Make a specific list of players active during a multiactive gamestate. Update notification is sent to all players who&#039;s state changed.&lt;br /&gt;
: &amp;quot;players&amp;quot; is the array of player id that should be made active.&lt;br /&gt;
: If &amp;quot;exclusive&amp;quot; parameter is not set or false it doesn&#039;t deactivate other previously active players. If its set to true, the players who will be multiactive at the end are only these in &amp;quot;$layers&amp;quot; array&lt;br /&gt;
&lt;br /&gt;
: In case &amp;quot;players&amp;quot; is empty, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
: returns true if state transition happened, false otherwise&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayerNonMultiactive( $player_id, $next_state )&lt;br /&gt;
: During a multiactive game state, make the specified player inactive.&lt;br /&gt;
: Usually, you call this method during a multiactive game state after a player did his action.&lt;br /&gt;
: If this player was the last active player, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
: returns true if state transition happened, false otherwise&lt;br /&gt;
&lt;br /&gt;
;  $this-&amp;gt;gamestate-&amp;gt;updateMultiactiveOrNextState( $next_state_if_none )&lt;br /&gt;
: Sends update notification about multiplayer changes. All multiactive set* functions above do that, however if you want to change state manually using db queries for complex calculations, you have to call this yourself after. Do not call this if you calling one of the other setters above.&lt;br /&gt;
Example: you have player teams and you want to activate all players in one team&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $sql = &amp;quot;UPDATE player SET player_is_multiactive=&#039;0&#039;&amp;quot;;&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        $sql = &amp;quot;UPDATE player SET player_is_multiactive=&#039;1&#039; WHERE player_id=&#039;$player_id&#039; AND player_team=&#039;$team_no&#039;&amp;quot;;&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        &lt;br /&gt;
        $this-&amp;gt;gamestate-&amp;gt;updateMultiactiveOrNextState( &#039;error&#039; );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;getActivePlayerList()&lt;br /&gt;
: With this method you can retrieve the list of the active player at any time.&lt;br /&gt;
: During a &amp;quot;game&amp;quot; type gamestate, it will return a void array.&lt;br /&gt;
: During a &amp;quot;activeplayer&amp;quot; type gamestate, it will return an array with one value (the active player id).&lt;br /&gt;
: During a &amp;quot;multipleactiveplayer&amp;quot; type gamestate, it will return an array of the active players id.&lt;br /&gt;
: Note: you should only use this method is the latter case.&lt;br /&gt;
&lt;br /&gt;
=== States functions ===&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;nextState( $transition )&lt;br /&gt;
: Change current state to a new state. Important: parameter $transition is the name of the transition, and NOT the name of the target game state, see [[Your game state machine: states.inc.php]] for more information about states.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;checkAction( $actionName, $bThrowException=true )&lt;br /&gt;
: Check if action is valid regarding current game state (exception if fails).&lt;br /&gt;
: The action is valid if it is listed as a &amp;quot;possibleactions&amp;quot; in the current game state (see game state description).&lt;br /&gt;
: This method MUST be called in the first place in ALL your PHP methods that handle players action, in order to make sure a player can&#039;t do an action when the rules disallow it at this moment of the game.&lt;br /&gt;
: if &amp;quot;bThrowException&amp;quot; is set to &amp;quot;false&amp;quot;, the function return false in case of failure instead of throwing and exception. This is useful when several actions are possible in order to test each of them without throwing exceptions.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;checkPossibleAction( $action )&lt;br /&gt;
: (rarely used)&lt;br /&gt;
: This works exactly like &amp;quot;checkAction&amp;quot;, except that it do NOT check if current player is active.&lt;br /&gt;
: This is used specifically in certain game states when you want to authorize some additional actions for players that are not active at the moment.&lt;br /&gt;
: Example: in Libertalia game, you want to authorize players to change their mind about card played. They are of course not active at the time they change their mind, so you cannot use &amp;quot;checkAction&amp;quot; and use &amp;quot;checkPossibleAction&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;state()&lt;br /&gt;
: Get an associative array of current game state attributes, see [[Your game state machine: states.inc.php]] for state attributes.&lt;br /&gt;
  $state=$this-&amp;gt;gamestate-&amp;gt;state(); if( $state[&#039;name&#039;] == &#039;myGameState&#039; ) {...}&lt;br /&gt;
&lt;br /&gt;
== Players turn order ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getNextPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return an associative array which associate each player with the next player around the table.&lt;br /&gt;
&lt;br /&gt;
In addition, key 0 is associated to the first player to play.&lt;br /&gt;
&lt;br /&gt;
Example: if three player with ID 1, 2 and 3 are around the table, in this order, the method returns:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   array( &lt;br /&gt;
    1 =&amp;gt; 2, &lt;br /&gt;
    2 =&amp;gt; 3, &lt;br /&gt;
    3 =&amp;gt; 1, &lt;br /&gt;
    0 =&amp;gt; 1 &lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPrevPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, but the associative array associate the previous player around the table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerAfter( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing after given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerBefore( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing before given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
Note: There is no API to modify this order, if you have custom player order you have to maintain it in your database&lt;br /&gt;
and have custom function to access it.&lt;br /&gt;
&lt;br /&gt;
== Notify players ==&lt;br /&gt;
&lt;br /&gt;
To understand notifications, please read [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance] first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notifications are sent at the very end of the request, when it ends normally. It means that if you throw an exception for any reason (ex: move not allowed), no notifications will be sent to players.&lt;br /&gt;
Notifications sent between the game start (setupNewGame) and the end of the &amp;quot;action&amp;quot; method of the first active state will never reach their destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyAllPlayers( $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send a notification to all players of the game.&lt;br /&gt;
&lt;br /&gt;
* notification_type:&lt;br /&gt;
A string that defines the type of your notification.&lt;br /&gt;
&lt;br /&gt;
Your game interface Javascript logic will use this to know what is the type of the received notification (and to trigger the corresponding method).&lt;br /&gt;
&lt;br /&gt;
* notification_log:&lt;br /&gt;
A string that defines what is to be displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
You can use an empty string here (&amp;quot;&amp;quot;). In this case, nothing is displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
If you define a real string here, you should use &amp;quot;clienttranslate&amp;quot; method to make sure it can be translate.&lt;br /&gt;
&lt;br /&gt;
You can use arguments in your notification_log strings, that refers to values defines in the &amp;quot;notification_args&amp;quot; argument (see below). &lt;br /&gt;
Note: Make sure you only use single quotes (&#039;), otherwise PHP will try to interpolate the variable and will ignore the values in the args array.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* notification_args:&lt;br /&gt;
The arguments of your notifications, as an associative array.&lt;br /&gt;
&lt;br /&gt;
This array will be transmitted to the game interface logic, in order the game interface can be updated.&lt;br /&gt;
&lt;br /&gt;
Complete notifyAllPlayers example (from &amp;quot;Reversi&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::notifyAllPlayers( &amp;quot;playDisc&amp;quot;, clienttranslate( &#039;${player_name} plays a disc and turns over ${returned_nbr} disc(s)&#039; ),&lt;br /&gt;
 array(&lt;br /&gt;
        &#039;player_id&#039; =&amp;gt; $player_id,&lt;br /&gt;
        &#039;player_name&#039; =&amp;gt; self::getActivePlayerName(),&lt;br /&gt;
        &#039;returned_nbr&#039; =&amp;gt; count( $turnedOverDiscs ),&lt;br /&gt;
        &#039;x&#039; =&amp;gt; $x,&lt;br /&gt;
        &#039;y&#039; =&amp;gt; $y&lt;br /&gt;
     ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see in the example above the use of the &amp;quot;clienttranslate&amp;quot; method, and the use of 2 arguments &amp;quot;player_name&amp;quot; and &amp;quot;returned_nbr&amp;quot; in the notification log.&lt;br /&gt;
&lt;br /&gt;
Important: NO private data must be sent with this method, as a cheater could see it even it is not used explicitly by the game interface logic. If you want to send private information to a player, please use notifyPlayer below.&lt;br /&gt;
&lt;br /&gt;
Note: you CAN use some HTML inside your notification log, however it not recommended for many reasons:&lt;br /&gt;
* Its bad architecture, ui elements leak into server now you have to manage ui in many places&lt;br /&gt;
* If you decided to change something in ui in future version, old games reply and tutorials may not work, since they use stored notifications&lt;br /&gt;
* When you read log preview for old games its unreadable (this is log before you enter the game reply, useful for troubleshooting or game analysis)&lt;br /&gt;
* Its more data to transfer and store in db&lt;br /&gt;
* Its nightmare for translators, at least don&#039;t put HTML tags inside the &amp;quot;clienttranslate&amp;quot; method. You can use a notification argument instead, and provide your HTML through this argument.&lt;br /&gt;
&lt;br /&gt;
If you still want to have pretty pictures in the log check this [[BGA_Studio_Cookbook#Inject_images_and_styled_html_in_the_log]].&lt;br /&gt;
&lt;br /&gt;
If your notification contains some phrases that build programmatically you may need to use recursive notifications. In this case the argument can be not only the string but&lt;br /&gt;
an array itself, which contains &#039;log&#039; and &#039;args&#039;, i.e.&lt;br /&gt;
&lt;br /&gt;
  $this-&amp;gt;notifyAllPlayers(&#039;playerLog&#039;,clienttranslate(&#039;Game moves ${token_name_rec}&#039;),&lt;br /&gt;
                   [&#039;token_name_rec&#039;=&amp;gt;[&#039;log&#039;=&amp;gt;&#039;${token_name} #${token_number}&#039;,&lt;br /&gt;
                                       &#039;args&#039;=&amp;gt; [&#039;token_name&#039;=&amp;gt;clienttranslate(&#039;Boo&#039;), &#039;token_number&#039;=&amp;gt;$number, &#039;i18n&#039;=&amp;gt;[&#039;token_name&#039;] ]&lt;br /&gt;
                                      ]&lt;br /&gt;
                   ]);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyPlayer( $player_id, $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, except that the notification is sent to one player only.&lt;br /&gt;
&lt;br /&gt;
This method must be used each time some private information must be transmitted to a player.&lt;br /&gt;
&lt;br /&gt;
Important: the variable for player name must be ${player_name} in order to be highlighted with the player color in the game log&lt;br /&gt;
&lt;br /&gt;
== About random and randomness ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Game statistics ==&lt;br /&gt;
&lt;br /&gt;
There are 2 types of statistics:&lt;br /&gt;
* a &amp;quot;player&amp;quot; statistic is a statistic associated to a player&lt;br /&gt;
* a &amp;quot;table&amp;quot; statistics is a statistic not associated to a player (global statistic for this game).&lt;br /&gt;
&lt;br /&gt;
See [[Game statistics: stats.inc.php]] to see how you defines statistics for your game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initStat( $table_or_player, $name, $value, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a statistic entry  with a default value.&lt;br /&gt;
This method must be called for each statistics of your game, in your setupNewGame method.&lt;br /&gt;
&lt;br /&gt;
&#039;$table_or_player&#039; must be set to &amp;quot;table&amp;quot; if this is a table statistics, or &amp;quot;player&amp;quot; if this is a player statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;$name&#039; is the name of your statistics, as it has been defined in your stats.inc.php file.&lt;br /&gt;
&lt;br /&gt;
&#039;$value&#039; is the initial value of the statistics. If this is a player statistics and if the player is not specified by &amp;quot;$player_id&amp;quot; argument, the value is set for ALL players.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setStat( $value, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set a statistic $name to $value.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is not specified, setStat consider it is a TABLE statistic.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is specified, setStat consider it is a PLAYER statistic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incStat( $delta, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment (or decrement) specified statistic value by $delta value. Same behavior as setStat function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getStat( $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the value of statistic specified by $name. Useful when creating derivative statistics such as average.&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Manage player scores and Tie breaker ==&lt;br /&gt;
&lt;br /&gt;
=== Normal scoring ===&lt;br /&gt;
&lt;br /&gt;
At the end of the game, players automatically get a rank depending on their score: the player with the biggest score is #1, the player with the second biggest score is #2, and so on...&lt;br /&gt;
&lt;br /&gt;
During the game, you update player&#039;s score directly by updating &amp;quot;player_score&amp;quot; field of &amp;quot;player&amp;quot; table in database.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  // +2 points to active player&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=player_score+2 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Set score of active player to 5&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=5 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: don&#039;t forget to notify the client side in order the score control can be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
=== Tie breaker ===&lt;br /&gt;
&lt;br /&gt;
Tie breaker is used when two players get the same score at the end of a game.&lt;br /&gt;
&lt;br /&gt;
Tie breaker is using &amp;quot;player_score_aux&amp;quot; field of &amp;quot;player&amp;quot; table. It is updated exactly like the &amp;quot;player_score&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
Tie breaker score is displayed only for players who are tied at the end of the game. Most of the time, it is not supposed to be displayed explicitly during the game.&lt;br /&gt;
&lt;br /&gt;
When you are using &amp;quot;player_score_aux&amp;quot; functionality, you must describe the formula to use in your gameinfos.inc.php file like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         &#039;tie_breaker_description&#039; =&amp;gt; totranslate(&amp;quot;Describe here your tie breaker formula&amp;quot;),&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This description will be used as a tooltip to explain to players how this auxiliary score has been calculated.&lt;br /&gt;
&lt;br /&gt;
=== Co-operative game ===&lt;br /&gt;
&lt;br /&gt;
To make everyone lose in full-coop game:&lt;br /&gt;
&lt;br /&gt;
Add the following in gameinfos.inc.php :&lt;br /&gt;
&#039;is_coop&#039; =&amp;gt; 1, // full cooperative&lt;br /&gt;
&lt;br /&gt;
And score zero to everyone.&lt;br /&gt;
&lt;br /&gt;
=== Semi-coop ===&lt;br /&gt;
&lt;br /&gt;
If the game is not full-coop, then everyone lose = everyone is tie. I.e. set score to 0 to everybody.&lt;br /&gt;
&lt;br /&gt;
=== One winner only ===&lt;br /&gt;
If you need to one person to win and everybody else to lose, set the scores so that the winner has the best score, and the other players have the same (lower) score. Then add the following lines to gameinfos.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// If in the game, all losers are equal (no score to rank them or explicit in the rules that losers are not ranked between them), set this to true &lt;br /&gt;
// The game end result will display &amp;quot;Winner&amp;quot; for the 1st player and &amp;quot;Loser&amp;quot; for all other players&lt;br /&gt;
&#039;losers_not_ranked&#039; =&amp;gt; true,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quantum and Coup are implemented like this, as you can see here:&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=quantum&amp;amp;section=lastresults&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=coupcitystate&amp;amp;section=lastresults&lt;br /&gt;
&lt;br /&gt;
=== Solo ===&lt;br /&gt;
&lt;br /&gt;
If game supports solo variant, a negative score means defeat, a positive score means victory.&lt;br /&gt;
&lt;br /&gt;
=== Player elimination ===&lt;br /&gt;
&lt;br /&gt;
In some games, this is useful to eliminate a player from the game in order he/she can start another game without waiting for the current game end.&lt;br /&gt;
&lt;br /&gt;
This case should be rare. Please don&#039;t use player elimination feature if some player just has to wait the last 10% of the game for game end. This feature should be used only in games where players are eliminated all along the game (typical examples: &amp;quot;Perudo&amp;quot; or &amp;quot;The Werewolves of Miller&#039;s Hollow&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
* Player to eliminate should NOT be active anymore (preferably use the feature in a &amp;quot;game&amp;quot; type game state).&lt;br /&gt;
* In your PHP code:&lt;br /&gt;
  self::eliminatePlayer( &amp;lt;player_to_eliminate_id&amp;gt; );&lt;br /&gt;
* the player is informed in a dialog box that he no longer have to played and can start another game if he/she wants too (whith buttons &amp;quot;stay at this table&amp;quot; &amp;quot;quit table and back to main site&amp;quot;). In any case, the player is free to tart&amp;amp;join another table from now.&lt;br /&gt;
* When your game is over, all players who have been eliminated before receive a &amp;quot;notification&amp;quot; (the small &amp;quot;!&amp;quot; icon on the top right of the BGA interface) that indicate them that &amp;quot;the game has ended&amp;quot; and invite them to review the game results.&lt;br /&gt;
&lt;br /&gt;
=== Scoring Helper functions ===&lt;br /&gt;
&lt;br /&gt;
    // get score&lt;br /&gt;
    function dbGetScore($player_id) {&lt;br /&gt;
        return $this-&amp;gt;getUniqueValueFromDB(&amp;quot;SELECT player_score FROM player WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // set score&lt;br /&gt;
    function dbSetScore($player_id, $count) {&lt;br /&gt;
        $this-&amp;gt;DbQuery(&amp;quot;UPDATE player SET player_score=&#039;$count&#039; WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // set aux score (tie breaker)&lt;br /&gt;
    function dbSetAuxScore($player_id, $score) {&lt;br /&gt;
        $this-&amp;gt;DbQuery(&amp;quot;UPDATE player SET player_score_aux=$score WHERE player_id=&#039;$player_id&#039;&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // increment score (can be negative too)&lt;br /&gt;
    function dbIncScore($player_id, $inc) {&lt;br /&gt;
        $count = $this-&amp;gt;dbGetScore($player_id);&lt;br /&gt;
        if ($inc != 0) {&lt;br /&gt;
            $count += $inc;&lt;br /&gt;
            $this-&amp;gt;dbSetScore($player_id, $count);&lt;br /&gt;
        }&lt;br /&gt;
        return $count;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
== Reflexion time ==&lt;br /&gt;
&lt;br /&gt;
; function giveExtraTime( $player_id, $specific_time=null )&lt;br /&gt;
: Give standard extra time to this player.&lt;br /&gt;
: Standard extra time depends on the speed of the game (small with &amp;quot;slow&amp;quot; game option, bigger with other options).&lt;br /&gt;
: You can also specify an exact time to add, in seconds, with the &amp;quot;specified_time&amp;quot; argument (rarely used).&lt;br /&gt;
&lt;br /&gt;
== Managing errors and exceptions ==&lt;br /&gt;
&lt;br /&gt;
Note: when you throw an exception, all database changes and all notifications are cancelled immediately. This way, the game situation that existed before the request is completely restored.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaUserException ( $error_message)&lt;br /&gt;
: Base class to notify a user error&lt;br /&gt;
: You must throw this exception when a player wants to do something that he is not allowed to do.&lt;br /&gt;
: The error message will be shown to the player as a &amp;quot;red message&amp;quot;, so it must be translated.&lt;br /&gt;
: Throwing such an exception is NOT considered a bug, so it is not traced in BGA error logs.&lt;br /&gt;
&lt;br /&gt;
Example from Gomoku:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     throw new BgaUserException( self::_(&amp;quot;There is already a stone on this intersection, you can&#039;t play there&amp;quot;) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; throw new BgaVisibleSystemException ( $error_message)&lt;br /&gt;
: You must throw this exception when you detect something that is not supposed to happened in your code.&lt;br /&gt;
: The error message is shown to the user as an &amp;quot;Unexpected error&amp;quot;, in order that he can report it in the forum.&lt;br /&gt;
: The error message is logged in BGA error logs. If it happens regularly, we will report it to you.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaSystemException ( $error_message)&lt;br /&gt;
: Base class to notify a system exception. The message will be hidden from the user, but show in the logs. Use this if the message contains technical information.&lt;br /&gt;
: You shouldn&#039;t use this type of exception except if you think the information shown could be critical. Indeed: a generic error message will be shown to the user, so it&#039;s going to be difficult for you to see what happened.&lt;br /&gt;
&lt;br /&gt;
== Zombie mode ==&lt;br /&gt;
&lt;br /&gt;
When a player leaves a game for any reason (expelled, quit), he becomes a &amp;quot;zombie player&amp;quot;. In this case, the results of the game won&#039;t count for statistics, but this is cool if the other players can finish the game anyway. That&#039;s why zombie mode exists: allow the other player to finish the game, even if the situation is not ideal.&lt;br /&gt;
&lt;br /&gt;
While developing your zombie mode, keep in mind that:&lt;br /&gt;
* Do not refer to the rules, because this situation is not planned by the rules.&lt;br /&gt;
* Try to figure that you are playing with your friends and one of them has to leave: how can we finish the game without killing the spirit of the game?&lt;br /&gt;
* The idea is NOT to develop an artificial intelligence for the game.&lt;br /&gt;
&lt;br /&gt;
Most of the time, the best thing to do when it is zombie player turn is to jump immediately to a state where he is not active anymore. For example, if he is in a game state where he has a choice between playing A and playing B, the best thing to do is NOT to choose A or B, but to pass. So, even if there&#039;s no &amp;quot;pass&amp;quot; action in the rules, add a &amp;quot;zombiepass&amp;quot; transitition in your game state and use it.&lt;br /&gt;
&lt;br /&gt;
Each time a zombie player must play, your &amp;quot;zombieTurn&amp;quot; method is called.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* $state: the name of the current game state.&lt;br /&gt;
* $active_player: the id of the active player.&lt;br /&gt;
&lt;br /&gt;
Most of the time, your zombieTurn method looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    function zombieTurn( $state, $active_player )&lt;br /&gt;
    {&lt;br /&gt;
    	$statename = $state[&#039;name&#039;];&lt;br /&gt;
&lt;br /&gt;
        if( $statename == &#039;myFirstGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my2ndGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my3rdGameState&#039;&lt;br /&gt;
               ....&lt;br /&gt;
           )&lt;br /&gt;
        {&lt;br /&gt;
            $this-&amp;gt;gamestate-&amp;gt;nextState( &amp;quot;zombiePass&amp;quot; );&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            throw new BgaVisibleSystemException( &amp;quot;Zombie mode not supported at this game state: &amp;quot;.$statename );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that in the example above, all corresponding game state should implement &amp;quot;zombiePass&amp;quot; as a transition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Player color preferences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BGA players (Club members) may now choose their preferred color for playing. For example, if they are used to play green for every board game, they can select &amp;quot;green&amp;quot; in their BGA preferences page.&lt;br /&gt;
&lt;br /&gt;
Making your game compatible with colors preferences is very easy and requires only 1 line of PHP and 1 configuration change :&lt;br /&gt;
&lt;br /&gt;
On your gameinfos.inc.php file, add the following lines :&lt;br /&gt;
&lt;br /&gt;
  // Favorite colors support : if set to &amp;quot;true&amp;quot;, support attribution of favorite colors based on player&#039;s preferences (see reattributeColorsBasedOnPreferences PHP method)&lt;br /&gt;
  &#039;favorite_colors_support&#039; =&amp;gt; true,&lt;br /&gt;
&lt;br /&gt;
Then, on your main &amp;lt;your_game&amp;gt;.game.php file, find the &amp;quot;reloadPlayersBasicInfos&amp;quot; call in your &amp;quot;setupNewGame&amp;quot; method and replace :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
By :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reattributeColorsBasedOnPreferences( $players, array(  /* LIST HERE THE AVAILABLE COLORS OF YOUR GAME INSTEAD OF THESE ONES */&amp;quot;ff0000&amp;quot;, &amp;quot;008000&amp;quot;, &amp;quot;0000ff&amp;quot;, &amp;quot;ffa500&amp;quot;, &amp;quot;773300&amp;quot; ) );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;reattributeColorsBasedOnPreferences&amp;quot; method reattributes all colors, taking into account players color preferences and available colors.&lt;br /&gt;
&lt;br /&gt;
Note that you must update the colors to indicate the colors available for your game.&lt;br /&gt;
&lt;br /&gt;
2 important remarks :&lt;br /&gt;
* for some games (ex : Chess), the color has an influence on a mechanism of the game, most of the time by giving a special advantage to a player (ex : Starting the game). Color preference mechanism must NOT be used in such a case.&lt;br /&gt;
* your logic should NEVER consider that the first player has the color X, that the second player has the color Y, and so on. If this is the case, your game will NOT be compatible with reattributeColorsBasedOnPreferences as this method attribute colors to players based on their preferences and not based as their order at the table.&lt;br /&gt;
&lt;br /&gt;
Colours currently listed as a choice in preferences:&lt;br /&gt;
&lt;br /&gt;
* #ff0000 Red&lt;br /&gt;
* #008000 Green&lt;br /&gt;
* #0000ff Blue&lt;br /&gt;
* #ffa500 Yellow&lt;br /&gt;
* #000000 Black&lt;br /&gt;
* #ffffff White&lt;br /&gt;
&lt;br /&gt;
== Debugging and Tracing ==&lt;br /&gt;
&lt;br /&gt;
To debug php code you can use some tracing functions available from the parent class such as debug, trace, error, warn, dump.&lt;br /&gt;
  &lt;br /&gt;
  self::debug(&amp;quot;Ahh!&amp;quot;);&lt;br /&gt;
  self::dump(&#039;my_var&#039;,$my_var);&lt;br /&gt;
&lt;br /&gt;
See [[Practical_debugging]] section for complete information about debugging interfaces and where to find logs.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Game_options_and_preferences:_gameoptions.inc.php&amp;diff=3204</id>
		<title>Game options and preferences: gameoptions.inc.php</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Game_options_and_preferences:_gameoptions.inc.php&amp;diff=3204"/>
		<updated>2018-09-25T08:06:24Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
In this file, you can define your game options (= game variants) and user preferences.&lt;br /&gt;
   &lt;br /&gt;
Note: If your game has no variants or preferences, you don&#039;t have to modify this file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; after you edited this file in your SFTP folder you have to go to the control panel and press &amp;quot;Reload game options configuration&amp;quot; for your changes to take effect.&lt;br /&gt;
&lt;br /&gt;
== Game Options ==&lt;br /&gt;
&lt;br /&gt;
Game options is something selected by table creator and usually correspond to game variant, for example if game includes expansion or certain special rule.&lt;br /&gt;
&lt;br /&gt;
These variants defined in gameoptions.inc.php as variable  &lt;br /&gt;
  $game_options = array(...); // exactly named that&lt;br /&gt;
&lt;br /&gt;
Each option is pair number =&amp;gt; &#039;option description array&#039;. &lt;br /&gt;
&lt;br /&gt;
All options defined in this file should have a corresponding &amp;quot;game state label&amp;quot; with the same ID (see &amp;quot;initGameStateLabels&amp;quot; in yourgame.game.php)&lt;br /&gt;
&lt;br /&gt;
             self::initGameStateLabels ( array (&lt;br /&gt;
                        ...&lt;br /&gt;
                        &amp;quot;my_first_game_variant&amp;quot; =&amp;gt; 100,&lt;br /&gt;
              ) );&lt;br /&gt;
&lt;br /&gt;
That is how you access them during runtime:&lt;br /&gt;
&lt;br /&gt;
              $this-&amp;gt;gamestate-&amp;gt;table_globals[100]&lt;br /&gt;
&lt;br /&gt;
The following are the parameters of option description array:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; - &#039;&#039;&#039;mandartory&#039;&#039;&#039;. The name of the option visible for table creator. Value must be wrapped in totranslate function.&lt;br /&gt;
* &#039;&#039;&#039;values&#039;&#039;&#039; - &#039;&#039;&#039;mandartory&#039;&#039;&#039;. The array (map) of values with additional parameters per value.&lt;br /&gt;
** &#039;&#039;&#039;name&#039;&#039;&#039; - &#039;&#039;&#039;mandartory&#039;&#039;&#039;. String representation of the numeric value visible to table creator. Value must be wrapped in totranslate function.&lt;br /&gt;
** &#039;&#039;&#039;tmdisplay&#039;&#039;&#039; - String representation of the option visible in the table description, usually if variant &amp;quot;names&amp;quot; are On and Off, but the description would be same as option name when On, and nothing when Off.&lt;br /&gt;
** &#039;&#039;&#039;nobeginner&#039;&#039;&#039; - Set to true if not recommended for begginers&lt;br /&gt;
** &#039;&#039;&#039;beta&#039;&#039;&#039; - Option in beta stage on development&lt;br /&gt;
** &#039;&#039;&#039;premium&#039;&#039;&#039; - Option can be only used by premium members&lt;br /&gt;
* &#039;&#039;&#039;displaycondition&#039;&#039;&#039; - checks the conditions before displaying the option for selection. All conditions must be true for the option to display. Supported condition types:&lt;br /&gt;
** &#039;&#039;otheroption&#039;&#039; condition ensures another option is set to this given values. Framework options - 201 - ELO OFF.&lt;br /&gt;
** &#039;&#039;otheroptionisnot&#039;&#039; conditions ensure another option is NOT set to this given values&lt;br /&gt;
* &#039;&#039;&#039;startcondition&#039;&#039;&#039; - checks the conditions (on options VALUES) before starting the game. All conditions must be true for the game to start, otherwise players will get a red error message when attempting to begin the game. Supported condition types:&lt;br /&gt;
** &#039;&#039;minplayers&#039;&#039; condition ensures at least this many players&lt;br /&gt;
** &#039;&#039;maxplayers&#039;&#039; conditions ensure at most this many players&lt;br /&gt;
** &#039;&#039;otheroption&#039;&#039; conditions ensure another option is set to this given values. That works the same as in &#039;&#039;&#039;displaycondition&#039;&#039;&#039;.&lt;br /&gt;
** &#039;&#039;otheroptionisnot&#039;&#039; conditions ensure another option is NOT set to this given value.  That works the same as in &#039;&#039;&#039;displaycondition&#039;&#039;&#039;.&lt;br /&gt;
* &#039;&#039;&#039;notdisplayedmessage&#039;&#039;&#039; - if option is not suppose to be visible because of displaycondition but this is set, the text will be visible instead of combo drop down&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $game_options = array(&lt;br /&gt;
     100 =&amp;gt; array(&lt;br /&gt;
         &#039;name&#039; =&amp;gt; totranslate(&#039;my game option&#039;),&lt;br /&gt;
         &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
             // A simple value for this option:&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;option 1&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
&lt;br /&gt;
             // A simple value for this option.&lt;br /&gt;
             // If this value is chosen, the value of &amp;quot;tmdisplay&amp;quot; is displayed in the game lobby&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;option 2&#039;),&lt;br /&gt;
                 &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;option 2&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
&lt;br /&gt;
             // Another value, with other options:&lt;br /&gt;
             //  beta=true =&amp;gt; this option is in beta version right now.&lt;br /&gt;
             //  nobeginner=true  =&amp;gt;  this option is not recommended for beginners&lt;br /&gt;
             3 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;option 3&#039;),&lt;br /&gt;
                 &#039;beta&#039; =&amp;gt; true,&lt;br /&gt;
                 &#039;nobeginner&#039; =&amp;gt; true&lt;br /&gt;
             ),&lt;br /&gt;
         )&lt;br /&gt;
     ),&lt;br /&gt;
     &lt;br /&gt;
     101 =&amp;gt; array(&lt;br /&gt;
         &#039;name&#039; =&amp;gt; totranslate(&#039;Draft variant&#039;),&lt;br /&gt;
         &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;No draft&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;Draft&#039;),&lt;br /&gt;
                 &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;Draft&#039;),&lt;br /&gt;
                 &#039;premium&#039; =&amp;gt; true,&lt;br /&gt;
                 &#039;nobeginner&#039; =&amp;gt; true&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;displaycondition&#039; =&amp;gt; array( &lt;br /&gt;
             // Note: do not display this option unless these conditions are met&lt;br /&gt;
             array(&lt;br /&gt;
                 &#039;type&#039; =&amp;gt; &#039;otheroption&#039;,&lt;br /&gt;
                 &#039;id&#039; =&amp;gt; 100, // Game specific option defined in the same array above&lt;br /&gt;
                 &#039;value&#039; =&amp;gt; array(2, 3, 4)&lt;br /&gt;
             ),&lt;br /&gt;
             // Note: do not display this option unless these conditions are met&lt;br /&gt;
            array( &#039;type&#039; =&amp;gt; &#039;otheroption&#039;, &lt;br /&gt;
                 &#039;id&#039; =&amp;gt; 201, // ELO OFF hardcoded framework option&lt;br /&gt;
                 &#039;value&#039; =&amp;gt; 1 // 1 if OFF&lt;br /&gt;
            )&lt;br /&gt;
         ),&lt;br /&gt;
&lt;br /&gt;
         &#039;startcondition&#039; =&amp;gt; array(&lt;br /&gt;
             1 =&amp;gt; array(),&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 array(&lt;br /&gt;
                     &#039;type&#039; =&amp;gt; &#039;maxplayers&#039;,&lt;br /&gt;
                     &#039;value&#039; =&amp;gt; 3,&lt;br /&gt;
                     &#039;message&#039; =&amp;gt; totranslate(&#039;Draft option is available for 3 players maximum.&#039;)&lt;br /&gt;
                 )&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;disable&#039; =&amp;gt; true&lt;br /&gt;
     ),&lt;br /&gt;
     &lt;br /&gt;
     102 =&amp;gt; array(&lt;br /&gt;
         &#039;name&#039; =&amp;gt; totranslate(&#039;Takeovers&#039;),&lt;br /&gt;
         &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;No takeover&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;Allow takeovers&#039;),&lt;br /&gt;
                 &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;Takeovers&#039;),&lt;br /&gt;
                 &#039;premium&#039; =&amp;gt; true,&lt;br /&gt;
                 &#039;nobeginner&#039; =&amp;gt; true&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;displaycondition&#039; =&amp;gt; array( // Note: do not display this option unless these conditions are met&lt;br /&gt;
             array(&lt;br /&gt;
                 &#039;type&#039; =&amp;gt; &#039;otheroption&#039;,&lt;br /&gt;
                 &#039;id&#039; =&amp;gt; 100,&lt;br /&gt;
                 &#039;value&#039; =&amp;gt; array(3, 4)&lt;br /&gt;
             )&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;startcondition&#039; =&amp;gt; array(&lt;br /&gt;
             2 =&amp;gt; array(),&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 array(&lt;br /&gt;
                     &#039;type&#039; =&amp;gt; &#039;maxplayers&#039;,&lt;br /&gt;
                     &#039;value&#039; =&amp;gt; 2,&lt;br /&gt;
                     &#039;message&#039; =&amp;gt; totranslate(&#039;Rebel vs Imperium Takeover Scenario is available for 2 players only.&#039;)&lt;br /&gt;
                 )&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;disable&#039; =&amp;gt; true&lt;br /&gt;
     )&lt;br /&gt;
 );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of option that condition on ELO off&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$game_options = array(&lt;br /&gt;
&lt;br /&gt;
        100 =&amp;gt; array(&lt;br /&gt;
                &#039;name&#039; =&amp;gt; totranslate(&#039;Learning Game (No Research)&#039;),&lt;br /&gt;
                &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
                        &lt;br /&gt;
                        1 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate(&#039;Off&#039;), &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;&#039;) ),&lt;br /&gt;
                        2 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate(&#039;On&#039;), &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;Learning Game&#039;) ),&lt;br /&gt;
                        &lt;br /&gt;
                ),&lt;br /&gt;
                &#039;displaycondition&#039; =&amp;gt; array(&lt;br /&gt;
                        // Note: do not display this option unless these conditions are met&lt;br /&gt;
                        array( &#039;type&#039; =&amp;gt; &#039;otheroption&#039;,&lt;br /&gt;
                                &#039;id&#039; =&amp;gt; 201, // ELO OFF hardcoded framework option&lt;br /&gt;
                                &#039;value&#039; =&amp;gt; 1, // 1 if OFF&lt;br /&gt;
&lt;br /&gt;
                        )&lt;br /&gt;
                ),&lt;br /&gt;
                &#039;notdisplayedmessage&#039; =&amp;gt; totranslate(&#039;Learning variant available only with ELO off&#039;)&lt;br /&gt;
                ),&lt;br /&gt;
&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of using condition on your own option&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        102 =&amp;gt; array(&lt;br /&gt;
                &#039;name&#039; =&amp;gt; totranslate(&#039;Scenarios&#039;),&lt;br /&gt;
                &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
                        1 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate(&#039;Off&#039;),&lt;br /&gt;
                                &#039;nobeginner&#039; =&amp;gt; false  ),&lt;br /&gt;
                        2 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate(&#039;On&#039;), &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;Scenarios&#039;),&lt;br /&gt;
                                &#039;nobeginner&#039; =&amp;gt; true  ),&lt;br /&gt;
                        &lt;br /&gt;
                ),&lt;br /&gt;
                &#039;displaycondition&#039; =&amp;gt; array(&lt;br /&gt;
                        // Note: do not display this option unless these conditions are met&lt;br /&gt;
                        array( &#039;type&#039; =&amp;gt; &#039;otheroptionisnot&#039;,&lt;br /&gt;
                                &#039;id&#039; =&amp;gt; 100, // learning variant&lt;br /&gt;
                                &#039;value&#039; =&amp;gt; 2, // 1 if OFF,2 is ON&lt;br /&gt;
                                &lt;br /&gt;
                        )&lt;br /&gt;
                ),&lt;br /&gt;
                &#039;notdisplayedmessage&#039; =&amp;gt; totranslate(&#039;Scenarios variant is not available if Learning variant is chosen&#039;)&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== User Preferences ==&lt;br /&gt;
&lt;br /&gt;
User preferences is something cosmetic about the game interface which however can create user wars, so you can satisfy all users&lt;br /&gt;
by giving them individual preferences. You should use this only if it significantly improves the interface for a large proportion of users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$game_preferences = array(&lt;br /&gt;
    100 =&amp;gt; array(&lt;br /&gt;
			&#039;name&#039; =&amp;gt; totranslate(&#039;Notation style&#039;),&lt;br /&gt;
			&#039;needReload&#039; =&amp;gt; true, // after user changes this preference game interface would auto-reload&lt;br /&gt;
			&#039;values&#039; =&amp;gt; array(&lt;br /&gt;
					1 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate( &#039;Classic&#039; ), &#039;cssPref&#039; =&amp;gt; &#039;notation_classic&#039; ),&lt;br /&gt;
					2 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate( &#039;Tournament&#039; ), &#039;cssPref&#039; =&amp;gt; &#039;notation_tournament&#039; )&lt;br /&gt;
			)&lt;br /&gt;
	)&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is two ways to check/apply this. In java Script&lt;br /&gt;
&lt;br /&gt;
  if (this.prefs[100].value == 2) ...&lt;br /&gt;
&lt;br /&gt;
This checks if preferences 100 has selected value 2.&lt;br /&gt;
&lt;br /&gt;
Second, if cssPref specified it will be applied to the body tag. So you can use different css styling for the preference.&lt;br /&gt;
&lt;br /&gt;
As user you have to select them from the Gear menu when game is started. On studio only user0 will have it actually working (bug?).&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Game_options_and_preferences:_gameoptions.inc.php&amp;diff=3203</id>
		<title>Game options and preferences: gameoptions.inc.php</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Game_options_and_preferences:_gameoptions.inc.php&amp;diff=3203"/>
		<updated>2018-09-25T07:25:46Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
In this file, you can define your game options (= game variants) and user preferences.&lt;br /&gt;
   &lt;br /&gt;
Note: If your game has no variants or preferences, you don&#039;t have to modify this file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT:&#039;&#039;&#039; after you edited this file in your SFTP folder you have to go to the control panel and press &amp;quot;Reload game options configuration&amp;quot; for your changes to take effect.&lt;br /&gt;
&lt;br /&gt;
== Game Options ==&lt;br /&gt;
&lt;br /&gt;
Game options is something selected by table creator and usually correspond to game variant, for example if game includes expansion or certain special rule.&lt;br /&gt;
&lt;br /&gt;
These variants defined in gameoptions.inc.php as variable  &lt;br /&gt;
  $game_options = array(...); // exactly named that&lt;br /&gt;
&lt;br /&gt;
Each option is pair number =&amp;gt; &#039;option description array&#039;. &lt;br /&gt;
&lt;br /&gt;
All options defined in this file should have a corresponding &amp;quot;game state label&amp;quot; with the same ID (see &amp;quot;initGameStateLabels&amp;quot; in yourgame.game.php)&lt;br /&gt;
&lt;br /&gt;
             self::initGameStateLabels ( array (&lt;br /&gt;
                        ...&lt;br /&gt;
                        &amp;quot;my_first_game_variant&amp;quot; =&amp;gt; 100,&lt;br /&gt;
              ) );&lt;br /&gt;
&lt;br /&gt;
That is how you access them during runtime:&lt;br /&gt;
&lt;br /&gt;
              $this-&amp;gt;gamestate-&amp;gt;table_globals[100]&lt;br /&gt;
&lt;br /&gt;
The following are the parameters of option description array:&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; - &#039;&#039;&#039;mandartory&#039;&#039;&#039;. The name of the option visible for table creator. Value must be wrapped in totranslate function.&lt;br /&gt;
* &#039;&#039;&#039;values&#039;&#039;&#039; - &#039;&#039;&#039;mandartory&#039;&#039;&#039;. The array (map) of values with additional parameters per value.&lt;br /&gt;
** &#039;&#039;&#039;name&#039;&#039;&#039; - &#039;&#039;&#039;mandartory&#039;&#039;&#039;. String representation of the numeric value visible to table creator. Value must be wrapped in totranslate function.&lt;br /&gt;
** &#039;&#039;&#039;tmdisplay&#039;&#039;&#039; - String representation of the option visible in the table description, usually if variant &amp;quot;names&amp;quot; are On and Off, but the description would be same as option name when On, and nothing when Off.&lt;br /&gt;
** &#039;&#039;&#039;nobeginner&#039;&#039;&#039; - Set to true if not recommended for begginers&lt;br /&gt;
** &#039;&#039;&#039;beta&#039;&#039;&#039; - Option in beta stage on development&lt;br /&gt;
** &#039;&#039;&#039;premium&#039;&#039;&#039; - Option can be only used by premium members&lt;br /&gt;
* &#039;&#039;&#039;displaycondition&#039;&#039;&#039; - checks the conditions before displaying the option for selection. All conditions must be true for the option to display. Supported condition types:&lt;br /&gt;
** &#039;&#039;otheroption&#039;&#039; condition ensures another option is set to this given value. Framework options - 201 - ELO OFF.&lt;br /&gt;
* &#039;&#039;&#039;startcondition&#039;&#039;&#039; - checks the conditions (on options VALUES) before starting the game. All conditions must be true for the game to start, otherwise players will get a red error message when attempting to begin the game. Supported condition types:&lt;br /&gt;
** &#039;&#039;minplayers&#039;&#039; condition ensures at least this many players&lt;br /&gt;
** &#039;&#039;maxplayers&#039;&#039; conditions ensure at most this many players&lt;br /&gt;
** &#039;&#039;otheroption&#039;&#039; conditions ensure another option is set to this given value. That works the same as in &#039;&#039;&#039;displaycondition&#039;&#039;&#039;.&lt;br /&gt;
** &#039;&#039;otheroptionisnot&#039;&#039; conditions ensure another option is NOT set to this given value&lt;br /&gt;
* &#039;&#039;&#039;notdisplayedmessage&#039;&#039;&#039; - if option is not suppose to be visible because of displaycondition but this is set, the text will be visible instead of combo drop down&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $game_options = array(&lt;br /&gt;
     100 =&amp;gt; array(&lt;br /&gt;
         &#039;name&#039; =&amp;gt; totranslate(&#039;my game option&#039;),&lt;br /&gt;
         &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
             // A simple value for this option:&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;option 1&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
&lt;br /&gt;
             // A simple value for this option.&lt;br /&gt;
             // If this value is chosen, the value of &amp;quot;tmdisplay&amp;quot; is displayed in the game lobby&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;option 2&#039;),&lt;br /&gt;
                 &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;option 2&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
&lt;br /&gt;
             // Another value, with other options:&lt;br /&gt;
             //  beta=true =&amp;gt; this option is in beta version right now.&lt;br /&gt;
             //  nobeginner=true  =&amp;gt;  this option is not recommended for beginners&lt;br /&gt;
             3 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;option 3&#039;),&lt;br /&gt;
                 &#039;beta&#039; =&amp;gt; true,&lt;br /&gt;
                 &#039;nobeginner&#039; =&amp;gt; true&lt;br /&gt;
             ),&lt;br /&gt;
         )&lt;br /&gt;
     ),&lt;br /&gt;
     &lt;br /&gt;
     101 =&amp;gt; array(&lt;br /&gt;
         &#039;name&#039; =&amp;gt; totranslate(&#039;Draft variant&#039;),&lt;br /&gt;
         &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;No draft&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;Draft&#039;),&lt;br /&gt;
                 &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;Draft&#039;),&lt;br /&gt;
                 &#039;premium&#039; =&amp;gt; true,&lt;br /&gt;
                 &#039;nobeginner&#039; =&amp;gt; true&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;displaycondition&#039; =&amp;gt; array( &lt;br /&gt;
             // Note: do not display this option unless these conditions are met&lt;br /&gt;
             array(&lt;br /&gt;
                 &#039;type&#039; =&amp;gt; &#039;otheroption&#039;,&lt;br /&gt;
                 &#039;id&#039; =&amp;gt; 100, // Game specific option defined in the same array above&lt;br /&gt;
                 &#039;value&#039; =&amp;gt; array(2, 3, 4)&lt;br /&gt;
             ),&lt;br /&gt;
             // Note: do not display this option unless these conditions are met&lt;br /&gt;
            array( &#039;type&#039; =&amp;gt; &#039;otheroption&#039;, &lt;br /&gt;
                 &#039;id&#039; =&amp;gt; 201, // ELO OFF hardcoded framework option&lt;br /&gt;
                 &#039;value&#039; =&amp;gt; 1 // 1 if OFF&lt;br /&gt;
            )&lt;br /&gt;
         ),&lt;br /&gt;
&lt;br /&gt;
         &#039;startcondition&#039; =&amp;gt; array(&lt;br /&gt;
             1 =&amp;gt; array(),&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 array(&lt;br /&gt;
                     &#039;type&#039; =&amp;gt; &#039;maxplayers&#039;,&lt;br /&gt;
                     &#039;value&#039; =&amp;gt; 3,&lt;br /&gt;
                     &#039;message&#039; =&amp;gt; totranslate(&#039;Draft option is available for 3 players maximum.&#039;)&lt;br /&gt;
                 )&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;disable&#039; =&amp;gt; true&lt;br /&gt;
     ),&lt;br /&gt;
     &lt;br /&gt;
     102 =&amp;gt; array(&lt;br /&gt;
         &#039;name&#039; =&amp;gt; totranslate(&#039;Takeovers&#039;),&lt;br /&gt;
         &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;No takeover&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;Allow takeovers&#039;),&lt;br /&gt;
                 &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;Takeovers&#039;),&lt;br /&gt;
                 &#039;premium&#039; =&amp;gt; true,&lt;br /&gt;
                 &#039;nobeginner&#039; =&amp;gt; true&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;displaycondition&#039; =&amp;gt; array( // Note: do not display this option unless these conditions are met&lt;br /&gt;
             array(&lt;br /&gt;
                 &#039;type&#039; =&amp;gt; &#039;otheroption&#039;,&lt;br /&gt;
                 &#039;id&#039; =&amp;gt; 100,&lt;br /&gt;
                 &#039;value&#039; =&amp;gt; array(3, 4)&lt;br /&gt;
             )&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;startcondition&#039; =&amp;gt; array(&lt;br /&gt;
             2 =&amp;gt; array(),&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 array(&lt;br /&gt;
                     &#039;type&#039; =&amp;gt; &#039;maxplayers&#039;,&lt;br /&gt;
                     &#039;value&#039; =&amp;gt; 2,&lt;br /&gt;
                     &#039;message&#039; =&amp;gt; totranslate(&#039;Rebel vs Imperium Takeover Scenario is available for 2 players only.&#039;)&lt;br /&gt;
                 )&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;disable&#039; =&amp;gt; true&lt;br /&gt;
     )&lt;br /&gt;
 );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of option that condition on ELO off&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$game_options = array(&lt;br /&gt;
&lt;br /&gt;
        100 =&amp;gt; array(&lt;br /&gt;
                &#039;name&#039; =&amp;gt; totranslate(&#039;Learning Game (No Research)&#039;),&lt;br /&gt;
                &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
                        &lt;br /&gt;
                        1 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate(&#039;Off&#039;), &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;&#039;) ),&lt;br /&gt;
                        2 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate(&#039;On&#039;), &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;Learning Game&#039;) ),&lt;br /&gt;
                        &lt;br /&gt;
                ),&lt;br /&gt;
                &#039;displaycondition&#039; =&amp;gt; array(&lt;br /&gt;
                        // Note: do not display this option unless these conditions are met&lt;br /&gt;
                        array( &#039;type&#039; =&amp;gt; &#039;otheroption&#039;,&lt;br /&gt;
                                &#039;id&#039; =&amp;gt; 201, // ELO OFF hardcoded framework option&lt;br /&gt;
                                &#039;value&#039; =&amp;gt; 1, // 1 if OFF&lt;br /&gt;
&lt;br /&gt;
                        )&lt;br /&gt;
                ),&lt;br /&gt;
                &#039;notdisplayedmessage&#039; =&amp;gt; totranslate(&#039;Learning variant available only with ELO off&#039;)&lt;br /&gt;
                ),&lt;br /&gt;
&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of using condition on your own option&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        102 =&amp;gt; array(&lt;br /&gt;
                &#039;name&#039; =&amp;gt; totranslate(&#039;Scenarios&#039;),&lt;br /&gt;
                &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
                        1 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate(&#039;Off&#039;),&lt;br /&gt;
                                &#039;nobeginner&#039; =&amp;gt; false  ),&lt;br /&gt;
                        2 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate(&#039;On&#039;), &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;Scenarios&#039;),&lt;br /&gt;
                                &#039;nobeginner&#039; =&amp;gt; true  ),&lt;br /&gt;
                        &lt;br /&gt;
                ),&lt;br /&gt;
                &#039;displaycondition&#039; =&amp;gt; array(&lt;br /&gt;
                        // Note: do not display this option unless these conditions are met&lt;br /&gt;
                        array( &#039;type&#039; =&amp;gt; &#039;otheroptionisnot&#039;,&lt;br /&gt;
                                &#039;id&#039; =&amp;gt; 100, // learning variant&lt;br /&gt;
                                &#039;value&#039; =&amp;gt; 2, // 1 if OFF,2 is ON&lt;br /&gt;
                                &lt;br /&gt;
                        )&lt;br /&gt;
                ),&lt;br /&gt;
                &#039;notdisplayedmessage&#039; =&amp;gt; totranslate(&#039;Scenarios variant is not available if Learning variant is chosen&#039;)&lt;br /&gt;
        ),&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== User Preferences ==&lt;br /&gt;
&lt;br /&gt;
User preferences is something cosmetic about the game interface which however can create user wars, so you can satisfy all users&lt;br /&gt;
by giving them individual preferences. You should use this only if it significantly improves the interface for a large proportion of users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$game_preferences = array(&lt;br /&gt;
    100 =&amp;gt; array(&lt;br /&gt;
			&#039;name&#039; =&amp;gt; totranslate(&#039;Notation style&#039;),&lt;br /&gt;
			&#039;needReload&#039; =&amp;gt; true, // after user changes this preference game interface would auto-reload&lt;br /&gt;
			&#039;values&#039; =&amp;gt; array(&lt;br /&gt;
					1 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate( &#039;Classic&#039; ), &#039;cssPref&#039; =&amp;gt; &#039;notation_classic&#039; ),&lt;br /&gt;
					2 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate( &#039;Tournament&#039; ), &#039;cssPref&#039; =&amp;gt; &#039;notation_tournament&#039; )&lt;br /&gt;
			)&lt;br /&gt;
	)&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is two ways to check/apply this. In java Script&lt;br /&gt;
&lt;br /&gt;
  if (this.prefs[100].value == 2) ...&lt;br /&gt;
&lt;br /&gt;
This checks if preferences 100 has selected value 2.&lt;br /&gt;
&lt;br /&gt;
Second, if cssPref specified it will be applied to the body tag. So you can use different css styling for the preference.&lt;br /&gt;
&lt;br /&gt;
As user you have to select them from the Gear menu when game is started. On studio only user0 will have it actually working (bug?).&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Post-release_phase&amp;diff=3075</id>
		<title>Post-release phase</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Post-release_phase&amp;diff=3075"/>
		<updated>2018-05-22T08:38:04Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Updating the database schema */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Your game is now on BGA: congrats!&lt;br /&gt;
&lt;br /&gt;
But what happened when there are some bugs to fix or when you want to optimize something?&lt;br /&gt;
&lt;br /&gt;
Don&#039;t be afraid: you&#039;re still allowed to modify your game. You just have to pay attention to the points below.&lt;br /&gt;
&lt;br /&gt;
== Bugs reporting ==&lt;br /&gt;
&lt;br /&gt;
Bugs are reported in the [http://forum.boardgamearena.com/viewforum.php?f=4 BGA bugs forum].&lt;br /&gt;
&lt;br /&gt;
During days after your game has been published and from time to time, please have a look at it to check if everything is fine.&lt;br /&gt;
&lt;br /&gt;
== How to submit changes? ==&lt;br /&gt;
&lt;br /&gt;
There is 3 (short) steps to make your changes visible on BGA (from your Control Panel):&lt;br /&gt;
&lt;br /&gt;
* Commit your changes.&lt;br /&gt;
* Build a new version (don&#039;t forget to do a successful commit BEFORE your build).&lt;br /&gt;
* Deploy your new version in production.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can be modified after release? ==&lt;br /&gt;
&lt;br /&gt;
Everything can be modified. BUT, some items requires a special attention, and you must inform us in some cases:&lt;br /&gt;
&lt;br /&gt;
===Changes that breaks the games in progress===&lt;br /&gt;
&lt;br /&gt;
Some changes will break the games in progress at the moment the release/the hotfix will be performed. Each time you make a change, you should ask you the question &amp;quot;it is safe to make this change in a game in progress&amp;quot;, and if the answer is &amp;quot;no&amp;quot; you have to inform us.&lt;br /&gt;
&lt;br /&gt;
Example of changes that break the games in progress:&lt;br /&gt;
* Changes in the database schema of the game (dbmodel.sql).&lt;br /&gt;
* New global variable or game option accessed during the game (if it&#039;s only used during setup, it should be safe).&lt;br /&gt;
* New statistic (it won&#039;t be initialized properly, so it&#039;s going to crash the game).&lt;br /&gt;
* Change ID of existing game states (adding new game states is fine).&lt;br /&gt;
&lt;br /&gt;
Of course, as a rule of thumb, you should avoid to introduce changes that break a game in progress. Sometimes however, you do not have any other choice. In this case:&lt;br /&gt;
* Try to group all your updates in one version, thus we won&#039;t have to block your game several times.&lt;br /&gt;
* Tell us explicitly that you introduce some update that can break games in progress so we can block the game during a short time.&lt;br /&gt;
&lt;br /&gt;
Note: in the near future, we will introduce the possibility for you to block/unblock a game directly from your Control Panel in order to perform all the process by yourself.&lt;br /&gt;
&lt;br /&gt;
=== Updating Statistics ===&lt;br /&gt;
&lt;br /&gt;
You should be careful when updating a statistics:&lt;br /&gt;
&lt;br /&gt;
* If you want to add a new statistics, please refer to the paragraph above (&amp;quot;changes that breaks the games in progress&amp;quot;).&lt;br /&gt;
* If you want to update a statistic, please update it and do not remove/create another one. Otherwise, the statistic won&#039;t keep the same ID and players will lost all the historical statistics data.&lt;br /&gt;
* If your game is published on BGA, please don&#039;t remove any statistics (historical data will be lost).&lt;br /&gt;
&lt;br /&gt;
=== Updating the database schema ===&lt;br /&gt;
&lt;br /&gt;
If you want to update the database schema of the game (dbmodel.sql), you should inform us before releasing the new version (see &amp;quot;[[#Changes that breaks the games in progress|changes that breaks the games in progress]]&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Any modification in dbmodel.sql should also appear in your nameofyourgame.game.php, in a function&lt;br /&gt;
&lt;br /&gt;
  function upgradeTableDb( $from_version ){&lt;br /&gt;
  &lt;br /&gt;
  if( $from_version &amp;lt;= YYMMDDHHMM ){ // where your CURRENT version in production has number YYMMDD-HHMM&lt;br /&gt;
  &lt;br /&gt;
            // You DB schema update request.&lt;br /&gt;
            // Note: all tables names should be prefixed by &amp;quot;DBPREFIX_&amp;quot; to be compatible with the applyDbUpgradeToAllDB method you should use below&lt;br /&gt;
            $sql = &amp;quot;CREATE TABLE DBPREFIX_xxxxxxx ....&amp;quot;;&lt;br /&gt;
  &lt;br /&gt;
            // The method below is applying your DB schema update request to all tables, including the BGA framework utility tables like &amp;quot;zz_replayXXXX&amp;quot; or &amp;quot;zz_savepointXXXX&amp;quot;.&lt;br /&gt;
            // You should really use this request, in conjunction with &amp;quot;DBPREFIX_&amp;quot; in your $sql, so ALL tables are updated. All utility tables MUST have the same schema than the main table, otherwise the game may be blocked.&lt;br /&gt;
            self::applyDbUpgradeToAllDB( $sql );&lt;br /&gt;
  &lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
Note: of course you need to change your dbmodel.sql accordingly, so that new games get your updated scheme.&lt;br /&gt;
&lt;br /&gt;
Note2: this is always risky to modify the DB scheme, so:&lt;br /&gt;
_ it may be worthy to contact us before, so we can stop the realtime games during the update (this way, only turn based games are concerned by the DB live upgrade).&lt;br /&gt;
_ if you can avoid it... try to avoid it :)&lt;br /&gt;
&lt;br /&gt;
=== Updating string to be translated  ===&lt;br /&gt;
&lt;br /&gt;
When you update a string that has been marked to be translatable, please keep in mind that all current translations done by the BGA community will be lost.&lt;br /&gt;
&lt;br /&gt;
Consequently, when you are about to modify a string to be translated (after release), please ask you the following questions:&lt;br /&gt;
* Is it just an English misspelling? In this case, it is better to fix the English translation of the string than the original string to be translated.&lt;br /&gt;
* Has the meaning of the string changed? If yes, you HAVE to change the original string in order to invalidate all translations that has been done already.&lt;br /&gt;
* Is there a similar string already used elsewhere in my game? In this case, you&#039;d better use it again to enjoy immediately all translations already available.&lt;br /&gt;
&lt;br /&gt;
===Major changes===&lt;br /&gt;
&lt;br /&gt;
If you do some major changes to your game like:&lt;br /&gt;
* Introducing a new expansion.&lt;br /&gt;
* Major code rewriting/refactoring.&lt;br /&gt;
&lt;br /&gt;
... please tell us. In this case, we can:&lt;br /&gt;
* Make your game back from &amp;quot;gold&amp;quot; to &amp;quot;public beta&amp;quot;, to incite player to report bugs.&lt;br /&gt;
* And eventually, publish a news about it :)&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Post-release_phase&amp;diff=3074</id>
		<title>Post-release phase</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Post-release_phase&amp;diff=3074"/>
		<updated>2018-05-22T08:37:57Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Updating the database schema */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Your game is now on BGA: congrats!&lt;br /&gt;
&lt;br /&gt;
But what happened when there are some bugs to fix or when you want to optimize something?&lt;br /&gt;
&lt;br /&gt;
Don&#039;t be afraid: you&#039;re still allowed to modify your game. You just have to pay attention to the points below.&lt;br /&gt;
&lt;br /&gt;
== Bugs reporting ==&lt;br /&gt;
&lt;br /&gt;
Bugs are reported in the [http://forum.boardgamearena.com/viewforum.php?f=4 BGA bugs forum].&lt;br /&gt;
&lt;br /&gt;
During days after your game has been published and from time to time, please have a look at it to check if everything is fine.&lt;br /&gt;
&lt;br /&gt;
== How to submit changes? ==&lt;br /&gt;
&lt;br /&gt;
There is 3 (short) steps to make your changes visible on BGA (from your Control Panel):&lt;br /&gt;
&lt;br /&gt;
* Commit your changes.&lt;br /&gt;
* Build a new version (don&#039;t forget to do a successful commit BEFORE your build).&lt;br /&gt;
* Deploy your new version in production.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can be modified after release? ==&lt;br /&gt;
&lt;br /&gt;
Everything can be modified. BUT, some items requires a special attention, and you must inform us in some cases:&lt;br /&gt;
&lt;br /&gt;
===Changes that breaks the games in progress===&lt;br /&gt;
&lt;br /&gt;
Some changes will break the games in progress at the moment the release/the hotfix will be performed. Each time you make a change, you should ask you the question &amp;quot;it is safe to make this change in a game in progress&amp;quot;, and if the answer is &amp;quot;no&amp;quot; you have to inform us.&lt;br /&gt;
&lt;br /&gt;
Example of changes that break the games in progress:&lt;br /&gt;
* Changes in the database schema of the game (dbmodel.sql).&lt;br /&gt;
* New global variable or game option accessed during the game (if it&#039;s only used during setup, it should be safe).&lt;br /&gt;
* New statistic (it won&#039;t be initialized properly, so it&#039;s going to crash the game).&lt;br /&gt;
* Change ID of existing game states (adding new game states is fine).&lt;br /&gt;
&lt;br /&gt;
Of course, as a rule of thumb, you should avoid to introduce changes that break a game in progress. Sometimes however, you do not have any other choice. In this case:&lt;br /&gt;
* Try to group all your updates in one version, thus we won&#039;t have to block your game several times.&lt;br /&gt;
* Tell us explicitly that you introduce some update that can break games in progress so we can block the game during a short time.&lt;br /&gt;
&lt;br /&gt;
Note: in the near future, we will introduce the possibility for you to block/unblock a game directly from your Control Panel in order to perform all the process by yourself.&lt;br /&gt;
&lt;br /&gt;
=== Updating Statistics ===&lt;br /&gt;
&lt;br /&gt;
You should be careful when updating a statistics:&lt;br /&gt;
&lt;br /&gt;
* If you want to add a new statistics, please refer to the paragraph above (&amp;quot;changes that breaks the games in progress&amp;quot;).&lt;br /&gt;
* If you want to update a statistic, please update it and do not remove/create another one. Otherwise, the statistic won&#039;t keep the same ID and players will lost all the historical statistics data.&lt;br /&gt;
* If your game is published on BGA, please don&#039;t remove any statistics (historical data will be lost).&lt;br /&gt;
&lt;br /&gt;
=== Updating the database schema ===&lt;br /&gt;
&lt;br /&gt;
If you want to update the database schema of the game (dbmodel.sql), you should inform us before releasing the new version (see &amp;quot;[[#Changes that breaks the games in progress|changes that breaks the games in progress]]&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Any modification in dbmodel.sql should also appear in your nameofyourgame.game.php, in a function&lt;br /&gt;
&lt;br /&gt;
  function upgradeTableDb( $from_version ){&lt;br /&gt;
&lt;br /&gt;
  if( $from_version &amp;lt;= YYMMDDHHMM ){ // where your CURRENT version in production has number YYMMDD-HHMM&lt;br /&gt;
  &lt;br /&gt;
            // You DB schema update request.&lt;br /&gt;
            // Note: all tables names should be prefixed by &amp;quot;DBPREFIX_&amp;quot; to be compatible with the applyDbUpgradeToAllDB method you should use below&lt;br /&gt;
            $sql = &amp;quot;CREATE TABLE DBPREFIX_xxxxxxx ....&amp;quot;;&lt;br /&gt;
  &lt;br /&gt;
            // The method below is applying your DB schema update request to all tables, including the BGA framework utility tables like &amp;quot;zz_replayXXXX&amp;quot; or &amp;quot;zz_savepointXXXX&amp;quot;.&lt;br /&gt;
            // You should really use this request, in conjunction with &amp;quot;DBPREFIX_&amp;quot; in your $sql, so ALL tables are updated. All utility tables MUST have the same schema than the main table, otherwise the game may be blocked.&lt;br /&gt;
            self::applyDbUpgradeToAllDB( $sql );&lt;br /&gt;
  &lt;br /&gt;
  }}&lt;br /&gt;
&lt;br /&gt;
Note: of course you need to change your dbmodel.sql accordingly, so that new games get your updated scheme.&lt;br /&gt;
&lt;br /&gt;
Note2: this is always risky to modify the DB scheme, so:&lt;br /&gt;
_ it may be worthy to contact us before, so we can stop the realtime games during the update (this way, only turn based games are concerned by the DB live upgrade).&lt;br /&gt;
_ if you can avoid it... try to avoid it :)&lt;br /&gt;
&lt;br /&gt;
=== Updating string to be translated  ===&lt;br /&gt;
&lt;br /&gt;
When you update a string that has been marked to be translatable, please keep in mind that all current translations done by the BGA community will be lost.&lt;br /&gt;
&lt;br /&gt;
Consequently, when you are about to modify a string to be translated (after release), please ask you the following questions:&lt;br /&gt;
* Is it just an English misspelling? In this case, it is better to fix the English translation of the string than the original string to be translated.&lt;br /&gt;
* Has the meaning of the string changed? If yes, you HAVE to change the original string in order to invalidate all translations that has been done already.&lt;br /&gt;
* Is there a similar string already used elsewhere in my game? In this case, you&#039;d better use it again to enjoy immediately all translations already available.&lt;br /&gt;
&lt;br /&gt;
===Major changes===&lt;br /&gt;
&lt;br /&gt;
If you do some major changes to your game like:&lt;br /&gt;
* Introducing a new expansion.&lt;br /&gt;
* Major code rewriting/refactoring.&lt;br /&gt;
&lt;br /&gt;
... please tell us. In this case, we can:&lt;br /&gt;
* Make your game back from &amp;quot;gold&amp;quot; to &amp;quot;public beta&amp;quot;, to incite player to report bugs.&lt;br /&gt;
* And eventually, publish a news about it :)&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Post-release_phase&amp;diff=3073</id>
		<title>Post-release phase</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Post-release_phase&amp;diff=3073"/>
		<updated>2018-05-22T08:37:43Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Updating the database schema */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Your game is now on BGA: congrats!&lt;br /&gt;
&lt;br /&gt;
But what happened when there are some bugs to fix or when you want to optimize something?&lt;br /&gt;
&lt;br /&gt;
Don&#039;t be afraid: you&#039;re still allowed to modify your game. You just have to pay attention to the points below.&lt;br /&gt;
&lt;br /&gt;
== Bugs reporting ==&lt;br /&gt;
&lt;br /&gt;
Bugs are reported in the [http://forum.boardgamearena.com/viewforum.php?f=4 BGA bugs forum].&lt;br /&gt;
&lt;br /&gt;
During days after your game has been published and from time to time, please have a look at it to check if everything is fine.&lt;br /&gt;
&lt;br /&gt;
== How to submit changes? ==&lt;br /&gt;
&lt;br /&gt;
There is 3 (short) steps to make your changes visible on BGA (from your Control Panel):&lt;br /&gt;
&lt;br /&gt;
* Commit your changes.&lt;br /&gt;
* Build a new version (don&#039;t forget to do a successful commit BEFORE your build).&lt;br /&gt;
* Deploy your new version in production.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can be modified after release? ==&lt;br /&gt;
&lt;br /&gt;
Everything can be modified. BUT, some items requires a special attention, and you must inform us in some cases:&lt;br /&gt;
&lt;br /&gt;
===Changes that breaks the games in progress===&lt;br /&gt;
&lt;br /&gt;
Some changes will break the games in progress at the moment the release/the hotfix will be performed. Each time you make a change, you should ask you the question &amp;quot;it is safe to make this change in a game in progress&amp;quot;, and if the answer is &amp;quot;no&amp;quot; you have to inform us.&lt;br /&gt;
&lt;br /&gt;
Example of changes that break the games in progress:&lt;br /&gt;
* Changes in the database schema of the game (dbmodel.sql).&lt;br /&gt;
* New global variable or game option accessed during the game (if it&#039;s only used during setup, it should be safe).&lt;br /&gt;
* New statistic (it won&#039;t be initialized properly, so it&#039;s going to crash the game).&lt;br /&gt;
* Change ID of existing game states (adding new game states is fine).&lt;br /&gt;
&lt;br /&gt;
Of course, as a rule of thumb, you should avoid to introduce changes that break a game in progress. Sometimes however, you do not have any other choice. In this case:&lt;br /&gt;
* Try to group all your updates in one version, thus we won&#039;t have to block your game several times.&lt;br /&gt;
* Tell us explicitly that you introduce some update that can break games in progress so we can block the game during a short time.&lt;br /&gt;
&lt;br /&gt;
Note: in the near future, we will introduce the possibility for you to block/unblock a game directly from your Control Panel in order to perform all the process by yourself.&lt;br /&gt;
&lt;br /&gt;
=== Updating Statistics ===&lt;br /&gt;
&lt;br /&gt;
You should be careful when updating a statistics:&lt;br /&gt;
&lt;br /&gt;
* If you want to add a new statistics, please refer to the paragraph above (&amp;quot;changes that breaks the games in progress&amp;quot;).&lt;br /&gt;
* If you want to update a statistic, please update it and do not remove/create another one. Otherwise, the statistic won&#039;t keep the same ID and players will lost all the historical statistics data.&lt;br /&gt;
* If your game is published on BGA, please don&#039;t remove any statistics (historical data will be lost).&lt;br /&gt;
&lt;br /&gt;
=== Updating the database schema ===&lt;br /&gt;
&lt;br /&gt;
If you want to update the database schema of the game (dbmodel.sql), you should inform us before releasing the new version (see &amp;quot;[[#Changes that breaks the games in progress|changes that breaks the games in progress]]&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Any modification in dbmodel.sql should also appear in your nameofyourgame.game.php, in a function&lt;br /&gt;
&lt;br /&gt;
function upgradeTableDb( $from_version ){&lt;br /&gt;
&lt;br /&gt;
if( $from_version &amp;lt;= YYMMDDHHMM ){ // where your CURRENT version in production has number YYMMDD-HHMM&lt;br /&gt;
&lt;br /&gt;
            // You DB schema update request.&lt;br /&gt;
            // Note: all tables names should be prefixed by &amp;quot;DBPREFIX_&amp;quot; to be compatible with the applyDbUpgradeToAllDB method you should use below&lt;br /&gt;
            $sql = &amp;quot;CREATE TABLE DBPREFIX_xxxxxxx ....&amp;quot;;&lt;br /&gt;
  &lt;br /&gt;
            // The method below is applying your DB schema update request to all tables, including the BGA framework utility tables like &amp;quot;zz_replayXXXX&amp;quot; or &amp;quot;zz_savepointXXXX&amp;quot;.&lt;br /&gt;
            // You should really use this request, in conjunction with &amp;quot;DBPREFIX_&amp;quot; in your $sql, so ALL tables are updated. All utility tables MUST have the same schema than the main table, otherwise the game may be blocked.&lt;br /&gt;
            self::applyDbUpgradeToAllDB( $sql );&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note: of course you need to change your dbmodel.sql accordingly, so that new games get your updated scheme.&lt;br /&gt;
&lt;br /&gt;
Note2: this is always risky to modify the DB scheme, so:&lt;br /&gt;
_ it may be worthy to contact us before, so we can stop the realtime games during the update (this way, only turn based games are concerned by the DB live upgrade).&lt;br /&gt;
_ if you can avoid it... try to avoid it :)&lt;br /&gt;
&lt;br /&gt;
=== Updating string to be translated  ===&lt;br /&gt;
&lt;br /&gt;
When you update a string that has been marked to be translatable, please keep in mind that all current translations done by the BGA community will be lost.&lt;br /&gt;
&lt;br /&gt;
Consequently, when you are about to modify a string to be translated (after release), please ask you the following questions:&lt;br /&gt;
* Is it just an English misspelling? In this case, it is better to fix the English translation of the string than the original string to be translated.&lt;br /&gt;
* Has the meaning of the string changed? If yes, you HAVE to change the original string in order to invalidate all translations that has been done already.&lt;br /&gt;
* Is there a similar string already used elsewhere in my game? In this case, you&#039;d better use it again to enjoy immediately all translations already available.&lt;br /&gt;
&lt;br /&gt;
===Major changes===&lt;br /&gt;
&lt;br /&gt;
If you do some major changes to your game like:&lt;br /&gt;
* Introducing a new expansion.&lt;br /&gt;
* Major code rewriting/refactoring.&lt;br /&gt;
&lt;br /&gt;
... please tell us. In this case, we can:&lt;br /&gt;
* Make your game back from &amp;quot;gold&amp;quot; to &amp;quot;public beta&amp;quot;, to incite player to report bugs.&lt;br /&gt;
* And eventually, publish a news about it :)&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Post-release_phase&amp;diff=3072</id>
		<title>Post-release phase</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Post-release_phase&amp;diff=3072"/>
		<updated>2018-05-22T08:37:34Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Updating the database schema */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Your game is now on BGA: congrats!&lt;br /&gt;
&lt;br /&gt;
But what happened when there are some bugs to fix or when you want to optimize something?&lt;br /&gt;
&lt;br /&gt;
Don&#039;t be afraid: you&#039;re still allowed to modify your game. You just have to pay attention to the points below.&lt;br /&gt;
&lt;br /&gt;
== Bugs reporting ==&lt;br /&gt;
&lt;br /&gt;
Bugs are reported in the [http://forum.boardgamearena.com/viewforum.php?f=4 BGA bugs forum].&lt;br /&gt;
&lt;br /&gt;
During days after your game has been published and from time to time, please have a look at it to check if everything is fine.&lt;br /&gt;
&lt;br /&gt;
== How to submit changes? ==&lt;br /&gt;
&lt;br /&gt;
There is 3 (short) steps to make your changes visible on BGA (from your Control Panel):&lt;br /&gt;
&lt;br /&gt;
* Commit your changes.&lt;br /&gt;
* Build a new version (don&#039;t forget to do a successful commit BEFORE your build).&lt;br /&gt;
* Deploy your new version in production.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can be modified after release? ==&lt;br /&gt;
&lt;br /&gt;
Everything can be modified. BUT, some items requires a special attention, and you must inform us in some cases:&lt;br /&gt;
&lt;br /&gt;
===Changes that breaks the games in progress===&lt;br /&gt;
&lt;br /&gt;
Some changes will break the games in progress at the moment the release/the hotfix will be performed. Each time you make a change, you should ask you the question &amp;quot;it is safe to make this change in a game in progress&amp;quot;, and if the answer is &amp;quot;no&amp;quot; you have to inform us.&lt;br /&gt;
&lt;br /&gt;
Example of changes that break the games in progress:&lt;br /&gt;
* Changes in the database schema of the game (dbmodel.sql).&lt;br /&gt;
* New global variable or game option accessed during the game (if it&#039;s only used during setup, it should be safe).&lt;br /&gt;
* New statistic (it won&#039;t be initialized properly, so it&#039;s going to crash the game).&lt;br /&gt;
* Change ID of existing game states (adding new game states is fine).&lt;br /&gt;
&lt;br /&gt;
Of course, as a rule of thumb, you should avoid to introduce changes that break a game in progress. Sometimes however, you do not have any other choice. In this case:&lt;br /&gt;
* Try to group all your updates in one version, thus we won&#039;t have to block your game several times.&lt;br /&gt;
* Tell us explicitly that you introduce some update that can break games in progress so we can block the game during a short time.&lt;br /&gt;
&lt;br /&gt;
Note: in the near future, we will introduce the possibility for you to block/unblock a game directly from your Control Panel in order to perform all the process by yourself.&lt;br /&gt;
&lt;br /&gt;
=== Updating Statistics ===&lt;br /&gt;
&lt;br /&gt;
You should be careful when updating a statistics:&lt;br /&gt;
&lt;br /&gt;
* If you want to add a new statistics, please refer to the paragraph above (&amp;quot;changes that breaks the games in progress&amp;quot;).&lt;br /&gt;
* If you want to update a statistic, please update it and do not remove/create another one. Otherwise, the statistic won&#039;t keep the same ID and players will lost all the historical statistics data.&lt;br /&gt;
* If your game is published on BGA, please don&#039;t remove any statistics (historical data will be lost).&lt;br /&gt;
&lt;br /&gt;
=== Updating the database schema ===&lt;br /&gt;
&lt;br /&gt;
If you want to update the database schema of the game (dbmodel.sql), you should inform us before releasing the new version (see &amp;quot;[[#Changes that breaks the games in progress|changes that breaks the games in progress]]&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Any modification in dbmodel.sql should also appear in your nameofyourgame.game.php, in a function&lt;br /&gt;
&lt;br /&gt;
function upgradeTableDb( $from_version ){&lt;br /&gt;
&lt;br /&gt;
if( $from_version &amp;lt;= YYMMDDHHMM ){ // where your CURRENT version in production has number YYMMDD-HHMM&lt;br /&gt;
&lt;br /&gt;
            // You DB schema update request.&lt;br /&gt;
            // Note: all tables names should be prefixed by &amp;quot;DBPREFIX_&amp;quot; to be compatible with the applyDbUpgradeToAllDB method you should use below&lt;br /&gt;
            $sql = &amp;quot;CREATE TABLE DBPREFIX_xxxxxxx ....&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
            // The method below is applying your DB schema update request to all tables, including the BGA framework utility tables like &amp;quot;zz_replayXXXX&amp;quot; or &amp;quot;zz_savepointXXXX&amp;quot;.&lt;br /&gt;
            // You should really use this request, in conjunction with &amp;quot;DBPREFIX_&amp;quot; in your $sql, so ALL tables are updated. All utility tables MUST have the same schema than the main table, otherwise the game may be blocked.&lt;br /&gt;
            self::applyDbUpgradeToAllDB( $sql );&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note: of course you need to change your dbmodel.sql accordingly, so that new games get your updated scheme.&lt;br /&gt;
&lt;br /&gt;
Note2: this is always risky to modify the DB scheme, so:&lt;br /&gt;
_ it may be worthy to contact us before, so we can stop the realtime games during the update (this way, only turn based games are concerned by the DB live upgrade).&lt;br /&gt;
_ if you can avoid it... try to avoid it :)&lt;br /&gt;
&lt;br /&gt;
=== Updating string to be translated  ===&lt;br /&gt;
&lt;br /&gt;
When you update a string that has been marked to be translatable, please keep in mind that all current translations done by the BGA community will be lost.&lt;br /&gt;
&lt;br /&gt;
Consequently, when you are about to modify a string to be translated (after release), please ask you the following questions:&lt;br /&gt;
* Is it just an English misspelling? In this case, it is better to fix the English translation of the string than the original string to be translated.&lt;br /&gt;
* Has the meaning of the string changed? If yes, you HAVE to change the original string in order to invalidate all translations that has been done already.&lt;br /&gt;
* Is there a similar string already used elsewhere in my game? In this case, you&#039;d better use it again to enjoy immediately all translations already available.&lt;br /&gt;
&lt;br /&gt;
===Major changes===&lt;br /&gt;
&lt;br /&gt;
If you do some major changes to your game like:&lt;br /&gt;
* Introducing a new expansion.&lt;br /&gt;
* Major code rewriting/refactoring.&lt;br /&gt;
&lt;br /&gt;
... please tell us. In this case, we can:&lt;br /&gt;
* Make your game back from &amp;quot;gold&amp;quot; to &amp;quot;public beta&amp;quot;, to incite player to report bugs.&lt;br /&gt;
* And eventually, publish a news about it :)&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Multipleaccounts&amp;diff=2999</id>
		<title>Multipleaccounts</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Multipleaccounts&amp;diff=2999"/>
		<updated>2018-04-23T17:04:54Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The Main Rule ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;One BGA account = One person&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Playing from the same IP ==&lt;br /&gt;
&lt;br /&gt;
This is &#039;&#039;&#039;authorized&#039;&#039;&#039; to play at the same table from the same IP (internet address).&lt;br /&gt;
&lt;br /&gt;
Warning: playing from the same location is a Premium feature. For details see: https://boardgamearena.com/#premium&lt;br /&gt;
&lt;br /&gt;
The warning message &amp;quot;this player plays from the same internet address as another player&amp;quot; is a &#039;&#039;&#039;simple warning&#039;&#039;&#039;. It is a useful warning, because the other players have the right to know that there are players at their table that are able to discuss out of game.&lt;br /&gt;
&lt;br /&gt;
If you want to play from the same internet address as another person:&lt;br /&gt;
* The best option is not to play at the same table, or play at a table where you know everyone.&lt;br /&gt;
* If you play with strangers, make them comfortable with the fact you are 2 (or more) different people: don&#039;t discuss about the game outside the chatroom, don&#039;t collaborate (or do kingmaking) with your partner.&lt;br /&gt;
&lt;br /&gt;
When some of your opponents are playing from the same IP:&lt;br /&gt;
* You may politely refuse to play with them.&lt;br /&gt;
* You should be vigilant and check that they are not collaborating during the game.&lt;br /&gt;
* You don&#039;t have to report them until they are doing a concrete kingmaking action. If you report some players saying that &amp;quot;they are playing from the same IP&amp;quot; without any kingmaking proof, we will close your report.&lt;br /&gt;
&lt;br /&gt;
== Boosting your ELO by playing against yourself ==&lt;br /&gt;
&lt;br /&gt;
This is the most stupid and useless thing to do on BGA.&lt;br /&gt;
&lt;br /&gt;
Why? Because this is very easy to detect, and because the penalty is:&lt;br /&gt;
* all your secondary account are removed.&lt;br /&gt;
* your primary account is reset to 1500 ELO for all games.&lt;br /&gt;
&lt;br /&gt;
Why this is so easy to detect:&lt;br /&gt;
* When you start having a very good ELO, all other good players will look at you and your game history. In the game history, this is really easy to see how you manage to have a good ELO.&lt;br /&gt;
* In BGA, every game can be replayed. So if a game is suspect, anyone can replay it and check if this is a real game or a fake game.&lt;br /&gt;
* In addition to this, we are using some automatic methods and some technical information that allow us to check if &amp;quot;one person = one account&amp;quot;.&lt;br /&gt;
* Consequently, it happens that some players manage to do ELO boosting, but at the end they are all detected and reset to 1500. This is why this is a waste of time for everyone, and this is why this is useless.&lt;br /&gt;
&lt;br /&gt;
If you have a lot of time to spend, please try to get better at this game and please do not try to cheat.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=ServiceOutage&amp;diff=2995</id>
		<title>ServiceOutage</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=ServiceOutage&amp;diff=2995"/>
		<updated>2018-04-21T09:21:45Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
No recent service outage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Our philosophy ===&lt;br /&gt;
&lt;br /&gt;
Having a gaming service available 24 hours a day, 7 days a week is not something easy to achieve for a (very) small team like ours. In addition, BGA is a realtime service, and any service outage may ruins games in progress.&lt;br /&gt;
&lt;br /&gt;
Our philosophy is to be transparent on service outages, by explaining why it happens, what has been impacted (and how long), and what we did to make sure it won&#039;t happen again. Explaining all of this is the goal of this page.&lt;br /&gt;
&lt;br /&gt;
Note: If an incident is in progress, &#039;&#039;&#039;we may not update this page in realtime&#039;&#039;&#039;.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Faq&amp;diff=2655</id>
		<title>Faq</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Faq&amp;diff=2655"/>
		<updated>2017-08-23T13:29:48Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* How you guys make money? Do you make a living of it? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Help]]&lt;br /&gt;
&lt;br /&gt;
== General questions ==&lt;br /&gt;
&lt;br /&gt;
===What is Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena (BGA) is an online board game platform. With BGA, you can play online and in real time against players from around the world. A selection of various board games and card games are available. In order to play, the only thing you need is your browser!&lt;br /&gt;
&lt;br /&gt;
===What do you mean by &amp;quot;real time play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
On Board Game Arena your opponents are connected to the game platform during the entire game. They can see your moves and react to them immediately - as is the case in the real world.&lt;br /&gt;
&lt;br /&gt;
===What is &amp;quot;turn based play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
This is often referred to as &amp;quot;asynchronous play&amp;quot; on other sites, and is used here to differentiate from &amp;quot;real time play&amp;quot;.  Instead of all players being around the table at the same time, players leave and come back.  After your opponent takes a move you are notified that it is your turn (via email or on your next visit to the site).  You then go to your game, take your turn, and the process repeats for the next player.&lt;br /&gt;
&lt;br /&gt;
For details please read [[Turn based FAQ]].&lt;br /&gt;
&lt;br /&gt;
===What do I need to play?===&lt;br /&gt;
&lt;br /&gt;
Your browser ... and that&#039;s it!&lt;br /&gt;
&lt;br /&gt;
Board Game Arena does not require anything else on your computer. Thus, you can play from any computer, anywhere, anytime!&lt;br /&gt;
&lt;br /&gt;
In order to make this possible, we are using the latest technologies available for the web. This is the reason you should play with the most up to date web browsers to enjoy an optimal BGA experience (read more about our [[Browser_support|browser policy]]).&lt;br /&gt;
&lt;br /&gt;
===How much does it cost to play on BGA?===&lt;br /&gt;
&lt;br /&gt;
Playing on BGA is free.&lt;br /&gt;
&lt;br /&gt;
You can also choose to help us by contributing to the website or by getting [http://en.boardgamearena.com/#!premium Premium] member.&lt;br /&gt;
&lt;br /&gt;
===What games are available on BGA?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena offers a selection of board and card games, but  specializes in modern (&amp;quot;European style&amp;quot;) adult games.&lt;br /&gt;
&lt;br /&gt;
[http://en.boardgamearena.com/#!gamelist See available games].&lt;br /&gt;
&lt;br /&gt;
== Meeting players and starting games ==&lt;br /&gt;
&lt;br /&gt;
===I launched a new table but nobody is joining?===&lt;br /&gt;
&lt;br /&gt;
For the most popular games, you can find players at any time of day. For other games, we advise you to come back at peak hour (around 22:00 CEST) if you can&#039;t find opponents at the moment.&lt;br /&gt;
&lt;br /&gt;
Tip: check the number of online/available players for a game before launching the table.&lt;br /&gt;
&lt;br /&gt;
Tip: if nobody is available for a realtime game, you can turn your table into a turn-based table, so another player can join even hours/days after you created it.&lt;br /&gt;
&lt;br /&gt;
===I joined a game. When does the game start?===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For realtime games&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Each table has an administrator, who is the table creator. It is the responsibility of the table administrator to start the game when he or she is satisfied with the number of players who have joined the table.&lt;br /&gt;
&lt;br /&gt;
If you are the table administrator and can&#039;t launch the game, most of the time it&#039;s because there are not yet enough players who have joined the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For turnbased games&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The game starts as soon as the maximum number of players has been reached. The table administrator can also start the game manually any time after the minimum number of required players have joined.&lt;br /&gt;
&lt;br /&gt;
===What does the small colored circle next to a player&#039;s name mean?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/online_.png : this player is active. He or she completed an action very recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/inactive_.png : this player is inactive. He or she is connected to the website but has not performed any action recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/offline_.png : this player is offline.&lt;br /&gt;
&lt;br /&gt;
===What does the &#039;% hits&#039; statistic mean?===&lt;br /&gt;
% hits = number of victory points / number of games played&lt;br /&gt;
&lt;br /&gt;
Players earn more victory points for winning a game that has more players (half a point per player).  So:&lt;br /&gt;
* When you win a 2 players game: 1 point.&lt;br /&gt;
* When you win a 3 players game: 1.5 points.&lt;br /&gt;
* When you win a 4 players game: 2 points.&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
For example, a player who plays a three player game and wins a third of the time will have: &amp;quot;50% hits&amp;quot;, while a player who plays a four person game and wins a third of the time, will have: &amp;quot;67% hits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== During the game ==&lt;br /&gt;
&lt;br /&gt;
===What do the icons next to players&#039; names mean?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player.gif : this player must make a move now.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_clockalert.gif : this player must make a move now, and has used up their reflection time. Can someone wake them up? ;)&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_nonack.gif : this player must make a move now, but is probably not aware of this fact. If the situation doesn&#039;t change, it might suggest that this player has a connection issue.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/common/zombie.png : this player is a &amp;quot;zombie&amp;quot; (has left the game or been fired from the game). The game is going on without this player.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;normal&amp;quot; avatar of a player is displayed, it means that this player is waiting for their turn to play.&lt;br /&gt;
&lt;br /&gt;
===A player has to make a move but he/she doesn&#039;t. What can I do?===&lt;br /&gt;
&lt;br /&gt;
* First, please remember that this player has the right to think as long as they need to about the next move...  well as long as there is still some time left on the game clock, that is.&lt;br /&gt;
* Then you can ask this player to confirm that he or she is still thinking about how to play.&lt;br /&gt;
* If this player seems to be away, we advise you to wait a few  minutes: this player may be experiencing some network problems or have left the computer temporarily.&lt;br /&gt;
* If the player is not coming back, you can skip their turn as soon as the clock is negative. This player will get a &amp;quot;leave&amp;quot; penalty and you will win &amp;quot;by forfeit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For more details, please read [[Game clock]].&lt;br /&gt;
&lt;br /&gt;
===What is the current progression of the game I&#039;m playing?===&lt;br /&gt;
&lt;br /&gt;
A percentage of progression is displayed on the top of the web page.&lt;br /&gt;
There is also a progress bar at the bottom of the web page shows you the current progression of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is forbidden on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Leaving a game in progress on purpose.&lt;br /&gt;
* Taking an unnecessary and unreasonable amount of time at the end of game in an obvious losing situation.&lt;br /&gt;
* Kingmaking: enabling another player to win on purpose while there is a better move to make for yourself.&lt;br /&gt;
* Running out of time on the game clock.&lt;br /&gt;
* Giving some piece of information about the current game situation that corrupts the normal game flow.&lt;br /&gt;
* Communicating with another player about the game privately (ex: with MSN).&lt;br /&gt;
* Provocation / triumphalism / defeatism ... anything which is not fair play.&lt;br /&gt;
* Having a shocking avatar (no advertisement, no politics, ...)&lt;br /&gt;
&lt;br /&gt;
Going against these rules will affect your reputation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is absolutely forbidden in Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Creating multiple accounts and playing against oneself.&lt;br /&gt;
* Insulting other players in any manner.&lt;br /&gt;
&lt;br /&gt;
Going against these rules can lead to the removal of your account and/or to the blacklisting of your IP.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What if some player does something wrong?===&lt;br /&gt;
&lt;br /&gt;
The Board Game Arena platform has been designed to encourage players to maintain good behavior. The reputation system allows you to distinguish between good and bad players. Then, it is up to you to decide whether to start a game with them or not.&lt;br /&gt;
&lt;br /&gt;
If you think a player has behaved badly during a game, you can give them a &amp;quot;red thumb&amp;quot; at the end of the game.&lt;br /&gt;
&lt;br /&gt;
If you think a player has committed a serious wrongdoing during a game (ex: insult), please report this player to us, using the &amp;quot;report this player&amp;quot; link from their profile or game result page, so that we can take appropriate measures.&lt;br /&gt;
&lt;br /&gt;
== Tournaments ==&lt;br /&gt;
&lt;br /&gt;
Tournaments is a BETA feature of BGA (for a long time).&lt;br /&gt;
&lt;br /&gt;
Tournament management is very complex. We&#039;d like to open tournament creation to everyone at some time in the future but it need a lot of work and until then we always had something more urgent to do.&lt;br /&gt;
&lt;br /&gt;
When tournaments will be improved, this FAQ section will be improved too.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About board games we proposed on BGA ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is the legal status of this website?===&lt;br /&gt;
&lt;br /&gt;
All the games currently available on this site have been licensed or otherwise authorized by copyright holders. Please be aware that games available on BGA can be removed at the copyright holders demand (for example: if they publish their own adaptation of the game).&lt;br /&gt;
&lt;br /&gt;
Board Game Arena would like to thank all game publishers and game designers who allow us to have their games here, thus making it possible for this website to exist.&lt;br /&gt;
&lt;br /&gt;
=== How do we select games that are on BGA? Why the game XXX is not on BGA? ===&lt;br /&gt;
&lt;br /&gt;
To have a game published on BGA we need 2 things:&lt;br /&gt;
* The authorization of the rights owner (most of the time: original publisher of the game).&lt;br /&gt;
* A software developer who develops the adaptation (ie: has some time available to develop it).&lt;br /&gt;
&lt;br /&gt;
We (= BGA team) are trying a lot of board games ourselves. Sometimes we are lucky enough to play prototypes too. And of course we receive a lot of game suggestions through the BGA forum, the BoardGameGeek &amp;quot;most wanted games&amp;quot; list, or by any other means. Based on this we are asking game publishers for authorizations, and sometimes we also receive requests directly from game publishers - there is no rule.&lt;br /&gt;
&lt;br /&gt;
As it is today, BGA has a very good reputation and very productive relationships with almost all major board game publishers, but this is not enough: each situation is specific, and there can be various reasons why a game publisher can refuse to see a game adaptation on BGA (for example: board games with a third party licence, like &amp;quot;Star Wars&amp;quot;, is practically impossible to negotiate).&lt;br /&gt;
&lt;br /&gt;
On the other hand, we got some authorizations for some very good games but no developers volunteering to develop them, or sometimes some of them don&#039;t manage to finish the job. Developers of adaptations are volunteers, and we don&#039;t blame them for this.&lt;br /&gt;
&lt;br /&gt;
Finally, some games are authorized and being developed, but the time frame is not good. For example, it happened that we had too many games to release and we decided to delay some of them. It also frequently happens that we must synchronize the release of a game with a publisher event, so the game adaptation can stay &amp;quot;on hold&amp;quot; for some months.&lt;br /&gt;
&lt;br /&gt;
So if you are asking yourself: why game XXX is not on BGA, it could be for various reasons:&lt;br /&gt;
* Maybe we never asked authorization for this game. Note that usually we ask authorizations for every popular games (ex: &amp;quot;Most wanted games&amp;quot;). So if the game is popular, the reason is probably not this one.&lt;br /&gt;
* The publisher refused.&lt;br /&gt;
* The publisher accepted, but we didn&#039;t find a developer until now for this game.&lt;br /&gt;
* The game adaptation is ready, but we are waiting for a specific event to release it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To conclude: yes we are taking into account your suggestions, but as you can see there are many factors than can influence the fact that a game is (or is not) on BGA. In addition, as a rule of thumb, we don&#039;t communicate about &amp;quot;why&amp;quot; this game is not on BGA. If we already got the authorization, we want to keep the &amp;quot;surprise&amp;quot;, and if we didn&#039;t get the authorization, the game publisher may not want to explain the reasons.&lt;br /&gt;
&lt;br /&gt;
=== Are you taking into account the &amp;quot;Most wanted games&amp;quot; list? When will these games be on BGA? ===&lt;br /&gt;
&lt;br /&gt;
You should read first the previous section (&amp;quot;how do we select games that are on BGA?&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
So the answer is:&lt;br /&gt;
* Yes, we are taking this list into account.&lt;br /&gt;
* For most of these games we already asked for authorizations.&lt;br /&gt;
* Some of these games won&#039;t be on BGA (authorization refused), some may be, some are in an &amp;quot;intermediate&amp;quot; step.&lt;br /&gt;
* We don&#039;t communicate about future game releases anyway.&lt;br /&gt;
&lt;br /&gt;
=== Why do some games have expansions on BGA and some don&#039;t? ===&lt;br /&gt;
&lt;br /&gt;
You should read first the previous section (&amp;quot;how do we select games that are on BGA?&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Game expansions follow the same steps than games. There can be various reasons why a game publisher doesn&#039;t want the expansion online, and sometimes we don&#039;t find a developer that has the time to develop it.&lt;br /&gt;
&lt;br /&gt;
===I&#039;m a game publisher: why would I like to have my game on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
The main goal of Board Game Arena is to make it easy for people to discover and love new games. We think that there are only two kinds of players on Board Game Arena: those who already bought the games they are playing online, and those who plan to buy them soon!&lt;br /&gt;
&lt;br /&gt;
As the activity of this website contributes to increasing a game&#039;s popularity and thus generates hard copy sales in the &amp;quot;real world&amp;quot;, we think it is beneficial to the board game community: people from all over the world can play online, we can have fun developing this game platform to the best of our ability, and game publishers get money from the box sales and build a special relationship with their player&#039;s community.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m a game publisher: how to get my game on Board Game Arena ===&lt;br /&gt;
&lt;br /&gt;
You should read our [https://boardgamearena.com/#!gamepublishers Board Game Arena for game publishers] section.&lt;br /&gt;
&lt;br /&gt;
== Turn-based mode ==&lt;br /&gt;
&lt;br /&gt;
Please read [[Turn based FAQ]].&lt;br /&gt;
&lt;br /&gt;
== Issues with BGA ==&lt;br /&gt;
&lt;br /&gt;
===What can I do if I have an issue with the website?===&lt;br /&gt;
&lt;br /&gt;
Most of the issues on this website should be solved with a simple web page refresh (or &amp;quot;F5&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you experience persistent issues, you can browse the [http://boardgamearena.com/#!bugs bug tool], see if someone already reported the issue, and add a new bug report if that&#039;s not the case. Please take some time to describe the bug you are reporting in detail so that we can quickly reproduce and fix it.&lt;br /&gt;
&lt;br /&gt;
=== Why is my bug still not fixed? ===&lt;br /&gt;
&lt;br /&gt;
We fix bugs every weeks. Of course we have priorities:&lt;br /&gt;
* We give the highest priority to recent features and recent games, because the most important bugs are reported fast.&lt;br /&gt;
* We give the highest priority to the bugs with the biggest number of &amp;quot;green thumb&amp;quot; on the [http://boardgamearena.com/#!bugs bug tool].&lt;br /&gt;
* Usually we fix bugs by group. So if we decide to fix an important bug on a game, there is a chance that we will fix 3 or 4 minor bugs at the same time.&lt;br /&gt;
&lt;br /&gt;
BGA is known for the quality of its adaptations, and if you look at the bug tool, you can see that -considering the number of games and the size of the community- there are not so many critical bugs with a lot of &amp;quot;green thumbs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Please also note that BGA adaptations are realized by volunteers (even if most of them are also professional developers). It is not always easy for them to fix bugs, especially when some players are complaining violently and/or do not give precise information in bug reports.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== I played on smartphone / tablet / touch device and I have some difficulties: what can I do? ===&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, BGA does not support tablets/smartphones. There are tons of board game adaptations for tablets/smartphones, and some BGA adaptations are not well designed for small screens. Thus, we don&#039;t have plans to do a mobile / tablet version at the moment.&lt;br /&gt;
&lt;br /&gt;
So if you want to use BGA from a smartphone / tablet you can, but we don&#039;t promise to fix all bugs so it&#039;s at your own risk :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Why is BGA slow? Why do I have bad connections performances on BGA? ===&lt;br /&gt;
&lt;br /&gt;
We are constantly monitoring server responsiveness. Some incidents occurs, but most of the time BGA is responsive.&lt;br /&gt;
&lt;br /&gt;
We designed our game servers (ie: servers used when you are inside a game) to be very responsive. Usually, less than 2% of the game moves take more than 200 milliseconds to process, and less than 0.2% take more than 1 second.&lt;br /&gt;
&lt;br /&gt;
BGA servers are located in Europe (France), but we bought servers all across the world (19 locations) so that the big files (ex: images) are loaded fast even if you are far from us.&lt;br /&gt;
&lt;br /&gt;
Most of bad performances came from your internet connection or your system. Try to connect with a different browser / computer / internet connection to troubleshoot the issue.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, if BGA is not responsive enough, you shouldn&#039;t engage yourself into a game because there is a risk for you to get clock penalties.&lt;br /&gt;
&lt;br /&gt;
=== I got issue with a specific player: how does the moderation works? ===&lt;br /&gt;
&lt;br /&gt;
You should read [[Moderation and grades]] page.&lt;br /&gt;
&lt;br /&gt;
== Contribute to BGA ==&lt;br /&gt;
&lt;br /&gt;
=== How can I contribute to BGA? ===&lt;br /&gt;
&lt;br /&gt;
Please visit page [http://boardgamearena.com/#!contribute Contribute to BGA].&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m a software developer. What can I do? ===&lt;br /&gt;
&lt;br /&gt;
We created a website specifically dedicated to board games adaptation development: [http://studio.boardgamearena.com BGA Studio].&lt;br /&gt;
&lt;br /&gt;
== About the BGA team ==&lt;br /&gt;
&lt;br /&gt;
=== Who are you? How to contact you? ===&lt;br /&gt;
&lt;br /&gt;
Please read page [[About us]].&lt;br /&gt;
&lt;br /&gt;
=== How you guys make money? Do you make a living of it? ===&lt;br /&gt;
&lt;br /&gt;
After 6 years working on BGA on their free time, both BGA founders (Sourisdudesert and Een) are now working full-time on BGA. This was really required by the growing audience playing on this website, and this has been made possible thanks to all Premium members (thank you again!).&lt;br /&gt;
&lt;br /&gt;
But to be honest, there is so much work to do on BGA that even two persons working full-time is not enough. This is not really an issue because we think the &amp;quot;community based&amp;quot; approach is the best for BGA and we&#039;d like to continue to give you the possibility to contribute to make this service running.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Faq&amp;diff=2654</id>
		<title>Faq</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Faq&amp;diff=2654"/>
		<updated>2017-08-23T13:27:44Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* I&amp;#039;m a game publisher: how to get my game on Board Game Arena */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Help]]&lt;br /&gt;
&lt;br /&gt;
== General questions ==&lt;br /&gt;
&lt;br /&gt;
===What is Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena (BGA) is an online board game platform. With BGA, you can play online and in real time against players from around the world. A selection of various board games and card games are available. In order to play, the only thing you need is your browser!&lt;br /&gt;
&lt;br /&gt;
===What do you mean by &amp;quot;real time play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
On Board Game Arena your opponents are connected to the game platform during the entire game. They can see your moves and react to them immediately - as is the case in the real world.&lt;br /&gt;
&lt;br /&gt;
===What is &amp;quot;turn based play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
This is often referred to as &amp;quot;asynchronous play&amp;quot; on other sites, and is used here to differentiate from &amp;quot;real time play&amp;quot;.  Instead of all players being around the table at the same time, players leave and come back.  After your opponent takes a move you are notified that it is your turn (via email or on your next visit to the site).  You then go to your game, take your turn, and the process repeats for the next player.&lt;br /&gt;
&lt;br /&gt;
For details please read [[Turn based FAQ]].&lt;br /&gt;
&lt;br /&gt;
===What do I need to play?===&lt;br /&gt;
&lt;br /&gt;
Your browser ... and that&#039;s it!&lt;br /&gt;
&lt;br /&gt;
Board Game Arena does not require anything else on your computer. Thus, you can play from any computer, anywhere, anytime!&lt;br /&gt;
&lt;br /&gt;
In order to make this possible, we are using the latest technologies available for the web. This is the reason you should play with the most up to date web browsers to enjoy an optimal BGA experience (read more about our [[Browser_support|browser policy]]).&lt;br /&gt;
&lt;br /&gt;
===How much does it cost to play on BGA?===&lt;br /&gt;
&lt;br /&gt;
Playing on BGA is free.&lt;br /&gt;
&lt;br /&gt;
You can also choose to help us by contributing to the website or by getting [http://en.boardgamearena.com/#!premium Premium] member.&lt;br /&gt;
&lt;br /&gt;
===What games are available on BGA?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena offers a selection of board and card games, but  specializes in modern (&amp;quot;European style&amp;quot;) adult games.&lt;br /&gt;
&lt;br /&gt;
[http://en.boardgamearena.com/#!gamelist See available games].&lt;br /&gt;
&lt;br /&gt;
== Meeting players and starting games ==&lt;br /&gt;
&lt;br /&gt;
===I launched a new table but nobody is joining?===&lt;br /&gt;
&lt;br /&gt;
For the most popular games, you can find players at any time of day. For other games, we advise you to come back at peak hour (around 22:00 CEST) if you can&#039;t find opponents at the moment.&lt;br /&gt;
&lt;br /&gt;
Tip: check the number of online/available players for a game before launching the table.&lt;br /&gt;
&lt;br /&gt;
Tip: if nobody is available for a realtime game, you can turn your table into a turn-based table, so another player can join even hours/days after you created it.&lt;br /&gt;
&lt;br /&gt;
===I joined a game. When does the game start?===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For realtime games&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Each table has an administrator, who is the table creator. It is the responsibility of the table administrator to start the game when he or she is satisfied with the number of players who have joined the table.&lt;br /&gt;
&lt;br /&gt;
If you are the table administrator and can&#039;t launch the game, most of the time it&#039;s because there are not yet enough players who have joined the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For turnbased games&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The game starts as soon as the maximum number of players has been reached. The table administrator can also start the game manually any time after the minimum number of required players have joined.&lt;br /&gt;
&lt;br /&gt;
===What does the small colored circle next to a player&#039;s name mean?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/online_.png : this player is active. He or she completed an action very recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/inactive_.png : this player is inactive. He or she is connected to the website but has not performed any action recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/offline_.png : this player is offline.&lt;br /&gt;
&lt;br /&gt;
===What does the &#039;% hits&#039; statistic mean?===&lt;br /&gt;
% hits = number of victory points / number of games played&lt;br /&gt;
&lt;br /&gt;
Players earn more victory points for winning a game that has more players (half a point per player).  So:&lt;br /&gt;
* When you win a 2 players game: 1 point.&lt;br /&gt;
* When you win a 3 players game: 1.5 points.&lt;br /&gt;
* When you win a 4 players game: 2 points.&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
For example, a player who plays a three player game and wins a third of the time will have: &amp;quot;50% hits&amp;quot;, while a player who plays a four person game and wins a third of the time, will have: &amp;quot;67% hits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== During the game ==&lt;br /&gt;
&lt;br /&gt;
===What do the icons next to players&#039; names mean?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player.gif : this player must make a move now.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_clockalert.gif : this player must make a move now, and has used up their reflection time. Can someone wake them up? ;)&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_nonack.gif : this player must make a move now, but is probably not aware of this fact. If the situation doesn&#039;t change, it might suggest that this player has a connection issue.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/common/zombie.png : this player is a &amp;quot;zombie&amp;quot; (has left the game or been fired from the game). The game is going on without this player.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;normal&amp;quot; avatar of a player is displayed, it means that this player is waiting for their turn to play.&lt;br /&gt;
&lt;br /&gt;
===A player has to make a move but he/she doesn&#039;t. What can I do?===&lt;br /&gt;
&lt;br /&gt;
* First, please remember that this player has the right to think as long as they need to about the next move...  well as long as there is still some time left on the game clock, that is.&lt;br /&gt;
* Then you can ask this player to confirm that he or she is still thinking about how to play.&lt;br /&gt;
* If this player seems to be away, we advise you to wait a few  minutes: this player may be experiencing some network problems or have left the computer temporarily.&lt;br /&gt;
* If the player is not coming back, you can skip their turn as soon as the clock is negative. This player will get a &amp;quot;leave&amp;quot; penalty and you will win &amp;quot;by forfeit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For more details, please read [[Game clock]].&lt;br /&gt;
&lt;br /&gt;
===What is the current progression of the game I&#039;m playing?===&lt;br /&gt;
&lt;br /&gt;
A percentage of progression is displayed on the top of the web page.&lt;br /&gt;
There is also a progress bar at the bottom of the web page shows you the current progression of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is forbidden on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Leaving a game in progress on purpose.&lt;br /&gt;
* Taking an unnecessary and unreasonable amount of time at the end of game in an obvious losing situation.&lt;br /&gt;
* Kingmaking: enabling another player to win on purpose while there is a better move to make for yourself.&lt;br /&gt;
* Running out of time on the game clock.&lt;br /&gt;
* Giving some piece of information about the current game situation that corrupts the normal game flow.&lt;br /&gt;
* Communicating with another player about the game privately (ex: with MSN).&lt;br /&gt;
* Provocation / triumphalism / defeatism ... anything which is not fair play.&lt;br /&gt;
* Having a shocking avatar (no advertisement, no politics, ...)&lt;br /&gt;
&lt;br /&gt;
Going against these rules will affect your reputation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is absolutely forbidden in Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Creating multiple accounts and playing against oneself.&lt;br /&gt;
* Insulting other players in any manner.&lt;br /&gt;
&lt;br /&gt;
Going against these rules can lead to the removal of your account and/or to the blacklisting of your IP.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What if some player does something wrong?===&lt;br /&gt;
&lt;br /&gt;
The Board Game Arena platform has been designed to encourage players to maintain good behavior. The reputation system allows you to distinguish between good and bad players. Then, it is up to you to decide whether to start a game with them or not.&lt;br /&gt;
&lt;br /&gt;
If you think a player has behaved badly during a game, you can give them a &amp;quot;red thumb&amp;quot; at the end of the game.&lt;br /&gt;
&lt;br /&gt;
If you think a player has committed a serious wrongdoing during a game (ex: insult), please report this player to us, using the &amp;quot;report this player&amp;quot; link from their profile or game result page, so that we can take appropriate measures.&lt;br /&gt;
&lt;br /&gt;
== Tournaments ==&lt;br /&gt;
&lt;br /&gt;
Tournaments is a BETA feature of BGA (for a long time).&lt;br /&gt;
&lt;br /&gt;
Tournament management is very complex. We&#039;d like to open tournament creation to everyone at some time in the future but it need a lot of work and until then we always had something more urgent to do.&lt;br /&gt;
&lt;br /&gt;
When tournaments will be improved, this FAQ section will be improved too.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About board games we proposed on BGA ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is the legal status of this website?===&lt;br /&gt;
&lt;br /&gt;
All the games currently available on this site have been licensed or otherwise authorized by copyright holders. Please be aware that games available on BGA can be removed at the copyright holders demand (for example: if they publish their own adaptation of the game).&lt;br /&gt;
&lt;br /&gt;
Board Game Arena would like to thank all game publishers and game designers who allow us to have their games here, thus making it possible for this website to exist.&lt;br /&gt;
&lt;br /&gt;
=== How do we select games that are on BGA? Why the game XXX is not on BGA? ===&lt;br /&gt;
&lt;br /&gt;
To have a game published on BGA we need 2 things:&lt;br /&gt;
* The authorization of the rights owner (most of the time: original publisher of the game).&lt;br /&gt;
* A software developer who develops the adaptation (ie: has some time available to develop it).&lt;br /&gt;
&lt;br /&gt;
We (= BGA team) are trying a lot of board games ourselves. Sometimes we are lucky enough to play prototypes too. And of course we receive a lot of game suggestions through the BGA forum, the BoardGameGeek &amp;quot;most wanted games&amp;quot; list, or by any other means. Based on this we are asking game publishers for authorizations, and sometimes we also receive requests directly from game publishers - there is no rule.&lt;br /&gt;
&lt;br /&gt;
As it is today, BGA has a very good reputation and very productive relationships with almost all major board game publishers, but this is not enough: each situation is specific, and there can be various reasons why a game publisher can refuse to see a game adaptation on BGA (for example: board games with a third party licence, like &amp;quot;Star Wars&amp;quot;, is practically impossible to negotiate).&lt;br /&gt;
&lt;br /&gt;
On the other hand, we got some authorizations for some very good games but no developers volunteering to develop them, or sometimes some of them don&#039;t manage to finish the job. Developers of adaptations are volunteers, and we don&#039;t blame them for this.&lt;br /&gt;
&lt;br /&gt;
Finally, some games are authorized and being developed, but the time frame is not good. For example, it happened that we had too many games to release and we decided to delay some of them. It also frequently happens that we must synchronize the release of a game with a publisher event, so the game adaptation can stay &amp;quot;on hold&amp;quot; for some months.&lt;br /&gt;
&lt;br /&gt;
So if you are asking yourself: why game XXX is not on BGA, it could be for various reasons:&lt;br /&gt;
* Maybe we never asked authorization for this game. Note that usually we ask authorizations for every popular games (ex: &amp;quot;Most wanted games&amp;quot;). So if the game is popular, the reason is probably not this one.&lt;br /&gt;
* The publisher refused.&lt;br /&gt;
* The publisher accepted, but we didn&#039;t find a developer until now for this game.&lt;br /&gt;
* The game adaptation is ready, but we are waiting for a specific event to release it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To conclude: yes we are taking into account your suggestions, but as you can see there are many factors than can influence the fact that a game is (or is not) on BGA. In addition, as a rule of thumb, we don&#039;t communicate about &amp;quot;why&amp;quot; this game is not on BGA. If we already got the authorization, we want to keep the &amp;quot;surprise&amp;quot;, and if we didn&#039;t get the authorization, the game publisher may not want to explain the reasons.&lt;br /&gt;
&lt;br /&gt;
=== Are you taking into account the &amp;quot;Most wanted games&amp;quot; list? When will these games be on BGA? ===&lt;br /&gt;
&lt;br /&gt;
You should read first the previous section (&amp;quot;how do we select games that are on BGA?&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
So the answer is:&lt;br /&gt;
* Yes, we are taking this list into account.&lt;br /&gt;
* For most of these games we already asked for authorizations.&lt;br /&gt;
* Some of these games won&#039;t be on BGA (authorization refused), some may be, some are in an &amp;quot;intermediate&amp;quot; step.&lt;br /&gt;
* We don&#039;t communicate about future game releases anyway.&lt;br /&gt;
&lt;br /&gt;
=== Why do some games have expansions on BGA and some don&#039;t? ===&lt;br /&gt;
&lt;br /&gt;
You should read first the previous section (&amp;quot;how do we select games that are on BGA?&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Game expansions follow the same steps than games. There can be various reasons why a game publisher doesn&#039;t want the expansion online, and sometimes we don&#039;t find a developer that has the time to develop it.&lt;br /&gt;
&lt;br /&gt;
===I&#039;m a game publisher: why would I like to have my game on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
The main goal of Board Game Arena is to make it easy for people to discover and love new games. We think that there are only two kinds of players on Board Game Arena: those who already bought the games they are playing online, and those who plan to buy them soon!&lt;br /&gt;
&lt;br /&gt;
As the activity of this website contributes to increasing a game&#039;s popularity and thus generates hard copy sales in the &amp;quot;real world&amp;quot;, we think it is beneficial to the board game community: people from all over the world can play online, we can have fun developing this game platform to the best of our ability, and game publishers get money from the box sales and build a special relationship with their player&#039;s community.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m a game publisher: how to get my game on Board Game Arena ===&lt;br /&gt;
&lt;br /&gt;
You should read our [https://boardgamearena.com/#!gamepublishers Board Game Arena for game publishers] section.&lt;br /&gt;
&lt;br /&gt;
== Turn-based mode ==&lt;br /&gt;
&lt;br /&gt;
Please read [[Turn based FAQ]].&lt;br /&gt;
&lt;br /&gt;
== Issues with BGA ==&lt;br /&gt;
&lt;br /&gt;
===What can I do if I have an issue with the website?===&lt;br /&gt;
&lt;br /&gt;
Most of the issues on this website should be solved with a simple web page refresh (or &amp;quot;F5&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you experience persistent issues, you can browse the [http://boardgamearena.com/#!bugs bug tool], see if someone already reported the issue, and add a new bug report if that&#039;s not the case. Please take some time to describe the bug you are reporting in detail so that we can quickly reproduce and fix it.&lt;br /&gt;
&lt;br /&gt;
=== Why is my bug still not fixed? ===&lt;br /&gt;
&lt;br /&gt;
We fix bugs every weeks. Of course we have priorities:&lt;br /&gt;
* We give the highest priority to recent features and recent games, because the most important bugs are reported fast.&lt;br /&gt;
* We give the highest priority to the bugs with the biggest number of &amp;quot;green thumb&amp;quot; on the [http://boardgamearena.com/#!bugs bug tool].&lt;br /&gt;
* Usually we fix bugs by group. So if we decide to fix an important bug on a game, there is a chance that we will fix 3 or 4 minor bugs at the same time.&lt;br /&gt;
&lt;br /&gt;
BGA is known for the quality of its adaptations, and if you look at the bug tool, you can see that -considering the number of games and the size of the community- there are not so many critical bugs with a lot of &amp;quot;green thumbs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Please also note that BGA adaptations are realized by volunteers (even if most of them are also professional developers). It is not always easy for them to fix bugs, especially when some players are complaining violently and/or do not give precise information in bug reports.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== I played on smartphone / tablet / touch device and I have some difficulties: what can I do? ===&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, BGA does not support tablets/smartphones. There are tons of board game adaptations for tablets/smartphones, and some BGA adaptations are not well designed for small screens. Thus, we don&#039;t have plans to do a mobile / tablet version at the moment.&lt;br /&gt;
&lt;br /&gt;
So if you want to use BGA from a smartphone / tablet you can, but we don&#039;t promise to fix all bugs so it&#039;s at your own risk :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Why is BGA slow? Why do I have bad connections performances on BGA? ===&lt;br /&gt;
&lt;br /&gt;
We are constantly monitoring server responsiveness. Some incidents occurs, but most of the time BGA is responsive.&lt;br /&gt;
&lt;br /&gt;
We designed our game servers (ie: servers used when you are inside a game) to be very responsive. Usually, less than 2% of the game moves take more than 200 milliseconds to process, and less than 0.2% take more than 1 second.&lt;br /&gt;
&lt;br /&gt;
BGA servers are located in Europe (France), but we bought servers all across the world (19 locations) so that the big files (ex: images) are loaded fast even if you are far from us.&lt;br /&gt;
&lt;br /&gt;
Most of bad performances came from your internet connection or your system. Try to connect with a different browser / computer / internet connection to troubleshoot the issue.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, if BGA is not responsive enough, you shouldn&#039;t engage yourself into a game because there is a risk for you to get clock penalties.&lt;br /&gt;
&lt;br /&gt;
=== I got issue with a specific player: how does the moderation works? ===&lt;br /&gt;
&lt;br /&gt;
You should read [[Moderation and grades]] page.&lt;br /&gt;
&lt;br /&gt;
== Contribute to BGA ==&lt;br /&gt;
&lt;br /&gt;
=== How can I contribute to BGA? ===&lt;br /&gt;
&lt;br /&gt;
Please visit page [http://boardgamearena.com/#!contribute Contribute to BGA].&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m a software developer. What can I do? ===&lt;br /&gt;
&lt;br /&gt;
We created a website specifically dedicated to board games adaptation development: [http://studio.boardgamearena.com BGA Studio].&lt;br /&gt;
&lt;br /&gt;
== About the BGA team ==&lt;br /&gt;
&lt;br /&gt;
=== Who are you? How to contact you? ===&lt;br /&gt;
&lt;br /&gt;
Please read page [[About us]].&lt;br /&gt;
&lt;br /&gt;
=== How you guys make money? Do you make a living of it? ===&lt;br /&gt;
&lt;br /&gt;
Since the beginning of 2016, one BGA Founder (Sourisdudesert) is working full-time on BGA. It was really required by the growing audience playing on this website, and this has been made possible thanks to all paying members (thank you again!).&lt;br /&gt;
&lt;br /&gt;
But to be honest, there is so much work to do on BGA that a single person is not enough. This is not really an issue because we think the &amp;quot;community based&amp;quot; approach is the best for BGA and we&#039;d like to continue to give you the possibility to contribute to make this service running.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Faq&amp;diff=2653</id>
		<title>Faq</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Faq&amp;diff=2653"/>
		<updated>2017-08-23T13:26:22Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* How much does it cost to play on BGA? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Help]]&lt;br /&gt;
&lt;br /&gt;
== General questions ==&lt;br /&gt;
&lt;br /&gt;
===What is Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena (BGA) is an online board game platform. With BGA, you can play online and in real time against players from around the world. A selection of various board games and card games are available. In order to play, the only thing you need is your browser!&lt;br /&gt;
&lt;br /&gt;
===What do you mean by &amp;quot;real time play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
On Board Game Arena your opponents are connected to the game platform during the entire game. They can see your moves and react to them immediately - as is the case in the real world.&lt;br /&gt;
&lt;br /&gt;
===What is &amp;quot;turn based play&amp;quot;?===&lt;br /&gt;
&lt;br /&gt;
This is often referred to as &amp;quot;asynchronous play&amp;quot; on other sites, and is used here to differentiate from &amp;quot;real time play&amp;quot;.  Instead of all players being around the table at the same time, players leave and come back.  After your opponent takes a move you are notified that it is your turn (via email or on your next visit to the site).  You then go to your game, take your turn, and the process repeats for the next player.&lt;br /&gt;
&lt;br /&gt;
For details please read [[Turn based FAQ]].&lt;br /&gt;
&lt;br /&gt;
===What do I need to play?===&lt;br /&gt;
&lt;br /&gt;
Your browser ... and that&#039;s it!&lt;br /&gt;
&lt;br /&gt;
Board Game Arena does not require anything else on your computer. Thus, you can play from any computer, anywhere, anytime!&lt;br /&gt;
&lt;br /&gt;
In order to make this possible, we are using the latest technologies available for the web. This is the reason you should play with the most up to date web browsers to enjoy an optimal BGA experience (read more about our [[Browser_support|browser policy]]).&lt;br /&gt;
&lt;br /&gt;
===How much does it cost to play on BGA?===&lt;br /&gt;
&lt;br /&gt;
Playing on BGA is free.&lt;br /&gt;
&lt;br /&gt;
You can also choose to help us by contributing to the website or by getting [http://en.boardgamearena.com/#!premium Premium] member.&lt;br /&gt;
&lt;br /&gt;
===What games are available on BGA?===&lt;br /&gt;
&lt;br /&gt;
Board Game Arena offers a selection of board and card games, but  specializes in modern (&amp;quot;European style&amp;quot;) adult games.&lt;br /&gt;
&lt;br /&gt;
[http://en.boardgamearena.com/#!gamelist See available games].&lt;br /&gt;
&lt;br /&gt;
== Meeting players and starting games ==&lt;br /&gt;
&lt;br /&gt;
===I launched a new table but nobody is joining?===&lt;br /&gt;
&lt;br /&gt;
For the most popular games, you can find players at any time of day. For other games, we advise you to come back at peak hour (around 22:00 CEST) if you can&#039;t find opponents at the moment.&lt;br /&gt;
&lt;br /&gt;
Tip: check the number of online/available players for a game before launching the table.&lt;br /&gt;
&lt;br /&gt;
Tip: if nobody is available for a realtime game, you can turn your table into a turn-based table, so another player can join even hours/days after you created it.&lt;br /&gt;
&lt;br /&gt;
===I joined a game. When does the game start?===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For realtime games&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Each table has an administrator, who is the table creator. It is the responsibility of the table administrator to start the game when he or she is satisfied with the number of players who have joined the table.&lt;br /&gt;
&lt;br /&gt;
If you are the table administrator and can&#039;t launch the game, most of the time it&#039;s because there are not yet enough players who have joined the table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For turnbased games&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The game starts as soon as the maximum number of players has been reached. The table administrator can also start the game manually any time after the minimum number of required players have joined.&lt;br /&gt;
&lt;br /&gt;
===What does the small colored circle next to a player&#039;s name mean?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/online_.png : this player is active. He or she completed an action very recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/inactive_.png : this player is inactive. He or she is connected to the website but has not performed any action recently.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/status/offline_.png : this player is offline.&lt;br /&gt;
&lt;br /&gt;
===What does the &#039;% hits&#039; statistic mean?===&lt;br /&gt;
% hits = number of victory points / number of games played&lt;br /&gt;
&lt;br /&gt;
Players earn more victory points for winning a game that has more players (half a point per player).  So:&lt;br /&gt;
* When you win a 2 players game: 1 point.&lt;br /&gt;
* When you win a 3 players game: 1.5 points.&lt;br /&gt;
* When you win a 4 players game: 2 points.&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
For example, a player who plays a three player game and wins a third of the time will have: &amp;quot;50% hits&amp;quot;, while a player who plays a four person game and wins a third of the time, will have: &amp;quot;67% hits&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== During the game ==&lt;br /&gt;
&lt;br /&gt;
===What do the icons next to players&#039; names mean?===&lt;br /&gt;
&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player.gif : this player must make a move now.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_clockalert.gif : this player must make a move now, and has used up their reflection time. Can someone wake them up? ;)&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/layout/active_player_nonack.gif : this player must make a move now, but is probably not aware of this fact. If the situation doesn&#039;t change, it might suggest that this player has a connection issue.&lt;br /&gt;
* http://fr.boardgamearena.com/theme/img/common/zombie.png : this player is a &amp;quot;zombie&amp;quot; (has left the game or been fired from the game). The game is going on without this player.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;normal&amp;quot; avatar of a player is displayed, it means that this player is waiting for their turn to play.&lt;br /&gt;
&lt;br /&gt;
===A player has to make a move but he/she doesn&#039;t. What can I do?===&lt;br /&gt;
&lt;br /&gt;
* First, please remember that this player has the right to think as long as they need to about the next move...  well as long as there is still some time left on the game clock, that is.&lt;br /&gt;
* Then you can ask this player to confirm that he or she is still thinking about how to play.&lt;br /&gt;
* If this player seems to be away, we advise you to wait a few  minutes: this player may be experiencing some network problems or have left the computer temporarily.&lt;br /&gt;
* If the player is not coming back, you can skip their turn as soon as the clock is negative. This player will get a &amp;quot;leave&amp;quot; penalty and you will win &amp;quot;by forfeit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For more details, please read [[Game clock]].&lt;br /&gt;
&lt;br /&gt;
===What is the current progression of the game I&#039;m playing?===&lt;br /&gt;
&lt;br /&gt;
A percentage of progression is displayed on the top of the web page.&lt;br /&gt;
There is also a progress bar at the bottom of the web page shows you the current progression of the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is forbidden on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Leaving a game in progress on purpose.&lt;br /&gt;
* Taking an unnecessary and unreasonable amount of time at the end of game in an obvious losing situation.&lt;br /&gt;
* Kingmaking: enabling another player to win on purpose while there is a better move to make for yourself.&lt;br /&gt;
* Running out of time on the game clock.&lt;br /&gt;
* Giving some piece of information about the current game situation that corrupts the normal game flow.&lt;br /&gt;
* Communicating with another player about the game privately (ex: with MSN).&lt;br /&gt;
* Provocation / triumphalism / defeatism ... anything which is not fair play.&lt;br /&gt;
* Having a shocking avatar (no advertisement, no politics, ...)&lt;br /&gt;
&lt;br /&gt;
Going against these rules will affect your reputation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is absolutely forbidden in Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
* Creating multiple accounts and playing against oneself.&lt;br /&gt;
* Insulting other players in any manner.&lt;br /&gt;
&lt;br /&gt;
Going against these rules can lead to the removal of your account and/or to the blacklisting of your IP.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What if some player does something wrong?===&lt;br /&gt;
&lt;br /&gt;
The Board Game Arena platform has been designed to encourage players to maintain good behavior. The reputation system allows you to distinguish between good and bad players. Then, it is up to you to decide whether to start a game with them or not.&lt;br /&gt;
&lt;br /&gt;
If you think a player has behaved badly during a game, you can give them a &amp;quot;red thumb&amp;quot; at the end of the game.&lt;br /&gt;
&lt;br /&gt;
If you think a player has committed a serious wrongdoing during a game (ex: insult), please report this player to us, using the &amp;quot;report this player&amp;quot; link from their profile or game result page, so that we can take appropriate measures.&lt;br /&gt;
&lt;br /&gt;
== Tournaments ==&lt;br /&gt;
&lt;br /&gt;
Tournaments is a BETA feature of BGA (for a long time).&lt;br /&gt;
&lt;br /&gt;
Tournament management is very complex. We&#039;d like to open tournament creation to everyone at some time in the future but it need a lot of work and until then we always had something more urgent to do.&lt;br /&gt;
&lt;br /&gt;
When tournaments will be improved, this FAQ section will be improved too.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== About board games we proposed on BGA ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===What is the legal status of this website?===&lt;br /&gt;
&lt;br /&gt;
All the games currently available on this site have been licensed or otherwise authorized by copyright holders. Please be aware that games available on BGA can be removed at the copyright holders demand (for example: if they publish their own adaptation of the game).&lt;br /&gt;
&lt;br /&gt;
Board Game Arena would like to thank all game publishers and game designers who allow us to have their games here, thus making it possible for this website to exist.&lt;br /&gt;
&lt;br /&gt;
=== How do we select games that are on BGA? Why the game XXX is not on BGA? ===&lt;br /&gt;
&lt;br /&gt;
To have a game published on BGA we need 2 things:&lt;br /&gt;
* The authorization of the rights owner (most of the time: original publisher of the game).&lt;br /&gt;
* A software developer who develops the adaptation (ie: has some time available to develop it).&lt;br /&gt;
&lt;br /&gt;
We (= BGA team) are trying a lot of board games ourselves. Sometimes we are lucky enough to play prototypes too. And of course we receive a lot of game suggestions through the BGA forum, the BoardGameGeek &amp;quot;most wanted games&amp;quot; list, or by any other means. Based on this we are asking game publishers for authorizations, and sometimes we also receive requests directly from game publishers - there is no rule.&lt;br /&gt;
&lt;br /&gt;
As it is today, BGA has a very good reputation and very productive relationships with almost all major board game publishers, but this is not enough: each situation is specific, and there can be various reasons why a game publisher can refuse to see a game adaptation on BGA (for example: board games with a third party licence, like &amp;quot;Star Wars&amp;quot;, is practically impossible to negotiate).&lt;br /&gt;
&lt;br /&gt;
On the other hand, we got some authorizations for some very good games but no developers volunteering to develop them, or sometimes some of them don&#039;t manage to finish the job. Developers of adaptations are volunteers, and we don&#039;t blame them for this.&lt;br /&gt;
&lt;br /&gt;
Finally, some games are authorized and being developed, but the time frame is not good. For example, it happened that we had too many games to release and we decided to delay some of them. It also frequently happens that we must synchronize the release of a game with a publisher event, so the game adaptation can stay &amp;quot;on hold&amp;quot; for some months.&lt;br /&gt;
&lt;br /&gt;
So if you are asking yourself: why game XXX is not on BGA, it could be for various reasons:&lt;br /&gt;
* Maybe we never asked authorization for this game. Note that usually we ask authorizations for every popular games (ex: &amp;quot;Most wanted games&amp;quot;). So if the game is popular, the reason is probably not this one.&lt;br /&gt;
* The publisher refused.&lt;br /&gt;
* The publisher accepted, but we didn&#039;t find a developer until now for this game.&lt;br /&gt;
* The game adaptation is ready, but we are waiting for a specific event to release it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To conclude: yes we are taking into account your suggestions, but as you can see there are many factors than can influence the fact that a game is (or is not) on BGA. In addition, as a rule of thumb, we don&#039;t communicate about &amp;quot;why&amp;quot; this game is not on BGA. If we already got the authorization, we want to keep the &amp;quot;surprise&amp;quot;, and if we didn&#039;t get the authorization, the game publisher may not want to explain the reasons.&lt;br /&gt;
&lt;br /&gt;
=== Are you taking into account the &amp;quot;Most wanted games&amp;quot; list? When will these games be on BGA? ===&lt;br /&gt;
&lt;br /&gt;
You should read first the previous section (&amp;quot;how do we select games that are on BGA?&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
So the answer is:&lt;br /&gt;
* Yes, we are taking this list into account.&lt;br /&gt;
* For most of these games we already asked for authorizations.&lt;br /&gt;
* Some of these games won&#039;t be on BGA (authorization refused), some may be, some are in an &amp;quot;intermediate&amp;quot; step.&lt;br /&gt;
* We don&#039;t communicate about future game releases anyway.&lt;br /&gt;
&lt;br /&gt;
=== Why do some games have expansions on BGA and some don&#039;t? ===&lt;br /&gt;
&lt;br /&gt;
You should read first the previous section (&amp;quot;how do we select games that are on BGA?&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Game expansions follow the same steps than games. There can be various reasons why a game publisher doesn&#039;t want the expansion online, and sometimes we don&#039;t find a developer that has the time to develop it.&lt;br /&gt;
&lt;br /&gt;
===I&#039;m a game publisher: why would I like to have my game on Board Game Arena?===&lt;br /&gt;
&lt;br /&gt;
The main goal of Board Game Arena is to make it easy for people to discover and love new games. We think that there are only two kinds of players on Board Game Arena: those who already bought the games they are playing online, and those who plan to buy them soon!&lt;br /&gt;
&lt;br /&gt;
As the activity of this website contributes to increasing a game&#039;s popularity and thus generates hard copy sales in the &amp;quot;real world&amp;quot;, we think it is beneficial to the board game community: people from all over the world can play online, we can have fun developing this game platform to the best of our ability, and game publishers get money from the box sales and build a special relationship with their player&#039;s community.&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m a game publisher: how to get my game on Board Game Arena ===&lt;br /&gt;
&lt;br /&gt;
At first, you just have to write us an email (contact (at) boardgamearena.com) with a description of your game(s).&lt;br /&gt;
&lt;br /&gt;
Then, we add this game to the list of &amp;quot;available licences&amp;quot; on our website dedicated to game developers ([http://studio.boardgamearena.com BGA Studio]).&lt;br /&gt;
&lt;br /&gt;
The most difficult part is to find a developer among our community. Our only requirement is that the developer must love the game. Of course, the most popular the game is, the easiest it is to find a volunteer developer. Sometimes it is very fast, sometimes it takes months, sometimes it never happens. We can&#039;t say in advance.&lt;br /&gt;
&lt;br /&gt;
It is also possible to find your own developer: of course it accelerates the process a lot!&lt;br /&gt;
&lt;br /&gt;
== Turn-based mode ==&lt;br /&gt;
&lt;br /&gt;
Please read [[Turn based FAQ]].&lt;br /&gt;
&lt;br /&gt;
== Issues with BGA ==&lt;br /&gt;
&lt;br /&gt;
===What can I do if I have an issue with the website?===&lt;br /&gt;
&lt;br /&gt;
Most of the issues on this website should be solved with a simple web page refresh (or &amp;quot;F5&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
If you experience persistent issues, you can browse the [http://boardgamearena.com/#!bugs bug tool], see if someone already reported the issue, and add a new bug report if that&#039;s not the case. Please take some time to describe the bug you are reporting in detail so that we can quickly reproduce and fix it.&lt;br /&gt;
&lt;br /&gt;
=== Why is my bug still not fixed? ===&lt;br /&gt;
&lt;br /&gt;
We fix bugs every weeks. Of course we have priorities:&lt;br /&gt;
* We give the highest priority to recent features and recent games, because the most important bugs are reported fast.&lt;br /&gt;
* We give the highest priority to the bugs with the biggest number of &amp;quot;green thumb&amp;quot; on the [http://boardgamearena.com/#!bugs bug tool].&lt;br /&gt;
* Usually we fix bugs by group. So if we decide to fix an important bug on a game, there is a chance that we will fix 3 or 4 minor bugs at the same time.&lt;br /&gt;
&lt;br /&gt;
BGA is known for the quality of its adaptations, and if you look at the bug tool, you can see that -considering the number of games and the size of the community- there are not so many critical bugs with a lot of &amp;quot;green thumbs&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Please also note that BGA adaptations are realized by volunteers (even if most of them are also professional developers). It is not always easy for them to fix bugs, especially when some players are complaining violently and/or do not give precise information in bug reports.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== I played on smartphone / tablet / touch device and I have some difficulties: what can I do? ===&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, BGA does not support tablets/smartphones. There are tons of board game adaptations for tablets/smartphones, and some BGA adaptations are not well designed for small screens. Thus, we don&#039;t have plans to do a mobile / tablet version at the moment.&lt;br /&gt;
&lt;br /&gt;
So if you want to use BGA from a smartphone / tablet you can, but we don&#039;t promise to fix all bugs so it&#039;s at your own risk :)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Why is BGA slow? Why do I have bad connections performances on BGA? ===&lt;br /&gt;
&lt;br /&gt;
We are constantly monitoring server responsiveness. Some incidents occurs, but most of the time BGA is responsive.&lt;br /&gt;
&lt;br /&gt;
We designed our game servers (ie: servers used when you are inside a game) to be very responsive. Usually, less than 2% of the game moves take more than 200 milliseconds to process, and less than 0.2% take more than 1 second.&lt;br /&gt;
&lt;br /&gt;
BGA servers are located in Europe (France), but we bought servers all across the world (19 locations) so that the big files (ex: images) are loaded fast even if you are far from us.&lt;br /&gt;
&lt;br /&gt;
Most of bad performances came from your internet connection or your system. Try to connect with a different browser / computer / internet connection to troubleshoot the issue.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, if BGA is not responsive enough, you shouldn&#039;t engage yourself into a game because there is a risk for you to get clock penalties.&lt;br /&gt;
&lt;br /&gt;
=== I got issue with a specific player: how does the moderation works? ===&lt;br /&gt;
&lt;br /&gt;
You should read [[Moderation and grades]] page.&lt;br /&gt;
&lt;br /&gt;
== Contribute to BGA ==&lt;br /&gt;
&lt;br /&gt;
=== How can I contribute to BGA? ===&lt;br /&gt;
&lt;br /&gt;
Please visit page [http://boardgamearena.com/#!contribute Contribute to BGA].&lt;br /&gt;
&lt;br /&gt;
=== I&#039;m a software developer. What can I do? ===&lt;br /&gt;
&lt;br /&gt;
We created a website specifically dedicated to board games adaptation development: [http://studio.boardgamearena.com BGA Studio].&lt;br /&gt;
&lt;br /&gt;
== About the BGA team ==&lt;br /&gt;
&lt;br /&gt;
=== Who are you? How to contact you? ===&lt;br /&gt;
&lt;br /&gt;
Please read page [[About us]].&lt;br /&gt;
&lt;br /&gt;
=== How you guys make money? Do you make a living of it? ===&lt;br /&gt;
&lt;br /&gt;
Since the beginning of 2016, one BGA Founder (Sourisdudesert) is working full-time on BGA. It was really required by the growing audience playing on this website, and this has been made possible thanks to all paying members (thank you again!).&lt;br /&gt;
&lt;br /&gt;
But to be honest, there is so much work to do on BGA that a single person is not enough. This is not really an issue because we think the &amp;quot;community based&amp;quot; approach is the best for BGA and we&#039;d like to continue to give you the possibility to contribute to make this service running.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2586</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2586"/>
		<updated>2017-07-18T17:15:06Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* BGA transparent horizontal logo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
&lt;br /&gt;
[[File:LOGO FULL POSITIVE-HORIZONTAL COLOR RVB.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:Logo_without_title.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:Main_rgb.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2585</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2585"/>
		<updated>2017-07-18T17:14:50Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* BGA icon */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:LOGO FULL POSITIVE-HORIZONTAL COLOR RVB.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:Logo_without_title.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:Main_rgb.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2584</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2584"/>
		<updated>2017-07-18T17:14:29Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* BGA transparent horizontal white logo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:LOGO FULL POSITIVE-HORIZONTAL COLOR RVB.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:Logo_without_title.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:Main_rgb.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA icon ==&lt;br /&gt;
&lt;br /&gt;
16x16:&lt;br /&gt;
[[File:BGA logo 16.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
75x75:&lt;br /&gt;
[[File:BGA logo 75.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
128x128:&lt;br /&gt;
[[File:BGA logo 128.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
512x512:&lt;br /&gt;
[[File:BGA logo 512.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2583</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2583"/>
		<updated>2017-07-18T17:14:11Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* BGA transparent horizontal white logo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:LOGO FULL POSITIVE-HORIZONTAL COLOR RVB.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:File:Logo_without_title.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:Main_rgb.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA icon ==&lt;br /&gt;
&lt;br /&gt;
16x16:&lt;br /&gt;
[[File:BGA logo 16.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
75x75:&lt;br /&gt;
[[File:BGA logo 75.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
128x128:&lt;br /&gt;
[[File:BGA logo 128.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
512x512:&lt;br /&gt;
[[File:BGA logo 512.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Dosya:Logo_without_title.png&amp;diff=2582</id>
		<title>Dosya:Logo without title.png</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Dosya:Logo_without_title.png&amp;diff=2582"/>
		<updated>2017-07-18T17:13:47Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2581</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2581"/>
		<updated>2017-07-18T17:13:25Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* BGA transparent horizontal logo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:LOGO FULL POSITIVE-HORIZONTAL COLOR RVB.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:BGA transparent horizontal white logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:Main_rgb.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA icon ==&lt;br /&gt;
&lt;br /&gt;
16x16:&lt;br /&gt;
[[File:BGA logo 16.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
75x75:&lt;br /&gt;
[[File:BGA logo 75.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
128x128:&lt;br /&gt;
[[File:BGA logo 128.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
512x512:&lt;br /&gt;
[[File:BGA logo 512.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2580</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2580"/>
		<updated>2017-07-18T17:12:59Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* BGA transparent horizontal logo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:LOGO FULL POSITIVE-HORIZONTAL COLOR RVB.png|500px]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:BGA transparent horizontal white logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:Main_rgb.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA icon ==&lt;br /&gt;
&lt;br /&gt;
16x16:&lt;br /&gt;
[[File:BGA logo 16.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
75x75:&lt;br /&gt;
[[File:BGA logo 75.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
128x128:&lt;br /&gt;
[[File:BGA logo 128.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
512x512:&lt;br /&gt;
[[File:BGA logo 512.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2579</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2579"/>
		<updated>2017-07-18T17:11:53Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* BGA transparent horizontal logo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:LOGO FULL POSITIVE-HORIZONTAL COLOR RVB.png|400px]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:BGA transparent horizontal white logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:Main_rgb.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA icon ==&lt;br /&gt;
&lt;br /&gt;
16x16:&lt;br /&gt;
[[File:BGA logo 16.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
75x75:&lt;br /&gt;
[[File:BGA logo 75.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
128x128:&lt;br /&gt;
[[File:BGA logo 128.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
512x512:&lt;br /&gt;
[[File:BGA logo 512.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2578</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2578"/>
		<updated>2017-07-18T17:11:01Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* BGA transparent horizontal logo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:LOGO FULL POSITIVE-HORIZONTAL COLOR RVB.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:BGA transparent horizontal white logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:Main_rgb.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA icon ==&lt;br /&gt;
&lt;br /&gt;
16x16:&lt;br /&gt;
[[File:BGA logo 16.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
75x75:&lt;br /&gt;
[[File:BGA logo 75.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
128x128:&lt;br /&gt;
[[File:BGA logo 128.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
512x512:&lt;br /&gt;
[[File:BGA logo 512.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Dosya:LOGO_FULL_POSITIVE-HORIZONTAL_COLOR_RVB.png&amp;diff=2577</id>
		<title>Dosya:LOGO FULL POSITIVE-HORIZONTAL COLOR RVB.png</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Dosya:LOGO_FULL_POSITIVE-HORIZONTAL_COLOR_RVB.png&amp;diff=2577"/>
		<updated>2017-07-18T17:10:35Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2576</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2576"/>
		<updated>2017-07-18T17:09:53Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* BGA transparent vertical logo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:BGA transparent horizontal logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:BGA transparent horizontal white logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:Main_rgb.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA icon ==&lt;br /&gt;
&lt;br /&gt;
16x16:&lt;br /&gt;
[[File:BGA logo 16.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
75x75:&lt;br /&gt;
[[File:BGA logo 75.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
128x128:&lt;br /&gt;
[[File:BGA logo 128.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
512x512:&lt;br /&gt;
[[File:BGA logo 512.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Dosya:Main_rgb.png&amp;diff=2575</id>
		<title>Dosya:Main rgb.png</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Dosya:Main_rgb.png&amp;diff=2575"/>
		<updated>2017-07-18T17:09:33Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2574</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2574"/>
		<updated>2017-07-18T17:09:08Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:BGA transparent horizontal logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:BGA transparent horizontal white logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:BGA_transparent_vertical_logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA icon ==&lt;br /&gt;
&lt;br /&gt;
16x16:&lt;br /&gt;
[[File:BGA logo 16.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
75x75:&lt;br /&gt;
[[File:BGA logo 75.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
128x128:&lt;br /&gt;
[[File:BGA logo 128.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
512x512:&lt;br /&gt;
[[File:BGA logo 512.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Dosya:Bga_button_play_online_fr.png&amp;diff=2573</id>
		<title>Dosya:Bga button play online fr.png</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Dosya:Bga_button_play_online_fr.png&amp;diff=2573"/>
		<updated>2017-07-18T17:08:46Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: uploaded a new version of &amp;amp;quot;File:Bga button play online fr.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2572</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2572"/>
		<updated>2017-07-18T17:08:17Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* French */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
== German ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_de.png]]&lt;br /&gt;
&lt;br /&gt;
== Spanish ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_es.png]]&lt;br /&gt;
&lt;br /&gt;
== Italian ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_it.png]]&lt;br /&gt;
&lt;br /&gt;
== Chinese (traditional) ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_zh.png]]&lt;br /&gt;
&lt;br /&gt;
== Chinese (simplified) ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_zh_cn.png]]&lt;br /&gt;
&lt;br /&gt;
== Japanese ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_ja.png]]&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:BGA transparent horizontal logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:BGA transparent horizontal white logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:BGA_transparent_vertical_logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA icon ==&lt;br /&gt;
&lt;br /&gt;
16x16:&lt;br /&gt;
[[File:BGA logo 16.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
75x75:&lt;br /&gt;
[[File:BGA logo 75.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
128x128:&lt;br /&gt;
[[File:BGA logo 128.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
512x512:&lt;br /&gt;
[[File:BGA logo 512.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Dosya:Bga_button_play_online_fr.png&amp;diff=2571</id>
		<title>Dosya:Bga button play online fr.png</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Dosya:Bga_button_play_online_fr.png&amp;diff=2571"/>
		<updated>2017-07-18T17:07:54Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2570</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2570"/>
		<updated>2017-07-18T17:07:35Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* French */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_it_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
== German ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_de.png]]&lt;br /&gt;
&lt;br /&gt;
== Spanish ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_es.png]]&lt;br /&gt;
&lt;br /&gt;
== Italian ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_it.png]]&lt;br /&gt;
&lt;br /&gt;
== Chinese (traditional) ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_zh.png]]&lt;br /&gt;
&lt;br /&gt;
== Chinese (simplified) ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_zh_cn.png]]&lt;br /&gt;
&lt;br /&gt;
== Japanese ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_ja.png]]&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:BGA transparent horizontal logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:BGA transparent horizontal white logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:BGA_transparent_vertical_logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA icon ==&lt;br /&gt;
&lt;br /&gt;
16x16:&lt;br /&gt;
[[File:BGA logo 16.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
75x75:&lt;br /&gt;
[[File:BGA logo 75.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
128x128:&lt;br /&gt;
[[File:BGA logo 128.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
512x512:&lt;br /&gt;
[[File:BGA logo 512.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2569</id>
		<title>Logos</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Logos&amp;diff=2569"/>
		<updated>2017-07-18T17:07:17Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* English */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you can find brand assets for Board Game Arena and easy way to create links to BGA.&lt;br /&gt;
&lt;br /&gt;
Please use &amp;quot;right click + save image as&amp;quot; to download needed images.&lt;br /&gt;
&lt;br /&gt;
= BGA buttons =&lt;br /&gt;
&lt;br /&gt;
You can use buttons below as links to BGA website.&lt;br /&gt;
&lt;br /&gt;
If you need a button that is not on the list please contact us (contact@boardgamearena.com).&lt;br /&gt;
&lt;br /&gt;
== Language independent ==&lt;br /&gt;
&lt;br /&gt;
[[File:bga_button.png]]&lt;br /&gt;
&lt;br /&gt;
== English ==&lt;br /&gt;
&lt;br /&gt;
Generic:&lt;br /&gt;
&lt;br /&gt;
[[File:Bga_button_play_online.png]]&lt;br /&gt;
&lt;br /&gt;
== French ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_fr.png]]&lt;br /&gt;
&lt;br /&gt;
== German ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_de.png]]&lt;br /&gt;
&lt;br /&gt;
== Spanish ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_es.png]]&lt;br /&gt;
&lt;br /&gt;
== Italian ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_it.png]]&lt;br /&gt;
&lt;br /&gt;
== Chinese (traditional) ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_zh.png]]&lt;br /&gt;
&lt;br /&gt;
== Chinese (simplified) ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_zh_cn.png]]&lt;br /&gt;
&lt;br /&gt;
== Japanese ==&lt;br /&gt;
&lt;br /&gt;
[[File:play_games_online_ja.png]]&lt;br /&gt;
&lt;br /&gt;
= BGA logos =&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a white background):&lt;br /&gt;
[[File:BGA transparent horizontal logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent horizontal white logo ==&lt;br /&gt;
&lt;br /&gt;
(should be used on a black background):&lt;br /&gt;
[[File:BGA transparent horizontal white logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA transparent vertical logo ==&lt;br /&gt;
&lt;br /&gt;
[[File:BGA_transparent_vertical_logo.png]]&lt;br /&gt;
&lt;br /&gt;
== BGA icon ==&lt;br /&gt;
&lt;br /&gt;
16x16:&lt;br /&gt;
[[File:BGA logo 16.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
75x75:&lt;br /&gt;
[[File:BGA logo 75.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
128x128:&lt;br /&gt;
[[File:BGA logo 128.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
512x512:&lt;br /&gt;
[[File:BGA logo 512.png]]&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Dosya:Bga_button_play_online.png&amp;diff=2568</id>
		<title>Dosya:Bga button play online.png</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Dosya:Bga_button_play_online.png&amp;diff=2568"/>
		<updated>2017-07-18T17:06:42Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Dosya:Bga_button.png&amp;diff=2567</id>
		<title>Dosya:Bga button.png</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Dosya:Bga_button.png&amp;diff=2567"/>
		<updated>2017-07-18T17:05:55Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: uploaded a new version of &amp;amp;quot;File:Bga button.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=ServiceOutage&amp;diff=2566</id>
		<title>ServiceOutage</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=ServiceOutage&amp;diff=2566"/>
		<updated>2017-07-18T09:48:25Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
=== Our philosophy ===&lt;br /&gt;
&lt;br /&gt;
Having a gaming service available 24 hours a day, 7 days a week is not something easy to achieve for a (very) small team like ours. In addition, BGA is a realtime service, and any service outage may ruins games in progress.&lt;br /&gt;
&lt;br /&gt;
Our philosophy is to be transparent on service outages, by explaining why it happens, what has been impacted (and how long), and what we did to make sure it won&#039;t happen again. Explaining all of this is the goal of this page.&lt;br /&gt;
&lt;br /&gt;
Note: If an incident is in progress, &#039;&#039;&#039;we may not update this page in realtime&#039;&#039;&#039;.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=ServiceOutage&amp;diff=2565</id>
		<title>ServiceOutage</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=ServiceOutage&amp;diff=2565"/>
		<updated>2017-07-18T06:02:39Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Our philosophy ==&lt;br /&gt;
&lt;br /&gt;
Having a gaming service available 24 hours a day, 7 days a week is not something easy to achieve for a (very) small team like ours. In addition, BGA is a realtime service, and any service outage may ruins games in progress.&lt;br /&gt;
&lt;br /&gt;
Our philosophy is to be transparent on service outages, by explaining why it happens, what has been impacted (and how long), and what we did to make sure it won&#039;t happen again. Explaining all of this is the goal of this page.&lt;br /&gt;
&lt;br /&gt;
Note: If an incident is in progress, &#039;&#039;&#039;we may not update this page in realtime&#039;&#039;&#039;.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=ServiceOutage&amp;diff=2564</id>
		<title>ServiceOutage</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=ServiceOutage&amp;diff=2564"/>
		<updated>2017-07-18T05:47:41Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: Protected &amp;quot;ServiceOutage&amp;quot; ([edit=sysop] (indefinite) [move=sysop] (indefinite))&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
(test)&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=ServiceOutage&amp;diff=2563</id>
		<title>ServiceOutage</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=ServiceOutage&amp;diff=2563"/>
		<updated>2017-07-18T05:46:44Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: Created page with &amp;quot; (test)&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
(test)&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=Latest_incidents&amp;diff=2552</id>
		<title>Latest incidents</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=Latest_incidents&amp;diff=2552"/>
		<updated>2017-07-14T17:36:04Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: Created page with &amp;quot; No incident reported at now&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
No incident reported at now&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=3D&amp;diff=2506</id>
		<title>3D</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=3D&amp;diff=2506"/>
		<updated>2017-06-20T09:51:37Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
Board Game Arena is using CSS 3D features to provide a basic 3D view of the games.&lt;br /&gt;
&lt;br /&gt;
This is not a &amp;quot;100% real&amp;quot; 3D as this is very difficult to play with real 3D model with CSS, but most of the time it provides a satisfying 3D view of the game.&lt;br /&gt;
&lt;br /&gt;
The objective of 3D is to provide a nice view of the game : 90% of the time, 2D is more suitable for playing. So we don&#039;t force developers to make sure games can be played in 3D : this is just a &amp;quot;bonus&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Enabling 3D =&lt;br /&gt;
&lt;br /&gt;
3D is enabled by default for your game.&lt;br /&gt;
&lt;br /&gt;
You can click on the &amp;quot;3D&amp;quot; button at the top right and see your game in 3D.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to allow players to use 3D with your game, you can add this to you &amp;quot;gameinfos.inc.php&amp;quot; file :&lt;br /&gt;
&lt;br /&gt;
&#039;enable_3d&#039; =&amp;gt; false,&lt;br /&gt;
&lt;br /&gt;
= Detecting 3D =&lt;br /&gt;
&lt;br /&gt;
When 3D is &amp;quot;on&amp;quot;, BGA adds CSS class &amp;quot;mode_3d&amp;quot; to the body element.&lt;br /&gt;
&lt;br /&gt;
In CSS, you should prefix all your 3D mode specific directives by &amp;quot;.mode_3d&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In Javascript, you can detect 3D by using the following :&lt;br /&gt;
&lt;br /&gt;
  if( this.control3dmode3d )&lt;br /&gt;
  {&lt;br /&gt;
     // Only executed in 3d mode&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Built-in 3D enhancements =&lt;br /&gt;
&lt;br /&gt;
BGA is doing some built-in 3D enhancements with your 3D adaptations, so your adaptation will have some 3D effects without any efforts :&lt;br /&gt;
&lt;br /&gt;
* When executing a slideToObject, a slideToObjectPos or a slideTemporaryObject, BGA is moving the objects vertically (up, then down).&lt;br /&gt;
* It also happens when moving elements of a Stock module, or to a Zone module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enhance your adaptation for 3D =&lt;br /&gt;
&lt;br /&gt;
== Use Z axis ==&lt;br /&gt;
&lt;br /&gt;
Using CSS transform: translateZ, you can translate your HTML elements along the Z axis. Example :&lt;br /&gt;
&lt;br /&gt;
  .floating_element {&lt;br /&gt;
      transform: translateZ( 20px );  /* This element is going to float 20px above the surface */&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At any moment, you can know the Z position of an element from javascript using :&lt;br /&gt;
&lt;br /&gt;
  this.getComputedTranslateZ( html_element );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Use pre-build BGA 3D classes ==&lt;br /&gt;
&lt;br /&gt;
By adding the following to your objects, they will look nicer in 3D :&lt;br /&gt;
&lt;br /&gt;
  thickness: add a (3px) black thickness to your HTML element.&lt;br /&gt;
  &lt;br /&gt;
  roundthickness: (to be used with thickness) if your element is a circle, you should add roundthickness so your element thickness can be a circle too.&lt;br /&gt;
  &lt;br /&gt;
  whitethickness: (to be used with thickness) if you prefer to have a whitethickness instead of black.&lt;br /&gt;
  &lt;br /&gt;
  floatingabove : make your element &amp;quot;float&amp;quot; 10px above the surface, with a nice shadow.&lt;br /&gt;
  &lt;br /&gt;
  roundfloatingabove: (to be used with floatingabove) : if your element is a circle, use roundfloatingabove in addition to floatingabove.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : if you found some generic CSS that may help some other developers for 3D enhancements, please send it to us so we can add it there.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=3D&amp;diff=2505</id>
		<title>3D</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=3D&amp;diff=2505"/>
		<updated>2017-06-20T09:34:16Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Use Z axis */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
Board Game Arena is using CSS 3D features to provide a basic 3D view of the games.&lt;br /&gt;
&lt;br /&gt;
This is not a &amp;quot;100% real&amp;quot; 3D as this is very difficult to play with real 3D model with CSS, but most of the time it provides a satisfying 3D view of the game.&lt;br /&gt;
&lt;br /&gt;
The objective of 3D is to provide a nice view of the game : 90% of the time, 3D is more suitable for playing. So we don&#039;t force developers to make sure games can be played in 3D : this is just a &amp;quot;bonus&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Enabling 3D =&lt;br /&gt;
&lt;br /&gt;
3D is enabled by default for your game.&lt;br /&gt;
&lt;br /&gt;
You can click on the &amp;quot;3D&amp;quot; button at the top right and see your game in 3D.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to allow players to use 3D with your game, you can add this to you &amp;quot;gameinfos.inc.php&amp;quot; file :&lt;br /&gt;
&lt;br /&gt;
&#039;enable_3d&#039; =&amp;gt; false,&lt;br /&gt;
&lt;br /&gt;
= Detecting 3D =&lt;br /&gt;
&lt;br /&gt;
When 3D is &amp;quot;on&amp;quot;, BGA adds CSS class &amp;quot;mode_3d&amp;quot; to the body element.&lt;br /&gt;
&lt;br /&gt;
In CSS, you should prefix all your 3D mode specific directives by &amp;quot;.mode_3d&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In Javascript, you can detect 3D by using the following :&lt;br /&gt;
&lt;br /&gt;
  if( this.control3dmode3d )&lt;br /&gt;
  {&lt;br /&gt;
     // Only executed in 3d mode&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Built-in 3D enhancements =&lt;br /&gt;
&lt;br /&gt;
BGA is doing some built-in 3D enhancements with your 3D adaptations, so your adaptation will have some 3D effects without any efforts :&lt;br /&gt;
&lt;br /&gt;
* When executing a slideToObject, a slideToObjectPos or a slideTemporaryObject, BGA is moving the objects vertically (up, then down).&lt;br /&gt;
* It also happens when moving elements of a Stock module, or to a Zone module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enhance your adaptation for 3D =&lt;br /&gt;
&lt;br /&gt;
== Use Z axis ==&lt;br /&gt;
&lt;br /&gt;
Using CSS transform: translateZ, you can translate your HTML elements along the Z axis. Example :&lt;br /&gt;
&lt;br /&gt;
  .floating_element {&lt;br /&gt;
      transform: translateZ( 20px );  /* This element is going to float 20px above the surface */&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At any moment, you can know the Z position of an element from javascript using :&lt;br /&gt;
&lt;br /&gt;
  this.getComputedTranslateZ( html_element );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Use pre-build BGA 3D classes ==&lt;br /&gt;
&lt;br /&gt;
By adding the following to your objects, they will look nicer in 3D :&lt;br /&gt;
&lt;br /&gt;
  thickness: add a (3px) black thickness to your HTML element.&lt;br /&gt;
  &lt;br /&gt;
  roundthickness: (to be used with thickness) if your element is a circle, you should add roundthickness so your element thickness can be a circle too.&lt;br /&gt;
  &lt;br /&gt;
  whitethickness: (to be used with thickness) if you prefer to have a whitethickness instead of black.&lt;br /&gt;
  &lt;br /&gt;
  floatingabove : make your element &amp;quot;float&amp;quot; 10px above the surface, with a nice shadow.&lt;br /&gt;
  &lt;br /&gt;
  roundfloatingabove: (to be used with floatingabove) : if your element is a circle, use roundfloatingabove in addition to floatingabove.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : if you found some generic CSS that may help some other developers for 3D enhancements, please send it to us so we can add it there.&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
	<entry>
		<id>https://tr.doc.boardgamearena.com/index.php?title=3D&amp;diff=2504</id>
		<title>3D</title>
		<link rel="alternate" type="text/html" href="https://tr.doc.boardgamearena.com/index.php?title=3D&amp;diff=2504"/>
		<updated>2017-06-20T09:27:46Z</updated>

		<summary type="html">&lt;p&gt;Sourisdudesert: /* Detecting 3D */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
Board Game Arena is using CSS 3D features to provide a basic 3D view of the games.&lt;br /&gt;
&lt;br /&gt;
This is not a &amp;quot;100% real&amp;quot; 3D as this is very difficult to play with real 3D model with CSS, but most of the time it provides a satisfying 3D view of the game.&lt;br /&gt;
&lt;br /&gt;
The objective of 3D is to provide a nice view of the game : 90% of the time, 3D is more suitable for playing. So we don&#039;t force developers to make sure games can be played in 3D : this is just a &amp;quot;bonus&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Enabling 3D =&lt;br /&gt;
&lt;br /&gt;
3D is enabled by default for your game.&lt;br /&gt;
&lt;br /&gt;
You can click on the &amp;quot;3D&amp;quot; button at the top right and see your game in 3D.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t want to allow players to use 3D with your game, you can add this to you &amp;quot;gameinfos.inc.php&amp;quot; file :&lt;br /&gt;
&lt;br /&gt;
&#039;enable_3d&#039; =&amp;gt; false,&lt;br /&gt;
&lt;br /&gt;
= Detecting 3D =&lt;br /&gt;
&lt;br /&gt;
When 3D is &amp;quot;on&amp;quot;, BGA adds CSS class &amp;quot;mode_3d&amp;quot; to the body element.&lt;br /&gt;
&lt;br /&gt;
In CSS, you should prefix all your 3D mode specific directives by &amp;quot;.mode_3d&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
In Javascript, you can detect 3D by using the following :&lt;br /&gt;
&lt;br /&gt;
  if( this.control3dmode3d )&lt;br /&gt;
  {&lt;br /&gt;
     // Only executed in 3d mode&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Built-in 3D enhancements =&lt;br /&gt;
&lt;br /&gt;
BGA is doing some built-in 3D enhancements with your 3D adaptations, so your adaptation will have some 3D effects without any efforts :&lt;br /&gt;
&lt;br /&gt;
* When executing a slideToObject, a slideToObjectPos or a slideTemporaryObject, BGA is moving the objects vertically (up, then down).&lt;br /&gt;
* It also happens when moving elements of a Stock module, or to a Zone module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Enhance your adaptation for 3D =&lt;br /&gt;
&lt;br /&gt;
== Use Z axis ==&lt;br /&gt;
&lt;br /&gt;
Using CSS transform: translateZ, you can translate your HTML elements along the Z axis. Example :&lt;br /&gt;
&lt;br /&gt;
  .floating_element {&lt;br /&gt;
      transform: translateZ( 20px );  /* This element is going to float 20px above the surface */&lt;br /&gt;
  }&lt;/div&gt;</summary>
		<author><name>Sourisdudesert</name></author>
	</entry>
</feed>