Jump to content

Ladder system


Genesis730

Recommended Posts

So I'm having fun designing this site to create leagues and I have the site functional as far as creating a new league and setting up it's own site with members, etc. However I'm having trouble even planning how to setup the database to manage leagues, rankings, creating tournaments, etc. I know it's hard to help without code or anything to start with but like I said I can't even begin to put something functional together in my head. With that in mind, i'd really appreciate ANY input or advice anyone can give. Thanks in advance for anything anyone can provide. :)

Link to comment
https://forums.phpfreaks.com/topic/208082-ladder-system/
Share on other sites

I'm really not sure what you are after, but I will try and give you some input. It would be best if you could at least describe the problem that you are trying to solve. If you can describe how the users of your system will expect the system to behave (a UML usecase), then that would give me something to go on.

 

If you already have a mySQL table for your users with columns like, 'id', 'name', 'address' etc., then you can create another table for a ladder. Have a column called 'id' to match the column in the 'users' table, a second column called 'ranking' and the third column called 'playing', make the first a primary key and the second unique and the third default to null.

 

When a member of the club wants to join the ladder:

[*]Check that that member is not already in that ladder

 

[*]Find the highest ranking in the ladder and insert the new member after this ranking

 

 

For one player to challenge another

[*]Players names are entered

[*]Check the ladder table to ensure that the players are within a certain ranking of one an other (eg 5 places)

[*]Check that neither player is flagged as 'playing'

[*]If everything is ok, then put the userid of the first player in the 'playing' column of the second player and vice versa

 

To enter the result of a match

[*]Enter both players names and the result

[*]Depending on how trustworthy your club is, you might want to have both players log in to agree the results of the match, otherwise the system is open to abuse

[*]Check the 'ladder' table to ensure that the players entered are flagged as playing each other

[*]Swap the players rankings according to the result of the match

[*]Set both players 'playing' flag back to null

 

I hope this was of some help, but I still don't quite understand what you wanted.

 

Paul

Link to comment
https://forums.phpfreaks.com/topic/208082-ladder-system/#findComment-1087762
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.