Page 1 of 1

Bug - n must be possible

PostPosted: 28 Jan 2011, 21:14
by justme
What happended:
When starting the quest game 'Twice?!', and no deck is selected, a dialog is returned: 'Game could not be initialized'. A java.lang.IllegalArgumentException: n must be positive is written to the log file.

Before the match, the game suggest you build a deck, but it's not listed as an prerequisite.
This error can possibly be caught in the GUI before game start, by checking the 'Name player' > 'Deck' box for a null value, and either return a warning message or disbale the button
Code: Select all
b.setEnabled ( false );
Steps to reproduce:
1) Apply quest 'twice?!'
2) make sure deck inputbox is empty (under Player name)
3) Click 'start game' button

Log:
http://www.filedropper.com/28012011215019

(couldn't attach with .log or .txt extension)

Re: Bug - n must be possible

PostPosted: 30 Jan 2011, 10:15
by Malban
Hi,

I am not able to reproduce this behaviour. Perhaps I fixed it in my codebase already. Here is a snipped of the corresponding code:

Code: Select all
    private void jButtonStarQuestModeActionPerformed(java.awt.event.ActionEvent evt)                                                     
    {                                                         
        mParent.preStartMatch();
        if (jComboBoxDeckComputerQuest.getSelectedIndex()==-1) return;
        if (jComboBoxComputerQuest.getSelectedIndex()==-1) return;
        if (jComboBoxDeckPlayer.getSelectedIndex()==-1) return;
As you see amongst the first things I do when the start game button is pressed is to look if all decks are selected.

I can´t image how you got this bug, if I didn´t change the coding.
Will have a look in svn what I did last...

Malban

Re: Bug - n must be possible

PostPosted: 30 Jan 2011, 14:09
by justme
I have no clue why, but as you can see from the log I attached, I did get this error yesterday. Today, I can't reproduce it either.

With my default persisent player, the game automatically chose the first deck in the list, if I hadn't selected one.
So I created a new testplayer, did the same with him, but this time no error message was given, and the game wouldn't start (since there were no decks for the game to auto select).

the conclusion must be, that my JRE (Sun's 1.6_16) got unstable last night