public override bool load(StringBuilder sb, Permissions permissions, HttpListenerContext context)
        {
            if (!base.load(sb, permissions, context))
            {
                return(false);
            }

            if (!permissions.HasFlag(Permissions))
            {
                AppendNoRights(sb);
                return(true);
            }

            int accID = 0;
            //if (context.Request.HttpMethod.ToUpper().Trim() == "GET")
            //{
            String query = new StreamReader(context.Request.InputStream, context.Request.ContentEncoding).ReadToEnd();

            var nameValuePairs = HttpUtility.ParseQueryString(query, context.Request.ContentEncoding);

            Int32.TryParse(context.Request.QueryString.Get("accID"), out accID);
            //}


            sb.AppendLine("<h2>Account Log</h2>");
            sb.AppendLine("\t\t<div class=\"content\">");

            if (accID != 0)
            {
                Actions.GetAccountLogAction gpla = new Actions.GetAccountLogAction(accID);
                ActionTimer.get().addAction(gpla);

                while (!gpla.IsFinished)
                {
                    Thread.Sleep(50);
                }

                sb.AppendLine("<h3>Log für: " + gpla.Name + "</h3>");

                sb.AppendLine("\t\t\t<table>");
                foreach (Actions.GetAccountLogAction.AccountLogChar alc
                         in gpla.CharStatList)
                {
                    sb.AppendLine("\t\t\t\t<tr>");
                    sb.AppendLine("\t\t\t\t\t<td>");
                    sb.AppendLine("\t\t\t\t\t\t" + new DateTime(alc.time).ToShortTimeString() + " " + new DateTime(alc.time).ToShortDateString());
                    sb.AppendLine("\t\t\t\t\t</td>");
                    sb.AppendLine("\t\t\t\t\t<td>");
                    String type = "";
                    if (alc.type >= (long)GUC.Server.Scripts.Accounts.Logs.SQLiteLogger.CharStat.HitChances)
                    {
                        type = "" + (NPCTalent)(alc.type - (long)GUC.Server.Scripts.Accounts.Logs.SQLiteLogger.CharStat.HitChances);
                    }
                    else if (alc.type >= (long)GUC.Server.Scripts.Accounts.Logs.SQLiteLogger.CharStat.TalentSkillStart)
                    {
                        type = "" + (NPCTalent)(alc.type - (long)GUC.Server.Scripts.Accounts.Logs.SQLiteLogger.CharStat.TalentSkillStart);
                    }
                    else if (alc.type >= (long)GUC.Server.Scripts.Accounts.Logs.SQLiteLogger.CharStat.TalentValuesStart)
                    {
                        type = "" + (NPCTalent)(alc.type - (long)GUC.Server.Scripts.Accounts.Logs.SQLiteLogger.CharStat.TalentValuesStart);
                    }
                    else if (alc.type >= (long)GUC.Server.Scripts.Accounts.Logs.SQLiteLogger.CharStat.AttributeStart)
                    {
                        type = "" + (NPCAttribute)(alc.type - (long)GUC.Server.Scripts.Accounts.Logs.SQLiteLogger.CharStat.AttributeStart);
                    }
                    type += " | " + alc.type;
                    sb.AppendLine("\t\t\t\t\t\t" + type);
                    sb.AppendLine("\t\t\t\t\t</td>");
                    sb.AppendLine("\t\t\t\t\t<td>");
                    sb.AppendLine("\t\t\t\t\t\t" + alc.value);
                    sb.AppendLine("\t\t\t\t\t</td>");
                    sb.AppendLine("\t\t\t\t</tr>");
                }
                sb.AppendLine("\t\t\t</table>");
            }
            else
            {
                sb.AppendLine("Account wurde nicht gefunden!");
            }



            sb.AppendLine("\t\t</div>");


            return(true);
        }
示例#2
0
        public override bool load(StringBuilder sb, Permissions permissions, System.Net.HttpListenerContext context)
        {
            if (!base.load(sb, permissions, context))
            {
                return(false);
            }

            if (!permissions.HasFlag(Permissions))
            {
                AppendNoRights(sb);
                return(true);
            }

            sb.AppendLine("\t\t<h2>Nachrichten:</h2><br>");

            if (context.Request.HttpMethod.ToUpper().Trim() == "POST")
            {
                var nameValuePairs = HttpUtility.ParseQueryString(new StreamReader(context.Request.InputStream, context.Request.ContentEncoding).ReadToEnd(), context.Request.ContentEncoding);
                int id             = 0;
                if (Int32.TryParse(nameValuePairs.Get("msgID"), out id) &&
                    nameValuePairs.Get("sendMsg") != null)
                {
                    String str = nameValuePairs.Get("taMsg");
                    if (str != null & str.Length != 0)
                    {
                        lock (SLMessageManager.GetSLMessageManager().MessageList)
                        {
                            foreach (SLMessageManager.SLMessage message in SLMessageManager.GetSLMessageManager().MessageList)
                            {
                                if (message.ID == id)
                                {
                                    message.IsAnswered = true;

                                    Actions.WriteMessageAction gpla = new Actions.WriteMessageAction(message.playerID, str, 255, 0, 0, 255);
                                    ActionTimer.get().addAction(gpla);

                                    while (!gpla.IsFinished)
                                    {
                                        Thread.Sleep(50);
                                    }

                                    sb.AppendLine("\t\t<div class=\"content_n\">");
                                    if (gpla.completed)
                                    {
                                        sb.AppendLine("Nachricht gesendet!");
                                    }
                                    else
                                    {
                                        sb.AppendLine("Spieler nicht Online!");
                                    }
                                    sb.AppendLine("\t\t</div>");

                                    break;
                                }
                            }
                        }
                    }
                }
            }

            lock (SLMessageManager.GetSLMessageManager().MessageList)
            {
                foreach (SLMessageManager.SLMessage slm in SLMessageManager.GetSLMessageManager().MessageList)
                {
                    sb.AppendLine("\t\t<div class=\"content_n\">");
                    sb.AppendLine("\t\t\t" + slm.name + " (" + slm.playerID + "): " + slm.msg + "<br>");
                    sb.AppendLine("\t\t\t<hr>");
                    sb.AppendLine("\t\t\t<form method=\"post\">");
                    sb.AppendLine("\t\t\t\t<input type=\"hidden\" name=\"msgID\" value=\"" + slm.ID + "\" />");
                    sb.AppendLine("\t\t\t\t<textarea name=\"taMsg\" style=\"width: 100%; height: 100px;\"></textarea>");
                    sb.AppendLine("\t\t\t\t<input style=\"width: 100%;\" name=\"sendMsg\" type=\"submit\" value=\"Abschicken\" >");
                    sb.AppendLine("\t\t\t</form>");
                    sb.AppendLine("\t\t</div>");
                }
            }


            return(true);
        }
