Skip to content

Commit

Permalink
rename ECustomDataClientTrust
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Nov 6, 2024
1 parent 640c46f commit f67acc6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Server/mods/deathmatch/logic/CCustomData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void CCustomData::Set(const char* szName, const CLuaArgument& Variable, ESyncTyp
SCustomData newData;
newData.Variable = Variable;
newData.syncType = syncType;
newData.clientChangesMode = ECustomDataClientTrust::UNSET;
newData.clientChangesMode = eCustomDataClientTrust::UNSET;
m_Data[szName] = newData;
UpdateSynced(szName, Variable, syncType);
}
Expand All @@ -121,7 +121,7 @@ bool CCustomData::Delete(const char* szName)
return false;
}

void CCustomData::SetClientChangesMode(const char* szName, ECustomDataClientTrust mode)
void CCustomData::SetClientChangesMode(const char* szName, eCustomDataClientTrust mode)
{
SCustomData& pData = m_Data[szName];
pData.clientChangesMode = mode;
Expand Down
6 changes: 3 additions & 3 deletions Server/mods/deathmatch/logic/CCustomData.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum class ESyncType
SUBSCRIBE,
};

enum class ECustomDataClientTrust : std::uint8_t
enum class eCustomDataClientTrust : std::uint8_t
{
UNSET,
ALLOW,
Expand All @@ -36,7 +36,7 @@ struct SCustomData
{
CLuaArgument Variable;
ESyncType syncType;
ECustomDataClientTrust clientChangesMode;
eCustomDataClientTrust clientChangesMode;
};

class CCustomData
Expand All @@ -50,7 +50,7 @@ class CCustomData

bool Delete(const char* szName);

void SetClientChangesMode(const char* szName, ECustomDataClientTrust mode);
void SetClientChangesMode(const char* szName, eCustomDataClientTrust mode);

unsigned short CountOnlySynchronized();

Expand Down
4 changes: 2 additions & 2 deletions Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,14 +955,14 @@ bool CStaticFunctionDefinitions::SetElementID(CElement* pElement, const char* sz
}

bool CStaticFunctionDefinitions::SetElementData(CElement* pElement, const char* szName, const CLuaArgument& Variable, ESyncType syncType,
std::optional<ECustomDataClientTrust> clientTrust)
std::optional<eCustomDataClientTrust> clientTrust)
{
assert(pElement);
assert(szName);
assert(strlen(szName) <= MAX_CUSTOMDATA_NAME_LENGTH);

ESyncType lastSyncType = ESyncType::BROADCAST;
ECustomDataClientTrust lastClientTrust{};
eCustomDataClientTrust lastClientTrust{};
CLuaArgument* pCurrentVariable = pElement->GetCustomData(szName, false, &lastSyncType, &lastClientTrust);

if (clientTrust.has_value() && lastClientTrust != clientTrust.value())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ DECLARE_ENUM(CAccessControlListRight::ERightType);
DECLARE_ENUM(CElement::EElementType);
DECLARE_ENUM(CAccountPassword::EAccountPasswordType);
DECLARE_ENUM_CLASS(ESyncType);
DECLARE_ENUM_CLASS(ECustomDataClientTrust)
DECLARE_ENUM_CLASS(eCustomDataClientTrust)

enum eHudComponent
{
Expand Down
4 changes: 2 additions & 2 deletions Server/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ int CLuaElementDefs::setElementData(lua_State* luaVM)
SString strKey;
CLuaArgument value;
ESyncType syncType = ESyncType::BROADCAST;
std::optional<ECustomDataClientTrust> clientTrust{};
std::optional<eCustomDataClientTrust> clientTrust{};

CScriptArgReader argStream(luaVM);
argStream.ReadUserData(pElement);
Expand All @@ -1557,7 +1557,7 @@ int CLuaElementDefs::setElementData(lua_State* luaVM)

if (!argStream.NextIsNone())
{
ECustomDataClientTrust trustReaded;
eCustomDataClientTrust trustReaded;
argStream.ReadEnumString(trustReaded);
clientTrust = trustReaded;
}
Expand Down

0 comments on commit f67acc6

Please sign in to comment.