Beispiel #1
0
        private void DoAgreeFriendRequest(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();

            dbf.AgreeFriendRequest(analy.GetParaIndexOf(0), analy.GetParaIndexOf(1));
            string msg = "Server#" + OpType.AGREE_FRIEND_REQUEST_RES + "#" + analy.GetParaIndexOf(0) + "#" + analy.GetParaIndexOf(1);

            if (OLList.IsOnLine(analy.GetParaIndexOf(1)))
            {
                SmallUser sUser  = OLList.GetUserByID(analy.GetParaIndexOf(1));
                CClient   client = new CClient(sUser.IPAddress, sUser.IPPort);
                try
                {
                    client.ConnectToServer();
                    client.GetNetworkStream();
                    client.Communicate(msg);
                    client.ReLeaseAll();
                }
                catch (Exception e)
                {
                    System.Console.WriteLine("无法连接用户");
                }
            }
        }
Beispiel #2
0
        private string DoLogin(string formatString)
        {
            AnalysisStr analy  = new AnalysisStr(formatString);
            DBFunction  dbf    = new DBFunction();
            string      format = "Server#" + OpType.LOGIN_RES + "#";

            format += (dbf.Login(analy.GetParaIndexOf(0), analy.GetParaIndexOf(1)) == true?1:0);
            if (dbf.Login(analy.GetParaIndexOf(0), analy.GetParaIndexOf(1)))
            {
                string IP   = endPoint.Address.ToString();
                int    Port = endPoint.Port;
                OLList.OnLined(new SmallUser(analy.GetUserID(), IP, Port));

                string msg = "Server#" + OpType.INFORM_FRIENDS + "#" + analy.GetParaIndexOf(0);
                foreach (string userID in OLList.GetAllOLUsersID())
                {
                    if (dbf.IsFriend(analy.GetParaIndexOf(0), userID))
                    {
                        SmallUser sUser  = OLList.GetUserByID(userID);
                        CClient   client = new CClient(sUser.IPAddress, sUser.IPPort);
                        client.ConnectToServer();
                        client.GetNetworkStream();
                        client.Communicate(msg);
                        client.ReLeaseAll();
                    }
                }
            }
            return(format);
        }
Beispiel #3
0
        private void DoLeaveGroup(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();

            dbf.LeaveGroup(int.Parse(analy.GetParaIndexOf(1)), analy.GetParaIndexOf(0));
        }
Beispiel #4
0
        private void DoDisagreeJoinGroup(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();

            dbf.DisagreeJoinGroup(int.Parse(analy.GetParaIndexOf(1)), analy.GetParaIndexOf(0));
            string msg = "Server#" + OpType.DISAGREE_JOIN_GROUP_RES + "#" + analy.GetParaIndexOf(0) + "#" + analy.GetParaIndexOf(1);

            if (OLList.IsOnLine(analy.GetParaIndexOf(0)))
            {
                SmallUser sUser  = OLList.GetUserByID(analy.GetParaIndexOf(0));
                CClient   client = new CClient(sUser.IPAddress, sUser.IPPort);
                try
                {
                    client.ConnectToServer();
                    client.GetNetworkStream();
                    client.Communicate(msg);
                    client.ReLeaseAll();
                }
                catch (Exception e)
                {
                    System.Console.WriteLine("无法连接用户");
                }
            }
        }
Beispiel #5
0
        private void  DoRecieveOffLineMsg(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();

            dbf.RecieveOffLineMessage(int.Parse(analy.GetParaIndexOf(0)));
        }
