Page 1 of 1

How do I prevent building release version in debug mode?

Posted: 18 March 2021, 22:56
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?

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

Posted: 19 March 2021, 00:50
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.

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

Posted: 19 March 2021, 09:19
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 ^^

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

Posted: 19 March 2021, 14:05
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

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

Posted: 19 March 2021, 14:57
by BoltKey
Just learned about the possibility to call functions from chat, that seems like the correct approach.