private void HandleSubscribe(Subscribe x) { Console.WriteLine($"Actor: {Sender.Path} subscribed with guidId: {x.GuidId.ToString()}"); if (!_subscribers.ContainsKey(x.GuidId)) { _subscribers.Add(x.GuidId, Sender); } string avatar = (_subscribers.Count % 2 == 0) ? "male" : "female"; string num = $"pacman{x.GuidId.GetHashCode().ToString().Substring(x.GuidId.GetHashCode().ToString().Length - 2)}"; var msg = new MsgPlayers($"Vi ste igrač {num}, avatar: {avatar}", x.GuidId); Broadcast(msg); StartOrWait(); }
private void HandleMsgPlayers(MsgPlayers x) { MessageBox.Show(x.Poruka); }