Permalink
Browse files

Add the ability to set and retrieve MaxNetworks

(cherry picked from commit 5f660f3)
  • Loading branch information...
1 parent 1a37a39 commit 0d2622ec23771004a07b9cf6f21d2b5604718e71 Andrew Northall committed with DarthGandalf Nov 16, 2013
Showing with 12 additions and 0 deletions.
  1. +12 −0 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);

0 comments on commit 0d2622e

Please sign in to comment.