Server account lot size now a config value.

This commit is contained in:
Cekis
2022-03-21 15:30:01 -04:00
parent 9fea76f6ab
commit 77176f3495
5 changed files with 30 additions and 4 deletions
@@ -491,6 +491,8 @@ void ConfigServerGame::install(void)
KEY_STRING (serverLoadLevel, "heavy");
KEY_INT (maxHousingLots, 10);
if (data->baseDecayRate <= 1.0f)
data->baseDecayRate = 1.0f;
@@ -575,6 +575,8 @@ class ConfigServerGame
bool useOldSuidGenerator;
const char * serverLoadLevel;
int maxHousingLots;
};
private:
@@ -1061,6 +1063,8 @@ class ConfigServerGame
static bool getUseOldSuidGenerator();
static const char * getServerLoadLevel();
static int getMaxHousingLots();
};
//-----------------------------------------------------------------------
@@ -3702,4 +3706,11 @@ inline const char *ConfigServerGame::getServerLoadLevel()
return data->serverLoadLevel;
}
//-----------------------------------------------------------------------
inline int ConfigServerGame::getMaxHousingLots(void)
{
return data->maxHousingLots;
}
#endif
@@ -193,9 +193,6 @@ const SharedObjectTemplate * CreatureObject::m_defaultSharedTemplate = nullptr;
//----------------------------------------------------------------------
// The max number of lots available to a player. This value is also defined in base_class.java
static const int HOUSING_MAX_LOTS = 10;
// Slot names
static const ConstCharCrcLowerString DATAPAD_SLOT_NAME("datapad");
@@ -869,6 +866,8 @@ CreatureObject::CreatureObject(const ServerCreatureObjectTemplate* newTemplate)
IGNORE_RETURN(g_creatureList.insert(this));
ObjectTracker::addCreature();
m_maxHousingLots = ConfigServerGame::getMaxHousingLots();
}
//-----------------------------------------------------------------------
@@ -11915,7 +11914,7 @@ void CreatureObject::runMissionCreationQueue()
int CreatureObject::getMaxNumberOfLots() const
{
return HOUSING_MAX_LOTS;
return m_maxHousingLots;
}
//----------------------------------------------------------------------
@@ -1013,6 +1013,9 @@ private:
Archive::AutoDeltaVector<WearableEntry> m_wearableAppearanceData; // Vector for our appearance items.
Archive::AutoDeltaVariable<NetworkId> m_decoyOrigin; // The OID of the player whom we copied for this decoy creature.
// The max number of lots available to a player. This value is also defined in base_class.java
int m_maxHousingLots;
};
//----------------------------------------------------------------------
@@ -55,6 +55,7 @@ namespace ScriptMethodsPlayerAccountNamespace
jboolean JNICALL isIgnoring(JNIEnv *env, jobject self, jlong player, jstring who);
jboolean JNICALL adjustLotCount(JNIEnv *env, jobject self, jlong player, jint adjustment);
jint JNICALL getAccountNumLots(JNIEnv *env, jobject self, jlong player);
jint JNICALL getMaxHousingLots(JNIEnv *env, jobject self);
jint JNICALL getGameFeatureBits(JNIEnv *env, jobject self, jlong player);
jint JNICALL getSubscriptionFeatureBits(JNIEnv *env, jobject self, jlong player);
jboolean JNICALL isUsingAdminLogin(JNIEnv *env, jobject self, jlong player);
@@ -91,6 +92,7 @@ const JNINativeMethod NATIVES[] = {
JF("_isIgnoring", "(JLjava/lang/String;)Z", isIgnoring),
JF("_adjustLotCount", "(JI)Z", adjustLotCount),
JF("_getAccountNumLots", "(J)I", getAccountNumLots),
JF("_getMaxHousingLots", "()I", getMaxHousingLots),
JF("_getGameFeatureBits", "(J)I", getGameFeatureBits),
JF("_getSubscriptionFeatureBits", "(J)I", getSubscriptionFeatureBits),
JF("_isUsingAdminLogin", "(J)Z", isUsingAdminLogin),
@@ -199,6 +201,15 @@ jint JNICALL ScriptMethodsPlayerAccountNamespace::getAccountNumLots(JNIEnv *env,
// ----------------------------------------------------------------------
jint JNICALL ScriptMethodsPlayerAccountNamespace::getMaxHousingLots(JNIEnv *env, jobject self)
{
UNREF(env);
UNREF(self);
return ConfigServerGame::getMaxHousingLots();
}
// ----------------------------------------------------------------------
jint JNICALL ScriptMethodsPlayerAccountNamespace::getGameFeatureBits(JNIEnv *env, jobject self, jlong player)
{
CreatureObject *playerObject = 0;