|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.parlor.tourney.server.TourneyManager
public abstract class TourneyManager
Controls a running tourney.
| Field Summary | |
|---|---|
protected TourneyConfig |
_config
Our touney configuration. |
protected InvocationManager |
_invmgr
|
protected Comparable<?> |
_key
The key this tourney is recorded under. |
protected BodyLocator |
_locator
|
protected RootDObjectManager |
_omgr
|
protected long |
_startTime
The time, in milliseconds, when the tourney starts. |
protected TourniesManager |
_tmgr
|
protected TourneyObject |
_trobj
Our distributed tourney object. |
protected static long |
MINUTE
One minute in milliseconds. |
| Fields inherited from interface com.threerings.parlor.tourney.data.TourneyCodes |
|---|
ALREADY_IN_PROGRESS, ALREADY_IN_TOURNEY, CANCELLED, FAILED_ENTRY_FEE, HAS_PLAYERS, NOT_IN_TOURNEY, TOO_LATE, TOO_LATE_LEAVE |
| Fields inherited from interface com.threerings.presents.data.InvocationCodes |
|---|
ACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR |
| Constructor Summary | |
|---|---|
TourneyManager()
|
|
| Method Summary | |
|---|---|
void |
cancel(ClientObject caller,
InvocationService.ConfirmListener listener)
Handles a TourneyService.cancel(com.threerings.presents.client.InvocationService.ConfirmListener) request. |
void |
cancelTourney(String cause)
Cancel the tourney, return entry fees to all participants. |
int |
init(TourneyConfig config,
Comparable<?> key)
Initializes this tourney manager and prepares it for operation. |
boolean |
isFinished()
Returns true if the tourney is finished. |
boolean |
isPaused()
Returns true if the tourney is paused. |
boolean |
isPending()
Returns true if the tourney is pending. |
boolean |
isRunning()
Returns true if the tourney is running. |
void |
join(ClientObject caller,
InvocationService.ConfirmListener listener)
Handles a TourneyService.join(com.threerings.presents.client.InvocationService.ConfirmListener) request. |
protected abstract void |
joinTourney(BodyObject body)
Will throw an InvocationException if the user cannot join the tourney. |
void |
leave(ClientObject caller,
InvocationService.ConfirmListener listener)
Handles a TourneyService.leave(com.threerings.presents.client.InvocationService.ConfirmListener) request. |
protected Participant |
makeParticipant(BodyObject body)
Creates a Participant record for the specified user. |
abstract void |
notifyAllParticipants(String msg)
|
protected void |
releaseTourney()
Releases the tourney from the tourney manager, and removes the tourney from the list of tournies. |
boolean |
shouldStart(long now)
Returns true if it is time or past time the tourney starts. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TourneyConfig _config
protected TourneyObject _trobj
protected long _startTime
protected Comparable<?> _key
@Inject protected RootDObjectManager _omgr
@Inject protected InvocationManager _invmgr
@Inject protected BodyLocator _locator
@Inject protected TourniesManager _tmgr
protected static long MINUTE
| Constructor Detail |
|---|
public TourneyManager()
| Method Detail |
|---|
public int init(TourneyConfig config,
Comparable<?> key)
public void cancel(ClientObject caller,
InvocationService.ConfirmListener listener)
throws InvocationException
TourneyProviderTourneyService.cancel(com.threerings.presents.client.InvocationService.ConfirmListener) request.
cancel in interface TourneyProviderInvocationException
public void join(ClientObject caller,
InvocationService.ConfirmListener listener)
throws InvocationException
TourneyProviderTourneyService.join(com.threerings.presents.client.InvocationService.ConfirmListener) request.
join in interface TourneyProviderInvocationException
public void leave(ClientObject caller,
InvocationService.ConfirmListener listener)
throws InvocationException
TourneyProviderTourneyService.leave(com.threerings.presents.client.InvocationService.ConfirmListener) request.
leave in interface TourneyProviderInvocationExceptionpublic void cancelTourney(String cause)
public boolean isFinished()
public boolean isPending()
public boolean isRunning()
public boolean isPaused()
public boolean shouldStart(long now)
protected Participant makeParticipant(BodyObject body)
Participant record for the specified user.
public abstract void notifyAllParticipants(String msg)
protected void releaseTourney()
protected abstract void joinTourney(BodyObject body)
throws InvocationException
InvocationException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||