Exemple #1
0
 public HeartbeatRequestState(HttpWebRequest request, HeartbeatData data, bool getServerUri)
 {
     Request = request;
     Data = data;
     GetServerUri = getServerUri;
 }
Exemple #2
0
        static void SendWoMDirectBeat()
        {
            HeartbeatData data = new HeartbeatData(WoMDirectUri);

            data.CustomData["noforward"] = "1";

            if (!RaiseHeartbeatSendingEvent(data, WoMDirectUri, false))
            {
                return;
            }
            womDirectRequest = CreateRequest(data.CreateUri());
            var state = new HeartbeatRequestState(womDirectRequest, data, false);
            womDirectRequest.BeginGetResponse(ResponseCallback, state);
        }
Exemple #3
0
 static void RaiseHeartbeatSentEvent(HeartbeatData heartbeatData,
                                      HttpWebResponse response,
                                      string text)
 {
     var h = Sent;
     if (h != null)
     {
         h(null, new HeartbeatSentEventArgs(heartbeatData,
                                              response.Headers,
                                              response.StatusCode,
                                              text));
     }
 }
Exemple #4
0
 static void SendMinecraftNetBeat()
 {
     HeartbeatData data = new HeartbeatData(MinecraftNetUri);
     if (!RaiseHeartbeatSendingEvent(data, MinecraftNetUri, true))
     {
         return;
     }
     minecraftNetRequest = CreateRequest(data.CreateUri());
     var state = new HeartbeatRequestState(minecraftNetRequest, data, true);
     minecraftNetRequest.BeginGetResponse(ResponseCallback, state);
 }
Exemple #5
0
 static bool RaiseHeartbeatSendingEvent(HeartbeatData data, Uri uri, bool getServerUri)
 {
     var h = Sending;
     if (h == null) return true;
     var e = new HeartbeatSendingEventArgs(data, uri, getServerUri);
     h(null, e);
     return !e.Cancel;
 }