5165 Console error.

02/27/2010 05:44 salem rey#1
How can i fix this 2 error spamming in my concole, server. anyonecan help me?


[Only registered and activated users can see links. Click Here To Register...]


Code:
                                                if (UsedItem.Plus > 0)
                                                    [COLOR="Red"]Points += Database.SocPlusExtra[UsedItem.Plus - 1];[/COLOR]

                                                if (UsedItem.FreeItem)
                                                    break;
the red is the line 600 in my packet handlers.


Code:
            try
            {
                [COLOR="Red"]FileStream FS = new FileStream(@"C:\OldCODB\Users\Characters\" + C.Name + ".chr", FileMode.Open);[/COLOR]
                BinaryWriter BW = new BinaryWriter(FS);

                int DoubleExp = C.DoubleExpLeft;
red is the line 1388 in my database.

PLEASE IF ANYONE KNOW HOW TO FIX THIS, PLEASE HELP.
02/27/2010 06:15 ImFlamedCOD#2
Well the Index of Packet Handler on line 600 was bigger than it was supposed to be. The part where people having to much cps that is a check in the server you need to Ctrl+F and search for "has suppsicualy much cps". As for the second error the file for the character ~CAREN~ is not available for access so either the file is not there or some of the code or database path is missing. Hopefully this helped if you need more help i will be glad to help. You just have to read the error and go to the line it tells you and see what error why and where

Edit the reason why you get the error in line 1388 is because that file is already in acess by another process. Did you have it open in notepad or some other program while running the serveR?

As for the first error on line 600 in the Packet Handler Points += Database.SocPlusExtra[UsedItem.Plus - 1];
The SocketPlusExtra[UsedItem.Plus - 1] , This part [UsedItem.Plus - 1] is the index that part is out side meaning bigger than the array can be so if SocketPlusExtra is a byte and the array is 256 it will give you that error becuase 256 is bigger than the var byte's max value.
02/27/2010 06:27 salem rey#3
SO what will i do? can you give me a guide? please
02/27/2010 07:12 .Ocularis#4
The error that says the file is in use by another process...
The process is your server.
The server is trying to write to the file while it's still writing to the file.
This cannot be fixed, I tried... And tried... Thread sleeps don't work... It can't be fixed.
the reason why being people can do this...
  • John opens client #1 and logs in
  • Jane opens client #2 and logs in
  • John opens client #3
  • John logs in to the same account logged in on client #1
When someone does this the server simply can't keep up.
No matter how awesome your computer is.
The logout-login is so fast...

When you see that error on your console the .chr file that is linked to that character is stuck open, putting it simply.
It puts the character into a rollback.
Allowing the player to dupe cps, items... anything in trade.
And no putting a save after trade for both sides won't work either, since the character is already in a rollback :)
This is why so many people on your server have massive amounts of cps.
Seriously.... Do you really think 'fredilo' really hunted 13 million cps?

This is an ongoing issue with EVERY 'NewestCOServer', excluding those who have switched to MySQL/MSSQL

The only solution is switching the server to MySQL.
You could just about copy the way Co Emu uses MySQL and port it to NCS.
But then you have the login freezes, which can be fixed with a... Ahem
System :)



And as for your error with line 600 in the packet handler...

Try replacing your entire case 35 with this

It's the packets dealing with talisman upgrades...
Not quite sure why that would be giving errors, unless someone is trying to use foreign objects in their talismans x)

