Register for your free account! | Forgot your password?

You last visited: Today at 21:00

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

 

rdb 8.2

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2012
Posts: 22
Received Thanks: 3
rdb 8.2

Hello what changes need to be used for the opening of the RDB

source code

db_summonrandomskill.rdb



teampan is offline  
Old   #2
 
elite*gold: 0
Join Date: Oct 2010
Posts: 2,557
Received Thanks: 2,411
[I]As many guides have stated in the past, rdb normally follow closely to their database (table) counter-part.

So as usual the first 128 bytes of data = date_modified, next 4 bytes = row_count, next 4 bytes = beginning of first row

after the first four bytes of the row (usually id field) you will need to read each column (data_type) in order.

For example:

db_questlink.rdb

date_modified = 128 Bytes [String]
row_count = 4 bytes [Int32]
quest_id = 4 bytes [Int32]
npc_id = 4 bytes [Int32]
flag_start = byte
flag_progress = byte
flag_end = byte

after the first row is read, it will just repeat in the same manner. So put your rdb editor on a read loop, like:

I wrote up an example program to demonstrate:

Main Program:

Code:
using System;
using System.ComponentModel;
using System.IO;
using System.Text;
using Gtk;

namespace test
{
	class MainClass
	{
		BindingList<db_questlink> db_questlinkinfo = new BindingList<db_questlink>();

		public string date_modified { get; set; }
		public Int32 row_count { get; set; }

		public static void Main (string[] args)
		{
			Application.Init ();
			MainWindow win = new MainWindow ();
			win.Show ();
			Application.Run ();
		}

		//Replace this with OpenFileDialog (This is just for demonstration)
		static string prog_dir = Directory.GetCurrentDirectory(); //This will load files from programs current directory
		static string file_dir = Path.Combine(prog_dir, "db_questlink.rdb");

		public void read_rdb()
		{ //F
			using(BinaryReader br = new BinaryReader(File.OpenRead(file_dir)))
			{
				//First as usual read the rdb header
				Byte[] in_date = br.ReadBytes(8);
				date_modified = BytesToString (in_date);
				row_count = br.ReadInt32();

				//Now we begin reading the actual info
				db_questlink questlink = new db_questlink();

				//While the Reader is Reading
				while (br.PeekChar () != -1) 
				{
					questlink.read_rdb(br);

					//If response is agreeable add his info to the bindinglist
					db_questlinkinfo.Add(questlink);

				}

			}
		}

		public static string BytesToString(byte[] b)
		{
			int num = 0;
			string str = "";
			for (int i = 0; i < (int)b.Length && b[i] > 0; i++)
			{
				num++;
			}
			byte[] numArray = new byte[num];
			for (int i = 0; i < num && b[i] > 0; i++) {
				numArray [i] = b [i];
			}

			str = Encoding.GetEncoding ("ASCII").GetString (numArray);

			return str;
		}

	}
}
[/i]


!!!NOTE: I use Linux natively so you should remove "Using Gtk" !!!

db_questlink.cs
Code:
using System;
using System.IO;

namespace test
{
	public class db_questlink
	{
		public Int32 quest_id { get; set; }
		public Int32 npc_id { get; set; }
		public Byte flag_start { get; set; }
		public Byte flag_progress { get; set; }
		public Byte flag_end { get; set; }

		public void read_rdb(BinaryReader br)
		{
			this.quest_id = br.ReadInt32();
			this.npc_id = br.ReadInt32();
			this.flag_start = br.ReadByte();
			this.flag_progress = br.ReadByte();
			this.flag_end = br.ReadByte();
		}
	}
}
It is also possible to figure out the structure without the help of it's database counter-part as a reference but very very hard. If you're going to attempt it I'd recommend using structorian.


ismokedrow is offline  
Old   #3
 
elite*gold: 0
Join Date: Apr 2012
Posts: 22
Received Thanks: 3
I already have a quest

I need db_summonRANDOMskill.rdb ))
teampan is offline  
Old   #4
 
elite*gold: 0
Join Date: Oct 2010
Posts: 2,557
Received Thanks: 2,411
I am going to avoid calling you several names as I don't want an infraction.

It was to teach your lazy ungrateful self how to build an rdb editor, duh.


ismokedrow is offline  
Old   #5
 
elite*gold: 0
Join Date: Apr 2012
Posts: 22
Received Thanks: 3
you have opened an item 8.3?

If you have Skype?


teampan is offline  
Reply



« Previous Thread | Next Thread »



All times are GMT +2. The time now is 21:00.


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

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