Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        static void SendClassiCubeBeat()
        {
            HeartbeatData data = new HeartbeatData(ClassiCubeNetUri);

            if (!RaiseHeartbeatSendingEvent(data, ClassiCubeNetUri, true))
            {
                return;
            }
            minecraftNetRequest = CreateRequest(data.CreateUri(Salt2));
            var state = new HeartbeatRequestState(minecraftNetRequest, data, true);

            minecraftNetRequest.BeginGetResponse(ResponseCallback, state);
        }
Exemplo n.º 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));
            }
        }
Exemplo n.º 4
0
 public HeartbeatRequestState(HttpWebRequest request, HeartbeatData data, bool getServerUri)
 {
     Request      = request;
     Data         = data;
     GetServerUri = getServerUri;
 }