Beispiel #6
0
        //应该确保不是加入自己创建的群组,以及应该没有已有的请求,否则返回空的想序列值
        private string DoJoinGroup(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();
            string      msg   = "Server#" + OpType.JOIN_GROUP_RES;

            if (!dbf.GetGroupInfo(int.Parse(analy.GetParaIndexOf(1))).GroupCreator.Equals(analy.GetParaIndexOf(0)) && !dbf.EntityExists(int.Parse(analy.GetParaIndexOf(1)), analy.GetParaIndexOf(0)))
            {
                msg += "#" + dbf.RequestJoinGroup(int.Parse(analy.GetParaIndexOf(1)), analy.GetParaIndexOf(0));
                string notice = "Server#" + OpType.JOIN_GROUP_NOTE + "#" + analy.GetParaIndexOf(0) + "#" + analy.GetParaIndexOf(1);
                if (OLList.IsOnLine(dbf.GetGroupInfo(int.Parse(analy.GetParaIndexOf(1))).GroupCreator))
                {
                    SmallUser sUser  = OLList.GetUserByID(dbf.GetGroupInfo(int.Parse(analy.GetParaIndexOf(1))).GroupCreator);
                    CClient   client = new CClient(sUser.IPAddress, sUser.IPPort);
                    try
                    {
                        client.ConnectToServer();
                        client.GetNetworkStream();
                        client.Communicate(notice);
                        client.ReLeaseAll();
                    }
                    catch (Exception e)
                    {
                        System.Console.WriteLine("无法连接用户");
                    }
                }
            }
            return(msg);
        }
Beispiel #7
0
        //发送群组消息,如果在线则提示对方,如果不在线则送到离线数据库
        private void DoSendGroupMsg(string formatString)
        {
            AnalysisStr     analy = new AnalysisStr(formatString);
            DBFunction      dbf   = new DBFunction();
            List <UserInfo> list  = dbf.GetMembersInGroup(int.Parse(analy.GetParaIndexOf(1)));

            list.Add(dbf.GetUserInfo(dbf.GetGroupInfo(int.Parse(analy.GetParaIndexOf(1))).GroupCreator));
            string msg = "Server#" + OpType.SEND_GROUP_MSG_RES + "#" + analy.GetParaIndexOf(0) + "#" + dbf.GetUserInfo(analy.GetParaIndexOf(0)).UserName + "#" + analy.GetParaIndexOf(1) + "#" + analy.GetParaFromIndex(2);

            foreach (UserInfo user in list)
            {
                if (OLList.IsOnLine(user.UserID))
                {
                    SmallUser sUser  = OLList.GetUserByID(user.UserID);
                    CClient   client = new CClient(sUser.IPAddress, sUser.IPPort);
                    try
                    {
                        client.ConnectToServer();
                        client.GetNetworkStream();
                        client.Communicate(msg);
                        client.ReLeaseAll();
                    }
                    catch (Exception e)
                    {
                        System.Console.WriteLine("无法连接用户");
                    }
                }
                else
                {
                    dbf.SendOffLineMessage(user.UserID, analy.GetParaIndexOf(0), analy.GetParaFromIndex(2));
                }
            }
        }
Beispiel #8
0
        private void DoLogout(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();

            OLList.OffLined(analy.GetParaIndexOf(0));
            string msg = "Server#" + OpType.LOGOUT_NOTE + "#" + analy.GetParaIndexOf(0);

            foreach (string userID in OLList.GetAllOLUsersID())
            {
                if (dbf.IsFriend(userID, analy.GetParaIndexOf(0)))
                {
                    SmallUser sUser  = OLList.GetUserByID(userID);
                    CClient   client = new CClient(sUser.IPAddress, sUser.IPPort);
                    try
                    {
                        client.ConnectToServer();
                        client.GetNetworkStream();
                        client.Communicate(msg);
                        client.ReLeaseAll();
                    }
                    catch (Exception e)
                    {
                        System.Console.WriteLine("无法连接用户");
                    }
                }
            }
        }
Beispiel #9
0
        //删除好友
        private void DoDeleteFriend(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();

            dbf.DeleteFriend(analy.GetParaIndexOf(0), analy.GetParaIndexOf(1));
        }
