} catch (IOException e) {
e.printStackTrace();
return;
}
Client newClient = new Client(_socket.getInetAddress().getHostName(), nickName, _clientID);
// fire CLIENT CONNECT event to update UI
clientConnected(newClient);
// add new client to list
_clientsMap.put(_clientID, newClient);
CT_Socket ctSocket = new CT_Socket(_socket, _inputstream, _outputStream);
_clientsSocketMap.put(_clientID, ctSocket);
// send messages to other clients about new client
sendClientsListToClients();
}
else if (clientObj instanceof OpenMsg) { // client sent open message
OpenMsg om = (OpenMsg)clientObj;
Client clt = _clientsMap.get(om.get_client().get_ID());
clt.inc_numOpenMsgs();
_clientsMap.put(clt.get_ID(), clt);
OpenMsg newOM = new OpenMsg(clt, om.get_msg());
if (!_clientsMap.containsKey(newOM.get_client().get_ID())) { return; } // client not found in clients list