[HELP]Console

02/04/2010 02:14 Hanibal#1
I often get this error spamming my console, any ideas on what might be causing it or how to fix it.

[Only registered and activated users can see links. Click Here To Register...]
02/04/2010 03:55 hunterman01#2
Check database.cs line 1268 ......
02/04/2010 06:13 CIRASH#3
Go to C:\\PSERVER\users\Characters\TwinBladez.chr and delete it or something. it says its being used by another program or sumtin. I dont really know actually. Nevermind lol
02/04/2010 12:09 Hanibal#4
Quote:
Originally Posted by hunterman01 View Post
Check database.cs line 1268 ......
Ya that's the first thing I did and this is the line the error is reporting on.

Code:
FileStream FS = new FileStream(@"C:\PSERVER\Users\Characters\" + C.Name + ".chr", FileMode.Open);
And that's whats got me stumped, I can't quite figure out what it is referring to.
02/04/2010 12:25 pro4never#5
it's opening the file @ C:\PSERVER\Users\Characters\CharacterName.chr so it can update it.

If that path is invalid, there is something wrong with the file in question, it's in use or anything similar you will get the error you are experiencing.
02/04/2010 13:39 Korvacs#6
Adding to what pro4never said, if it happens alot to various characters then the server is opening a file in order to update it and failing to close it, and then trying to open it again to update it again, which will cause that exception.
02/04/2010 15:07 -impulse-#7
A simple fix for save would be probably, creating the buffer with the data inside it, then open the file, save the buffer, close the file... it will be a lot faster and probably wouldn't error that much, and for loading, you can use byte[] buffer = File.ReadAllBytes(path); BinaryReader r = new BinaryReader(new MemoryStream(buffer));
02/09/2010 01:11 salem rey#8
-impulse- How can we do it? anyone know it? where to put the code for fixing this?
please I'm a new don't know how to code it please?