mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Possibility drop (hide infact) records from DBStore/SQLStorage.
This commit is contained in:
parent
6610484609
commit
43cc07fbbc
3 changed files with 24 additions and 0 deletions
|
|
@ -83,6 +83,8 @@ class DBCStorage
|
|||
nCount = 0;
|
||||
}
|
||||
|
||||
void EraseEntry(uint32 id) { indexTable[id] = NULL; }
|
||||
|
||||
private:
|
||||
uint32 nCount;
|
||||
uint32 fieldCount;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,27 @@ SQLStorage sItemStorage(ItemPrototypesrcfmt, ItemPrototypedstfmt, "entry","item_
|
|||
SQLStorage sPageTextStore(PageTextfmt,"entry","page_text");
|
||||
SQLStorage sInstanceTemplate(InstanceTemplatesrcfmt, InstanceTemplatedstfmt, "map","instance_template");
|
||||
|
||||
void SQLStorage::EraseEntry(uint32 id)
|
||||
{
|
||||
uint32 offset=0;
|
||||
for(uint32 x=0;x<iNumFields;x++)
|
||||
if (dst_format[x]==FT_STRING)
|
||||
{
|
||||
if(pIndex[id])
|
||||
delete [] *(char**)((char*)(pIndex[id])+offset);
|
||||
|
||||
offset += sizeof(char*);
|
||||
}
|
||||
else if (dst_format[x]==FT_LOGIC)
|
||||
offset += sizeof(bool);
|
||||
else if (dst_format[x]==FT_BYTE)
|
||||
offset += sizeof(char);
|
||||
else
|
||||
offset += 4;
|
||||
|
||||
reinterpret_cast<void*&>(pIndex[id]) = NULL;
|
||||
}
|
||||
|
||||
void SQLStorage::Free ()
|
||||
{
|
||||
uint32 offset=0;
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ class SQLStorage
|
|||
void Load();
|
||||
void Free();
|
||||
|
||||
void EraseEntry(uint32 id);
|
||||
private:
|
||||
void init(const char * _entry_field, const char * sqlname)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue