Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="friendList"></param>
 internal void AddClanMemberList(ClanMember clanMember)
 {
     Monitor.Enter(m_LockClanMembers);
     {
         m_ClanMemberList.Add(clanMember);
     }
     Monitor.Exit(m_LockClanMembers);
 }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="friendList"></param>
 internal void RemoveClanMemberList(ClanMember clanMember)
 {
     Monitor.Enter(m_LockClanMembers);
     {
         m_ClanMemberList.Remove(clanMember);
     }
     Monitor.Exit(m_LockClanMembers);
 }
Exemplo n.º 3
0
        /// <summary>
        /// 读取部落列表
        /// </summary>
        private static void LoadClanList()
        {
            bool l_bIsReturn = false;
            Session l_Session = new Session( BaseDatabase.Domain );
            l_Session.BeginTransaction();
            {
                do
                {
                    Query l_QueryListClan = new Query( l_Session, "Select ListClan instances" );
                    QueryResult l_ListClanResult = l_QueryListClan.Execute();

                    if ( l_ListClanResult == null )
                    {
                        Debug.WriteLine( "Program.LoadClanList(...) - l_ListClanResult == null error!" );

                        l_bIsReturn = true;
                        break;
                    }

                    for ( int iIndex = 0; iIndex < l_ListClanResult.Count; iIndex++ )
                    {
                        ListClan l_ListClan = l_ListClanResult[iIndex] as ListClan;
                        if ( l_ListClan == null )
                        {
                            Debug.WriteLine( "Program.LoadClanList(...) - l_ListClan == null error!" );

                            l_bIsReturn = true;
                            break;
                        }

                        Clan l_Clan = new Clan();
                        l_Clan.ClanGuid = l_ListClan.ClanGuid;
                        l_Clan.ClanName = l_ListClan.ClanName;
                        l_Clan.Logo = l_ListClan.Logo;
                        l_Clan.Back = l_ListClan.Back;
                        l_Clan.Grade = l_ListClan.Grade;
                        l_Clan.CP = l_ListClan.CP;
                        l_Clan.Slogan = l_ListClan.Slogan;
                        l_Clan.News = l_ListClan.News;

                        //////////////////////////////////////////////////////////////////////////
                        // 获取部落的成员信息

                        Query l_QueryCharacters = new Query( l_Session, "Select Characters instances where {ClanGuid}=@ClanGuid" );
                        l_QueryCharacters.Parameters.Add( "@ClanGuid", l_ListClan.ClanGuid );
                        QueryResult l_CharactersResult = l_QueryCharacters.Execute();

                        if ( l_CharactersResult == null )
                        {
                            Debug.WriteLine( "Program.LoadClanList(...) - l_CharactersResult == null error!" );

                            l_bIsReturn = true;
                            break;
                        }

                        for ( int iIndex2 = 0; iIndex2 < l_CharactersResult.Count; iIndex2++ )
                        {
                            Characters l_Characters = l_CharactersResult[iIndex2] as Characters;
                            if ( l_Characters == null )
                            {
                                Debug.WriteLine( "Program.LoadClanList(...) - l_Characters == null error!" );

                                l_bIsReturn = true;
                                break;
                            }

                            ClanMember l_ClanMember = new ClanMember();

                            l_ClanMember.CharacterName = l_Characters.CharacterName;
                            l_ClanMember.ClanGuid = l_Characters.ClanGuid;
                            l_ClanMember.ClanRank = l_Characters.ClanRank;

                            l_Clan.AddClanMemberList( l_ClanMember );
                        }

                        if ( l_bIsReturn == true)
                            break;

                        Program.AddClanList( l_Clan );
                    }
                } while ( false );
            }
            l_Session.Commit();

            if ( l_bIsReturn == true )
                throw new Exception( "读取部落列表 错误!" );

            LOGs.WriteLine( LogMessageType.MSG_INFO, "信息: 部落列表读取完成!" );
        }