Beispiel #1
0
        private void getAction(Client c)
        {
            try
            {
                Thread threads = new Thread(delegate()
                {
                    if (c.clientStartAble)
                    {
                        if (c.clientMode == ClientMode.FMOWL)
                        {
                            try
                            {
                                string path = Path.Combine(Program.FMExport, c.owlWorldName, "Channel" + c.channel + ".txt");
                                if (File.Exists(path))
                                {
                                    using (FileStream stream = File.Open(path, FileMode.Open, FileAccess.ReadWrite))
                                    {
                                        stream.Close();
                                    }
                                }
                            }
                            catch (IOException)
                            {
                                Thread.Sleep(10);
                                getAction(c);
                            }
                        }
                        try
                        {
                            List <Thread> threadList = c.workerThreads.ToList <Thread>();
                            foreach (Thread t in threadList)
                            {
                                try
                                {
                                    t.Abort();
                                }
                                catch { }
                            }
                        }
                        catch
                        {
                            getAction(c);
                        }
                    }
                    try
                    {
                        if (c.clientStartAble & c.clientMode != ClientMode.DISCONNECTED)
                        {
                            Thread ts = new Thread(delegate()
                            {
                                if (c.clientMode == ClientMode.IDLE)
                                {
                                    c.cashShopManagement(false, false, 0, 0);
                                    c.onServerConnected(false);
                                }
                                else if (c.clientMode == ClientMode.MapleFarm)
                                {
                                    c.ExitFarm();
                                    c.onServerConnected(false);
                                }

                                /*if (c.clientMode == ClientMode.EXPLOIT)
                                 * {
                                 *  c.ses.SendPacket(PacketHandler.EXPLOIT_CLOSE(c).ToArray());
                                 *  c.cashShopManagement(false, false, 0, 0);
                                 *  c.onServerConnected();
                                 * }
                                 * */
                                else if (c.clientMode == ClientMode.FULLMAPPING_NP)
                                {
                                    c.cashShopManagement(false, false, 0, 0);
                                    c.updateAccountStatus("FullMapping @ CH" + c.channel.ToString() + " FM" + c.RoomNum + " via N.P.");
                                    c.onServerConnected(false);
                                }
                                else if (c.clientMode == ClientMode.SHOPAFKER)
                                {
                                    if (c.sent)
                                    {
                                        c.ses.SendPacket(PacketHandler.Close_Store().ToArray());
                                    }
                                    c.cashShopManagement(false, false, 0, 0);
                                    c.onServerConnected(true);
                                }
                                else if (c.clientMode == ClientMode.FMOWL)
                                {
                                    c.ses.SendPacket(PacketHandler.Close_Store().ToArray());
                                    c.cashShopManagement(false, false, 0, 0);
                                    c.onServerConnected(true);
                                }
                                else if (c.clientMode == ClientMode.PERMITUP || c.mode == 19)
                                {
                                    if (c.mode == 6)
                                    {
                                        c.mode = 5;
                                    }
                                    c.ses.SendPacket(PacketHandler.Close_Store().ToArray());
                                    c.cashShopManagement(false, false, 0, 0);
                                    c.onServerConnected(true);
                                }
                                else if (c.clientMode == ClientMode.LoginSpam && c.mode == 97)
                                {
                                    c.forceDisconnect(true, 1, false, "Login Spam Force DC");
                                    return;
                                }
                                else
                                {
                                    c.cashShopManagement(false, false, 0, 0);
                                    c.onServerConnected(false);
                                }
                            });
                            c.workerThreads.Add(ts);
                            ts.Start();
                        }
                    }
                    catch { }
                });
                threads.Start();
            }
            catch { }
        }