How do I prevent building release version in debug mode?

Game development with Board Game Arena Studio
Post Reply
User avatar
BoltKey
Posts: 10
Joined: 18 April 2017, 00:45

How do I prevent building release version in debug mode?

Post by BoltKey »

So I have a simple function that returns whether the debug mode (that gives everyone many resources etc) is active.

Code: Select all

    function debugMode() {
        return 0;  // switch to 1 for debug mode
    }
I obviously want to avoid pushing debug mode to production. I would like to do something like

Code: Select all

    if ($this->debugMode()) {
        $this->preventReleaseBuild();
    }
Is there a way to do something like this?
User avatar
Benoit314
Posts: 82
Joined: 02 April 2020, 22:12

Re: How do I prevent building release version in debug mode?

Post by Benoit314 »

Maybe you could use a different approach.
In the studio you can call your main class methods from the chat. So you could just define a function that gives many resources to everyone and call it when you do your tests.

You cannot call them on the main site, so it should resolve your issue.
Last edited by Benoit314 on 19 March 2021, 14:14, edited 1 time in total.
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: How do I prevent building release version in debug mode?

Post by Tisaac »

BoltKey wrote: 18 March 2021, 22:56 So I have a simple function that returns whether the debug mode (that gives everyone many resources etc) is active.

Code: Select all

    function debugMode() {
        return 0;  // switch to 1 for debug mode
    }
I obviously want to avoid pushing debug mode to production. I would like to do something like

Code: Select all

    if ($this->debugMode()) {
        $this->preventReleaseBuild();
    }
Is there a way to do something like this?
Not that I am aware of. You can hack it on js side by detecting current URL but not on backend side.
Such a feature would interest me a lot ! I've pushed so many times with debug still on ^^
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: How do I prevent building release version in debug mode?

Post by Victoria_La »

You can do it same way as it debug chat is disable on production, but suggestion on use php calls is better.
Don't put anything in the game by default, but just call giveResources() from chat
(That does not work on production)

If you still want the way to know if we are on studio or production contact me on discord or offline here I don't want to post it here
because it may be security sensitive info
User avatar
BoltKey
Posts: 10
Joined: 18 April 2017, 00:45

Re: How do I prevent building release version in debug mode?

Post by BoltKey »

Just learned about the possibility to call functions from chat, that seems like the correct approach.
Post Reply

Return to “Developers”