public int SecondsLeft() { if (ActualGameState.TourNumber != 0) { return((int)(UpdateTime.AddSeconds(TourTime) - DateTime.Now).TotalSeconds); } else { return(-1); } }
public void Discover(DhcpMessage discoverMessage) { PresentedName = discoverMessage.HostName ?? PresentedName; if (State == DhcpState.Offered && UpdateTime.AddSeconds(10) > DateTime.Now) { return; } if (State == DhcpState.Forbidden) { AddEvent(new DhcpRequestRejectedEvent(this, discoverMessage)); } else { UpdateTime = DateTime.Now; State = DhcpState.Offered; AddEvent(new DhcpRequestAcceptedEvent(this, discoverMessage)); } }