Register for your free account! | Forgot your password?

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

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

Advertisement



[Opinion] Loading user assigned items (inventory/equipments)

Discussion on [Opinion] Loading user assigned items (inventory/equipments) within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
[Opinion] Loading user assigned items (inventory/equipments)

So I'm using a SQL DataBase (MsSQL to be more specific) , and I can't really decide how I should load user assigned items, e.g. the inventory.
I could:
  • load all items at once and assign them to users when they log on
  • load them using a query which would only return items with a specific value as a owner
  • create one table per user, but this would affect organization
  • more ideas?
Basser is offline  
Old 03/27/2011, 12:51   #2
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
I'd say assign everything from outside. I'm loading items/nobility/spells etc separately, and assigning them to the character with the UID.
_Emme_ is offline  
Old 03/27/2011, 13:36   #3
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
But all in one table?
So load everything at once, and assign them later?
Basser is offline  
Old 03/27/2011, 13:56   #4
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,223
Received Thanks: 867
In the source i'm using,

All items in one table and set by UID,
ex:
[ITEMID][for character uid]

then when the character logs in the all the items in the table with the same UID are dished out.
_DreadNought_ is offline  
Old 03/27/2011, 14:00   #5
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Quote:
Originally Posted by Basser View Post
But all in one table?
So load everything at once, and assign them later?
Since you are using SQL you can do select * from table where UID = client.UID;
That would take only the rows that are assigned to the UID you want.
-impulse- is offline  
Old 03/27/2011, 14:42   #6
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
Quote:
Originally Posted by Basser View Post
But all in one table?
So load everything at once, and assign them later?
No, different tables. This will probably cause more loading time, but loading is only done at login (won't be noticeable), but will be more organized.

And as impulse said, at entity loading, just select the rows that have the UID of the entity you're loading, then read all the values.
_Emme_ is offline  
Old 03/27/2011, 17:08   #7
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
Quote:
Originally Posted by EmmeTheCoder View Post
No, different tables. This will probably cause more loading time, but loading is only done at login (won't be noticeable), but will be more organized.

And as impulse said, at entity loading, just select the rows that have the UID of the entity you're loading, then read all the values.
Than why create different tables lol?
Basser is offline  
Old 03/27/2011, 17:12   #8
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
As I said, more organized. This loading time will only differ a few milliseconds and it's during the login part, not game, so it won't be noticeable.
_Emme_ is offline  
Old 03/27/2011, 17:35   #9
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
Quote:
Originally Posted by EmmeTheCoder View Post
As I said, more organized. This loading time will only differ a few milliseconds and it's during the login part, not game, so it won't be noticeable.
How is it more organized to have multiple tables for the same thing? 1 table each character would make a big mess too.
Basser is offline  
Old 03/27/2011, 18:36   #10
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
There's a difference between table and column.

What I'm saying is that you'd create a table (note, table) for example, items. So you create an table called items, with columns (note, column) including the entity ID and the item information you want to load.

I'd suggest you do this for most of the stuff, for example skills.
_Emme_ is offline  
Old 03/27/2011, 19:05   #11


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,434
Received Thanks: 1,147
The only things I don't load in memory when I start the server are the characters and the accounts. The difference of memory usage is really not considerable and you don't have to load something more than one time...
CptSky is offline  
Thanks
1 User
Old 03/27/2011, 19:44   #12
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
Quote:
Originally Posted by EmmeTheCoder View Post
There's a difference between table and column.

What I'm saying is that you'd create a table (note, table) for example, items. So you create an table called items, with columns (note, column) including the entity ID and the item information you want to load.

I'd suggest you do this for most of the stuff, for example skills.
Exactly.
A column is only a part of a table.
A table is not a part of a column.
So why create multiple tables for items only?
Basser is offline  
Old 03/28/2011, 00:17   #13


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Quote:
Originally Posted by Basser View Post
Exactly.
A column is only a part of a table.
A table is not a part of a column.
So why create multiple tables for items only?
He never said create multiple tables just for items he meant, for all the things you need to load (items, skills, quests, etc) You create a table for each of these things (1 table for items, 1 for skills, 1 for quests) and then populate them accordingly.

Clear?
Korvacs is offline  
Old 03/28/2011, 01:38   #14
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
In your database have one table for player items, with a column with the owners UID.
When they login, query the table for every item who's owner UID is the same as the UID of the player logging in, and populate a dictionary for that player.
.Kinshi is offline  
Old 03/28/2011, 09:11   #15
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
As explained above, then in the source you query the table (a good sql wrapper is impulse's ).
_Emme_ is offline  
Reply


Similar Threads Similar Threads
[Question] delete Items from Inventory
08/12/2010 - EO PServer Hosting - 4 Replies
Perhaps it is rather a stupid question, but I ask anyway. Is there an Action Type ID what items will automatically delete after the maintenance? Or do I have to make that over a Query? And I could be whoever they happened to Action ID list post. Because I can not find here. The once forcer or funhacker created.
l2w ig items in inventory not showing.
04/11/2010 - Lin2 Exploits, Hacks, Bots, Tools & Macros - 2 Replies
Hi, I am having problems with my igw, i have the latest version, Oracles 2.17j, it works fine but I have a nig issue where inventory items are not showing correctly, as a result no consumables can be used also I cannot farm seeds. I can drop and pick up potions so they would work, but same trick didnt work for seeds, anyone else faced this problem and come across a solution? Thanks.
[Help] Loading items (Database.cs line 1210)
07/09/2009 - CO2 Private Server - 9 Replies
Ok this happened after not even touching Database.cs but adding a new health pot. But whenever i start the gameserver up (LOTF) it now says "Specified Cast is not valid" and then says "Database.cs:line 1210" And what is on that line: else if (Level == 89)//Line 1209 return 31033236;//Line 1210
Does anyone have the numbers assigned to specific monsters?
09/08/2008 - Dekaron - 3 Replies
I know that styx is 2251 from the vac hack tut. Does anyone have the new assignments of numbers to monsters? Also, does anyone know where I can find a list of the monsters updated in each of the crespo dungeons? thank you =)
Gems Assigned by Timing?
04/27/2006 - Conquer Online 2 - 12 Replies
Ok, heres food for thought. "Gems are determined by time of day" I present this idea based on the fact that i had 2 chars in independent mines mining and both got a gem at the exact same time (to the minute anyway) My flatmate also was mining in another mine and said he got one too when i whispered him minutes later. The Gems where all normal and for 3 players all to get gems at the same time i feel is a bit co-incidental. This idea could be plausable as say at 45min past the hour a...



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


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.