[5165] RollBacks

10/10/2010 18:12 †he Knight#1
5165/Tanel's ... Problem "RollBacks"
Anybody has a fix for this?
If he does , I Promisse its my last request/begging. :D :D
10/10/2010 19:18 Arcо#2
Switch my MySQL, nuff said.
10/10/2010 19:23 _tao4229_#3
Quote:
Originally Posted by Аrco View Post
Switch my MySQL, nuff said.
That has nothing to do with it.
10/10/2010 19:25 Arcо#4
Darn right it doesn't, but it helps a whole lot. With the current character system, you can't update a single line in the file. With mysql, at least you can update the table EVERYtime a change is made.
10/10/2010 19:56 _tao4229_#5
You don't need to for either system (it's possible to modify a single value in a binary file - that's what SQL does anyways); you really shouldn't to start with.

It's redundant, all you need is proper disconnection handling.
10/10/2010 20:22 Arcо#6
Quote:
Originally Posted by _tao4229_ View Post
it's possible to modify a single value in a binary file
How does one do that aye?
10/10/2010 20:28 †he Knight#7
oO , How Can I Switch to mysql lmao?
10/10/2010 20:33 Arcо#8
I recommend you to use Immune's MySQL Wrapper. If not that, then use Impulse's.
Both can be found in the corresponding sources.
10/10/2010 20:49 †he Knight#9
Yes but my server is 25 rank at xtremetop ... too many characters, going to be a big loss
10/10/2010 21:09 Arcо#10
Just make all the characters dump from the .chr file to mysql.
10/10/2010 21:17 _tao4229_#11
Quote:
Originally Posted by Аrco View Post
How does one do that aye?
Code:
FILE* file = fopen(fname, "rb+");

fseek(file, FIELD_OFFSET, SEEK_SET);

fwrite(&value, 1, sizeof(value), file);

fclose(file);
While this is obviously inefficient (due to having to reopen files constantly) it's possible.
10/10/2010 21:22 Arcо#12
Quote:
Originally Posted by _tao4229_ View Post
Code:
FILE* file = fopen(fname, "rb+");

fseek(file, FIELD_OFFSET, SEEK_SET);

fwrite(&value, 1, sizeof(value), file);

fclose(file);
While this is obviously inefficient (due to having to reopen files constantly) it's possible.
You do realize, this is for a source written in c# right?
10/10/2010 21:29 _tao4229_#13
Sigh, it's the same thing. You can open a binary file with read+ (read/write privileges which do not start you with a blank file) privileges and then seek to whatever offset you want. The only factor that would be a problem is fields with dynamic length (how write/reading a string from a BinaryReader/Writer does), so you'd have to take into account the lengths of those fields in order to seek past them (or obviously switch to fixed length fields).

Code:
// using System.IO;

FileStream fs = new FileStream("c:\\file.bin", FileMode.Open, FileAccess.ReadWrite);
BinaryWriter wrtr = new BinaryWriter(fs, Encoding.ASCII);

wrtr.BaseStream.Seek(OFFSET, SeekOrigin.Begin);
wrtr.Write(value);

wrtr.Close();
10/10/2010 21:42 †he Knight#14
Too dumb to understand this...
#request close
10/11/2010 03:31 hunterman01#15
Quote:
Originally Posted by JuiceDCodeR View Post
Too dumb to understand this...
#request close
Its not that your dumb, its just the lack of learning