vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Add-On Releases - [PBPG] Chess (https://vborg.vbsupport.ru/showthread.php?t=232923)

Carnage 01-11-2010 10:00 PM

[PBPG] Chess
 
1 Attachment(s)
What does it do?
This is a chess plugin for my Play by post gaming mod. It allows members to play chess against each other within a forum thread.

What can I use it for?
The main aim of games is fun :) but you could also run tournaments as well :p

Live Demo
A live demo of this mod can be seen on my own forums here: http://www.giveupalready.com/forumdi...r-Gaming-Forum

Features
  • Javascript powered chess game within a fourm thread.
  • Admin options:
    • Board Rotation (play with white at top or bottom)
    • Force board rotation (decide if players can override the default setting)
    • Private mode (only players can comment while game is in progress)
    • Image directory
    • pbpg_path
  • Admin help for chess specific options
  • Interface for setting options by members
  • Member options:
    • Board rotation (if allowed by admin)
    • White player username/userid
    • Black player username/userid
    • Private mode (only players can comment while game is in progress)
  • Status changing commands (resign, stalemate,check,checkmate)
  • Tournaments and ladders integration. (Requires T+L v 4.0-0.1 a3+)
  • Member statistics (games played/won/lost/drawn)

Planned features
[s]Struck out[/s] items in this list are implemented in my latest development copy and will make the next release. *** items are planned for next release.
  • Admin options:
    • Enforce rules on/off/ignore first
    • Input format (support for PGN and other standard input formats)
  • User options: (all can be forced to a certain value by the admin)
    • Enforce rules on/off/ignore first
    • Input format (support for PGN and other standard input formats)
  • Javascript move forward/backward through moves.
  • Ajax updating of board
  • Updated member FAQ
  • Full phrasing of front + back end to help translations.

Installation
1. Install Play by post gaming core product
2. Upload contents of upload folder.
3. Import product file.
4. Select the Manage Plugin Configurations option from the play by post gaming menu
5. Against Chess, select the create new configuration option.
6. Fill out the settings and save.
7. Create or edit an existing forum and assign the configuration you just created to it.


Uninstallation
As of beta 1, the product will not allow you to uninstall it while it is still in use. (this would break your board.)
1. Edit the forums that have a configuration of this plugin assigned and remove it from the list.
2. Now uninstall the product.
3. Delete the chess directory in pbpg_plugins.

Changelog
  • 4.0-0.1 b5
    • Fixed a number of minor issues.
    • Fixed issue with reset being hit half way through making a move.
    • Added comms support; this allows the plugin to share information with other plugins. Currently, this is used to provide automatic tournament results to the tournaments + ladders plugin.
    • Added statistics (wins, losses, draws and games played) These can be mapped to profile fields using the interface in the core product.
    • Now requires PBPG core b4
  • 4.0-0.1 b4
    • Fixed bug with javascript paths
    • Fixed extra move exploit in stalemate code
    • UI enhancements
      • Comment and post move button now appear along side chess board
      • Reset button added to reset board to current game state.
      • move list prevented from growing to big
      • Check/checkmate statuses highlight king
      • Status buttons go green when selected; can be toggled on and off.
    • Status changing commands for check and checkmate
    • Admin help
  • 4.0-0.1 b3
    • Added status changing commands, players can now resign and request a stalemate.
    • Added private mode; hides comments from none players while the game is in progress, once the game ends (stalemate or a player resigns) the comments are shown.
    • Private mode can be set/locked by admin
    • Directory for images can be set
  • 4.0-0.1 b2
    • Fixed bug with javascript in IE + chrome.
    • Plugin will now not install if you do not have core product installed and upto date.
    • Added option hinting to option boxes.
    • Fixed bug with castling/en passant causing the game to skip the next players turn.
    • Added highly defensive install/uninstallation code.
    • Now requires version 4.0-0.1 b3 (Beta 3) of pbpg core.
  • 4.0-0.1 b1
    • Added uninstall code with safety check to prevent you breaking your board.
    • Added JS interface for users to set game options and choose players. This only shows for the thread starter. (ajax autocomplete on usernames)
    • Fixed bug causing default value for white square to be transparent.
    • Numerous user interface improvments; now shows players who are playing, move number and who's turn it is next.
  • 4.0-0.1 a3
    • Fixed aditional database error in install code
  • 4.0-0.1 a2
    • Fixed database error in install code
  • 4.0-0.1 a1
    • Initial release



