[CLOSED]Convertir du JQUery en Dojo

Game development with Board Game Arena Studio
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

[CLOSED]Convertir du JQUery en Dojo

Post by Rudolf »

petite question:
comment puis-je transformer cette phrase JQuery en DOjo?

Code: Select all

$( "#result" ).load( "http://fr.studio.boardgamearena.com/#!table?table=23830 #active_player_small_infos_block", function() { alert( "Load was performed." );});
eventuellement, la fonction alert n'est pas indispensable)

Code: Select all

$( "#result" ).load( "http://fr.studio.boardgamearena.com/#!table?table=23830 #active_player_small_infos_block");
merci d'avance.
Last edited by Rudolf on 18 September 2015, 08:39, edited 1 time in total.
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

Re: Convertir du JQUery en Dojo

Post by Rudolf »

After a long war with code, here is my findGender function:

Code: Select all

 findGender:function()
        {
           var self=this; 
            this.showMessage('TOTO1','error');
            require(["dojo/request", "dojo/dom", "dojo/dom-construct",  "dojo/on", "dojo/domReady!"], function(request,dom, domConst, on){
                
                request("http://fr.studio.boardgamearena.com/#!table?table=23855").then(function(data){
                    domConst.place("<p>response: <code>" + data + "</code>", "gender");
                    if (dojo.hasClass("gender","icon20")) self.showMessage("icon20 trouvé!",'error')
                    else self.showMessage("test rudolf: icon20 non trouvé","error");
                    // do something with handled data
                }, function(err){
                    self.showMessage(err);
                    // handle an error condition
                }, function(evt){
                    self.showMessage('oops2');
                    // handle a progress event
                });
            });
            this.showMessage('TOTO2','error');
            
          },
I see correct TOTO1 and TOTO2, but nothing else:
But something is strange: there is an error message: Cannot Load "http://fr.studio.boardgamearena.com/#!table?table=23855" ... but I can load it via browser ...
So I suppose I have to add something to say "wait when all HTML is given from PHP"??? Or I cannot use this way?
User avatar
pikiou
Posts: 389
Joined: 03 October 2011, 05:36

Re: Convertir du JQUery en Dojo

Post by pikiou »

Or you could use gameui.players_metadata[playerId].gender
But either way we're not supposed to access this information so when BGA changes, all your real-time and turn-based game tables will become unplayable.
So better ask admins if you can use this data and what's the best way to use it?
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

Re: Convertir du JQUery en Dojo

Post by Rudolf »

Thanks...
by the way... I've learn some tricks maybe usefull in the future doing this...
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

Re: Convertir du JQUery en Dojo

Post by Rudolf »

Are you sure gameui.players_metagamedata exists? Seems not to be present on my project.
User avatar
pikiou
Posts: 389
Joined: 03 October 2011, 05:36

Re: Convertir du JQUery en Dojo

Post by pikiou »

I don't know about gameui.players_metagamedata, but gameui.players_metadata is available ^^
At least in prod, dunno about the studio.
I looked for it when I saw how complex your solution seemed, otherwise I'd have told you earlier.
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

Re: Convertir du JQUery en Dojo

Post by Rudolf »

Ah ... Ok... maybe in prod ...
But in studio, nothing in gameui begins by "players_meta..." :)
User avatar
JonChambers
Posts: 97
Joined: 03 July 2021, 11:40

Re: [CLOSED]Convertir du JQUery en Dojo

Post by JonChambers »

Rudolf wrote: 01 September 2015, 19:29 Ah ... Ok... maybe in prod ...
But in studio, nothing in gameui begins by "players_meta..."
Ten years later, same issue.

Has anyone written a bug report for this?

I'm not allowed to, as I haven't played enough games yet.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Convertir du JQUery en Dojo

Post by Een »

As expressed by pikiou:
pikiou wrote: 01 September 2015, 04:10 But either way we're not supposed to access this information so when BGA changes, all your real-time and turn-based game tables will become unplayable.
That's not a bug. This is meta information, outside of the game. It's not meant to be accessible or used by a game module.
User avatar
JonChambers
Posts: 97
Joined: 03 July 2021, 11:40

Re: [CLOSED]Convertir du JQUery en Dojo

Post by JonChambers »

Een wrote: 24 August 2021, 08:21 As expressed by pikiou:
pikiou wrote: 01 September 2015, 04:10 But either way we're not supposed to access this information so when BGA changes, all your real-time and turn-based game tables will become unplayable.
That's not a bug. This is meta information, outside of the game. It's not meant to be accessible or used by a game module.
Then wouldn't the bug be that it CAN be accessed in production? (Or has that bug been fixed?)

Studio should ideally be a 1:1 simulation of production. When code starts executing one way in one, and another way in the other, that's a failing of studio (or production).

I was hoping to include the player's flag in the game. This data is locked off if I do it in studio, but available (maybe?) if I do it in production. I've already got the 184px avatar, the name, the colour, and the link, but no flag. Should I just leave the flag out for now and maybe add it post-launch? Or is this a banned feature I may not add? It already exists on the player board, so I don't see the harm in using it again on the game itself.
Post Reply

Return to “Developers”