示例#3
0
        public override bool load(StringBuilder sb, Permissions permissions, HttpListenerContext context)
        {
            if (!base.load(sb, permissions, context))
            {
                return(false);
            }

            if (!permissions.HasFlag(Permissions))
            {
                AppendNoRights(sb);
                return(true);
            }


            Actions.GetPlayerListAction gpla = new Actions.GetPlayerListAction();
            ActionTimer.get().addAction(gpla);

            while (!gpla.IsFinished)
            {
                Thread.Sleep(50);
            }



            int l = -28000, t = 50500, r = 95500, b = -42500;
            int w = 1024, h = 768;

            sb.AppendLine("<h2>Karte</h2>");
            sb.AppendLine("\t\t<div class=\"content\">");
            sb.AppendLine("\t\t<div style=\"position:relative;\">");
            sb.AppendLine("\t\t\t<img src=\"/images/Map_NewWorld.jpg\" /><br>");



            foreach (GUC.Server.Scripts.Web.Actions.GetPlayerListAction.NPCCOPYED npc in gpla.List)
            {
                int   _maxWidth   = r - l;
                int   _maxHeight  = b - t;
                float _realWidth  = npc.position.X - l;
                float _realHeight = npc.position.Z - t;

                int _posX = (int)(_realWidth / _maxWidth * w);
                int _posY = (int)(_realHeight / _maxHeight * h);

                if (_posY < 0)
                {
                    _posY = 0;
                }

                String color = "green";
                if (npc.IsPlayer)
                {
                    color = "red";
                }

                sb.AppendLine("\t\t<div style=\"position:absolute; width: 5px; height: 5px; background: " + color + "; top: " + _posY + "px; left: " + _posX + "px;\"> </div>");
            }
            sb.AppendLine("\t\t</div>");
            sb.AppendLine("\t\t</div>");

            return(true);
        }
示例#4
0
        public override bool load(StringBuilder sb, Permissions permissions, HttpListenerContext context)
        {
            if (!base.load(sb, permissions, context))
            {
                return(false);
            }

            if (!permissions.HasFlag(Permissions))
            {
                AppendNoRights(sb);
                return(true);
            }


            Actions.GetAccountListAction gpla = new Actions.GetAccountListAction();
            ActionTimer.get().addAction(gpla);

            while (!gpla.IsFinished)
            {
                Thread.Sleep(50);
            }



            sb.AppendLine("<h2>Accounts</h2>");
            sb.AppendLine("\t\t<div class=\"content\">");
            sb.AppendLine("\t\t\t<table>");

            foreach (Actions.GetAccountListAction.Account acc in gpla.List)
            {
                sb.AppendLine("\t\t\t\t<tr>");
                sb.AppendLine("\t\t\t\t\t<td>");
                sb.AppendLine("\t\t\t\t\t\t" + acc.accountID);
                sb.AppendLine("\t\t\t\t\t</td>");
                sb.AppendLine("\t\t\t\t\t<td>");
                sb.AppendLine("\t\t\t\t\t\t" + acc.name);
                sb.AppendLine("\t\t\t\t\t</td>");
                if (permissions.HasFlag(Permissions.Accounts_EDIT))
                {
                    sb.AppendLine("\t\t\t\t\t<td>");
                    sb.AppendLine("\t\t\t\t\t\t" + "<a href=\"#\" >[Bearbeiten]</a>");
                    sb.AppendLine("\t\t\t\t\t</td>");
                }
                if (permissions.HasFlag(Permissions.Accounts_Log))
                {
                    sb.AppendLine("\t\t\t\t\t<td>");
                    sb.AppendLine("\t\t\t\t\t\t" + "<a href=\"accounts_Log.html?accID=" + acc.accountID + "\" >[Logs]</a>");
                    sb.AppendLine("\t\t\t\t\t</td>");
                }
                if (permissions.HasFlag(Permissions.Accounts_Delete))
                {
                    sb.AppendLine("\t\t\t\t\t<td>");
                    sb.AppendLine("\t\t\t\t\t\t" + "<a href=\"#\" >[Löschen]</a>");
                    sb.AppendLine("\t\t\t\t\t</td>");
                }
                if (permissions.HasFlag(Permissions.Accounts_Active))
                {
                    sb.AppendLine("\t\t\t\t\t<td>");
                    sb.AppendLine("\t\t\t\t\t\t" + "<a href=\"#\" >[Deaktivieren]</a>");
                    sb.AppendLine("\t\t\t\t\t</td>");
                }
                sb.AppendLine("\t\t\t\t</tr>");
            }

            sb.AppendLine("\t\t\t</table>");
            sb.AppendLine("\t\t</div>");


            return(true);
        }