/** * Retrieves the RpcConnection for the specified HostedConnection * if that HostedConnection has had RPC services started using * startHostingOnConnection() (or via autohosting). Returns null * if the connection currently doesn't have RPC hosting services * attached. */ public RpcConnection getRpcConnection( HostedConnection hc ) { return hc.getAttribute(ATTRIBUTE_NAME); }
/** * Returns the RMI registry for the specific HostedConnection. Each connection * has its own registry with its own connection-specific shared objects. */ public RmiRegistry getRmiRegistry( HostedConnection hc ) { return hc.getAttribute(ATTRIBUTE_NAME); }
/** * Returns the attributeName attribute of the supplied source * HostConnection. If there is no value at that attribute then * the miss() method is called. */ protected Object getSourceDelegate( HostedConnection source ) { Object result = source.getAttribute(attributeName); if( result == null ) { miss(source); } return result; } }
/** * Removes any RMI hosting services associated with the specified * connection. Calls to getRmiRegistry() will return null for * this connection. * This method is called automatically for all leaving connections if * autohost is set to true. */ public void stopHostingOnConnection( HostedConnection hc ) { RmiRegistry rmi = hc.getAttribute(ATTRIBUTE_NAME); if( rmi == null ) { return; } if( log.isLoggable(Level.FINEST) ) { log.log(Level.FINEST, "stopHostingOnConnection:{0}", hc); } hc.setAttribute(ATTRIBUTE_NAME, null); //rpc.close(); }
/** * Removes any RPC hosting services associated with the specified * connection. Calls to getRpcConnection() will return null for * this connection. The connection's RpcConnection is also closed, * releasing any waiting synchronous calls with a "Connection closing" * error. * This method is called automatically for all leaving connections if * autohost is set to true. */ @Override public void stopHostingOnConnection( HostedConnection hc ) { RpcConnection rpc = hc.getAttribute(ATTRIBUTE_NAME); if( rpc == null ) { return; } if( log.isLoggable(Level.FINEST) ) { log.log(Level.FINEST, "stopHostingOnConnection:{0}", hc); } hc.setAttribute(ATTRIBUTE_NAME, null); rpc.close(); }
/** * Retrieves the RpcConnection for the specified HostedConnection * if that HostedConnection has had RPC services started using * startHostingOnConnection() (or via autohosting). Returns null * if the connection currently doesn't have RPC hosting services * attached. */ public RpcConnection getRpcConnection( HostedConnection hc ) { return hc.getAttribute(ATTRIBUTE_NAME); }
/** * Returns the RMI registry for the specific HostedConection. Each connection * has its own registry with its own connection-specific shared objects. */ public RmiRegistry getRmiRegistry( HostedConnection hc ) { return hc.getAttribute(ATTRIBUTE_NAME); }
/** * Returns the HostedEntityData for the specified connection. This * can be used to setup connection-specific entity data setup. */ public HostedEntityData getHostedEntityData( HostedConnection hc ) { return hc.getAttribute(HostedEntityData.ATTRIBUTE_NAME); }
public static String getPlayerName(HostedConnection conn) { return conn.getAttribute(ATTRIBUTE_PLAYER_NAME); }
private LobbySessionImpl getLobbySession(HostedConnection conn) { return conn.getAttribute(ATTRIBUTE_SESSION); }
private ChatSessionImpl getChatSession(HostedConnection conn) { return conn.getAttribute(ATTRIBUTE_SESSION); }
/** * Returns the attributeName attribute of the supplied source * HostConnection. If there is no value at that attribute then * the miss() method is called. */ protected Object getSourceDelegate( HostedConnection source ) { Object result = source.getAttribute(attributeName); if( result == null ) { miss(source); } return result; } }
protected Object getSourceDelegate( HostedConnection source ) { Object result = source.getAttribute(attributeName); if( result == null ) { miss(source); } return result; } }
/** * Removes any RMI hosting services associated with the specified * connection. Calls to getRmiRegistry() will return null for * this connection. * This method is called automatically for all leaving connections if * autohost is set to true. */ public void stopHostingOnConnection( HostedConnection hc ) { RmiRegistry rmi = hc.getAttribute(ATTRIBUTE_NAME); if( rmi == null ) { return; } if( log.isLoggable(Level.FINEST) ) { log.log(Level.FINEST, "stopHostingOnConnection:{0}", hc); } hc.setAttribute(ATTRIBUTE_NAME, null); //rpc.close(); }
protected void postMessage(ChatSessionImpl from, String message) { logger.log(Level.INFO, "chat> {0} said:{1}", new Object[]{from.name, message}); for (ChatSessionImpl chatter : players) { chatter.newMessage(from.conn.getId(), from.conn.getAttribute(ATTRIBUTE_KEEPER_ID), from.name, message); } }
/** * Terminates the specified connection for hosting remote * entity data commands. By default this is performed automatically * in removeConnection(). */ public void stopHostingOnConnection( HostedConnection hc ) { HostedEntityData hed = hc.getAttribute(HostedEntityData.ATTRIBUTE_NAME); if( hed == null ) { return; } log.debug("stopHostingOnConnection:" + hc); hc.setAttribute(HostedEntityData.ATTRIBUTE_NAME, null); hed.close(); }
/** * Terminates the specified connection for hosting remote * entity data commands. By default this is performed automatically * in removeConnection(). */ public void stopHostingOnConnection( HostedConnection hc ) { HostedEntityData hed = hc.getAttribute(HostedEntityData.ATTRIBUTE_NAME); if( hed == null ) { return; } log.debug("stopHostingOnConnection:" + hc); hc.setAttribute(HostedEntityData.ATTRIBUTE_NAME, null); hed.close(); }
/** * Must be called by the game server to send pending updates * to the relevant clients. */ public void sendUpdates() { for( HostedConnection conn : server.getConnections() ) { HostedEntityData hed = conn.getAttribute(HostedEntityData.ATTRIBUTE_NAME); if( hed == null ) { continue; } hed.sendUpdates(); } }
/** * Removes any RPC hosting services associated with the specified * connection. Calls to getRpcConnection() will return null for * this connection. The connection's RpcConnection is also closed, * releasing any waiting synchronous calls with a "Connection closing" * error. * This method is called automatically for all leaving connections if * autohost is set to true. */ @Override public void stopHostingOnConnection( HostedConnection hc ) { RpcConnection rpc = hc.getAttribute(ATTRIBUTE_NAME); if( rpc == null ) { return; } if( log.isLoggable(Level.FINEST) ) { log.log(Level.FINEST, "stopHostingOnConnection:{0}", hc); } hc.setAttribute(ATTRIBUTE_NAME, null); rpc.close(); }
/** * Must be called by the game server to send pending updates * to the relevant clients. */ public void sendUpdates() { for( HostedConnection conn : getServer().getConnections() ) { HostedEntityData hed = conn.getAttribute(HostedEntityData.ATTRIBUTE_NAME); if( hed == null ) { continue; } hed.sendUpdates(); } }