[RC] Virtual Casino 1.2.4a

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52298
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

[RC] Virtual Casino 1.2.4a

Post by Brf »

MOD Title: Virtual Casino
MOD Description: Casino games (Slot Machine, Video Poker, Blackjack) for your users to waste their virtual cash.
MOD Version: 1.2.4a

MOD Download: http://castledoom.com/forum/files/Virtual-Casino.zip
Last Stable version: 0.7.0

Demo Board: http://castledoom.com/forum/
Demo Usernames/Password:
Demo-1/phpbb-1
Demo-2/phpbb-2
Demo-3/phpbb-3

After I added the Cash Mod to my forum, I went looking for some nice casino games. I was quite disappointed with what I found -- especially the way the authors did not use the proper Script/Template format.

Therefore I wrote my own.

This casino is pretty much stand-alone, but I have also added in the correct hooks to display online status properly, so you can tell if your users are playing at all.

This MOD requires the Cash Mod found elsewhere on this forum. No particular cash-name or cash-datafield-name is required. The Cash Mod API is used the pull the info for the Cash with ID of "1", unless it it changed in the ACP.

If you delete your currency, and create another, you will need to enter the Control Panel for all four games and submit the new currency, otherwise you will get a non-existant object error when you try to play.

This MOD adds a "gamecookie" field to the user SQL table to store the context of the Blackjack and Poker games. No useful data is stored in the HTML form returned to the user, because that would allow cheats and exploits.

I have created three Demo usernames to avoid the problems with multiple users playing games with the same username. If the gamecookie does not match the returned-form, the user's action will be ignored or his game voided. This is to discourage cheating. If your game is acting "weird", try one of the other Demo- users.

##############################################################
## Author Notes:
##
## This is designed to work with Cash Mod found at phpbb.com
## No particular cash-name or database fieldname is required, because the Cash will be selected
## from each game's control panel.
## If CashMod is not installed, a user database column named "user_points" will be assumed.
## ------------------------------------------------------------------------------------------------
## The original cards images came from the casino mod by aUsTiN-Inc http://austin-inc.com/
## but they were renamed to make them easier to use.
## -----------------------------------------------------------------------------------------------
## The Slot machine image was originally from Microsoft's public online Office Clipart collection.
##############################################################
## MOD History:
##
## 2006-11-28 - Version 1.2.4a
## - Minor bug preventing splitting in Blackjack
##
## 2006-11-19 - Version 1.2.4
## - Additional cash object error checking
## - Minor cash-update changes
##
## 2006-11-06 - Version 1.2.3
## - Moved login redirects before page_header
##
## 2006-10-15 - Version 1.2.2
## - Fixed a bug... with misnamed cash configs
##
## 2006-10-01 - Version 1.2.1
## - Fix page-constants and titles for release.
##
## 2006-09-24 - Version 1.2.0
## - user_points compatability tested and released.
## - Added language variable for "Cash_Points"
##
## 2006-09-24 - Version 1.1.0
## - Make compatable with non-CashMod user_points systems.
##
## 2006-09-23 - Version 1.0.1
## - Fixed display of currency names in CP.
##
## 2006-09-16 - Version 1.0.0
## - Add ending slashes to all img, br, and input tags
## - Verify all HTTP inputs are purified.
##
## 2006-09-14 - Version 0.7.1
## - Correct keno_admin cash button.
## - Login redirect for vcasino menu.
##
## 2006-09-09 - Version 0.7.0
## - Replaced all text with language strings.
##
## 2006-08-21 - Version 0.6.2
## - Dont allow playing Keno with no cash.
##
## 2006-08-20 - Version 0.6.1
## - Corrected Keno Currency Problem
##
## 2006-08-20 - Version 0.6.0
## - Added Keno
##
## 2006-08-16 - Version 0.5.2
## - Added Blackjack hand point-total display and ACP option to display that total while playing
##
## 2006-08-12 - Version 0.5.1
## - Added New options to Blackjack (special hands, surrender, constraints on split, double, hit on soft-17)
## - Re-Fixed width style of blackjack buttons
##
## 2006-08-11 - Version 0.5.0
## - Added New options to Blackjack (special hands, surrender, constraints on split, double, hit on soft-17)
##
## 2006-08-10 - Version 0.4.1
## - Fixed error in new Progressive slot machine jackpot after it wasnt awarded to me :(
##
## 2006-08-09 - Version 0.4.0
## - Added Control panels for all three apps
##
## 2006-08-08 - Version 0.3.1
## - Fixed width style of blackjack buttons
## - Added links back to Index and Casino from within games
##
## 2006-08-07 - Version 0.3.0
## - Replaced short-form Globals
## - Replaced global object references with stricter object calls
##
## 2006-08-06 - Version 0.2.1
## - Added missing images
##
## 2006-08-06 - Version 0.2.1
## - Minor typo: includes/page_header.php changed U_CASINO to U_VCASINO
## - changed width of display field in slot machine from 60 to 60px
##
## 2006-08-05 - Version 0.2.0
## - Initial Release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#

Code: Select all

ALTER TABLE `phpbb_users` ADD `user_gamecookie` TEXT NULL ;
INSERT INTO `phpbb_config` VALUES ('vcasino_bj', '1|2|10|100|0|0|0|0|1|3|1|1');
INSERT INTO `phpbb_config` VALUES ('vcasino_poker', '1|1000|100|25|9|5|4|3|2|1|1|2|10');
INSERT INTO `phpbb_config` VALUES ('vcasino_slot', '1|100|60|40|20|30|20|10|4|5|2|1|1|2|5|10|20|61|1000');

