Beispiel #1
0
        static void OnAllLevelsLoad_SystemLvl(Level sender, API.Events.LevelLoadEventArgs args)
        {
            sender.PhysicsThread = new Thread(() => {
                while (!Server.ShuttingDown)
                {
                    Thread.Sleep(300);
                    sender.pblocks.ForEach((pb) => {
                        if (pb is Door)
                        {
                            if ((pb as Door).time >= 256)
                            {
                                toDelete.Add(pb);
                            }
                        }
                        pb.Tick(sender);
                    });

                    toDelete.ForEach(item => {
                        sender.pblocks.Remove(item);
                    });
                    toDelete.Clear();
                    Thread.Sleep(sender.PhysicsTick);
                }
            });
            sender.PhysicsThread.Start();
        }
 static void OnAllLevelsLoad_SystemLvl(Level sender, API.Events.LevelLoadEventArgs args)
 {
     sender.PhysicsThread = new Thread(() => {
         while (!Server.ShuttingDown)
         {
             sender.pblocks.ForEach((pb) => pb.Tick(sender));
             Thread.Sleep(sender.PhysicsTick);
         }
     });
     sender.PhysicsThread.Start();
 }
        void OnAllLevelsLoad_Normal(Level sender, API.Events.LevelLoadEventArgs args)
        {
            if (InvokeRequired)
            {
                BeginInvoke((MethodInvoker) delegate { OnAllLevelsLoad_Normal(sender, args); });
                return;
            }

            if (!lstLevels.Items.Contains(sender.Name))
            {
                lstLevels.Items.Add(sender.Name);
            }
        }
        void OnAllLevelsUnload_Normal(Level sender, API.Events.LevelLoadEventArgs args)
        {
            if (!lstUnloaded.Items.Contains(sender.Name))
            {
                lstUnloaded.Items.Add(sender.Name);
            }

            int index = GetRowIndexFromLevel(sender);

            if (index != -1)
            {
                dtaLoaded.Rows.RemoveAt(index);
            }
        }
 void OnAllLevelsLoadUnload_Normal(Level sender, API.Events.LevelLoadEventArgs args)
 {
     if (args.Loaded)
     {
         if (!BlockChangeHistory.Load(sender.Name))
         {
             BlockChangeHistory.SetLevel(sender.Name, (ushort)sender.CWMap.Size.x, (ushort)sender.CWMap.Size.z, (ushort)sender.CWMap.Size.y, sender.CWMap.BlockData);
         }
     }
     else
     {
         BlockChangeHistory.WriteOut(sender.Name, true);
     }
 }