Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Database/World Building

Development::Database/World Building World Building forum, dedicated to the EQEmu MySQL Database. Post partial/complete databases for spawns, items, etc.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 09-08-2006, 11:56 PM
eq4me
Hill Giant
 
Join Date: Jul 2006
Posts: 166
Default

Please bear with me if the below is a bit vague and filled with lots of assumptions. I am occupied with other stuff right now and I am just feeling my way back in C programming after 8 years of doing other things.
My assumption is that right now the size of the shared memory is set by the number of table entrys. That means even if 90% of the table entrys are empty it will still be reserved in memory.
There could be multiple ways to redeem that.

First you could use the c++ function map(), according to a C++ crack I know that might be not a good idea to do in a shared memory segment.

Here a small scrap of code :
Code:
#include <map>

main()
{
    typedef map<int, double> id_map;
    id_map foo;

    foo[17] = 3.5;

    foo[19] = 7;

    ++foo[17];


    for (id_map::iterator i = foo.begin(); i != foo.end(); ++i
    {
        int idx = i->first;
        double val = i->second;
    }

    id_map::iterator i = foo.find(5);
    if (i != foo.end())
        foo.erase(i)
}
The second possiblity could be to do a double pointer. For each table entry generate a pointer that points to the actual data entry. On default this is set to void. So only if the mysql table entry holds data you need to allocate memory. (Sorry for being very vage here but our resident C expert didnt had much time and just outlined it briefly - to brief for me to understand propperly. )


The third possibility would be to allow multipe tables.

Lets take the items table for an example.

items (the one we have right now = default, so its either peq or cavedudes db)
items.ax (angelox db additions)
items.custom (local customized stuff)

The big advantage would be that these tables can grow without interfering with each other.
The problem here would be how to allow eg. the items.ax table to override stuff in the items table. Maybe an additional table entry which holds the id number and table name for the entry you want to override would do the trick.

like

Code:
CREATE TABLE items.ax (
  id int(11) NOT NULL default '0',
  overridetable  varchar(64) NOT NULL default '',
  overrideid int(11) NOT NULL default '0',
  overrideprority int(11) NOT NULL default '0',
The field overridepriority would eg. allow for local customizations that build on more than one table.

Well, enough of my ramblings. Maybe someone with more knowledge about the inner workings of EQEmu can comment on this.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:21 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3