Beispiel #10
0
        //这里调用时应该注意应确保两者不是好友,且两者没有未处理的加好友请求,否则返回空的序列值
        private string DoSendFriendRequest(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();
            string      msg   = "Server#" + OpType.SEND_FRIEND_REQUEST_RES;

            if (!dbf.IsFriend(analy.GetParaIndexOf(0), analy.GetParaIndexOf(1)) && !dbf.RequestExists(analy.GetParaIndexOf(0), analy.GetParaIndexOf(1)) && !dbf.RequestExists(analy.GetParaIndexOf(1), analy.GetParaIndexOf(0)) && !analy.GetParaIndexOf(0).Equals(analy.GetParaIndexOf(1)))
            {
                msg += "#" + dbf.RequestFriend(analy.GetParaIndexOf(0), analy.GetParaIndexOf(1));
                string notice = "Server#" + OpType.SEND_FRIEND_REQUEST_NOTE + "#" + analy.GetParaIndexOf(0) + "#" + analy.GetParaIndexOf(1);
                if (OLList.IsOnLine(analy.GetParaIndexOf(0)))
                {
                    SmallUser sUser  = OLList.GetUserByID(analy.GetParaIndexOf(0));
                    CClient   client = new CClient(sUser.IPAddress, sUser.IPPort);
                    try
                    {
                        client.ConnectToServer();
                        client.GetNetworkStream();
                        client.Communicate(notice);
                        client.ReLeaseAll();
                    }
                    catch (Exception e)
                    {
                        System.Console.WriteLine("无法连接用户");
                    }
                }
            }
            return(msg);
        }
Beispiel #11
0
        private string DoGetAllFriendsOL(string formatString)
        {
            AnalysisStr     analy = new AnalysisStr(formatString);
            DBFunction      dbf   = new DBFunction();
            List <UserInfo> list  = new List <UserInfo>();

            foreach (string userID in OLList.GetAllOLUsersID())
            {
                if (dbf.IsFriend(analy.GetParaIndexOf(0), userID))
                {
                    list.Add(dbf.GetUserInfo(userID));
                }
            }
            string msg = "Server#" + OpType.ALL_ONLINE_FRIENDS_RES;

            foreach (UserInfo user in list)
            {
                msg += "#" + user.UserID;
                msg += "#" + user.UserName;
                msg += "#" + user.UserPassword;
                msg += "#" + (user.UserSex == true ? 1 : 0);
                msg += "#" + user.UserAge.ToString();
                msg += "#" + user.UserAddress;
                msg += "#" + user.UserHeadpic;
                msg += "#" + user.UserCreateDate.ToString("yyyy-MM-dd HH:mm:ss");
                msg += "#" + user.UserEmail;
            }

            return(msg);
        }
Beispiel #12
0
        private string DoGetGroupMembers(string formatString)
        {
            AnalysisStr     analy = new AnalysisStr(formatString);
            DBFunction      dbf   = new DBFunction();
            List <UserInfo> list  = new List <UserInfo>();

            list.Add(dbf.GetUserInfo(dbf.GetGroupInfo(int.Parse(analy.GetParaIndexOf(0))).GroupCreator));
            list.AddRange(dbf.GetMembersInGroup(int.Parse(analy.GetParaIndexOf(0))));

            string msg = "Server#" + OpType.MEMBERS_IN_GROUP_RES;

            foreach (UserInfo user in list)
            {
                msg += "#" + user.UserID;
                msg += "#" + user.UserName;
                msg += "#" + user.UserPassword;
                msg += "#" + (user.UserSex == true ? 1 : 0);
                msg += "#" + user.UserAge.ToString();
                msg += "#" + user.UserAddress;
                msg += "#" + user.UserHeadpic;
                msg += "#" + user.UserCreateDate.ToString("yyyy-MM-dd HH:mm:ss");
                msg += "#" + user.UserEmail;
            }
            return(msg);
        }
Beispiel #13
0
        private string DoIsFriend(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();
            string      msg   = "Server#" + OpType.IS_FRIEND_RES;

            msg += "#" + (dbf.IsFriend(analy.GetParaIndexOf(0), analy.GetParaIndexOf(1)) == true?1:0);
            return(msg);
        }
Beispiel #14
0
        private string DoIsInGroup(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();
            string      msg   = "Server#" + OpType.IS_IN_GROUP_RES;

            msg += "#" + (dbf.IsInTheGroup(int.Parse(analy.GetParaIndexOf(1)), analy.GetParaIndexOf(0)) == true?1:0);
            return(msg);
        }
