Register for your free account! | Forgot your password?

You last visited: Today at 14:52

  • Please register to post and access all features, it's quick, easy and FREE!


[Help!!]PServer Coding

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2009
Posts: 361
Received Thanks: 98
[Help!!]PServer Coding

I've noticed that ALL of the cases in the code below are underlined in red. I have no clue why they're underlined because the code seems 100% fine to me. Its extremely annoying as I've been looking over it again and again and find no reasons as to why they are underlined. I've tampered with things and moved things but nothing works. Would someone be so kind as to see if they can give me a reason why this is happening. *Every case you will see below is underlined on my Visual C# program as well as the "}" bracket before the new case.

Code:
              }
                    case 1010:
                        {
                            PacketType = Data[22];

                            switch (PacketType)
                            {
                                case 120:
                                    {
                                        if (MyChar.Flying)
                                        {
                                            MyChar.Flying = false;
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
                                        }
                                        break;
                                    }
                                case 99:
                                    {
                                        if (MyChar.LocMap == 1028)
                                            MyChar.Mining = true;
                                        break;
                                    }
                                case 54:
                                    {
                                        uint VUID = (uint)((Data[15] << 24) + (Data[14] << 16) + (Data[13] << 8) + Data[12]);
                                        Character ViewedChar = (Character)World.AllChars[VUID];
                                        break;
                                    }
                                case 140:
                                    {
                                        uint UID = BitConverter.ToUInt32(Data, 12);
                                        Character Char = (Character)World.AllChars[UID];
                                        if (Char != null)
                                            SendPacket(General.MyPackets.FriendEnemyInfoPacket(Char, 0));
                                        break;
                                    }
                                case 94:
                                    {
                                        MyChar.Revive(true);
                                        MyChar.Stamina = 100;
                                        break;
                                    }
                                case 117:
                                    {
                                        MyChar.Ready = false;
                                        int Value1 = (Data[7] << 24) + (Data[6] << 16) + (Data[5] << 8) + Data[4];
                                        uint CharID = (uint)((Data[11] << 24) + (Data[10] << 16) + (Data[9] << 8) + Data[8]);
                                        uint VUID = (uint)((Data[15] << 24) + (Data[14] << 16) + (Data[13] << 8) + Data[12]);

                                        Character ViewedChar = (Character)World.AllChars[VUID];
                                        string[] Splitter;
                                        SendPacket(General.MyPackets.ViewEquip(ViewedChar));

                                        if (ViewedChar.Equips[1] != null && ViewedChar.Equips[1] != "0")
                                        {
                                            Splitter = ViewedChar.Equips[1].Split('-');
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, uint.Parse(Splitter[0]), byte.Parse(Splitter[1]), byte.Parse(Splitter[2]), byte.Parse(Splitter[3]), byte.Parse(Splitter[4]), byte.Parse(Splitter[5]), 1, 100, 100));
                                        }
                                        else
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, 0, 0, 0, 0, 0, 0, 1, 0, 0));

                                        if (ViewedChar.Equips[2] != null && ViewedChar.Equips[2] != "0")
                                        {
                                            Splitter = ViewedChar.Equips[2].Split('-');
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, uint.Parse(Splitter[0]), byte.Parse(Splitter[1]), byte.Parse(Splitter[2]), byte.Parse(Splitter[3]), byte.Parse(Splitter[4]), byte.Parse(Splitter[5]), 2, 100, 100));
                                        }
                                        else
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, 0, 0, 0, 0, 0, 0, 2, 0, 0));

                                        if (ViewedChar.Equips[3] != null && ViewedChar.Equips[3] != "0")
                                        {
                                            Splitter = ViewedChar.Equips[3].Split('-');
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, uint.Parse(Splitter[0]), byte.Parse(Splitter[1]), byte.Parse(Splitter[2]), byte.Parse(Splitter[3]), byte.Parse(Splitter[4]), byte.Parse(Splitter[5]), 3, 100, 100));
                                        }
                                        else
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, 0, 0, 0, 0, 0, 0, 3, 0, 0));

                                        if (ViewedChar.Equips[4] != null && ViewedChar.Equips[4] != "0")
                                        {
                                            Splitter = ViewedChar.Equips[4].Split('-');
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, uint.Parse(Splitter[0]), byte.Parse(Splitter[1]), byte.Parse(Splitter[2]), byte.Parse(Splitter[3]), byte.Parse(Splitter[4]), byte.Parse(Splitter[5]), 4, 100, 100));
                                        }
                                        else
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, 0, 0, 0, 0, 0, 0, 4, 0, 0));
                                        if (ViewedChar.Equips[5] != null && ViewedChar.Equips[5] != "0")
                                        {
                                            Splitter = ViewedChar.Equips[5].Split('-');
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, uint.Parse(Splitter[0]), byte.Parse(Splitter[1]), byte.Parse(Splitter[2]), byte.Parse(Splitter[3]), byte.Parse(Splitter[4]), byte.Parse(Splitter[5]), 5, 100, 100));
                                        }
                                        else
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, 0, 0, 0, 0, 0, 0, 5, 0, 0));

                                        if (ViewedChar.Equips[6] != null && ViewedChar.Equips[6] != "0")
                                        {
                                            Splitter = ViewedChar.Equips[6].Split('-');
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, uint.Parse(Splitter[0]), byte.Parse(Splitter[1]), byte.Parse(Splitter[2]), byte.Parse(Splitter[3]), byte.Parse(Splitter[4]), byte.Parse(Splitter[5]), 6, 100, 100));
                                        }
                                        else
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, 0, 0, 0, 0, 0, 0, 6, 0, 0));

                                        if (ViewedChar.Equips[7] != null && ViewedChar.Equips[7] != "0")
                                        {
                                            Splitter = ViewedChar.Equips[7].Split('-');
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, uint.Parse(Splitter[0]), byte.Parse(Splitter[1]), byte.Parse(Splitter[2]), byte.Parse(Splitter[3]), byte.Parse(Splitter[4]), byte.Parse(Splitter[5]), 7, 100, 100));
                                        }
                                        else
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, 0, 0, 0, 0, 0, 0, 7, 0, 0));

                                        if (ViewedChar.Equips[8] != null && ViewedChar.Equips[8] != "0")
                                        {
                                            Splitter = ViewedChar.Equips[8].Split('-');
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, uint.Parse(Splitter[0]), byte.Parse(Splitter[1]), byte.Parse(Splitter[2]), byte.Parse(Splitter[3]), byte.Parse(Splitter[4]), byte.Parse(Splitter[5]), 8, 100, 100));
                                        }
                                        else
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, 0, 0, 0, 0, 0, 0, 8, 0, 0));

                                        if (ViewedChar.Equips[9] != null && ViewedChar.Equips[9] != "0")
                                        {
                                            Splitter = ViewedChar.Equips[9].Split('-');
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, uint.Parse(Splitter[0]), byte.Parse(Splitter[1]), byte.Parse(Splitter[2]), byte.Parse(Splitter[3]), byte.Parse(Splitter[4]), byte.Parse(Splitter[5]), 9, 100, 100));
                                        }
                                        else
                                            SendPacket(General.MyPackets.ViewEquipAdd(VUID, 0, 0, 0, 0, 0, 0, 9, 0, 0));


                                        MyChar.Ready = true;
                                        break;
                                    }
                                case 142:
                                    {
                                        MyChar.Ready = false;
                                        SendPacket(Data);
                                        uint Face = Data[12];

                                        if (Face > 200)
                                            Face -= 200;

                                        uint Multiply = (uint)(Data[13] * 56);
                                        Face += Multiply;

                                        MyChar.Avatar = (byte)Face;
                                        MyChar.Silvers -= 500;

                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));

                                        World.UpdateSpawn(MyChar);
                                        MyChar.Ready = true;
                                        break;
                                    }
                                case 133:
                                    {
                                        if (MyChar.Mining)
                                            MyChar.Mining = false;

                                        SendPacket(Data);
                                        short PrevX = (short)((Data[0x11] << 8) + Data[0x10]);
                                        short PrevY = (short)((Data[0x13] << 8) + Data[0x12]);
                                        short NewX = (short)((Data[0xd] << 8) + Data[0xc]);
                                        short NewY = (short)((Data[0xf] << 8) + Data[0xe]);

                                        MyChar.Attacking = false;
                                        MyChar.TargetUID = 0;
                                        MyChar.MobTarget = null;
                                        MyChar.TGTarget = null;
                                        MyChar.PTarget = null;
                                        MyChar.SkillLooping = 0;
                                        MyChar.AtkType = 0;
                                        MyChar.PrevX = MyChar.LocX;
                                        MyChar.PrevY = MyChar.LocY;
                                        MyChar.LocX = (ushort)NewX;
                                        MyChar.LocY = (ushort)NewY;
                                        MyChar.Action = 100;

                                        World.SpawnMeToOthers(MyChar, true);
                                        World.SpawnOthersToMe(MyChar, true);
                                        World.PlayerMoves(MyChar, Data);
                                        World.SurroundNPCs(MyChar, true);
                                        World.SurroundMobs(MyChar, true);
                                        World.SurroundDroppedItems(MyChar, true);

                                        break;
                                    }
                                case 74:
                                    {
                                        if (There)
                                            return;
                                        if (MyChar == null)
                                            return;

                                        SendPacket(General.MyPackets.PlacePacket1(MyChar));
                                        SendPacket(General.MyPackets.PlacePacket2(MyChar));
                                        SendPacket(General.MyPackets.PlacePacket3(MyChar));
                                        SendPacket(General.MyPackets.LogonPacket());
                                        SendPacket(General.MyPackets.ShowMinimap(true));
                                        SendPacket(General.MyPackets.GeneralData((long)(MyChar.UID), 3, 0, 0, 96));

                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
                                        MyChar.StartXPCircle();

                                        MyChar.PKMode = 3;

                                        World.SpawnMeToOthers(MyChar, false);
                                        World.SpawnOthersToMe(MyChar, false);
                                        World.SurroundNPCs(MyChar, false);
                                        World.SurroundMobs(MyChar, false);
                                        World.SurroundDroppedItems(MyChar, false);
                                        MyChar.UnPackInventory();
                                        MyChar.SendInventory();
                                        MyChar.UnPackEquips();
                                        MyChar.SendEquips(true);
                                        MyChar.UnPackSkills();
                                        MyChar.SendSkills();
                                        MyChar.UnPackProfs();
                                        MyChar.SendProfs();
                                        MyChar.UnPackWarehouses();
                                        MyChar.UnPackEnemies();
                                        MyChar.UnPackFriends();
                                        Status = DataBase.GetStatus(Account);

                                        foreach (DictionaryEntry DE in Guilds.AllGuilds)
                                        {
                                            Guild AGuild = (Guild)DE.Value;
                                            SendPacket(General.MyPackets.GuildName(AGuild.GuildID, AGuild.GuildName));
                                        }
                                        if (MyChar.MyGuild != null)
                                        {
                                            SendPacket(General.MyPackets.GuildInfo(MyChar.MyGuild, MyChar));
                                            SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, MyChar.MyGuild.Bulletin, 2111));
                                            SendPacket(General.MyPackets.GuildName(MyChar.GuildID, MyChar.MyGuild.GuildName));
                                            SendPacket(General.MyPackets.GeneralData(MyChar.UID, 0, 0, 0, 97));
                                        }

                                        if (MyChar.RBCount > 1)
                                            SendPacket(General.MyPackets.String(MyChar.UID, 10, "2NDMetempsychosis"));
                                        
                                        if (MyChar.WhichBless > 0)
                                        {
                                            SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Heaven's Blessing will end on: " + MyChar.HBEnd2.ToString(), 2011));
                                            MyChar.Blessed = true;
                                            MyChar.HBEnd = DateTime.Parse(MyChar.HBEnd2);
                                            SendPacket(General.MyPackets.String(MyChar.UID, 10, "zf2-e128"));
                                            if (MyChar.WhichBless == 1)
                                                SendPacket(General.MyPackets.Vital(MyChar.UID, 18, (3 * 24 * 60 * 60)));
                                            if (MyChar.WhichBless == 2)
                                                SendPacket(General.MyPackets.Vital(MyChar.UID, 18, (7 * 24 * 60 * 60)));
                                            if (MyChar.WhichBless == 3)
                                                SendPacket(General.MyPackets.Vital(MyChar.UID, 18, (30 * 24 * 60 * 60)));
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
                                            World.UpdateSpawn(MyChar);
                                        }

                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Welcome to PyroCo!", 2000));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "This server is in it's testing stage.", 2000));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "The real playing starts after all bugs have been removed and the rest of the things implemented.", 2000));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Report ANY bugs you find in the Chatbox!", 2000));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Botters beware! Zero tolerance.", 2000));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Exp Rate: " + DataBase.ExpRate + "x", 2000));
                                        SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Players Online: " + World.AllChars.Count, 2005));
                                        SendPacket(General.MyPackets.GeneralData(MyChar.UID, 0, 0, 0, 75));
                                        There = true;

                                        break;
                                    }
                                case 96:
                                    {
                                        MyChar.Ready = false;
                                        SendPacket(General.MyPackets.GeneralData((long)(MyChar.UID), Data[12], 0, 0, 96));
                                        MyChar.PKMode = Data[12];
                                        MyChar.Ready = true;
                                        break;
                                    }
                                case 79:
                                    {
                                        MyChar.Ready = false;
                                        MyChar.Direction = Data[20];
                                        World.PlayerMoves(MyChar, Data);
                                        MyChar.Ready = true;
                                        break;
                                    }
                                case 81:
                                    {
                                        MyChar.Ready = false;
                                        MyChar.Action = Data[12];
                                        World.PlayerMoves(MyChar, Data);
                                        MyChar.Ready = true;
                                        break;
                                    }
                                case 85:
                                    {
                                        MyChar.Ready = false;
                                        ulong CharID = (ulong)((Data[11] << 24) + (Data[10] << 16) + (Data[9] << 8) + (Data[8]));
                                        int x = (Data[13] << 8) + (Data[12]);
                                        int y = (Data[15] << 8) + (Data[14]);

                                        if (MyChar.UID == CharID)
                                            MyChar.UsePortal();
                                        MyChar.Ready = true;
                                        break;
                                    }
                            }

                            break;
                        }
                    case 1001:
                        {
                            uint Model = 0;
                            uint Avatar = 0;
                            byte Class = 0;
                            string CharName = "";
                            bool ValidName = true;

                            Model = (uint)Data[0x35];
                            Model = (Model << 8) | (uint)(Data[0x34]);

                            Class = Data[0x36];

                            int x = 0x14;
                            while (x < 0x24 && Data[x] != 0x00)
                            {
                                CharName += Convert.ToChar(Data[x]);
                                x++;
                            }
                            if (Model == 1003)
                                Avatar = 67;
                            else if (Model == 1004)
                                Avatar = 67;
                            else if (Model == 2001)
                                Avatar = 201;
                            else if (Model == 2002)
                                Avatar = 201;

                            if (CharName.IndexOfAny(new char[3] { ' ', '[', ']' }) > -1)
                            {
                                ValidName = false;
                            }

                            foreach (string name in DataBase.ForbiddenNames)
                            {
                                if (name == CharName)
                                {
                                    ValidName = false;
                                    break;
                                }
                            }

                            try
                            {
                                if (ValidName)
                                {
                                    bool Success = DataBase.CreateCharacter(CharName, Class, Model, Avatar, this);
                                    if (Success)
                                        Console.WriteLine("New character: " + CharName);
                                    Online = false;
                                    MySocket.Disconnect();
                                }
                                else
                                {
                                    Online = false;
                                    MySocket.Disconnect();
                                }
                            }
                            catch (Exception Exc) { General.WriteLine(Exc.ToString()); }


                            break;
                        }
                }
            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }
        void GuildWarStop5min_Elapsed(object sender, ElapsedEventArgs e)
        {
            GuildWarStop5min.Stop();
            World.SendMsgToAll("Guild War will end in 5 minutes", "SYSTEM", 2011);
            GuildWarStop5min.Enabled = false;

            GuildWarStop4min.Interval = 60000;
            GuildWarStop4min.Elapsed += new ElapsedEventHandler(GuildWarStop4min_Elapsed);
            GuildWarStop4min.Start();
        }

        void GuildWarStop4min_Elapsed(object sender, ElapsedEventArgs e)
        {
            GuildWarStop4min.Stop();
            World.SendMsgToAll("Guild War will end in 4 minutes", "SYSTEM", 2011);
            GuildWarStop4min.Enabled = false;

            GuildWarStop3min.Interval = 60000;
            GuildWarStop3min.Elapsed += new ElapsedEventHandler(GuildWarStop3min_Elapsed);
            GuildWarStop3min.Start();
        }

        void GuildWarStop3min_Elapsed(object sender, ElapsedEventArgs e)
        {
            GuildWarStop3min.Stop();
            World.SendMsgToAll("Guild War will end in 3 minutes", "SYSTEM", 2011);
            GuildWarStop3min.Enabled = false;

            GuildWarStop2min.Interval = 60000;
            GuildWarStop2min.Elapsed += new ElapsedEventHandler(GuildWarStop2min_Elapsed);
            GuildWarStop2min.Start();
        }

        void GuildWarStop2min_Elapsed(object sender, ElapsedEventArgs e)
        {
            GuildWarStop2min.Stop();
            World.SendMsgToAll("Guild War will end in 2 minutes", "SYSTEM", 2011);
            GuildWarStop2min.Enabled = false;

            GuildWarStop1min.Interval = 60000;
            GuildWarStop1min.Elapsed += new ElapsedEventHandler(GuildWarStop1min_Elapsed);
            GuildWarStop1min.Start();
        }

        void GuildWarStop1min_Elapsed(object sender, ElapsedEventArgs e)
        {
            GuildWarStop1min.Stop();
            World.SendMsgToAll("Guild War will end in 1 minute", "SYSTEM", 2011);
            GuildWarStop1min.Enabled = false;

            GuildWarStop30sec.Interval = 30000;
            GuildWarStop30sec.Elapsed += new ElapsedEventHandler(GuildWarStop30sec_Elapsed);
            GuildWarStop30sec.Start();
        }

        void GuildWarStop30sec_Elapsed(object sender, ElapsedEventArgs e)
        {
            GuildWarStop30sec.Stop();
            World.SendMsgToAll("Guild War will end in 30 seconds", "SYSTEM", 2011);
            GuildWarStop30sec.Enabled = false;
        }

        void GuildWarStop_Elapsed(object sender, ElapsedEventArgs e)
        {
            GuildWarStop.Stop();
            GuildWarStart.Enabled = false;
            General.ServerRestart();
        }


        public void SendPacket(byte[] Dat)
        {
            try
            {
                if (ListenSock != null)
                    if (ListenSock.WinSock.Connected)
                    {
                        int Len = Dat[0] + (Dat[1] << 8);
                        if (Dat.Length != Len)
                            return;

                        System.Threading.Monitor.TryEnter(this, new TimeSpan(0, 0, 0, 8, 0));

                        byte[] Data = new byte[Dat.Length];
                        Dat.CopyTo(Data, 0);

                        Crypto.Encrypt(ref Data);
                        ListenSock.WinSock.Send(Data);

                        System.Threading.Monitor.Exit(this);
                    }
            }
            catch { }
        }

        public void Drop()
        {
            try
            {
                if (Online)
                {
                    DataBase.ChangeOnlineStatus(Account, 0);             

                    if (MyChar != null)
                    {
                        World.RemoveEntity(MyChar);
                        if (MyChar.TheTimer != null)
                        {
                            MyChar.TheTimer.Stop();
                            MyChar.TheTimer.Dispose();
                            MyChar.TheTimer = null;
                        }
                        if (MyChar.LocMap == 700)
                        {
                            MyChar.CPs += 27;
                            SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                            MyChar.Teleport(1036, 200, 200);
                        }

                        foreach (DictionaryEntry DE in MyChar.Friends)
                        {
                            uint FriendID = (uint)DE.Key;
                            if (World.AllChars.Contains(FriendID))
                            {
                                Character Friend = (Character)World.AllChars[FriendID];
                                if (Friend != null)
                                {
                                    Friend.MyClient.SendPacket(General.MyPackets.FriendEnemyPacket(MyChar.UID, MyChar.Name, 14, 0));
                                    Friend.MyClient.SendPacket(General.MyPackets.FriendEnemyPacket(MyChar.UID, MyChar.Name, 15, 0));
                                    Friend.MyClient.SendPacket(General.MyPackets.SendMsg(Friend.MyClient.MessageId, "SYSTEM", Friend.Name, "Your friend " + MyChar.Name + " has logged out.", 2005));
                                }
                            }
                        }
                        DataBase.SaveChar(MyChar);
                        MyChar.Trading = false;
                        MyChar.TradingSilvers = 0;
                        MyChar.TradingCPs = 0;
                        MyChar.TradeOK = false;
                        MyChar.Trading = false;
                        MyChar.AtkType = 0;
                        MyChar.JoinForbidden = false;
                        MyChar.SkillLoopingTarget = 0;
                        MyChar.SkillLoopingX = 0;
                        MyChar.SkillLoopingY = 0;
                        MyChar.SkillLooping = 0;
                        MyChar.SMOn = false;
                        MyChar.CycloneOn = false;
                        MyChar.CastingPray = false;
                        MyChar.Inventory = new string[41];
                        MyChar.Equips = new string[10];
                        MyChar.TCWH = new string[20];
                        MyChar.PCWH = new string[20];
                        MyChar.ACWH = new string[20];
                        MyChar.DCWH = new string[20];
                        MyChar.BIWH = new string[20];
                        MyChar.MAWH = new string[40];
                        MyChar.Skills.Clear();
                        MyChar.Skill_Exps.Clear();
                        MyChar.Profs.Clear();
                        MyChar.Prof_Exps.Clear();
                        MyChar.Friends.Clear();
                        MyChar.Enemies.Clear();

                        if (MyChar.Trading)
                        {
                            Character Who = (Character)World.AllChars[MyChar.TradingWith];
                            Who.MyClient.SendPacket(General.MyPackets.TradePacket(MyChar.TradingWith, 5));
                            Who.TradingSilvers = 0;
                            Who.TradingCPs = 0;
                            Who.TradeOK = false;
                            Who.Trading = false;
                            MyChar.TradingWith = 0;
                            Who.MyClient.SendPacket(General.MyPackets.SendMsg(Who.MyClient.MessageId, "SYSTEM", Who.Name, "Trading failed!", 2005));
                        }

                        if (MyChar.TeamLeader)
                            MyChar.TeamDismiss();

                        if (MyChar.MyTeamLeader != null && !MyChar.TeamLeader)
                            MyChar.MyTeamLeader.TeamRemove(MyChar, false);
                        
                        try
                        {
                            if (World.AllChars.Contains(MyChar.UID))
                                World.AllChars.Remove(MyChar.UID);                          
                        }
                        catch (Exception Exc) { General.WriteLine(Exc.ToString()); }
                                                
                        MyChar = null;
                    }
                    ListenSock.WinSock.Close();
                    Online = false;
                    ListenSock = null;
                }
            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
        }        
    }
}



