This is a documentation for Board Game Arena: play board games online !

Studio FAQ: diferència entre les revisions

De Board Game Arena
Salta a la navegació Salta a la cerca
Línia 51: Línia 51:


An extra deployment action from the BGA administrators is needed to activate new game options and statistics. Please contact us.
An extra deployment action from the BGA administrators is needed to activate new game options and statistics. Please contact us.
== What is the best way to debug? ==
On the server side (PHP), you can use one of these:
* die(var_dump( $variable_to_inspect );
* throw new BgaUserException(var_dump( $variable_to_inspect );
On the client side (Javascript), we recommand installing Firebug for Firefox (or using the 'Developer tools' with Chrome that have about the same functionalities), then:
* console.log( variable_to_inspect ); will give you the object structure of the variable in the Firebug console, without blocking the execution. It's often a good idea to precede this call with a console.log( '### HERE ###' ); to find more easily the appropriate line in the console log.
* alert( variable_to_inspect ); will popup what you wish and pause the execution until you click ok. This won't be useful for complex structures, only native types will get plainly displayed. But this is sometimes useful just with messages to make sure which way the execution goes.
In general for debugging, think of using the 'Save & restore state' functionality. It enables you to save the state of your game just before the issue you are investigating, then come back to that point with one click as many times as needed to understand what is going wrong. You can save up to 3 different states.
=== Some frequent errors ===
; The following error occurs when launching the game "Fatal error during creation of database ebd_quoridor_389 Not logged."
: Check that you didn't use $g_user or getCurrentPlayerId() in setupNewGame() function or in an "args" function of your state. As these functions are not consequences of a user action, there is no current player defined. As a general rule, you should use getActivePlayerId() and not getCurrentPlayerId(). See the [http://www.slideshare.net/boardgamearena/bga-studio-focus-on-bga-game-state-machine presentation on the game state machine] for more information.

Revisió del 22:52, 29 gen 2013

This is a place where we will collect and answer frequently asked questions.

What should I use to access the files through SFTP?

There is a lot of tools to do that. Use the one you are the most comfortable with.

On Linux Gnome, you can for example use the 'Connect to server' function of the Nautilus file management system, or use sshfs.

On Windows, there is for example the WinSCP client.

I can't edit the files in my game directory, it looks like they are readonly. What's happening?

Maybe there is a maintenance operation underway.

If you don't get access back after some time (say one or two hours), please send us a mail to check.

I can't access the Studio back-office, I get a 'Not authorized' error message?

You should first connect to the Studio website (with any of your <developer name><number> accounts). As the authentication is shared with the back-office, then you will be able to access it.

I don't know the name to use to commit my game, what name should I use?

The game name for committing is the name of the game in lower case and without spaces or special characters (ex: puertorico). It is the same name as the name used for the game folder in your SFTP access.

What is the working language on BGA studio?

Working language is English.

Variables and functions must be named with English words.

Comments must be written in English.

Game interface strings and game logs must be written in English.

How can I provide translation in my language?

BGA administrators will translate the game in French before the game release.

After the game release, the collaborative translation interface can be used to translate into other languages.

Check Translations to see how to make your game translatable.

I updated the images in the 'img' folder of my game, but they don't show?

On BGA Studio, there is the gameserver you are developing on, and the main site server that is used to launch the games. The game icon, box and the publisher logo are hosted on the main site server, so they are not immediately available when you modify them on the gameserver. To deploy them on the main site, you have to use the Studio back-office to do a commit.

If the images still don't show after that, please try emptying your browser cache and reloading the page.

I added some game options / some game statistics, but they don't show?

An extra deployment action from the BGA administrators is needed to activate new game options and statistics. Please contact us.