Beispiel #15
0
        private string DoSendOffLineMsg(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();
            string      msg   = "Server#" + OpType.SEND_OFFLINE_MSG_RES;

            msg += "#" + dbf.SendOffLineMessage(analy.GetParaIndexOf(0), analy.GetParaIndexOf(1), analy.GetParaFromIndex(2));
            return(msg);
        }
Beispiel #16
0
        private string DoGetFriendIP(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            string      msg   = "Server#" + OpType.FRIEND_IP_RES;

            if (OLList.IsOnLine(analy.GetParaIndexOf(0)))
            {
                msg += "#" + OLList.GetUserByID(analy.GetParaIndexOf(0)).IPAddress;
            }
            return(msg);
        }
Beispiel #17
0
        private void DoAlterGroupInfo(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();
            GroupInfo   group = new GroupInfo();

            group.GroupID         = int.Parse(analy.GetParaIndexOf(0));
            group.GroupName       = analy.GetParaIndexOf(1);
            group.GroupCreator    = analy.GetParaIndexOf(2);
            group.GroupCreateDate = DateTime.Parse(analy.GetParaIndexOf(3));
            group.GroupLogo       = analy.GetParaIndexOf(4);
            dbf.AlterGroupInfo(group);
        }
Beispiel #18
0
        private string DoGetGroupInfo(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();
            GroupInfo   group = dbf.GetGroupInfo(int.Parse(analy.GetParaIndexOf(0).Trim()));
            string      msg   = "Server#" + OpType.GROUP_INFO_RES;

            msg += "#" + group.GroupID.ToString();
            msg += "#" + group.GroupName;
            msg += "#" + group.GroupCreator;
            msg += "#" + group.GroupCreateDate.ToString("yyyy-MM-dd HH:mm:ss");
            msg += "#" + group.GroupLogo;
            return(msg);
        }
Beispiel #19
0
        private string DoCreateGroup(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();
            GroupInfo   group = new GroupInfo();

            group.GroupName       = analy.GetParaIndexOf(0);
            group.GroupCreator    = analy.GetParaIndexOf(1);
            group.GroupCreateDate = DateTime.Parse(analy.GetParaIndexOf(2));
            group.GroupLogo       = analy.GetParaIndexOf(3);
            string msg = "Server#" + OpType.CREATE_GROUP_RES;

            msg += "#" + dbf.InsertGroupInfo(group);
            return(msg);
        }
Beispiel #20
0
        private void DoAlterUserInfo(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();
            UserInfo    user  = new UserInfo();

            user.UserID         = analy.GetParaIndexOf(0);
            user.UserName       = analy.GetParaIndexOf(1);
            user.UserPassword   = analy.GetParaIndexOf(2);
            user.UserSex        = int.Parse(analy.GetParaIndexOf(3)) == 1 ? true : false;
            user.UserAge        = int.Parse(analy.GetParaIndexOf(4));
            user.UserAddress    = analy.GetParaIndexOf(5);
            user.UserHeadpic    = analy.GetParaIndexOf(6);
            user.UserCreateDate = DateTime.Parse(analy.GetParaIndexOf(7));
            user.UserEmail      = analy.GetParaIndexOf(8);
            dbf.AlterUserInfo(user);
        }
Beispiel #21
0
        private string DoFindGroups(string formatString)
        {
            AnalysisStr      analy = new AnalysisStr(formatString);
            DBFunction       dbf   = new DBFunction();
            List <GroupInfo> list  = dbf.FindGroupByName(analy.GetParaIndexOf(0).Trim());
            string           msg   = "Server#" + OpType.FIND_GROUPS_RES;

            foreach (GroupInfo group in list)
            {
                msg += "#" + group.GroupID.ToString();
                msg += "#" + group.GroupName;
                msg += "#" + group.GroupCreator;
                msg += "#" + group.GroupCreateDate.ToString("yyyy-MM-dd HH:mm:ss");
                msg += "#" + group.GroupLogo;
            }
            return(msg);
        }
