TheMasterGeneral Posted March 27, 2015 Share Posted March 27, 2015 I threw a little russian roulette mod together as I couldn't find a free one that seemed like something I want. What the mod does: -Allows players to challenge another player to a round of russian roulette. Players may bet. Winner receives the payout, loser is dead* (hospital/infirmary) Things to note: I haven't extensively tested this. I did basic tests for logic'ing and basic security injections and had no issues. This mod does log the outcomes. HOWEVER, I did not make a staff_log.php function for it. Its easy to do, so I'm sure you can do it. (If not, bug me and I'll get around to it) Time for the code, then! HERE ME RORE. I R SQL You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. rroulette.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Report back to me logic bombs, and/or security loopholes. :P Quote Link to comment Share on other sites More sharing options...
Veramys Posted March 27, 2015 Share Posted March 27, 2015 Looks nice from a cursory glance through. I'll try it out later when I'm in the mood to open up my files. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted March 27, 2015 Share Posted March 27, 2015 Not too bad at all. Some things that bother me due to personal preferences: 1. passing integers as a string when the type is set to int 2. Your little note about setting the post bet to a 0 if empty (goes with item 1). If you set the default of your ternary to 0 guess what? It would be 0 instead of an empty string. But it other than that, just by scrolling through it should be alright Quote Link to comment Share on other sites More sharing options...
Miks Posted March 28, 2015 Share Posted March 28, 2015 (edited) [MENTION=70574]TheMasterGeneral[/MENTION] I gotta say this is an awesome feature From a users point of view there is no statement for if the user ID you entered doesnt exist but thats a minor. Tested it several times with other players and it seems to work fine Oh and its probably the forum doing this but on the DB queries where the user gets put in hospital theres a big gap on the "reason" variable which breaks it, again its a minor Also I checked the logs table in the database and it appears (if Im right, and theres a high chance I'm not) that the log is putting the same user ID for rr_p1 and rr_p2 Edited March 28, 2015 by Miks Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted March 28, 2015 Share Posted March 28, 2015 @TheMasterGeneral I gotta say this is an awesome feature From a users point of view there is no statement for if the user ID you entered doesnt exist but thats a minor. Tested it several times with other players and it seems to work fine Oh and its probably the forum doing this but on the DB queries where the user gets put in hospital theres a big gap on the "reason" variable which breaks it, again its a minor Also I checked the logs table in the database and it appears (if Im right, and theres a high chance I'm not) that the log is putting the same user ID for rr_p1 and rr_p2 Yep. In the log function change one of the $whom's to a $who Quote Link to comment Share on other sites More sharing options...
TheMasterGeneral Posted March 28, 2015 Author Share Posted March 28, 2015 Yep. In the log function change one of the $whom's to a $who Heh whoopsy! Fixing the OP now. From a users point of view there is no statement for if the user ID you entered doesnt exist Check lines 135-141 You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I think that's a valid check. Someone could correct me if its not the case. Oh and its probably the forum doing this but on the DB queries where the user gets put in hospital theres a big gap on the "reason" variable which breaks it, again its a minor Yeah, it appears to be the forum. My local copy seems fine. 2. Your little note about setting the post bet to a 0 if empty (goes with item 1). If you set the default of your ternary to 0 guess what? It would be 0 instead of an empty string. Huh. Never would have thought that. I would guess this would be stopped with an "if (!$_GET['bet'])", right? At least I think that's how I did it in the past. 1. passing integers as a string when the type is set to int I hadn't did that originally. I believe there was a specific reason I did it this time, but for the life of me, I cannot remember. Thanks Veramis! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.