Notes
  • enforcing rules was a hot request for my vb3.6 chess mod. This version has INCOMPLETE rules enforcing that is disabled. You could enable it by editing the code, however this will probably render most games unplayable at some point.
  • This version is quasi-compatible with the vb3.6 version; however it requires some messing around to get it to work. At some point in the future I will release /something/ to convert between the two, however I don't have an ETA on this. Anyone asking for one without making a donation is likely to be ignored. UPDATE: this wasn't needed on my board, as members weren't interested in saving their old games, I will only work on this if requested by a donator.

Carnage 01-12-2010 08:28 PM

Translations/Reposting

Please DO NOT repost this mod on other vbulletin resource sites.

Translations may be posted in this thread, however the product isn't fully phrased at the moment so translations will be harder to do.

Skyrider 01-12-2010 09:57 PM

Got any demo? Sounds great btw!

TimberFloorAu 01-12-2010 11:16 PM

Can you give us a list of games that would work with your PBP plugin ?

Stuff similar to : http://www.myth-weavers.com ?

Also some interesting Links:

http://www.treasuretables.org/wiki/i...by-Post_Forums

This isnt something we have ever dabbled with, but could be promising for our community ( tagged )

Carnage 01-13-2010 08:24 AM

you could have a look at the chess forum on vb4.giveupalready.com but as thats my development site atm, it may have features that the version released dosn't have yet.

@timber:
What you've linked there are play by post role playing forums. While it would be possible to make role playing aids as a pbpg plugins, the aim was to get something more general along the lines of a multiplayer arcade with games such as chess, batgammon, checkers, poker and other classics.

Currently this is the only plugin that works with my pbpg mod, however I intend to release more (once this one is a bit more feature complete) and intend to encourage other developers to release some (once the core part is more complete)

TimberFloorAu 01-13-2010 10:35 AM

TBH we wouldnt want RPG's.

Our members are more into 1 on 1 strategy games, from cards to draughts :up:

wittebolx 01-13-2010 10:47 AM

Code:

Database error in vBulletin 4.0.1:

Invalid SQL:
SELECT * FROM pbpg_pluginid WHERE dir='chess';

MySQL Error  : Table 'witteb_vbulletin.pbpg_pluginid' doesn't exist
Error Number  : 1146
Request Date  : Wednesday, January 13th 2010 @ 01:46:38 PM
Error Date    : Wednesday, January 13th 2010 @ 01:46:38 PM
Script        : http://www.wittebolx.com/community/admincp/plugin.php?do=productimport
Referrer      : http://www.wittebolx.com/community/admincp/plugin.php?do=productadd
IP Address    : 86.91.97.228
Username      : wittebolx
Classname    : vB_Database
MySQL Version : 5.1.34


Carnage 01-13-2010 11:50 AM

Quote:

Originally Posted by wittebolx (Post 1954298)
Code:

Database error in vBulletin 4.0.1:

Invalid SQL:
SELECT * FROM pbpg_pluginid WHERE dir='chess';

MySQL Error  : Table 'witteb_vbulletin.pbpg_pluginid' doesn't exist
Error Number  : 1146
Request Date  : Wednesday, January 13th 2010 @ 01:46:38 PM
Error Date    : Wednesday, January 13th 2010 @ 01:46:38 PM
Script        : http://www.wittebolx.com/community/admincp/plugin.php?do=productimport
Referrer      : http://www.wittebolx.com/community/admincp/plugin.php?do=productadd
IP Address    : 86.91.97.228
Username      : wittebolx
Classname    : vB_Database
MySQL Version : 5.1.34


