Create account / Log in

Side Selection Dialog Appearing twicw

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

Side Selection Dialog Appearing twicw

Postby comdotski » May 19th, 2014, 9:46 am

In my development of new SOR Module after running my game it is now showing the side selection dialog twice. Only occurs when I run via Open ... and not after Edit ... and then running the module.

This has just recently started happening. Not sure where to look for this problem? Help appreciated.
User avatar
comdotski
 
Posts: 68
Joined: May 13th, 2013, 11:59 am
Location: Melbourne, Australia

Re: Side Selection Dialog Appearing twicw

Postby uckelman » May 19th, 2014, 10:01 am

Thus spake comdotski:
> In my development of new SOR Module after running my game it is now
> showing the side selection dialog twice. Only occurs when I run via Open
> ... and not after Edit ... and then running the module.
>
> This has just recently started happening. Not sure where to look for
> this problem? Help appreciated.

Have you been hand-editing the buildFile? If so, you might have
inadvertantly duplicated one of the XML elements which handles sides.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8798
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Side Selection Dialog Appearing twicw

Postby comdotski » May 20th, 2014, 1:01 pm

I don't think so, although it is possible as I have looked at the buildfile and may have done something by mistake.

What should I look for?
User avatar
comdotski
 
Posts: 68
Joined: May 13th, 2013, 11:59 am
Location: Melbourne, Australia

Re: Side Selection Dialog Appearing twicw

Postby uckelman » May 20th, 2014, 8:36 pm

Thus spake comdotski:
> I don't think so, although it is possible as I have looked at the
> buildfile and may have done something by mistake.
>
> What should I look for?
>

I can't say off the top of my head. Would you post the module so we
can have a look?

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8798
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Side Selection Dialog Appearing twicw

Postby comdotski » May 29th, 2014, 11:01 am

Before I post (it is a big file), can I just mention that this only occurs if I initially select <observer> as the player side. Selecting one of the others that I have defined in the player sides for the game seems to work as expected.

I this doesn't trigger anything let me know and I will post.

Thanks.

comdotski
User avatar
comdotski
 
Posts: 68
Joined: May 13th, 2013, 11:59 am
Location: Melbourne, Australia

Re: Side Selection Dialog Appearing twicw

Postby uckelman » May 29th, 2014, 11:10 am

Thus spake comdotski:
> Before I post (it is a big file), can I just mention that this only
> occurs if I initially select as the player side. Selecting
> one of the others that I have defined in the player sides for the game
> seems to work as expected.
>
> I this doesn't trigger anything let me know and I will post.

That's useful to know for testing, but doesn't indicate anything about
the problem to me.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8798
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Side Selection Dialog Appearing twicw

Postby comdotski » June 1st, 2014, 12:20 pm

PM sent with link.
User avatar
comdotski
 
Posts: 68
Joined: May 13th, 2013, 11:59 am
Location: Melbourne, Australia

Re: Side Selection Dialog Appearing twicw

Postby uckelman » June 1st, 2014, 10:02 pm

Thus spake comdotski:
> PM sent with link.
>

I can replicate the problem. I'm looking into the cause now.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8798
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Side Selection Dialog Appearing twicw

Postby comdotski » June 3rd, 2014, 11:20 am

Thanks - look forward to your response.
User avatar
comdotski
 
Posts: 68
Joined: May 13th, 2013, 11:59 am
Location: Melbourne, Australia

Re: Side Selection Dialog Appearing twicw

Postby uckelman » June 3rd, 2014, 9:49 pm

Thus spake comdotski:
> Thanks - look forward to your response.
>

This isn't just your module---it seems to happen for others as well.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8798
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Side Selection Dialog Appearing twicw

Postby comdotski » June 4th, 2014, 4:45 am

Bug or feature ?
User avatar
comdotski
 
Posts: 68
Joined: May 13th, 2013, 11:59 am
Location: Melbourne, Australia

Re: Side Selection Dialog Appearing twicw

Postby uckelman » June 4th, 2014, 7:21 am

Thus spake comdotski:
> Bug or feature ?

Bug.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8798
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Side Selection Dialog Appearing twicw

Postby comdotski » June 4th, 2014, 9:21 pm

OK thanks - its no major problem. I guess it goes into the queue for a potential fix? Should I report it under another forum?
User avatar
comdotski
 
Posts: 68
Joined: May 13th, 2013, 11:59 am
Location: Melbourne, Australia

Re: Side Selection Dialog Appearing twicw

Postby uckelman » June 5th, 2014, 7:06 pm

Thus spake comdotski:
> OK thanks - its no major problem. I guess it goes into the queue for a
> potential fix?

I've found the code which is at fault---it's was added in trunk@5772,
and was part of a fix for Bug 2806392, in which the observer could
erroneously end up with a password. I'll let you know when it's fixed.

> Should I report it under another forum?

No need.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8798
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Side Selection Dialog Appearing twicw

Postby uckelman » June 5th, 2014, 7:30 pm

Thus spake Joel Uckelman:
> Thus spake comdotski:
> > OK thanks - its no major problem. I guess it goes into the queue for a
> > potential fix?
>
> I've found the code which is at fault---it's was added in trunk@5772,
> and was part of a fix for Bug 2806392, in which the observer could
> erroneously end up with a password. I'll let you know when it's fixed.
>

Hey Brent, I'm looking at the code you added to PlayerRoster.isFinished()
in trunk@5772 and am not succeeding in understanding the reasoning
behind it. (Maybe you don't remember anymore, since it was from 2009.)

So, we have this:

// If we are already recorded as a player (i.e. in Saved Game), then
// the step is only finished if we are not the Observer.
final PlayerInfo newPlayerInfo = new PlayerInfo(
GameModule.getUserId(),
GlobalOptions.getInstance().getPlayerId(), null
);

if (players.contains(newPlayerInfo)) {
final PlayerInfo pi = players.get(players.indexOf(newPlayerInfo));
return ! OBSERVER.equals(pi.getSide());
}

// Step is not finished
return false;

The fact that selecting observer causes false to be returned here is
what makes the Welcome Wizard pop up again asking the user to select
a side. The comment makes me think this is *intentional*, but I don't
get why it would be.

Is there some reason why this can't simply be:

final PlayerInfo newPlayerInfo = new PlayerInfo(
GameModule.getUserId(),
GlobalOptions.getInstance().getPlayerId(), null
);

return players.contains(newPlayerInfo);


--
J.
User avatar
uckelman
Site Admin
 
Posts: 8798
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Next

Return to Module Design

Who is online

Users browsing this forum: No registered users and 2 guests