APP_GameAction::getArg and strings

Game development with Board Game Arena Studio
Post Reply
User avatar
Lymon Flowers
Posts: 196
Joined: 01 April 2020, 21:14

APP_GameAction::getArg and strings

Post 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.
User avatar
Benoit314
Posts: 82
Joined: 02 April 2020, 22:12

Re: APP_GameAction::getArg and strings

Post 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.
User avatar
apollo1001
Posts: 191
Joined: 21 July 2015, 10:41

Re: APP_GameAction::getArg and strings

Post 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.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: APP_GameAction::getArg and strings

Post by Een »

There is an AT_base64 actually ^^
User avatar
shadowphiar
Posts: 124
Joined: 01 January 2017, 16:07

Re: APP_GameAction::getArg and strings

Post 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.
User avatar
Lymon Flowers
Posts: 196
Joined: 01 April 2020, 21:14

Re: APP_GameAction::getArg and strings

Post 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").
Post Reply

Return to “Developers”