break;
case CLIENT_AskVoice:
handleVoiceRequest((VoiceConnexionPacket) p.getO());
break;
case CLIENT_ConfirmVoice:
VoiceConnexionPacket vcp = (VoiceConnexionPacket) p.getO();
if (voiceSender != null)
voiceSender.killSocket();
voiceSender = new VoiceSender(vcp.getUserIp());
Thread t1 = new Thread(voiceSender);
t1.start();
handleVoiceReceived(vcp);
break;
case SERVER_SearchResults:
ArrayList<User> alu = (ArrayList<User>) p.getO();
handleSearchResults(alu);
break;
case SERVER_Error:
String msg = (String) p.getO();
handleServerError(msg);
break;
case SERVER_Notice:
String msgn = (String) p.getO();
new NoticeView(msgn);
break;
case SERVER_HeartBeat:
if(me!=null) {
try {
NetworkService.sendPacket(new Packet(EnumPacket.CLIENT_HeartBeat, null));
} catch (IOException e) {
verbose.addConsoleMsg(e, EnumSet.of(EnumVerbose.ToConsole, EnumVerbose.ToLog));
}
}
break;
case CLIENT_CancelVoice:
VoiceConnexionPacket vcp2 = (VoiceConnexionPacket) p.getO();
if (voiceReceiver != null)
voiceReceiver.killSocket();
if (voiceSender != null)
voiceSender.killSocket();
handleVoiceRefused(vcp2);