Beispiel #22
0
        private GroupInfo GetGroupInfo(string formatString)
        {
            AnalysisStr analy     = new AnalysisStr(formatString);
            GroupInfo   group     = new GroupInfo();
            int         paraIndex = 0;

            if (analy.GetParaIndexOf(paraIndex) != null)
            {
                group.GroupID         = int.Parse(analy.GetParaIndexOf(paraIndex++));
                group.GroupName       = analy.GetParaIndexOf(paraIndex++);
                group.GroupCreator    = analy.GetParaIndexOf(paraIndex++);
                group.GroupCreateDate = DateTime.Parse(analy.GetParaIndexOf(paraIndex++));
                group.GroupLogo       = analy.GetParaIndexOf(paraIndex++);
                return(group);
            }

            return(null);
        }
Beispiel #23
0
        //这里解析遇到问题:输入的信息不应该包含'#'否则发生解析错误,可以在客户端防止用户输入该符号
        private List <OffLineMessages> GetOffLineMessagesList(string formatString)
        {
            AnalysisStr            analy = new AnalysisStr(formatString);
            List <OffLineMessages> list  = new List <OffLineMessages>();
            int paraIndex = 0;

            while (analy.GetParaIndexOf(paraIndex) != null)
            {
                OffLineMessages msgTemp = new OffLineMessages();
                msgTemp.MessageID       = int.Parse(analy.GetParaIndexOf(paraIndex++));
                msgTemp.MessageUser1    = analy.GetParaIndexOf(paraIndex++);
                msgTemp.MessageUser2    = analy.GetParaIndexOf(paraIndex++);
                msgTemp.MessageContent  = analy.GetParaIndexOf(paraIndex++);
                msgTemp.MessageSendTime = DateTime.Parse(analy.GetParaIndexOf(paraIndex++));
                list.Add(msgTemp);
            }
            return(list);
        }
Beispiel #24
0
        private List <GroupInfo> GetGroupList(string formatString)
        {
            AnalysisStr      analy = new AnalysisStr(formatString);
            List <GroupInfo> list  = new List <GroupInfo>();
            int paraIndex          = 0;

            while (analy.GetParaIndexOf(paraIndex) != null)
            {
                GroupInfo groupTemp = new GroupInfo();
                groupTemp.GroupID         = int.Parse(analy.GetParaIndexOf(paraIndex++));
                groupTemp.GroupName       = analy.GetParaIndexOf(paraIndex++);
                groupTemp.GroupCreator    = analy.GetParaIndexOf(paraIndex++);
                groupTemp.GroupCreateDate = DateTime.Parse(analy.GetParaIndexOf(paraIndex++));
                groupTemp.GroupLogo       = analy.GetParaIndexOf(paraIndex++);
                list.Add(groupTemp);
            }
            return(list);
        }
Beispiel #25
0
        private string DoGetUserInfo(string formatString)
        {
            AnalysisStr analy = new AnalysisStr(formatString);
            DBFunction  dbf   = new DBFunction();
            UserInfo    user  = dbf.GetUserInfo(analy.GetParaIndexOf(0).Trim());
            string      msg   = "Server#" + OpType.USER_INFO_RES;

            msg += "#" + user.UserID;
            msg += "#" + user.UserName;
            msg += "#" + user.UserPassword;
            msg += "#" + (user.UserSex == true ? 1 : 0);
            msg += "#" + user.UserAge.ToString();
            msg += "#" + user.UserAddress;
            msg += "#" + user.UserHeadpic;
            msg += "#" + user.UserCreateDate.ToString("yyyy-MM-dd HH:mm:ss");
            msg += "#" + user.UserEmail;
            return(msg);
        }
Beispiel #26
0
        private List <Relationship> GetRelationshipList(string formatString)
        {
            AnalysisStr         analy = new AnalysisStr(formatString);
            List <Relationship> list  = new List <Relationship>();
            int paraIndex             = 0;

            while (analy.GetParaIndexOf(paraIndex) != null)
            {
                Relationship relatTemp = new Relationship();
                relatTemp.RelatID         = int.Parse(analy.GetParaIndexOf(paraIndex++));
                relatTemp.RelatUser1      = analy.GetParaIndexOf(paraIndex++);
                relatTemp.RelatUser2      = analy.GetParaIndexOf(paraIndex++);
                relatTemp.RelatConfirm    = int.Parse(analy.GetParaIndexOf(paraIndex++)) == 1 ? true : false;
                relatTemp.RelatCreateDate = DateTime.Parse(analy.GetParaIndexOf(paraIndex++));

                list.Add(relatTemp);
            }
            return(list);
        }
