Exemplo n.º 1
0
        void cdrSrv_RequestCDREvent(object sender, int cmd, string caller, string callee, int result)
        {
            Clean c = new Clean() { caller = caller, callee = callee, result = result };

            var u = OnlineUsers.Keys.FirstOrDefault();

            ResponseFromTossServer r = null;

            Debug.WriteLine("ToossServer callee: " + callee);

            switch (callee)
            {
                case "0001":
                    // Make up room request
                    r = new ResponseFromTossServer() { Type = CommandType.MakeupRoomReq, Data = c };
                    break;
                case "0002":
                    // Make up room done
                    r = new ResponseFromTossServer() { Type = CommandType.MakeupRoomDone, Data = c };
                    break;
                case "0003":
                    // DnD 요청
                    r = new ResponseFromTossServer() { Type = CommandType.DnDReq, Data = c };
                    break;
                case "0004":
                    // DnD 취소
                    r = new ResponseFromTossServer() { Type = CommandType.DnDCancel, Data = c };
                    break;
                case "0005":
                    // 세탁 요청
                    r = new ResponseFromTossServer() { Type = CommandType.LaundaryReq, Data = c };
                    break;
                case "0006":
                    // 세탁 취소
                    r = new ResponseFromTossServer() { Type = CommandType.LaundaryCancel, Data = c };
                    break;
                case "0007":
                    // make up room confirm
                    r = new ResponseFromTossServer() { Type = CommandType.MakeupRoomConfirm, Data = c };
                    break;
                case "0008":
                    // 방청소 확인
                    r = new ResponseFromTossServer() { Type = CommandType.MakeupRoomConfirm, Data = c };
                    break;
                default:
                    switch (caller)
                    {
                        case "morning":
                            r = new ResponseFromTossServer() { Type = CommandType.MorningCall, Data = c };
                            break;
                        default:
                            return;
                    }
                    break;
            }

            if (u != null)
                u.Context.Send(JsonConvert.SerializeObject(r));
        }
Exemplo n.º 2
0
        void cdrSrv_RequestCDREvent(object sender, int cmd, string caller, string callee, int result)
        {
            Clean c = new Clean()
            {
                caller = caller, callee = callee, result = result
            };

            var u = OnlineUsers.Keys.FirstOrDefault();

            ResponseFromTossServer r = null;

            Debug.WriteLine("ToossServer callee: " + callee);

            switch (callee)
            {
            case "0001":
                // Make up room request
                r = new ResponseFromTossServer()
                {
                    Type = CommandType.MakeupRoomReq, Data = c
                };
                break;

            case "0002":
                // Make up room done
                r = new ResponseFromTossServer()
                {
                    Type = CommandType.MakeupRoomDone, Data = c
                };
                break;

            case "0003":
                // DnD 요청
                r = new ResponseFromTossServer()
                {
                    Type = CommandType.DnDReq, Data = c
                };
                break;

            case "0004":
                // DnD 취소
                r = new ResponseFromTossServer()
                {
                    Type = CommandType.DnDCancel, Data = c
                };
                break;

            case "0005":
                // 세탁 요청
                r = new ResponseFromTossServer()
                {
                    Type = CommandType.LaundaryReq, Data = c
                };
                break;

            case "0006":
                // 세탁 취소
                r = new ResponseFromTossServer()
                {
                    Type = CommandType.LaundaryCancel, Data = c
                };
                break;

            case "0007":
                // make up room confirm
                r = new ResponseFromTossServer()
                {
                    Type = CommandType.MakeupRoomConfirm, Data = c
                };
                break;

            case "0008":
                // 방청소 확인
                r = new ResponseFromTossServer()
                {
                    Type = CommandType.MakeupRoomConfirm, Data = c
                };
                break;

            default:
                switch (caller)
                {
                case "morning":
                    r = new ResponseFromTossServer()
                    {
                        Type = CommandType.MorningCall, Data = c
                    };
                    break;

                default:
                    return;
                }
                break;
            }

            if (u != null)
            {
                u.Context.Send(JsonConvert.SerializeObject(r));
            }
        }