Jay1029 is offline  
Old 08/31/2009, 03:13   #2
 
elite*gold: 0
Join Date: Aug 2009
Posts: 919
Received Thanks: 442
you probably made a mistake somewhere else. ctrl + z until they return to normal. then do it again.


.Guru is offline  
Old 08/31/2009, 03:28   #3
 
elite*gold: 0
Join Date: Aug 2009
Posts: 47
Received Thanks: 3
Quote:
Originally Posted by Prot0type View Post
you probably made a mistake somewhere else. ctrl + z until they return to normal. then do it again.
Usually when I get that error it's because I didn't put in the last } or something in the npc I'm coding so you might want to look at that.
_xTreme_ is offline  
Old 08/31/2009, 03:51   #4
 
elite*gold: 0
Join Date: Aug 2009
Posts: 418
Received Thanks: 37
ya more than likely you forgot a bracket somewhere in there


Arco:) is offline  
Old 08/31/2009, 17:49   #5
 
elite*gold: 0
Join Date: Jun 2009
Posts: 361
Received Thanks: 98
That's what I was thinking but I can't find any missing brackets. And to make it worse I can't use ctrl+z because I noticed the errors yesterday afternoon when I opened the program, so it was already saved that way. I'll search through it once more, wish meh luck =p
Jay1029 is offline  
Old 09/01/2009, 03:06   #6
 
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
Quote:
}
}
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
}
void GuildWarStop5min_Elapsed(object sender, ElapsedEventArgs e)
i think those 3 brackets suppose to be 2


samehvan is offline  
Reply



« [HELP] CoEmuV2 Ip problem | Problem »



All times are GMT +2. The time now is 14:52.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.