I'm going to assume your Wuxing oven dupes +12 gears after a logout aswell?
02/27/2010 07:53 salem rey#5
ahh, about the packet handlers line 600, you are right someone what to put socket in talisman using +15 items and +12 itemss, so is there a way i can fix it? :D or the code you give me is the fix one? Please.
02/27/2010 07:58 .Ocularis#6
I'm looking now.
02/27/2010 08:01 salem rey#7
you want me to put the case 35 here? the full case?
02/27/2010 08:08 salem rey#8
Code:
[COLOR="Red"]                                    case 35:
                                        {
                                            uint UID1 = BitConverter.ToUInt32(Data, 8);
                                            uint UID2 = BitConverter.ToUInt32(Data, 4);
                                            Game.Item UsedItem = GC.MyChar.FindInvItem(UID1);
                                            byte Slot = GC.MyChar.Equips.GetSlot(UID2);
                                            Game.Item Talisman = GC.MyChar.Equips.Get(Slot);

                                            if (UsedItem.UID == UID1 && Talisman.UID == UID2 && UsedItem.ID != 0 && Talisman.ID != 0)
                                            {
                                                ushort Points = 0;
                                                Game.ItemIDManipulation I = new NewestCOServer.Game.ItemIDManipulation(UsedItem.ID);
                                                if (I.Quality == NewestCOServer.Game.Item.ItemQuality.Refined)
                                                    Points += 5;
                                                else if (I.Quality == NewestCOServer.Game.Item.ItemQuality.Unique)
                                                    Points += 10;
                                                else if (I.Quality == NewestCOServer.Game.Item.ItemQuality.Elite)
                                                    Points += 40;
                                                else if (I.Quality == NewestCOServer.Game.Item.ItemQuality.Super)
                                                    Points += 1000;

                                                if (UsedItem.Plus > 0)
                                                    [COLOR="DarkOrange"]Points += Database.SocPlusExtra[UsedItem.Plus - 1];[/COLOR]

                                                if (UsedItem.FreeItem)
                                                    break;
                                                if (UsedItem.ID / 1000 == Talisman.ID / 1000)
                                                    break;

                                                string Type = UsedItem.ID.ToString().Remove(2, UsedItem.ID.ToString().Length - 2);
                                                uint WeirdThing = Convert.ToUInt32(Type);

                                                if (WeirdThing <= 61 && WeirdThing >= 40)
                                                {
                                                    if (I.Quality == NewestCOServer.Game.Item.ItemQuality.Elite || I.Quality == NewestCOServer.Game.Item.ItemQuality.Super)
                                                    {
                                                        if ((byte)UsedItem.Soc1 != 0 && (byte)UsedItem.Soc2 == 0)
                                                            Points += 160;
                                                        if ((byte)UsedItem.Soc1 != 0 && (byte)UsedItem.Soc2 != 0)
                                                            Points += 960;
                                                    }
                                                }
                                                else
                                                {
                                                    if (I.Quality == NewestCOServer.Game.Item.ItemQuality.Elite || I.Quality == NewestCOServer.Game.Item.ItemQuality.Super)
                                                    {
                                                        if ((byte)UsedItem.Soc1 != 0 && (byte)UsedItem.Soc2 == 0)
                                                            Points += 2000;
                                                        if ((byte)UsedItem.Soc1 != 0 && (byte)UsedItem.Soc2 != 0)
                                                            Points += 8000;
                                                    }
                                                }

                                                Talisman.TalismanProgress += Points;
                                                if (Talisman.Soc1 == NewestCOServer.Game.Item.Gem.NoSocket && Talisman.TalismanProgress >= 8000)
                                                {
                                                    Talisman.Soc1 = NewestCOServer.Game.Item.Gem.EmptySocket;
                                                    Talisman.TalismanProgress -= 8000;
                                                }
                                                if (Talisman.Soc1 != NewestCOServer.Game.Item.Gem.NoSocket && Talisman.Soc2 == NewestCOServer.Game.Item.Gem.NoSocket && Talisman.TalismanProgress >= 20000)
                                                {
                                                    Talisman.Soc2 = NewestCOServer.Game.Item.Gem.EmptySocket;
                                                    Talisman.TalismanProgress = 0;
                                                }
                                                GC.MyChar.Equips.Replace(Slot, Talisman, GC.MyChar);
                                                GC.MyChar.RemoveItem(UsedItem);
                                            }
                                            break;
                                        }[/COLOR]
thanks all my case 35 in my packethandlers

orange color text is the line 600 in my packethandlers.
02/27/2010 08:13 .Ocularis#9
This best I can come up with, keep in mind this is untested.
But I'm pretty sure this will allow +13-+15 items to be used to increase socket progress.

Find this in Database.cs
Code:
public static ushort[] SocPlusExtra = new ushort[9] { 6, 30, 70, 240, 740, 2240, 6670, 20000, 60000 };
Change it to this.
Code:
public static ushort[] SocPlusExtra = new ushort[[COLOR="Red"]12[/COLOR]] { 6, 30, 70, 240, 740, 2240, 6670, 20000, 60000[COLOR="Red"], 60000, 60000, 60000 [/COLOR]};
You can edit the last 3 '60000's to what ever you want +13-+15 to give talismans for socket progress.
02/27/2010 08:21 salem rey#10
Ok ill try to see if this work, my server is still running atm. but i will try to make it off :D coz problem is poping out :D
and thanks :D

i will just tell you if that will work :D.
02/27/2010 08:52 .Ocularis#11
I'll have another look at things tomorrow.
I believe that should fix your problem, I don't see why it wouldn't.
Not having a value for the talisman socket system to use past +12 is what was making the error.

I'll test this on my own server tomorrow to look for problems, I need to sleep :S
02/27/2010 09:20 salem rey#12
ok :d you will help me and fix that problem :D