Register for your free account! | Forgot your password?

You last visited: Today at 12:15

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


[Question] Saving Items

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2006
Posts: 129
Received Thanks: 15
[Question] Saving Items

Hello.
I'm using my source with .ini files
I would like to know what is the best between
Saving all items in only 1 folder where all items are into
Exemple of a item file:
Quote:
OwnerID=10000001
Location=0
ItemUID=123456789
ItemID=410339
Plus=12
Bless=7
Enchant=255
Soc1=13
Soc2=13
Dura=40
MaxDura=40
or making a folder for Inventory, Equipements, Whs ... wich define item UID when loading ...
Exemple of a Character's Inventory file:
Quote:
[Inventory]
Count=2
0=410339 12 7 255 13 13
1=480339 12 7 255 13 13
So what could be the best solution?
"I know that using MySql is faster, but I'm making with IniFile atm"



Kital82 is offline  
Old 08/09/2009, 17:31   #2
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 995
I'd probably go for this if I was using Inis. I'd be using the account to identifier which inventory file belongs to whom. So something like I've demonstrated below.

Code:
[Inventory]
Count=2
Item0=410339 12 7 255 13 13
Item1=480339 12 7 255 13 13

Code:
IniFile File = new IniFile(DatabasePath + "\\Inventories\\" + Client.Username + ".ini");
sbyte Count = File.ReadSByte("Inventory", "Count", -1);
if(Count == -1) { 
	// Whatever happens if there is no inventory yet, or for some reason it isn't possible to read the data.
}
for(sbyte i = 0; i < Count; i++) {
	ItemStructure Item = ItemStructure.Parse(File.ReadString("Inventory", "Item" + i, "0 0 0 0 0 0"));
	Client.Entity.Inventory.AddItem(Item);

}
Sorry about the length, got a little bit carried away, lol.


tanelipe is offline  
Reply



« tq biarys for 5065 | Request: +12 Moon Godess »

Similar Threads
Question. +1 items
11/07/2009 - CO2 Main - Discussions / Questions - 3 Replies
nvm
Question about items ids
10/23/2009 - CO2 Programming - 4 Replies
NVM
[Question]Saving Coordinates.
01/18/2009 - CO2 Programming - 2 Replies
My memory based archer bot is close to done, it can jump to a certain coordinate and scatter which are the most important things right now. Anyway, I'm trying to see what would be the best way to save specific coordinates to a file and then...
Prob with saving items
03/26/2007 - SRO Main - Discussions / Questions - 1 Replies
I&#39;ve changed the bot to save: weapons &#092; jewelry &#092; defense &#092; tablets &#092; elixirs And I allways find my char stuck at town with a full bag. It opens storage, but doesn&#39;t save those items. Do you know how to fix this?
Items ID question
01/15/2006 - WoW Main - Discussions / Questions - 2 Replies
Hi guys , i was wondering if there is a way to fake an iteam, i mean if is posible to write the iteam id or information on some file in your own wow directory, so when a GM check the iteam they see that you had it before. I know thats a server thing...



All times are GMT +2. The time now is 12:15.


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.