That is what comes of assuming that 2 lines of code cannot possibly have a bug in them :( uploaded a fixed version...

N1tr8 01-13-2010 12:55 PM

I have the same failure that wittebolx, we can do?

ArcadeSyndicate 01-13-2010 01:57 PM

line 6 has a little bug, it should look like this...

Code:

$db->query_write("INSERT INTO ". TABLE_PREFIX."pbpg_plugin (title,dir) VALUES ('Chess','chess')");

Carnage 01-13-2010 02:59 PM

Quote:

Originally Posted by N1tr8 (Post 1954366)
I have the same failure that wittebolx, we can do?

Do you have the latest version? Alpha 2 fixes that issue; or should do...

wittebolx 01-14-2010 07:19 AM

Quote:

Originally Posted by Carnage- (Post 1954334)
That is what comes of assuming that 2 lines of code cannot possibly have a bug in them :( uploaded a fixed version...

nope still nothing:
Code:

Invalid SQL:
INSERT INTO pbpg_plugin (title,dir) VALUES ('Chess','chess')';

MySQL Error  : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1
Error Number  : 1064
Request Date  : Thursday, January 14th 2010 @ 10:18:12 AM
Error Date    : Thursday, January 14th 2010 @ 10:18:12 AM
Script        : http://www.wittebolx.com/community/admincp/plugin.php?do=productimport
Referrer      : http://www.wittebolx.com/community/admincp/plugin.php?do=productadd
IP Address    : 86.91.97.228
Username      : wittebolx
Classname    : vB_Database
MySQL Version : 5.1.34


ArcadeSyndicate 01-14-2010 08:02 AM

Quote:

Originally Posted by wittebolx (Post 1955219)
nope still nothing:

try this...

https://vborg.vbsupport.ru/showpost....0&postcount=10

Carnage 01-14-2010 10:52 AM

-_- Should work this time...

joopster 01-16-2010 01:46 AM

I got it installed but how do you actually move the pieces and set up two players against each other?

WEBDosser 01-16-2010 02:14 AM

reserved

Carnage 01-16-2010 11:50 AM

Quote:

Originally Posted by joopster (Post 1957047)
I got it installed but how do you actually move the pieces and set up two players against each other?

From the admin side; I'm going to assume you followed the install instructions and have managed to create a configuration and assigned it to a forum.

From there, you need to goto the forum you assigned it to; create a new thread. There will be a list of avaliable games to play on the post new thread form. Select the chess configuration you just made. Make a post, at this point it dosn't really matter what you say in it.

The thread will then display as a chess board, with a comments box at the bottom and a moves list at the side. Clicking any piece on the chess board will select it (red border) and selecting an empty space (or space containing an enemy piece) will move it there. You will notice that some characters representing the move you just made were put into the quick reply box and the move was added to the moves list. You may now add a comment to the quick reply box (maybe something like 'check' or 'good move') and post a reply.Only when you've posted the reply has the move become commited.

Anyone who views the thread can now see your move. By default the first two people to post valid moves become white and black respectivly, but you can change this by adding the string (option,white,<username for white>) and (option,black,<username for black>) to your first post.

ShawnV 01-16-2010 03:50 PM

Hey Carnage, very nice Mod. Any Idea when you will have this and the core fleshed out and all the features in?

The version on your site seems to work very well.

Carnage 01-16-2010 04:07 PM

The core has all the features required /at the moment/ It will at some point need expanding to support leaderboards and ladders.

My major focus for this mod atm is getting the user interface tidied up; i'm currently supporting 5 vb4 products and working on 3 Projects for university. This combined with getting my own site upgraded to vb 4 leaves me somewhat unable to make any predictions. In no particular order, my next 3 planned releases include a feature update for this mod, a none beta version of my advanced ip ban manager, preferably with some more features included and a version of my friendly url customisation mod that allows customisation of the uri as well as the start segment of the url. I also want to release some more games; go, checkers/draughts, othelo/reversi are high on my priority list due to their similarity to this mod (lots of reusable code :P)

ShawnV 01-17-2010 05:12 AM

Installed, noticed that it doesn't have the how to game notes in the post with the board as it does on your site, ergo how to play it, commands.

Would be great if whatever side the player started as was auto set to that side, I moved a black piece first and it recorded it as whites move, I forgot to use the option,black,<username> to set myself to black beforehand, something which I'm sure allot of players will do.

Also, it works fine for me as Admin, however when a registered user clicks on the thread with the game I get this database error as do they.

Database error in vBulletin 4.0.1:

Invalid SQL:

SELECT post.postid
FROM post AS post

WHERE post.threadid = 113
AND post.visible = 1

ORDER BY post.dateline
LIMIT 0, 1.0E+14;

Carnage 01-17-2010 11:28 AM

Yeah, the version on my site is the vb3 version; its got a lot more features implemented in it as i've been developing it longer; with the advent of vb4 changing all the style stuff, i've had to reimplement the entire user interface.

A good portion of the interface is done and will be in the next release; feel free to copy the instructions from my site in the interim thou. There are also some faq entries, but these will be out of date as since i've had to reimplement the user interface, i'm improved it quite a bit as well.

For the db error, find the get ALL posts plugin (from the pbpg core) find this line:
PHP Code:

$perpage 99999999999999999//should be enough... 

change to:
PHP Code:

$perpage 99999999//should be enough... 


This will be fixed in the next pbpg core release.

ShawnV 01-17-2010 03:37 PM

Awesome, looking forward to the update.

Oh, I noticed that I cannot deselect a forum once I have selected it for the game, even after uninstalling the plug in, it still leaves the game selection drop-down option when you create a post. Not sure if you knew about that.

Carnage 01-17-2010 10:16 PM

Little known fact, if you ctrl+ click a selected item in a multi select box, in most browsers it de-selects it. You can use this to remove plugin from a forum.

The reason that uninstalling it dosn't help is that the uninstall code is currently //todo. It'll probably be there in the next release.

ShawnV 01-23-2010 02:34 AM

If possible, It would be good to post an uninstall script for this since uninstalling the product does nothing at the moment.

Carnage 01-23-2010 09:49 AM

PHP Code:

$q $db->query_first("SELECT * FROM "TABLE_PREFIX."pbpg_plugin WHERE dir='chess'"); 
$q2 $db->query("SELECT * FROM ".TABLE_PREFIX."pbpg_pluginconfig WHERE pbpg_pluginid = $q[pbpg_pluginid]");
while(
$row=$db->fetch_array($q2))
{
    foreach(
$vbulletin->forumcache AS $forum)
    {
        
$test unserialize($forum['pbpg_enabledpluginconfigs']);
        if(isset(
$test[$row['pbpg_pluginconfigid']]))
        {
            
print_cp_message('Error Plugin still in use. Remove all configs using this plugin from forums its enabled in and delete all threads using it before removing the plugin.');
        }
    }
    
$threads $db->query_first("SELECT * FROM ".TABLE_PREFIX."thread WHERE pbpg_pluginconfigid = $row[pbpg_pluginconfigid]");
    if(
is_array($threads))
    {
        
print_cp_message('Error Plugin still in use. Remove all configs using this plugin from forums its enabled in and delete all threads using it before removing the plugin.');
    }

$db->query_write("DELETE FROM ".TABLE_PREFIX."pbpg_pluginconfig WHERE pbpg_pluginid = $q[pbpg_pluginid]");
$db->query_write("DELETE FROM "TABLE_PREFIX."pbpg_plugin WHERE pbpg_pluginid = $q[pbpg_pluginid]"); 

That will do it, however you should remove any configs that use the plugin from the forums you have them enabled in first.

The next version will ship with uninstall code.

Edit: updated with safer uninstall code.

Carnage 01-23-2010 05:36 PM

Uploaded beta 1 of this product.

Most important improvment of note is a substantial improvment to the user interface; more information has been added to the default display and the thread starter gets a form to set game options untill the first move is posted.

For anyone who is interested; i've also begun work on a tournaments mod which will be released soon. (At the point at which it first becomes usable)

Carnage 01-26-2010 08:00 PM

Added some screenshots.

TimberFloorAu 01-29-2010 08:36 PM

All we get is Blank Chess Board

TimberFloorAu 01-29-2010 08:38 PM

Your plugin image path is wrong:

http://www.yobromofo.com/pbpg_plugin.../images/bR.gif

Should be

http://www.yobromofo.com/forum/pbpg_.../images/bR.gif

TimberFloorAu 01-29-2010 09:06 PM

Also in chess product, all gif paths are wrong. In our case I have had to prefix with /forum

TimberFloorAu 01-29-2010 09:12 PM

Have fixed product file, now working your paths assume the mod is installed in root

So prefixed all /pbpg with /forum

TimberFloorAu 01-29-2010 09:44 PM

Decided to uninstall. Unable to do so.

All threads deleted.
All forums de-selected.

ANy suggestions.?

Carnage 01-29-2010 11:32 PM

delete the configurations then try.

If that fails and you've only got this installed, remove the core product first.

TimberFloorAu 01-30-2010 12:41 AM

You cannot Deselect the bloody game from forums, even using Ctrl+mouse click

Therefore configs cannot be deleted.
Mate I would pull this mod, until it is actually safe to install and uninstall. Waiting for updates to uninstall !

Removing core product first still makes no difference.

Carnage 01-30-2010 11:20 AM

I have just tested the ctrl+click to remove in 3 browsers: firefox, chrome and internet explorer it works in all of them. That said, I will update the core product to use checkboxes from now on since that'll work out easier for unselecting them. If you've removed the core product change the uninstall code to this

Code:

$q = $db->query_first("SELECT * FROM ". TABLE_PREFIX."pbpg_plugin WHERE dir='chess'");
$db->query_write("DELETE FROM ".TABLE_PREFIX."pbpg_pluginconfig WHERE pbpg_pluginid = $q[pbpg_pluginid]");
$db->query_write("DELETE FROM ". TABLE_PREFIX."pbpg_plugin WHERE pbpg_pluginid = $q[pbpg_pluginid]");

to forcibly remove the mod.

EDIT: Alternativly, you can update to the newest version of the core. Based on your feedback i've added tools to make removal much easier.

TimberFloorAu 01-31-2010 01:39 AM

Appreciate your reply.

However, still cannot get rid of the chess plugin. Now throwing up db errors.

Latest: An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$q = $db->query_first("SELECT * FROM ". TABLE_PREFIX."pbpg_plugin WHERE dir='che' at line 1

Carnage 01-31-2010 10:01 AM

You sure you used the exact code above? It seems you've tried to pass $q = $db->query_first("SELECT * FROM ". TABLE_PREFIX."pbpg_plugin WHERE dir='che into the database somewhere; thats teh only way it would have returned that.

TimberFloorAu 01-31-2010 10:19 AM

How about :

Doing a full explanation on removing "your" product.

Carnage 01-31-2010 11:04 AM

ok, manual uninstallation:

remove the uninstallation code.
remove product.
delete pbpg_plugins/chess
remove pbpg core product.
remove pbpg_plugin and pbpg_pluginconfig tables

I have just checked and double checked. The latest versions of all the products install/uninstall correctly.

TimberFloorAu 01-31-2010 06:37 PM

Ok, thankyou.

It will not allow removal of chess plugin. Stating it has to be removed from config of forums, but it isnt enabled in a single forum


All times are GMT. The time now is 05:35 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01545 seconds
  • Memory Usage 1,863KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete