Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 17:55

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

Advertisement



[Question] Saving Items

Discussion on [Question] Saving Items within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
Kital82's Avatar
 
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: 1,000
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


Similar Threads Similar Threads
Question. +1 items
11/07/2009 - Conquer Online 2 - 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 ofcourse read them. (See it as setting a path to follow) It also has to allow other users to manipulate them to their likings, wich can be shared etc.. etc.. Now for my question, how should i approach this? Or better yet what would be my best bet and...
Prob with saving items
03/26/2007 - Silkroad Online - 1 Replies
I'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't save those items. Do you know how to fix this?
Items ID question
01/15/2006 - World of Warcraft - 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 but its must be an information file in your wow directory that confirm that you have created,buyit,looted..... that iteam, righ? well if some one can help me with a clue or simple clear my noob question , i will be very gratefull, thx all. ...



All times are GMT +2. The time now is 17:55.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.