Ejemplo n.º 1
0
        private void On_NETWORK_CalculateRTT(BEHandle <ENetworkID, int> handle)
        {
            ENetworkID requestingNetworkID = handle.Arg1;
            int        startTime           = handle.Arg2;

            // Half-way
            if (BEventManager.Instance.LocalNetworkID != requestingNetworkID)
            {
                BEventsCollection.NETWORK_CalculateRTT.Invoke(new BEHandle <ENetworkID, int>(requestingNetworkID, startTime), BEventReplicationType.TO_TARGET, false, requestingNetworkID);
            }
            // Round Trip
            else
            {
                CurrentPing = BUtils.GetTimeAsInt() - startTime;

                if (CurrentPing < pingDropTreshold)
                {
                    CalculateAvgPing(CurrentPing);
                }
                else
                {
                    LogConsole("Ping dropped : " + CurrentPing);
                }
            }
        }
Ejemplo n.º 2
0
        private void RequestPing()
        {
            int currentTime = BUtils.GetTimeAsInt();

            BEventsCollection.NETWORK_CalculateRTT.Invoke(new BEHandle <ENetworkID, int>(BEventManager.Instance.LocalNetworkID, currentTime), BEventReplicationType.TO_TARGET, false, ENetworkID.HOST);
        }
Ejemplo n.º 3
0
 public AbstractBEHandle()
 {
     InvocationTime = BUtils.GetTimeAsInt();
 }