Beispiel #1
0
        public HttpMsg.MessageResponse ReqEcho(HttpMsg.MessageType reqType, DispatchData request)
        {
            logger.Debug($"\n{JValue.Parse(request.ReqData).ToString(Formatting.Indented)}");

            var reqData = request.GetData <HttpMsg.ReqEcho>();

            var ackData = new HttpMsg.AckEcho();

            ackData.uid     = reqData.uid;
            ackData.message = reqData.message;

            return(ackData);
        }
Beispiel #2
0
        public HttpMsg.MessageResponse Dispatch(DispatchData dispatchData)
        {
            string tmpLogText = JValue.Parse(JsonConvert.SerializeObject(dispatchData)).ToString(Formatting.Indented);

            logger.Debug($"\r\n{tmpLogText}");

            if (messageHandler.ContainsKey(dispatchData.messageType) == false)
            {
                // not support message type;
                return(new HttpMsg.MessageResponse());
            }

            return(messageHandler[dispatchData.messageType](dispatchData.messageType, dispatchData));
        }
Beispiel #3
0
        public HttpMsg.MessageResponse ReqAuthorizationCallBack(HttpMsg.MessageType reqType, DispatchData request)
        {
            logger.Debug($"\n{JValue.Parse(request.ReqData).ToString(Formatting.Indented)}");

            var reqData = request.GetData <HttpMsg.ReqAuthorizationCallBack>();

            var intlData = new InternalMsg.IntlMsg_Authorization();

            intlData.guid = reqData.state;

            intlData.state = reqData.state;
            intlData.code  = reqData.code;
            intlData.friendship_status_changed = reqData.friendship_status_changed;

            intlData.error       = reqData.error;
            intlData.description = reqData.description;

            NetServer.InternalHandleMessageByGuid(intlData);

            return(null);
        }