INACTIVE PlusEMU RP Versio

Status
Not open for further replies.

Seriosk

Programmer;
Oct 29, 2016
256
105
Why don't you instead of loading about 100+ fields like most emulators do, use a KeyValue pair and cache it? Also add the functionality to get it live from the database would be nice, here is something I coded not too long ago...

Or.. store it in a dictionary
Code:
private readonly Dictionary<string, string> _cachedData;

Then get the string..
Code:
public string GetString(string columnName)
{
    if (_cachedData.ContainsKey(columnName) && _cacheEnabled)
    {
        return _cachedData[columnName];
    }
    else
    {
        var columnValue = SelectColumn(_player.GetHabbo().Id, columnName);
        _cachedData[columnName] = columnValue;
        return columnValue;
    }
}

Only downside is your hard coding the column names everywhere, you should probably also code a system to sort that out. I'm not saying use this because this is pretty horrible but use is as a template on what you would go...

Id also probably use an extra bool (default to false) to maybe get it live from the database?
 
May 1, 2015
467
152
Seems like nothing is being done on this - had no contact with @Velaski either.
If he doesn't create a thread of his own within a few days - I'll release it for whoever to work on it.
@JMG please close.
 
Status
Not open for further replies.

Users who are viewing this thread

Top