Last edited by Brf on Tue Nov 28, 2006 11:22 pm, edited 21 times in total.
User avatar
Elias
Registered User
Posts: 5139
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias

Post by Elias »

Very nice MOD. I like the games you added there.
Is it possible that multiple members that are logged in the board be able to play the poker game?
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52298
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

EY wrote: Is it possible that multiple members that are logged in the board be able to play the poker game?


Against one-another? No. That wouldnt work very well in a PhpBB environment. You would have to write some sort of client-server program.
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Post by RedTrinity »

This mod looks great and a lot more interesting than the Casino I currently have installed on our forums.

However have just installed this one to try it out, and am having a couple of teething problems.

First problem is that the slot machine does not appear to fit all the icons properly into it and they are overlapping out of the side of the machine, here is a screenshot:

http://img.photobucket.com/albums/v630/ ... lotpic.jpg

Also the animations dont appear to be working, on your test site it was all fantastically animated with the slot machine, however by clicking on an amount on this one, it just skips to the results :S It appears to be doing the same thing for the other games as well.

Any suggestions?

Regards,

Nikki.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52298
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

That slot machine display problem might be a template problem. The template I am using has no padding or spacing in tables. I will have to port this over to my old subSIlver and see if I need to explicitly take the padding out.

I am not sure why you would not be getting animation though. I tested it with both IExplore and Firefox on my own site, and it appeared to be OK. I will see how the subSilver test comes out first.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52298
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

OK. This looks fine in subSilver for me too. It appears that the problem for you is the Cash display. The available cash display input field is overridden to a width of 60px, but for some reason, on your forum it is being displayed much wider.

In slot.tpl, look for

Code: Select all

<input name="iscash" style="width:60;
and try twiddling that width value. It might work better for you with "60px" in there too.


I do not know why the animation would not work for you. That is a client-side script, so it should work the same no matter which website it is sitting on... Your website doesnt disable scripts some way does it?
gamerxgirl
Registered User
Posts: 379
Joined: Tue Feb 22, 2005 4:13 pm

Post by gamerxgirl »

When goingto the virtual casino:

General Error

User not logged in!!!!

DEBUG MODE

User=0

Line : 20
File : VCasino.php
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52298
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

Yup. I didnt put in a re-direct yet. You need to be logged in before going there.
User avatar
Elias
Registered User
Posts: 5139
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias

Post by Elias »

Is it possible to only make it viewable to people that are in X group.

Like only people in a certain group can see it and play it.
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52298
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

Only make cash #1 available to people who post in a Private forum, available to only that one group. Otherwise they would have zero cash to play.


Yeah... it would be possible to setup a "Gamblers" group. But that would require an admin setting program, which I havent found the need for yet :P

Lets see what the demand is, before I get into something like that :wink:
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Post by RedTrinity »

Brf wrote: OK. This looks fine in subSilver for me too. It appears that the problem for you is the Cash display. The available cash display input field is overridden to a width of 60px, but for some reason, on your forum it is being displayed much wider.

In slot.tpl, look for

Code: Select all

<input name="iscash" style="width:60;
and try twiddling that width value. It might work better for you with "60px" in there too.


I do not know why the animation would not work for you. That is a client-side script, so it should work the same no matter which website it is sitting on... Your website doesnt disable scripts some way does it?


Thanks for that Brf, I changed the width to 40px and sure enough everything is back in the right places again :)

No idea as to wether my website disables scripts or not, how would I find this out? I should mention I just recently had trouble installing another mod too that had Java scripting in it, I had to go without the animation for that....

If I can get it working it would be fantastic, as I am very impressed with this mod in comparison to the other one we were using which was very basic.

Cheers,

RT.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52298
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

Ok RedTrinity,

OK. I checked out my Casino on your board. It appears to work OK in IExplore, other than a few visual problems and missing images on the main casino page.... those are my fault. Also, it looks like all my style tags need to have that "px" modifier I told you about a few posts up.

In Firefox though, it appears that you have some some variable set somewhere that is forcing a more strict language. Lines that are gving warnings on my site are giving errors on yours... Something about accessing a global object. Also Java isnt accessing the form by id for some reason....
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Post by RedTrinity »

Thanks Brf, I will add all the px changes tomorrow morning to the rest of the mod and see how that goes.

I am indeed using Firefox, it didnt occur to me to try testing the Casino out in IE to see if it worked properly there.

I have no idea on how to fix the issue related to Firefox and accessing the "global object" so if anyone has any suggestions I'm all ears as I know a lot of the members on our forum favour this browser over IE, including myself.

RT.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52298
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

Well... It is up to me to fix this. I will see about fixing those style tags and getting a new version up sometime today. I will try and fix the global object references too.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52298
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Post by Brf »

I have updated the version to 0.3.0.

I have fixed some missing image files.

I have also eliminated the Javascript warnings which appear in Firefox Java-console and removed the short-form Globals to make it compliant with the Mod database.

Those who have version 0.2.0 will need to replace most of the PHP and TPL files and put in the missing image files.
Post Reply

Return to “[2.0.x] MODs in Development”