Exemplo n.º 1
0
        public void StartConnection(EClientType type)
        {
            DiscoverPeersTimer.AutoReset = true;
            DiscoverPeersTimer.Interval  = 1000;
            DiscoverPeersTimer.Elapsed  += DiscoverPeersTimer_Elapsed;
            DiscoverPeersTimer.Start();

            ClientId = new ClientIdData(Environment.MachineName, CommonDebug.GetOptionalNumberId(), type);

            PeerDiscovery.EnableDiscoverable(PeerDiscovery.DiscoveryMethod.UDPBroadcast);

            PeerDiscovery.OnPeerDiscovered += PeerDiscovery_OnPeerDiscovered;

            PeerDiscovery.DiscoverPeersAsync(PeerDiscovery.DiscoveryMethod.UDPBroadcast);

            NetworkComms.AppendGlobalConnectionEstablishHandler(conn => OnConnectionEstablished(conn));
            NetworkComms.AppendGlobalConnectionCloseHandler(conn => OnConnectionClosed(conn));
        }
Exemplo n.º 2
0
 public bool CompareTo(ClientIdData id)
 {
     return(Name == id.Name && OptionalNumberId == id.OptionalNumberId);
 }
Exemplo n.º 3
0
 public ScoreSplitData(ClientIdData id, float score, float totalScore)
 {
     Judge       = id;
     DialValue   = score;
     TotalPoints = totalScore;
 }