示例#1
0
        public void NT(Client client, Packet packet)
        {
            try
            {
                clientlist[IndexOfClient(client)].Msg();
            }
            catch
            {
                Console.WriteLine("An error happened so offing spam");
                try
                {
                    clientlist[IndexOfClient(client)].spamenabled = false;
                }
                catch { }
            }

            if (HelperHandler.enabled)
            {
                if (client.PlayerData.Name == clientlist[0].client.PlayerData.Name)
                {
                    //cancel out duplicates
                    if (tickno % 6 == 0)
                    {
                        try
                        {
                            foreach (var o in HelperHandler.olist)
                            {
                                o.Do();
                            }
                            foreach (var c in HelperHandler.clist)
                            {
                                c.Do();
                            }
                            //foreach (var s in HelperHandler.slist) s.Do();
                        }
                        catch { Console.WriteLine("Doing error!"); }
                    }
                }
            }

            if (client.PlayerData.Name == clientlist[0].client.PlayerData.Name)
            {
                if (tickno % 30 == 0)
                {
                    try
                    {
                        foreach (var item in new DirectoryInfo(SnapShotHandler.DataPath).GetFiles())
                        {
                            if (item.Name.StartsWith("AutosaveSnapshot-" + DateTime.Today.Year + "-" + DateTime.Today.Month + "-" + DateTime.Today.Day + "-"))
                            {
                                item.Delete();
                            }
                        }
                    }
                    catch { }
                    SnapShotHandler.Save("AutosaveSnapshot-");
                }

                tickno++;
            }
        }
示例#2
0
 private void button10_Click(object sender, EventArgs e)
 {
     SnapShotHandler.Save();
     MessageBox.Show("Saved!");
 }