[Kde-games-devel] Konquest bug & fix re aggregation of messages to player

Albert Astals Cid aacid at kde.org
Sun Jun 24 22:33:28 UTC 2012


(answers inline)

El Diumenge, 24 de juny de 2012, a les 13:14:37, E Willgohs va escriure:
> I hope this is an ok place to submit this.

Hi

> I built kdegames-4.8.90   konquest and found and fix a bug in player
> messages, as follows.  There were some additional minor changes, like at
> least once I think I moved an item from protected into public so I could
> refer to it elsewhere, but there's probably a better way to do that anyways
> & the issue will make itself clearly known as necessary.
> 
> player messages (planet attacks, reinforcements) were coming through one
> per messagebox instead of aggregated each turn.  In previous versions this
> had been dealt with in  gameview::beginTurn() , and although I think the
> connection was still attempted in mainwin.cc, the slot was not getting
> activated, because there was no longer a beginTurn() signal as was expected
> by the connection, and I think I maybe also had to copy over the
> gameview::beginTurn slot declaration and method from kdegames-4.7.4
> 
> I also added a signal to neutralplayer.h
> void showMessages();
> 
> and emit it from NeutralPlayer::play() after the loop over fleet arrivals
> and before the loop over planets.  As an additional item, I took the old
> scanForSurvivors function and put it pretty much unchanged into game
> because I enjoy its messages, & then also call it here, so
> in NeutralPlayer::play()  at lines 55& 56 in my file
> 
>     m_game->scanForSurvivors();
> emit showMessages();
> 
> and then the mainwin.cc connection ~line 119  wound up
> connect (m_game->m_neutral, SIGNAL(showMessages()), m_gameView,
> SLOT(beginTurn()));
> 
> (I think that's an example where I made m_neutral public to get it to work
> but I'm sure there's better ways)
> 
> Also, I had m_queueMessages start true and always stay true (not setting it
> false at the end of beginTurn() ) since there is no longer a signal into
> the endTurn() slot where it had been getting turned back on in previous
> messages.
> 
> I think that was all it took to get that working ( I had made some other
> changes along the way as I was figuring it out but I think this was all
> that was actually necessary).
> 
> I hope this is helpful;

It would be much more useful if you could submit a diff instead of describing 
textually what you did.

Do you know how to do a diff?
If you are using the svn code of konquest, just do 
  svn diff
in the command line and attach the result
If you are using the tarballs, you'll need to decompress the tarball again and 
then do
  diff -u pathtooldfile pathtonewfile
and attach the result.

Cheers,
  Albert

> 
> Cheers!


More information about the kde-games-devel mailing list