On Wed, Dec 16, 2009 at 6:03 AM, OvermindDL1 <[email protected]> wrote:
> On Wed, Dec 16, 2009 at 5:54 AM, Wim Dumon <[email protected]> wrote:
>> Copied from the file cmake/WtFindMysqlpp.txt:
>>
>> IF(MYSQLPP_LIBRARIES
>>    AND MYSQLPP_INCLUDE
>>    AND MYSQL_INCLUDE)
>>  SET(MYSQLPP_FOUND TRUE)
>>
>> So you need the path to mysql.h too.
>
> Ah, found it, MYSQL_INCLUDE is in CMake's "Ungrouped entities"
> section, rather then in a logical place like the MYSQLPP section, will
> try rebuilding with that later.  :)

That worked if anyone is curious, however, now I find that the hangman
game has bugs.  First, I wanted to test it myself because the hangman
on the site does not work, cannot login, create a user, anything.
Second, the game says that you can login with guest/guest if you do
not want to create an account, however that seems to be enforced on DB
side, not program side, meaning if the DB was fresh, someone could
rush and create a guest/otherPassword, plus if the DB is not setup it
does not even let you test (which is my guess at what is happening on
the Wt site's example), thus I added code to enforce it in app code:

In LoginWidget.C:67 I changed:

   if (HangmanDb::validLogin(User, pass)) {
      confirmLogin(L"<p>Welcome back, " + User + L".</p>");
   } else if (HangmanDb::addUser(User, pass)) {

Into this:

   if (HangmanDb::validLogin(User, pass)) {
      confirmLogin(L"<p>Welcome back, " + User + L".</p>");
   } else if (User==L"guest" && pass==L"guest") {
      confirmLogin(L"<p>Welcome guest, good luck.</p>");
   } else if (HangmanDb::addUser(User, pass)) {


Third, when you click a button to guess a letter, in
HangmanWidget.C::126, the lines:

   const wchar_t *txt = button->text().value().c_str();
   wchar_t c = txt[0];

*always* makes txt==L"", and although it looks like it should work, it
does not, my guess is because the temporary std::wstring that is
constructed is being destructed (I guess this because the temporary is
filled with the proper value, "G" for example, and txt gets that value
before the line returns, but upon the destructor being run for the
temporary txt is then set to "").  If the above lines are replaced
with this code:

   wchar_t c = button->text().value().c_str()[0];

Then the temporary is not destroyed before you extract the value that
you need from it, and now everything works as far as I can tell.

I have a debug version of the server running at
http://overminddl1.no-ip.info:8030/ with the above fixes (so since it
is running in debug mode there is a noticeable speed hit in some
cases, but it works), however it is not connected to a mysql server at
the address and port it wants to connect to, so you can *only* log in
as guest/guest and there is no highscore table, but if anyone wants to
give a working hangman a try (since the one on the Wt site is not),
here it is for the next however many hours, I will take it down when I
wake up in about 5 hours.  Regardless, can those two fixes above be
fixed?

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to