net.sf.magicproject.network
Class ConnectionManager

java.lang.Object
  extended by net.sf.magicproject.network.ConnectionManager

public final class ConnectionManager
extends java.lang.Object

Maintains/close connection of connected players.

Since:
0.80
Author:
Fabrice Daugan

Field Summary
static Client client
          this is the client (mono client for this version)
static Server server
          this is the server
 
Method Summary
static void closeConnexions()
          Close all opened connexions
static void enableConnectingTools(boolean really)
          Enable/Disable connection ability
static NetworkActor getNetworkActor()
          return the current net.sf.magicproject.network actor
static boolean isConnected()
          Indicates if we are connected to a game.
static void notifyDisconnection()
          Notify the disconnection with a warning message. this message is displayed once per disconnection
static void sendToOpponent(int... msg)
          send an event to opponent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

public static Server server
this is the server


client

public static Client client
this is the client (mono client for this version)

Method Detail

notifyDisconnection

public static void notifyDisconnection()
Notify the disconnection with a warning message. this message is displayed once per disconnection


closeConnexions

public static void closeConnexions()
Close all opened connexions

Since:
0.2c

enableConnectingTools

public static void enableConnectingTools(boolean really)
Enable/Disable connection ability

Parameters:
really - if true, the connection ability is enabled. Disable it otherwise.

sendToOpponent

public static void sendToOpponent(int... msg)
send an event to opponent. Since we send an event, we send too (if not done) settings changed. Data is necessary sent now.

Parameters:
msg - is the message sent

getNetworkActor

public static NetworkActor getNetworkActor()
return the current net.sf.magicproject.network actor

Returns:
the current net.sf.magicproject.network actor

isConnected

public static boolean isConnected()
Indicates if we are connected to a game.

Returns:
true if we are connected to a game.


Copyright © 2003-2007 Magic-Project. All Rights Reserved.