net.jetrix.commands
Class PingCommand

java.lang.Object
  extended by net.jetrix.commands.AbstractCommand
      extended by net.jetrix.commands.PingCommand
All Implemented Interfaces:
Command

public class PingCommand
extends AbstractCommand

Display the ping to the server. To compute the ping of tetrinet and tetrifast clients we send the playernum message that triggers a team message as response. We assume the ping is half the time between the request and the response. Since a command cannot wait for a client response this command must work with the PingFilter that is processing all team messages. This command sets the client properties command.ping=true and command.ping.time and send the playernum message. The filter will then listen for team messages and check if the property command.ping is true. If so it will display the ping of the player.

Version:
$Revision: 475 $, $Date: 2004-12-09 13:35:20 +0100 (jeu., 09 déc. 2004) $
Author:
Emmanuel Bourg

Field Summary
 
Fields inherited from class net.jetrix.commands.AbstractCommand
hidden, level, log
 
Constructor Summary
PingCommand()
           
 
Method Summary
 void execute(CommandMessage m)
          Execute the command.
 String getAlias()
          Return the command alias.
 
Methods inherited from class net.jetrix.commands.AbstractCommand
getAccessLevel, getAliases, getDescription, getUsage, isHidden, setAccessLevel, setHidden
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PingCommand

public PingCommand()
Method Detail

getAlias

public String getAlias()
Description copied from class: AbstractCommand
Return the command alias. This is a method to be overriden only by commands with a unique alias.

Overrides:
getAlias in class AbstractCommand

execute

public void execute(CommandMessage m)
Description copied from interface: Command
Execute the command.



Copyright © 2001-2008 Emmanuel Bourg. All Rights Reserved.