Register for your free account! | Forgot your password?

You last visited: Today at 21:20

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

[Question] Saving Items

Discussion on [Question] Saving Items within the CO2 PServer - Discussions / Questions forum part of the Conquer Online 2 category.

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

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:
or making a folder for Inventory, Equipements, Whs ... wich define item UID when loading ...
Exemple of a Character's Inventory file:
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.

Item0=410339 12 7 255 13 13
Item1=480339 12 7 255 13 13

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"));

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

tanelipe is offline  

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

Similar Threads
Question. +1 items
11/07/2009 - CO2 Main - Discussions / Questions - 3 Replies
Question about items ids
10/23/2009 - CO2 Programming - 4 Replies
[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 - 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 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 +1. The time now is 21:20.

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

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