Jump to content
MakeWebGames

Russian Roulette Multiplayer


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

[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 by Miks
Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...