Пример #1
0
 public ScriptObjContainer(NoxShared.Map.ScriptObject obj)
 {
     if (obj.NCObj.Length > 0)
     {
         br = new BinaryReader(new MemoryStream(obj.NCObj));
         ParseHeader();
         br.Close();
         br = null;
     }
     else
     {
         // Scripts were not included
         Functions = new List<ScriptObjContainer.ScriptFunction>(0);
         ScriptStringTable = new string[0];
     }
     scriptDecompiler = new Decompiler(this);
 }
Пример #2
0
        private void PlayerJoined(object sender, NoxShared.NoxMemoryHack.PlayerMemory.PlayerEventArgs e)
        {
            //this is necessary for thread safety, since background thread will call this
            if (InvokeRequired)
            {
                Invoke(new NoxMemoryHack.PlayerMemory.PlayerEvent(PlayerJoined),new object[] {sender, e});
                return;
            }

            AppConsole.WriteLine("{0} has joined the game.", e.Player.Name);
            if (e.Player.Unkickable)
            {
                AppConsole.WriteLine("{0} has an 'unkickable' name.", e.Player.Name);
                AppConsole.WriteLine("Fixing {0}'s 'unkickable' name.", e.Player.Name);
                NoxMemoryHack.Fixes.FixUnkickable(e.Player.Number);
            }
            if (e.Player.Login.Length > 9)
            {
                AppConsole.WriteLine("{0} has an fake login.", e.Player.Name);
                AppConsole.WriteLine("Kicking {0}", e.Player.Name);
                NoxMemoryHack.KickPlayer(e.Player.Number);
            }
            if (e.Player.Name.Contains("HurtsMore"))
            {
                AppConsole.WriteLine("{0} has an crash char.", e.Player.Name);
                AppConsole.WriteLine("Kicking {0}", e.Player.Name);
                NoxMemoryHack.KickPlayer(e.Player.Number);
            }
            // ADD A CLOTHING CHECK HERE

            Player orig = (Player) BannedPlayers[e.Player.Serial];
            if (AutoKickBanned && orig != null)
            {
                AppConsole.WriteLine("{0} was banned under the alias {1}, kicking...", e.Player.Name, orig.Name);
                NoxMemoryHack.KickPlayer(e.Player.Number);
            }
            else if (e.Player.Unkickable && AutoKickUnkickables)
            {
                    AppConsole.WriteLine("Autokicking {0} for 'unkickable' name.", e.Player.Name);
                    NoxMemoryHack.KickPlayer(e.Player.Number);
            }

            if (Created)
                dataTable.Rows.Add(new object[] {e.Player.Name, e.Player.Login, e.Player.Number});
        }
Пример #3
0
        private void PlayerLeft(object sender, NoxShared.NoxMemoryHack.PlayerMemory.PlayerEventArgs e)
        {
            //this is necessary for thread safety, since background thread will call this
            if (InvokeRequired)
            {
                Invoke(new NoxMemoryHack.PlayerMemory.PlayerEvent(PlayerLeft),new object[] {sender, e});
                return;
            }

            AppConsole.WriteLine("{0} has left the game.", e.Player.Name);
            if (Created)
                for (int ndx = 0; ndx < dataTable.Rows.Count; ndx++)
                    if ((int) ((DataRow) dataTable.Rows[ndx]).ItemArray[2] == e.Player.Number)//FIXME: hardcoded index
                    {
                        dataTable.Rows.RemoveAt(ndx);
                        break;//there should only be one, so we can quit looking now
                    }
        }
Пример #4
0
 public void UpdateForMap(NoxShared.Map map)
 {
     scriptContainer = new ScriptObjContainer(map.Scripts);
     UpdateFunctionsList();
     richTextBoxCode.SetScriptContainer(scriptContainer);
 }