Пример #1
0
        /// <summary>
        /// Gets Hero table from Data server
        /// </summary>
        internal List <Hero> GetHeroTable()
        {
            List <Hero> heroes = null;

            try
            {
                Console.Write("> Getting Hero table from DataServer... ");
                heroes = new List <Hero>(DSConnection.GetHeroTable());
                Console.WriteLine("OK!");
            } catch (DataServerException ex) {
                Console.WriteLine("ERROR!");
                throw ex;
            }

            return(heroes);
        }
Пример #2
0
        public Hero[] GetHeroTable(string token, out ECode ec)
        {
            ec = ECode.None;
            Hero[] heroes = null;

            if (UserRegistry.IsTokenRegistered(token))
            {
                try
                {
                    heroes = DSConnection.GetHeroTable();
                } catch (ServerConnectionException) {
                    ec = ECode.ConnectionError;
                } catch (DataServerException) {
                    ec = ECode.QueryError;
                }
            }
            else
            {
                ec = ECode.AuthenticationFail;
            }

            return(heroes);
        }