Beispiel #27
0
        private string DoGetAllSentFriendRequests(string formatString)
        {
            AnalysisStr         analy = new AnalysisStr(formatString);
            DBFunction          dbf   = new DBFunction();
            List <Relationship> list  = new List <Relationship>();

            list = dbf.SentFriendRequests(analy.GetParaIndexOf(0));
            string msg = "Server#" + OpType.ALL_FRIEND_REQUESTS_SED_RES;

            foreach (Relationship relat in list)
            {
                msg += "#" + relat.RelatID.ToString();
                msg += "#" + relat.RelatUser1;
                msg += "#" + relat.RelatUser2;
                msg += "#" + (relat.RelatConfirm == true ? 1 : 0);
                msg += "#" + relat.RelatCreateDate.ToString("yyyy-MM-dd HH:mm:ss");
            }
            return(msg);
        }
Beispiel #28
0
        private string DoGetAllJoinGroupRequests(string formatString)
        {
            AnalysisStr        analy = new AnalysisStr(formatString);
            DBFunction         dbf   = new DBFunction();
            List <GroupEntity> list  = new List <GroupEntity>();

            list = dbf.JoinGroupRequests(int.Parse(analy.GetParaIndexOf(0)));
            string msg = "Server#" + OpType.ALL_GROUP_REQUEST_RES;

            foreach (GroupEntity entity in list)
            {
                msg += "#" + entity.EntityID;
                msg += "#" + entity.EntityGroupID;
                msg += "#" + entity.EntityMemID;
                msg += "#" + (entity.EntityConfirm == true ? 1 : 0);
                msg += "#" + entity.EntityCreateDate.ToString("yyyy-MM-dd HH:mm:ss");
            }
            return(msg);
        }
Beispiel #29
0
        private List <GroupEntity> GetGroupEntityList(string formatString)
        {
            AnalysisStr        analy = new AnalysisStr(formatString);
            List <GroupEntity> list  = new List <GroupEntity>();
            int paraIndex            = 0;

            while (analy.GetParaIndexOf(paraIndex) != null)
            {
                GroupEntity entityTemp = new GroupEntity();
                entityTemp.EntityID         = int.Parse(analy.GetParaIndexOf(paraIndex++));
                entityTemp.EntityGroupID    = int.Parse(analy.GetParaIndexOf(paraIndex++));
                entityTemp.EntityMemID      = analy.GetParaIndexOf(paraIndex++);
                entityTemp.EntityConfirm    = int.Parse(analy.GetParaIndexOf(paraIndex++)) == 1 ? true : false;
                entityTemp.EntityCreateDate = DateTime.Parse(analy.GetParaIndexOf(paraIndex++));

                list.Add(entityTemp);
            }

            return(list);
        }
Beispiel #30
0
        private string DoGetAllOffLineMsg(string formatString)
        {
            AnalysisStr            analy = new AnalysisStr(formatString);
            DBFunction             dbf   = new DBFunction();
            List <OffLineMessages> list  = new List <OffLineMessages>();

            list = dbf.RecievedOffLineMessages(analy.GetParaIndexOf(0));
            list.AddRange(dbf.SentOffLineMessages(analy.GetParaIndexOf(0)));
            string msg = "Server#" + OpType.ALL_OFFLINE_MSG_RES;

            foreach (OffLineMessages message in list)
            {
                msg += "#" + message.MessageID.ToString();
                msg += "#" + message.MessageUser1;
                msg += "#" + message.MessageUser2;
                msg += "#" + message.MessageContent;
                msg += "#" + message.MessageSendTime.ToString("yyyy-MM-dd HH:mm:ss");
            }
            return(msg);
        }