Menu

#34 Human vs PC patch

open
nobody
None
5
2016-02-16
2005-11-08
DragonsWake
No

This patch allows you to setup Webchess to host Human
vs PC chess games using a chessengine. Currently, it
is setup to use gnuchess5.07. If there is interest, I
can see about making module to run an assortment of
favorite engines. I'm working on a how-to and will
post that later.

Discussion

  • Rodrigo Flores

    Rodrigo Flores - 2005-11-08

    Logged In: YES
    user_id=933927

    I was just thinking..
    .. it would be a good thing to add another section in the
    main menu named something like "Challenge computer", so that
    users know when they're challenging a computer or a human.

    What do you think?

     
  • DragonsWake

    DragonsWake - 2005-11-08

    Logged In: YES
    user_id=1355472

    It did cross my mind that it would be nice to have some sort
    of direct challenge button.

    I just haven't absorbed how the menu system works yet.

    It would also be nice if we could put the adding of the
    computer Webchess account in to the install file.

    Right now I check and add it when the newuser "Todo" is
    executed.

     
  • Rodrigo Flores

    Rodrigo Flores - 2005-11-08

    Logged In: YES
    user_id=933927

    It's not that complicated..

    What may be complicated is telling which is a human player
    and which is a computer..
    .. I'd need to check your code first to see how you're
    handling the "Webchess" player.

     
  • DragonsWake

    DragonsWake - 2005-11-08

    Logged In: YES
    user_id=1355472

    Essentially I treat the computer player like any other player

    What I've done is put two variables in the config.php file
    where you specify the computer name and password.

    I then check against that name when you are making a
    challenge or continuing a game. If there is a match I turn
    on the switches for playing against the computer.

    I would think for putting a challenge button you would just
    search on the computer name to get the playerID of the
    computer, then create your game record.

     
  • DragonsWake

    DragonsWake - 2005-11-09

    Logged In: YES
    user_id=1355472

    Just noticed last night that this patch is not PHP 4
    complient. You need PHP 5 for it to work. Looking into a
    work around to make it work with 4.

     
  • DragonsWake

    DragonsWake - 2005-11-09

    Patch 2. Fix Windows/Linux compatiblility.

     
  • DragonsWake

    DragonsWake - 2005-11-09

    Logged In: YES
    user_id=1355472

    Added a Windows/Linux switch to allow compatibility between
    platforms. Mainly to do with the CRLF/LF differece between
    systems.

     
  • Rodrigo Flores

    Rodrigo Flores - 2005-11-10

    Logged In: YES
    user_id=933927

    Do you know which part is not compatible with PHP4?

     
  • DragonsWake

    DragonsWake - 2005-11-10

    Logged In: YES
    user_id=1355472

    Yes the open_proc() function. I'm using the CWD option in
    my code. That is only available in PHP 5.

    The only solution I see it to take that out but then I
    believe your executable has to be in your path. I haven't
    had a chance to to test that. I much prefer having the CWD
    option.

    A call out to Albert for all the help on making sure this
    works on Linux and catching the CRLF/LF and proc_open problem.

     
  • Wfelix

    Wfelix - 2006-08-28

    Logged In: YES
    user_id=1316709

    this patch uses the last CVS files?

     
  • Rodrigo Flores

    Rodrigo Flores - 2006-08-28

    Logged In: YES
    user_id=933927

    This patch is nearly a year old.

    Unless DragonsWake confirms it, I'd test it before trying it
    out.

     
  • DragonsWake

    DragonsWake - 2006-08-28

    Logged In: YES
    user_id=1355472

    This patch was for version 0.9.0 I believe. You have to do
    some merging since I'm not sure if it's from the final final
    0.9.0.

    I haven't posted the code that works with pre 1.0 though you
    can check it out at
    http://www.gillisclan.com/chessnew/index.php.
    User/pw: testweb1

    Also this is from pre 1.0 code that is, as roflo pointed
    out, almost a year old.

    Thanks

     
  • DragonsWake

    DragonsWake - 2010-09-22
     
  • DragonsWake

    DragonsWake - 2010-09-22

    Patch for 1.0.0RC2.

     
  • DragonsWake

    DragonsWake - 2010-09-22

    Patch files uploaded for 1.0.0RC2 integration.

     
  • Jonathan Evraire

    Thank you so much! This is going in as soon as I setup the v1.1 Bazaar branch, which is what I am currently focused on. Look for it in the next release!

     
  • zohaib82

    zohaib82 - 2012-04-05

    Hi DragonsWake(clgillis),

    Thanks for great plug in.

    I check your web site - http://webchess.gillisclan.com/ and it works good there.

    I am able to play with computer on http://webchess.gillisclan.com/.

    I have installed your Patch for 1.0.0RC2 and .exe file is missing in config file.

    Following .exe file in config file not available in the patch. How can get .exe file for the game?

    /* Chess Engine name. Engine must respond with SAN not Xboard protocol.
    For Windows just enter the executable name. EX. gnuchess.exe
    For Linux use the exec command. EX. exec ./gnuchess */
    //$CFG_PCCHESSENG = "gnuchess507.exe";
    $CFG_PCCHESSENG = "GNUCHESS.EXE";

    - Thanks

     
  • Anima Mahato

    Anima Mahato - 2016-02-16

    Hi,

    WebChess cannot find chessengine load file.

    How to solve this issues.Please let me know how to set PC Game Settings

    Thanks...

     

    Last edit: Anima Mahato 2016-02-16

Log in to post a comment.