soc.server
Class SOCForceEndTurnThread

java.lang.Object
  extended by java.lang.Thread
      extended by soc.server.SOCForceEndTurnThread
All Implemented Interfaces:
java.lang.Runnable

 class SOCForceEndTurnThread
extends java.lang.Thread

Force this robot's turn to end, by calling SOCGameHandler.endGameTurnOrForce(SOCGame, int, String, StringConnection, boolean). Done in a separate thread in case of deadlocks; see run() for more details. Created from SOCGameHandler.endTurnIfInactive(SOCGame, long) when that's called from SOCGameTimeoutChecker.run().

Before 2.0.00, this class was SOCServer.SOCForceEndTurnThread; split out in 2.0.00 to its own top-level class.

Since:
1.1.11
Author:
Jeremy D Monin <jeremy@nand.net>

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  SOCGame ga
           
private  SOCGameHandler hand
           
private  SOCPlayer pl
           
private  SOCServer srv
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SOCForceEndTurnThread(SOCServer srv, SOCGameHandler hand, SOCGame g, SOCPlayer p)
           
 
Method Summary
 void run()
          If our targeted robot player is still the current player, force-end their turn.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

srv

private final SOCServer srv

hand

private final SOCGameHandler hand

ga

private final SOCGame ga

pl

private final SOCPlayer pl
Constructor Detail

SOCForceEndTurnThread

public SOCForceEndTurnThread(SOCServer srv,
                             SOCGameHandler hand,
                             SOCGame g,
                             SOCPlayer p)
Method Detail

run

public void run()
If our targeted robot player is still the current player, force-end their turn. If not current player but game is waiting for them to discard or pick free resources, choose randomly so the game can continue. Calls SOCGameHandler.endGameTurnOrForce(SOCGame, int, String, StringConnection, boolean).

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread