org.alliance.core.comm
Class FriendConnection

java.lang.Object
  extended by org.alliance.core.comm.Connection
      extended by org.alliance.core.comm.PacketConnection
          extended by org.alliance.core.comm.AuthenticatedConnection
              extended by org.alliance.core.comm.FriendConnection

public class FriendConnection
extends AuthenticatedConnection

Created by IntelliJ IDEA. User: maciek Date: 2005-dec-21 Time: 16:22:56 To change this template use File | Settings | File Templates.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.alliance.core.comm.Connection
Connection.Direction
 
Field Summary
static int CONNECTION_ID
           
 
Fields inherited from class org.alliance.core.comm.AuthenticatedConnection
remoteUserGUID
 
Fields inherited from class org.alliance.core.comm.Connection
bandwidthIn, bandwidthOut, bytesReceived, bytesSent, connected, core, direction, hasWriteInterest, key, netMan, statusString
 
Constructor Summary
FriendConnection(NetworkManager netMan, Connection.Direction direction, int userGUID)
           
FriendConnection(NetworkManager netMan, java.lang.Object key, Connection.Direction direction, int guid)
           
 
Method Summary
 void broadcast(short msgId, RPC rpc)
           
static Packet createRPCPacket(NetworkManager m, RPC rpc)
           
 Packet createRPCPacket(RPC rpc)
           
protected  int getConnectionId()
           
 void init()
           
 void packetReceived(Packet p)
           
 void received(int fromGuid, int hops, Packet packet)
           
 void received(int fromGuid, int hops, Packet packet, RPC outerRPC)
           
 void route(int dstGuid, RPC rpc)
           
 void send(int dstGuid, RPC rpc)
           
 void send(RPC rpc)
           
 java.lang.String toString()
           
 
Methods inherited from class org.alliance.core.comm.AuthenticatedConnection
getRemoteFriend, getRemoteUserGUID, getSocketAddress, newInstance, sendConnectionIdentifier, setRemoteUserGUID
 
Methods inherited from class org.alliance.core.comm.PacketConnection
getLastPacketSentAt, getPacketsReceived, readyToSend, received, send
 
Methods inherited from class org.alliance.core.comm.Connection
bytesReceived, bytesSent, close, getBandwidthIn, getBandwidthOut, getBytesReceived, getBytesSent, getConnectionIdForRemote, getDirection, getKey, getNetMan, getStatusString, hasWriteInterest, isConnected, setHasWriteInterest, setKey, setStatusString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONNECTION_ID

public static final int CONNECTION_ID
See Also:
Constant Field Values
Constructor Detail

FriendConnection

public FriendConnection(NetworkManager netMan,
                        Connection.Direction direction,
                        int userGUID)

FriendConnection

public FriendConnection(NetworkManager netMan,
                        java.lang.Object key,
                        Connection.Direction direction,
                        int guid)
                 throws java.io.IOException
Throws:
java.io.IOException
Method Detail

init

public void init()
          throws java.io.IOException
Overrides:
init in class AuthenticatedConnection
Throws:
java.io.IOException

packetReceived

public void packetReceived(Packet p)
                    throws java.io.IOException
Specified by:
packetReceived in class PacketConnection
Throws:
java.io.IOException

received

public void received(int fromGuid,
                     int hops,
                     Packet packet)
              throws java.io.IOException
Throws:
java.io.IOException

received

public void received(int fromGuid,
                     int hops,
                     Packet packet,
                     RPC outerRPC)
              throws java.io.IOException
Throws:
java.io.IOException

getConnectionId

protected int getConnectionId()
Specified by:
getConnectionId in class Connection

send

public void send(RPC rpc)
          throws java.io.IOException
Throws:
java.io.IOException

send

public void send(int dstGuid,
                 RPC rpc)
          throws java.io.IOException
Throws:
java.io.IOException

route

public void route(int dstGuid,
                  RPC rpc)
           throws java.io.IOException
Throws:
java.io.IOException

broadcast

public void broadcast(short msgId,
                      RPC rpc)
               throws java.io.IOException
Throws:
java.io.IOException

createRPCPacket

public Packet createRPCPacket(RPC rpc)

createRPCPacket

public static Packet createRPCPacket(NetworkManager m,
                                     RPC rpc)

toString

public java.lang.String toString()
Overrides:
toString in class AuthenticatedConnection