Page 1 of 1

APP_GameAction::getArg and strings

Posted: 08 May 2020, 23:38
by Lymon Flowers
Hello everyone,

I am currently toying with the idea of implementing Eat Poop You Cat as my next game after the one I am working with is finished. This is a drawing game and I think that we have everything here to make it working.

Except the possibility to send images to the servers. The solution is found is to send the base64 version of a canvas to the server, which is standard javascript and HTML5 canvas. I am able to send it using an AJAX call with a POST argument in order to keep short URLs. What I cannot do is to get the argument with APP_GameAction::getArg() as the AT_alphanum type is restricted to alphanumeric chars.

Is it possible to get arbitrary strings from the APP_GameAction::getArg() function? That would leverage the last technical difficulty for this game.

Re: APP_GameAction::getArg and strings

Posted: 09 May 2020, 16:40
by Benoit314
You may need to ask an admin about it.
Also, you would need to implement /use an XML parser in the back-end as it would be unsafe to just display the canvas sent by someone to other players without validation.

Re: APP_GameAction::getArg and strings

Posted: 09 May 2020, 16:49
by apollo1001
Whilst not ideal, there is nothing stopping you converting the b64 string to bytes and transferring using the 'AT_numberlist' type and reconstructing server side.

Re: APP_GameAction::getArg and strings

Posted: 09 May 2020, 17:20
by Een
There is an AT_base64 actually ^^

Re: APP_GameAction::getArg and strings

Posted: 09 May 2020, 17:21
by shadowphiar
Is there a maximum recommended (or even, allowed) size for the database entries which one game can occupy on BGA's servers?

The entire state of most games, including order of cards in the decks, all playing pieces etc. can be represented for most games in a few hundred bytes at most. Any game with drawn pictures would take orders of magnitude more. Is BGA going to be okay with that?

Also, even with the red thumbs system in place, I'm not certain I'd want to play this with people I don't know, given the internet's propensity towards ... interesting imagery.

Re: APP_GameAction::getArg and strings

Posted: 10 May 2020, 01:38
by Lymon Flowers
Thanks for the AT_base64 answer. :-)

For now, I was just toying with idea, I have also raised the same issues as you:
  • database size: First estimations would be about 250kB total for a game of 7 people. I considered erasing the images at the end of the game, people wanting to download them for archival would need to do that before the end of the game. On the other hand, this game will clearly not be the top seller of BGA, number of games would be small I guess. However, whether storing images in the database and if yes with which constraints are acceptable would be the admins call.
  • profanity: this site has a reputation system, I imagine people should be reluctant posting penis images or such. But again, if admins think the risk is too high, their call.
Once I have finished current game, I will present a prototype to the admins and ask them what they think (and I would have no problem with a "nope").