public Object DistributeResults(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);

            switch (analy.GetKindOfReq())
            {
            case OpType.LOGIN_RES:
                return(GetLogicValue(formatString));

            case OpType.ALL_GROUPS_RES:
                return(GetGroupList(formatString));

            case OpType.ALL_FRIENDS_RES:
                return(GetUserList(formatString));

            case OpType.ALL_ONLINE_FRIENDS_RES:
                return(GetUserList(formatString));

            case OpType.ALL_FRIEND_REQUESTS_REC_RES:
                return(GetRelationshipList(formatString));

            case OpType.ALL_FRIEND_REQUESTS_SED_RES:
                return(GetRelationshipList(formatString));

            case OpType.ALL_OFFLINE_MSG_RES:
                return(GetOffLineMessagesList(formatString));

            case OpType.SEND_FRIEND_REQUEST_RES:
                return(GetAutoIncNumber(formatString));

            case OpType.SEND_OFFLINE_MSG_RES:
                return(GetAutoIncNumber(formatString));

            case OpType.CREATE_GROUP_RES:
                return(GetAutoIncNumber(formatString));

            case OpType.JOIN_GROUP_RES:
                return(GetAutoIncNumber(formatString));

            case OpType.ALL_GROUP_REQUEST_RES:
                return(GetGroupEntityList(formatString));

            case OpType.USER_INFO_RES:
                return(GetUserInfo(formatString));

            case OpType.GROUP_INFO_RES:
                return(GetGroupInfo(formatString));

            case OpType.MEMBERS_IN_GROUP_RES:
                return(GetUserList(formatString));

            case OpType.FIND_USERS_RES:
                return(GetUserList(formatString));

            case OpType.FIND_GROUPS_RES:
                return(GetGroupList(formatString));

            case OpType.IS_FRIEND_RES:
                return(GetLogicValue(formatString));

            case OpType.IS_IN_GROUP_RES:
                return(GetLogicValue(formatString));


            default:
                break;
            }

            return(null);;
        }
Exemple #2
0
        public string DistributeTasks(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);

            if (analy.GetKindOfReq() != OpType.RIGISTER && analy.GetKindOfReq() != OpType.LOGIN)
            {
                if (OLList.GetUserByID(analy.GetUserID()) == null)
                {
                    return("###");
                }
                endPoint.Address = IPAddress.Parse(OLList.GetUserByID(analy.GetUserID()).IPAddress);
                endPoint.Port    = OLList.GetUserByID(analy.GetUserID()).IPPort;
            }
            switch (analy.GetKindOfReq())
            {
            case OpType.RIGISTER:
                return(DoRegister(formatString));

            case OpType.LOGIN:
                return(DoLogin(formatString));

            case OpType.ALL_GROUPS:
                return(DoGetAllGroupJoined(formatString));

            case OpType.ALL_FRIENDS:
                return(DoGetAllFriends(formatString));

            case OpType.ALL_ONLINE_FRIENDS:
                return(DoGetAllFriendsOL(formatString));

            case OpType.ALL_FRIEND_REQUESTS_REC:
                return(DoGetAllRecievedFriendRequests(formatString));

            case OpType.ALL_FRIEND_REQUESTS_SED:
                return(DoGetAllSentFriendRequests(formatString));

            case OpType.ALL_OFFLINE_MSG:
                return(DoGetAllOffLineMsg(formatString));

            case OpType.FRIEND_IP:
                return(DoGetFriendIP(formatString));

            case OpType.DELETE_FRIEND:
                DoDeleteFriend(formatString);
                break;

            case OpType.SEND_FRIEND_REQUEST:
                return(DoSendFriendRequest(formatString));

            case OpType.AGREE_FRIEND_REQUEST:
                DoAgreeFriendRequest(formatString);
                break;

            case OpType.DISAGREE_FRIEND_REQUEST:
                DoDisagreeFriendRequest(formatString);
                break;

            case OpType.SEND_OFFLINE_MSG:
                return(DoSendOffLineMsg(formatString));

            case OpType.RECIEVE_OFFLINE_MSG:
                DoRecieveOffLineMsg(formatString);
                break;

            case OpType.CREATE_GROUP:
                return(DoCreateGroup(formatString));

            case OpType.JOIN_GROUP:
                return(DoJoinGroup(formatString));

            case OpType.ALL_GROUP_REQUEST:
                return(DoGetAllJoinGroupRequests(formatString));

            case OpType.AGREE_JOIN_GROUP:
                DoAgreeJoinGroup(formatString);
                break;

            case OpType.DISAGREE_JOIN_GROUP:
                DoDisagreeJoinGroup(formatString);
                break;

            case OpType.ALTER_USER_INFO:
                DoAlterUserInfo(formatString);
                break;

            case OpType.USER_INFO:
                return(DoGetUserInfo(formatString));

            case OpType.GROUP_INFO:
                return(DoGetGroupInfo(formatString));

            case OpType.ALTER_GROUP_INFO:
                DoAlterGroupInfo(formatString);
                break;

            case OpType.SEND_NET_FILE:
                return(DoSendNetFile(formatString));

            case OpType.SEND_GRUOP_MSG:
                DoSendGroupMsg(formatString);
                break;

            case OpType.MEMBERS_IN_GROUP:
                return(DoGetGroupMembers(formatString));

            case OpType.LEAVE_GROUP:
                DoLeaveGroup(formatString);
                break;

            case OpType.FIND_USERS:
                return(DoFindUsers(formatString));

            case OpType.FIND_GROUPS:
                return(DoFindGroups(formatString));

            case OpType.IS_FRIEND:
                return(DoIsFriend(formatString));

            case OpType.IS_IN_GROUP:
                return(DoIsInGroup(formatString));

            case OpType.LOGOUT:
                DoLogout(formatString);
                break;

            default:
                break;
            }

            return("###");                 //表示调用函数无返回值
        }