Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add the ability to set and retrieve MaxNetworks

  • Loading branch information...
commit 5f660f37c2e0a3c155f2089d1a3ad2070947be61 1 parent f6b8167
Andrew Northall authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 modules/controlpanel.cpp
12 modules/controlpanel.cpp
View
@@ -68,6 +68,7 @@ class CAdminMod : public CModule {
{"Password", str},
{"JoinTries", integer},
{"MaxJoins", integer},
+ {"MaxNetworks", integer},
{"Timezone", str},
{"Admin", boolean},
{"AppendTimestamp", boolean},
@@ -188,6 +189,8 @@ class CAdminMod : public CModule {
PutModule("AutoClearChanBuffer = " + CString(pUser->AutoClearChanBuffer()));
else if (sVar == "maxjoins")
PutModule("MaxJoins = " + CString(pUser->MaxJoins()));
+ else if (sVar == "maxnetworks")
+ PutModule("MaxNetworks = " + CString(pUser->MaxNetworks()));
else if (sVar == "jointries")
PutModule("JoinTries = " + CString(pUser->JoinTries()));
else if (sVar == "timezone")
@@ -308,6 +311,15 @@ class CAdminMod : public CModule {
pUser->SetMaxJoins(i);
PutModule("MaxJoins = " + CString(pUser->MaxJoins()));
}
+ else if (sVar == "maxnetworks") {
+ if(m_pUser->IsAdmin()) {
+ unsigned int i = sValue.ToUInt();
+ pUser->SetMaxNetworks(i);
+ PutModule("MaxNetworks = " + sValue);
+ } else {
+ PutModule("Access denied!");
+ }
+ }
else if (sVar == "jointries") {
unsigned int i = sValue.ToUInt();
pUser->SetJoinTries(i);
Please sign in to comment.
Something went wrong with that request. Please try again.