<< Back to Programming Forum   Search

Posts 1 - 4 of 4   
Question about starting games: 12/14/2012 16:13:59


NecessaryEagle 
Level 59
Report
Since people manually join the CLOT Ladder (or whatever setup), can the CLOT system force-join like a normal tournament? Or can it not do anything that you couldn't do in a game you make yourself?

If it can't, why not? Could this be implemented in the future?
Question about starting games: 12/14/2012 16:53:28

Fizzer 
Level 64

Warzone Creator
Report
Right now, force-join is not possible for CLOT games. It might be possible in the future, but I'd need to think of a way for it to not be abused.

You can work around this problem though. Just add an extra check to your code for games that are still waiting on someone to join and older than X days (you can choose how long).

How you handle this situation is up to you. I can think of a few options:

1. Just count it as a loss for the person that didn't join.
2. Just delete the game from your database and pretend it never happened.
3. In addition to 1 or 2, you can also kick the person who didn't join out of your tournament/ladder so if they're idle they won't get more games. Perhaps you only want to do this if they fail to join or get booted from several games and not just one.
Question about starting games: 12/14/2012 16:58:27

Fizzer 
Level 64

Warzone Creator
Report
Here's how you'd check for this condition:

In the function cron.checkInProgressGames, check to see if the game's state is "WaitingForPlayers". This is how you know the game hasn't started yet. You can also look at the game's "dateCreated" property to see when it was made.

If you want to determine who is the player (or players) that didn't join, look through the "players" collection that the API returns. You can identify the players that didn't join by looking for a player state of "Invited". Invited means they've been invited to the game but haven't joined yet (it will change to "Playing" when they join.)
Question about starting games: 12/14/2012 17:08:36


NecessaryEagle 
Level 59
Report
Thanks the help Fiz. And I've very much like to see this function make it's way into the system eventually. I love this implementation. Keep up the good work :D
Posts 1 - 4 of 4