public void quit(Chatter c) { try { sendMessage(new Message(Header.Quit, c.getAlias())); } catch (IOException e) { Console.WriteLine(e); } }
public void quit(Chatter c) { try { sendMessage(new Message(Message.Header.QUIT_CR, c.getAlias())); this.close(); } catch (Exception e) { Console.WriteLine(e); } }
public void join(Chatter c) { try { sendMessage(new Message(Header.Join, c.getAlias())); chatter = c; } catch (IOException e) { Console.WriteLine(e); } }
public void quit(Chatter c) { if (_users.Contains(c)) { _users.Remove(c); Console.WriteLine("(Message from Chatroom : " + _topic + ") " + c.getAlias() + " has left the room."); } for (int i = 0; i < _users.Count(); i++) { _users.ElementAt(i).quitNotification(c); } }
public void join(Chatter c) { if (!_users.Contains(c)) { _users.Add(c); Console.WriteLine("(Message from Chatroom : " + _topic + ") " + c.getAlias() + " has joined the room."); for (int i = 0; i < _users.Count(); i++) { _users.ElementAt(i).joinNotification(c); } } }
public void quit(Chatter c) { if (!listChatter.Contains(c)) { listChatter.Remove(c); Console.WriteLine("(Message from Chatroom : " + topic + ") " + c.getAlias() + " has join the room."); for (int i = 0; i < listChatter.Count; i++) { listChatter[i].quitNotification(c); } } }
public void joinNotification(Chatter c) { List <string> data = new List <string>(1); data.Add(c.getAlias()); try { sendMessage(new Message(Message.Header.JOIN_TOPIC, data)); // todo: proper join } catch (Exception e) { Console.WriteLine(e); } }
public void post(String msg, Chatter c) { Message message = new Message(Message.Header.POST); message.addData(c.getAlias()); message.addData(msg); try { sendMessage(message); } catch (Exception e) { Console.WriteLine(e); } }
public void quitNotification(Chatter c) { List <string> data = new List <string>(1); data.Add(c.getAlias()); try { sendMessage(new Message(Message.Header.QUIT_CR, data)); } catch (Exception e) { Console.WriteLine(e); } }
public String receiveAMessage(String _message, Chatter c) { List <String> data = new List <String>(2); data.Add(c.getAlias()); data.Add(_message); try { sendMessage(new Message(Header.Receive, data)); Console.WriteLine(_message); } catch (IOException e) { Console.WriteLine(e); } return(_message); }
public void join(Chatter c) { try { List <string> temp = new List <string>(); temp.Add(c.getAlias()); //temp.Add(c.getPassword()); sendMessage(new Message(Message.Header.JOIN_CR, temp)); chatter = c; } catch (Exception e) { Console.WriteLine(e); } }
public String joinNotification(Chatter c) { String _message = ""; List <String> data = new List <String>(1); data.Add(c.getAlias()); try { sendMessage(new Message(Header.Joined, data)); } catch (IOException e) { Console.WriteLine(e); } return(_message); }
public void receiveAMessage(string msg, Chatter c) { List <string> data = new List <string>(2); data.Add(c.getAlias()); data.Add(msg); try { sendMessage(new Message(Message.Header.GET, data)); } catch (Exception e) { Console.WriteLine(e); } }
public void post(String msg, Chatter c) { //System.out.println("nous envoyons un message"); Message message = new Message(Header.Post); message.addString(c.getAlias()); message.addString(msg); try { //System.out.println("message en cours d'envoie"); sendMessage(message); } catch (IOException e) { Console.WriteLine(e); } }
public void join(Chatter c) { if (!listChatter.Contains(c)) { listChatter.Add(c); Console.WriteLine("(Message from Chatroom : " + topic + ") " + c.getAlias() + " has join the room."); for (int i = 0; i < listChatter.Count; i++) { listChatter[i].joinNotification(c); } } /* * System.Console.WriteLine(" Le pseudo : " +c.getAlias() + " vient de joindre le topic : "+this.topic); * listChatter.Add(c); */ }
public void receiveAMessage(string msg, Chatter c) { Console.WriteLine("(At " + _alias + ") : " + c.getAlias() + " $> " + msg); }
public String quitNotification(Chatter c) { return(c.getAlias() + " Disconnected"); }
public String joinNotification(Chatter c) { return(c.getAlias() + " Joined"); }
public String receiveAMessage(string msg, Chatter c) { return(c.getAlias() + " : " + msg); }
public void post(String msg, Chatter c) { if (_users.Contains(c)) { for (int i = 0; i < _users.Count(); i++) { _users.ElementAt(i).receiveAMessage(msg, c); } } else { Console.WriteLine("ERROR : message \"" + msg + "\" could not be sent. Sender " + c.getAlias() + " is not in the chatroom"); } }
public void post(string msg, Chatter c) { if (listChatter.Contains(c)) { for (int i = 0; i < listChatter.Count; i++) { listChatter[i].receiveAMessage(msg, c); } } else { Console.WriteLine("ERROR : message \"" + msg + "\" could not be sent. Sender " + c.getAlias() + " not in the chatroom"); } //System.Console.WriteLine(c.getAlias() + " : " + msg); }
public void join(Chatter c) // Add a chatter to a chatroom { try { this.listChatters.Add(c); Console.WriteLine("(Message from Chatroom: " + this.getTopic() + " ) " + c.getAlias() + " has join the room."); } catch (NullReferenceException) { Console.WriteLine("Chatter NULL"); } }