コード例 #1
0
ファイル: list.cs プロジェクト: Devwarlt/fsod_redis
        protected override void HandleRequest()
        {
            DbAccount acc;
            var       status = Database.Verify(Query["guid"], Query["password"], out acc);

            if (status == LoginStatus.OK || status == LoginStatus.AccountNotExists)
            {
                if (status == LoginStatus.AccountNotExists)
                {
                    acc = Database.CreateGuestAccount(Query["guid"]);
                }

                var ca = new DbClassAvailability(acc);
                if (ca.IsNull)
                {
                    ca.Init(GameData);
                }
                ca.Flush();

                var list = CharList.FromDb(Database, acc);
                list.Servers = GetServerList();
                WriteLine(list.ToXml(Program.GameData, acc));
            }
            else
            {
                WriteErrorLine(status.GetInfo());
            }
        }
コード例 #2
0
        public override void HandleRequest(RequestContext context, NameValueCollection query)
        {
            DbAccount acc;
            var       status = Database.Verify(query["guid"], query["password"], out acc);

            if (status == LoginStatus.OK || status == LoginStatus.AccountNotExists)
            {
                if (status == LoginStatus.AccountNotExists)
                {
                    acc = Database.CreateGuestAccount(query["guid"]);
                }

                if (acc.Admin && acc.AccountIdOverride != 0)
                {
                    var accOverride = Database.GetAccount(acc.AccountIdOverride);
                    if (accOverride != null)
                    {
                        acc = accOverride;
                    }
                }

                var list = CharList.FromDb(Database, acc);
                list.Servers = GetServerList();
                WriteXml(context, list.ToXml().ToString());
            }
            else
            {
                Write(context, "<Error>" + status.GetInfo() + "</Error>");
            }
        }
コード例 #3
0
ファイル: list.cs プロジェクト: NateDiscord/rotmg-redis
        public override void HandleRequest(HttpListenerContext context)
        {
            NameValueCollection query;

            using (StreamReader rdr = new StreamReader(context.Request.InputStream))
                query = HttpUtility.ParseQueryString(rdr.ReadToEnd());

            DbAccount acc;
            var       status = Database.Verify(query["guid"], query["password"], out acc);

            if (status == LoginStatus.OK || status == LoginStatus.AccountNotExists)
            {
                if (status == LoginStatus.AccountNotExists)
                {
                    acc = Database.CreateGuestAccount(query["guid"]);
                }
                var list = CharList.FromDb(Database, acc);
                list.Servers = GetServerList();
                Write(context, list.ToXml().ToString());
            }
            else
            {
                Write(context, "<Error>" + status.GetInfo() + "</Error>");
            }
        }
コード例 #4
0
ファイル: list.cs プロジェクト: ppmaks/LOE-V6-GAME
        protected override void HandleRequest()
        {
            DbAccount acc;
            var       status = Database.Verify(Query["guid"], Query["password"], out acc);

            if (status == LoginStatus.OK || status == LoginStatus.AccountNotExists)
            {
                if (status == LoginStatus.AccountNotExists)
                {
                    acc = Database.CreateGuestAccount(Query["guid"]);
                }
                if (acc.Banned)
                {
                    using (StreamWriter wtr = new StreamWriter(Context.Response.OutputStream))
                        wtr.WriteLine("<Error>Account under maintenance</Error>");
                    Context.Response.Close();
                }

                var ca = new DbClassAvailability(acc);
                if (ca.IsNull)
                {
                    ca.Init(GameData);
                }
                ca.Flush();

                var list = CharList.FromDb(Database, acc);
                list.Servers = GetServerList();
                WriteLine(list.ToXml(Program.GameData, acc));
            }
            else
            {
                WriteErrorLine(status.GetInfo());
            }
        }