changes to read max-agent-groups from login.cgi response

meow-7.2.2
Bill Curtis 2010-11-08 10:54:58 -08:00
parent 65d847de38
commit 3fa059409a
7 changed files with 13 additions and 8 deletions

View File

@ -245,9 +245,6 @@ const U8 SIM_ACCESS_ADULT = 42; // Seriously Adult Only
const U8 SIM_ACCESS_DOWN = 254;
const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT;
// group constants
const S32 MAX_AGENT_GROUPS = 25;
// attachment constants
const S32 MAX_AGENT_ATTACHMENTS = 38;
const U8 ATTACHMENT_ADD = 0x80;

View File

@ -58,6 +58,7 @@
#include "llsidetray.h"
#include "llsky.h"
#include "llsmoothstep.h"
#include "llstartup.h"
#include "llstatusbar.h"
#include "llteleportflags.h"
#include "lltool.h"
@ -2427,7 +2428,7 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO
BOOL LLAgent::canJoinGroups() const
{
return mGroups.count() < MAX_AGENT_GROUPS;
return mGroups.count() < gMaxAgentGroups;
}
LLQuaternion LLAgent::getHeadRotation()

View File

@ -41,6 +41,7 @@
#include "llbutton.h"
#include "llgroupactions.h"
#include "llscrolllistctrl.h"
#include "llstartup.h"
#include "lltextbox.h"
#include "lluictrlfactory.h"
#include "lltrans.h"
@ -171,7 +172,7 @@ void LLPanelGroups::reset()
group_list->operateOnAll(LLCtrlListInterface::OP_DELETE);
}
getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count()));
getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d",MAX_AGENT_GROUPS));
getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d",gMaxAgentGroups));
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID());
enableButtons();
@ -182,7 +183,7 @@ BOOL LLPanelGroups::postBuild()
childSetCommitCallback("group list", onGroupList, this);
getChild<LLUICtrl>("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.count()));
getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d",MAX_AGENT_GROUPS));
getChild<LLUICtrl>("groupcount")->setTextArg("[MAX]", llformat("%d",gMaxAgentGroups));
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("group list");
if (list)

View File

@ -146,6 +146,7 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia
requested_options.append("newuser-config");
requested_options.append("ui-config");
#endif
requested_options.append("max-agent-groups");
requested_options.append("map-server-url");
requested_options.append("voice-config");
requested_options.append("tutorial_setting");

View File

@ -198,6 +198,7 @@
// exported globals
//
bool gAgentMovementCompleted = false;
S32 gMaxAgentGroups;
std::string SCREEN_HOME_FILENAME = "screen_home.bmp";
std::string SCREEN_LAST_FILENAME = "screen_last.bmp";
@ -2944,7 +2945,7 @@ bool process_login_success_response()
text = response["circuit_code"].asString();
if(!text.empty())
{
gMessageSystem->mOurCircuitCode = strtoul(text.c_str(), NULL, 10);
gMessageSystem->mOurCircuitCode = strtoult(ext.c_str(), NULL, 10);
}
std::string sim_ip_str = response["sim_ip"];
std::string sim_port_str = response["sim_port"];
@ -3148,6 +3149,9 @@ bool process_login_success_response()
LLViewerMedia::openIDSetup(openid_url, openid_token);
}
std::string max_agent_groups(response["max-agent-groups"]);
gMaxAgentGroups = atoi(max_agent_groups.c_str());
bool success = false;
// JC: gesture loading done below, when we have an asset system
// in place. Don't delete/clear gUserCredentials until then.

View File

@ -70,6 +70,7 @@ typedef enum {
// exported symbols
extern bool gAgentMovementCompleted;
extern S32 gMaxAgentGroups;
extern LLPointer<LLViewerTexture> gStartTexture;
class LLStartUp

View File

@ -633,7 +633,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
if(option == 0 && !group_id.isNull())
{
// check for promotion or demotion.
S32 max_groups = MAX_AGENT_GROUPS;
S32 max_groups = gMaxAgentGroups;
if(gAgent.isInGroup(group_id)) ++max_groups;
if(gAgent.mGroups.count() < max_groups)