Made to Order Software Corporation Logo

LLChatLib: LLC::Manager Class Reference

LLC::Manager Class Reference

List of all members.

Public Member Functions

void AcceptFriendship (const std::string &sessionId, const std::string &senderIp)
 Accept friendship request from agent.

void AcceptGroupJoinOffer (const std::string &group_id, const std::string &message, const std::string &sessionId)
 Accept an offer to join a group.

void AcceptInventoryOffer (const std::string &target_id, const bool task=false)
 Accept inventory offer.

void AnnounceInSim ()
 Announce in simulator that the agent is now authenticated and wants to enter.

void Authenticate (const std::string &login_url, const std::string &first_name, const std::string &last_name, const std::string &munged_password, const std::string &starting_slurl="home")
 Authenticate against the SL database.

bool CheckForResponse ()
 Non-blocking call to check for authentication server response.

Connection ConnectFriendAddSignal (const StringSignal::slot_type &slot) const
 Signals which eminate to your client app as messages come in from the remote grid server.

void DeclareBool (const std::string &name, const bool value, const std::string &description)
 Declare bool for persistence.

void DeclareFloat (const std::string &name, const float value, const std::string &description)
 Declare floating point for persistence.

void DeclareInt (const std::string &name, const int value, const std::string &description)
 Declare long integer for persistence.

void DeclareRect (const std::string &name, const Rect &value, const std::string &description)
 Declare a rectangle (handy for GUI work).

void DeclareString (const std::string &name, const std::string &value, const std::string &description)
 Declare string for persistence.

void DeclareUInt (const std::string &name, const unsigned int value, const std::string &description)
 Declare unsigned long integer for persistence.

void DeclineFriendship (const std::string &sessionId, const std::string &senderIp)
 Decline friendship request from agent.

void DeclineGroupJoinOffer (const std::string &group_id, const std::string &message, const std::string &sessionId)
 Decline an offer to join a group.

std::string GetAgentId () const
 Get currently logged in agent id string.

std::string GetAgentLanguage (const std::string &agentId) const
 Get the current agent language.

bool GetAgentLanguageAuto (const std::string &agentId) const
 Get the auto-detect language setting for the agent.

bool GetBool (const std::string &name) const
 Retrieve bool from persistence.

float GetFloat (const std::string &name) const
 Retrieve float from persistence.

std::string GetFullName (const std::string &id)
 Lookup full name by agent ID. Deprecated.

int GetInt (const std::string &name) const
 Retrieve long integer from persistence.

std::string GetLanguage () const
 Get the default source language for the current AV.

void GetLM (std::string &region_name, int &x, int &y, int &z) const
 Get the landmark of the current sim we are in.

std::string GetLocalAvatar (const int idx) const
 Get local avatar in range by index.

int GetLocalAvatarCount () const
 Get count of local avatars in chat range.

std::string GetNameFromCache (const std::string &id)
 Lookup full name by agent ID from SL cache.

void GetNameFromCache (const std::string &id, std::string &full_name)
 Lookup first/last name by agent ID from SL cache.

void GetNameFromCache (const std::string &id, std::string &first_name, std::string &last_name)
 Lookup first/last name by agent ID from SL cache.

int GetPeopleSearchCount () const
 Number of hits returned in people search.

std::string GetPerson (const int index) const
 Get a full name from search results.

Rect GetRect (const std::string &name) const
 Retrieve rectangle from persistence.

std::string GetSLURL () const
 Get the SLURL of the current sim we are in.

std::string GetString (const std::string &name) const
 Retrieve string from persistence.

unsigned int GetUInt (const std::string &name) const
 Retrieve unsigned long integer from persistence.

std::string GetUserSettingsPath () const
 Get the user settings path, a place to write files stored in the user area (e.g. ~/.slitechat/foo.txt).

bool IsFriend (const std::string &id)
 Check to see if id appears in our cache, if so then we have a friend.

bool IsOnline (const std::string &id)
 Determine agent's online status.

bool IsOnline ()
 Check to make sure we are logged int.

void LeaveGroupRequest (const std::string &groupId)
 Request to leave a group.

std::string LookupGroupName (const std::string &id)
 Lookup group name by UUID.

std::string LookupId (const std::string &fullname)
 Lookup ID by full name.

void OfferFriendship (const std::string &target_id, const std::string &message)
 Offer friendship to agent.

void PumpMessages ()
 Pump the incoming tcp/ip messages from server.

void RejectInventoryOffer (const std::string &target_id, const bool task=false)
 Reject inventory offer.

void RequestBuddyList ()
 Sends request to the server for buddy list members.

void RequestLogout ()
 Send to server the logout request packet. This generates a response.

void SearchPeople (const std::string &fullname)
 Search the people database for a matching full name. Sends a search request. You will get a search result signal.

void SendGroupChatLeaveRequest (const std::string &group_session_id)
 Send a leave request to the specified group chat session.

void SendGroupChatStartRequest (const std::string &group_id)
 Request to start a group chat.

void SendInstantMessage (const std::string &to_id, const std::string &message, const bool to_group=false)
 Send instant message to target agent.

void SendLocalChatMessage (const std::string &text, const int channel=0)
 Send a message to local chat.

void SendTypingSignal (const std::string &target_id, const bool to_group, const bool typing)
 Send typing state signal.

void SetAgentLanguage (const std::string &agentId, const std::string &language)
 Set the current agent language.

void SetAgentLanguageAuto (const std::string &agentId, const bool val)
 Get the auto-detect language setting for the agent.

void SetBool (const std::string &name, const bool value)
 Set bool for persistence.

void SetFloat (const std::string &name, const float value)
 Set float for persistence.

void SetInt (const std::string &name, const int value)
 Set long integer for persistence.

void SetLanguage (const std::string &lang_id)
 Set the default source language for the current AV.

void SetRect (const std::string &name, const Rect &value)
 Set rectangle for persistence.

void SetString (const std::string &name, const std::string &value)
 Set string for persistence.

void SetUInt (const std::string &name, const unsigned int value)
 Set unsigned long integer for persistence.

void Shutdown ()
 Destroy all singleton and global instances and free up allocated memory.

void StartMessagingSystem (const char *appname, const char *user_settings)
 Call this first to start the messaging system, otherwise nothing will work!

void TeleportHome ()
 Teleport home.

void TeleportToRegion (const std::string &slurl)
 Teleport your AV to the specified SLURL.

void TeleportToRegion (const std::string &simName, const int x, const int y, const int z)
 Teleport your AV to the specified SLURL.

void TeleportViaLure (const std::string &lureId)
 Teleport to the offered lure by remote agent.

void TerminateFriendship (const std::string &agentId)
 Terminate friendship with and existing friend.

void TranslateMessage (const std::string &id, const std::string &message, const float minimum_confidence)
 Send a request to Google to translate a message.


Detailed Description

This class hides the working details of the SL codebase and provides a simple interface for communicating in world via IM (a facade pattern).


Member Function Documentation

void LLC::Manager::AcceptFriendship ( const std::string &  sessionId,
const std::string &  senderIp 
)

Accept friendship request from agent.

Parameters:
[in] sessionId Session id of the request. This comes from offer signal.
[in] senderIp IP of sender, comes from offer signal.
See also:
FriendOfferSignal, DeclineFriendship()
void LLC::Manager::AcceptGroupJoinOffer ( const std::string &  group_id,
const std::string &  message,
const std::string &  sessionId 
)

Accept an offer to join a group.

Parameters:
[in] group_id - Group id to join
[in] message - An optional message
[in] sessionId - transaction ID of request session
void LLC::Manager::AcceptInventoryOffer ( const std::string &  target_id,
const bool  task = false 
)

Accept inventory offer.

Parameters:
[in] target_id agent who did the offering
[in] task task or normal (default false)
void LLC::Manager::Authenticate ( const std::string &  login_url,
const std::string &  first_name,
const std::string &  last_name,
const std::string &  munged_password,
const std::string &  starting_slurl = "home" 
)

Authenticate against the SL database.

Parameters:
[in] login_url Login URL for the grid, for example "https://login.agni.lindenlab.com/cgi-bin/login.cgi".
[in] first_name First name of avatar.
[in] last_name Last name of avatar.
[in] munged_password Munged (non-clear text) password
[in] starting_slurl Where to appear when logged in. Defaults to "home".
See also:
MungedPassword()
bool LLC::Manager::CheckForResponse (  ) 

Non-blocking call to check for authentication server response.

This method witll throw AuthException if there is a problem authenticating. Check the message for details.

Returns:
true means that login was completely successful, and false means that we are still waiting for authentication.
See also:
AuthException()
void LLC::Manager::DeclineFriendship ( const std::string &  sessionId,
const std::string &  senderIp 
)

Decline friendship request from agent.

Parameters:
[in] sessionId Session id of the request. This comes from offer signal.
[in] senderIp IP of sender, comes from offer signal.
See also:
FriendOfferSignal, AcceptFriendship()
void LLC::Manager::DeclineGroupJoinOffer ( const std::string &  group_id,
const std::string &  message,
const std::string &  sessionId 
)

Decline an offer to join a group.

Parameters:
[in] group_id - Group id to decline
[in] message - An optional message
[in] sessionId - transaction ID of request session
std::string LLC::Manager::GetAgentId (  )  const

Get currently logged in agent id string.

Returns:
LLC::std::string containing agent id.
std::string LLC::Manager::GetAgentLanguage ( const std::string &  agentId  )  const

Get the current agent language.

Parameters:
[in] agentId - UUID of agent
Returns:
Code of the language
bool LLC::Manager::GetAgentLanguageAuto ( const std::string &  agentId  )  const

Get the auto-detect language setting for the agent.

Parameters:
[in] agentId - Agent to query
Returns:
true if auto-detect is set
std::string LLC::Manager::GetFullName ( const std::string &  id  ) 

Lookup full name by agent ID. Deprecated.

Parameters:
[in] id text representation of agent ID.
Returns:
std::string of full name of looked up value. This contains an entry from the last cache update and is a local store.
See also:
GetNameFromCache()
void LLC::Manager::GetLM ( std::string &  region_name,
int &  x,
int &  y,
int &  z 
) const

Get the landmark of the current sim we are in.

Parameters:
[out] region_name - name of the region
[out] x,y,z - coordinates
std::string LLC::Manager::GetNameFromCache ( const std::string &  id  ) 

Lookup full name by agent ID from SL cache.

Parameters:
[in] id text representation of agent ID.
Returns:
string holding first + " " + last
Bug:
No failure code is reported, so if not in cache you get "(Loading...)"
See also:
GetFullName()
void LLC::Manager::GetNameFromCache ( const std::string &  id,
std::string &  full_name 
)

Lookup first/last name by agent ID from SL cache.

Parameters:
[in] id text representation of agent ID.
[out] full_name reference to string holding first + " " + last
Bug:
No failure code is reported, so if not in cache you get "(Loading...)"
See also:
GetFullName()
void LLC::Manager::GetNameFromCache ( const std::string &  id,
std::string &  first_name,
std::string &  last_name 
)

Lookup first/last name by agent ID from SL cache.

Parameters:
[in] id text representation of agent ID.
[out] first_name reference to hold looked up value.
[out] last_name reference to hold looked up value.
Bug:
No failure code is reported, so if not in cache you get "(Loading...)"
See also:
GetFullName()
int LLC::Manager::GetPeopleSearchCount (  )  const

Number of hits returned in people search.

See also:
SearchResultSignal(), SearchPeople(), GetPerson()
std::string LLC::Manager::GetPerson ( const int  index  )  const

Get a full name from search results.

Parameters:
[in] index A 0-based index of search result.
See also:
GetPeopleSearchCount()
std::string LLC::Manager::GetSLURL (  )  const

Get the SLURL of the current sim we are in.

Returns:
std::string containing SLURL.
std::string LLC::Manager::GetUserSettingsPath (  )  const

Get the user settings path, a place to write files stored in the user area (e.g. ~/.slitechat/foo.txt).

Returns:
std::string containing full path.
bool LLC::Manager::IsFriend ( const std::string &  id  ) 

Check to see if id appears in our cache, if so then we have a friend.

Parameters:
[in] id Agent id to check for in cache
Returns:
true if in cache
bool LLC::Manager::IsOnline ( const std::string &  id  ) 

Determine agent's online status.

Parameters:
[in] id Text representation of agent id.
Returns:
true if found.
void LLC::Manager::LeaveGroupRequest ( const std::string &  groupId  ) 

Request to leave a group.

Parameters:
[in] groupId - id of group to leave
std::string LLC::Manager::LookupGroupName ( const std::string &  id  ) 

Lookup group name by UUID.

Parameters:
[in] id Text representation of agent ID
Returns:
Group name
std::string LLC::Manager::LookupId ( const std::string &  fullname  ) 

Lookup ID by full name.

Parameters:
[in] fullname Pointer to full name string.
Returns:
Text representation of agent ID found.
See also:
GetName(), GetFullName()
void LLC::Manager::OfferFriendship ( const std::string &  target_id,
const std::string &  message 
)

Offer friendship to agent.

Parameters:
[in] target_id Agent id to target.
[in] message std::string message to send to agent.
See also:
AcceptFriendship(), DeclineFriendship()
void LLC::Manager::RejectInventoryOffer ( const std::string &  target_id,
const bool  task = false 
)

Reject inventory offer.

Parameters:
[in] target_id agent who did the offering
[in] task task or normal (default false)
void LLC::Manager::SearchPeople ( const std::string &  fullname  ) 

Search the people database for a matching full name. Sends a search request. You will get a search result signal.

See also:
SearchResultSignal()
void LLC::Manager::SendGroupChatLeaveRequest ( const std::string &  group_session_id  ) 

Send a leave request to the specified group chat session.

Parameters:
[in] group_session_id Session to leave
void LLC::Manager::SendGroupChatStartRequest ( const std::string &  group_id  ) 

Request to start a group chat.

Parameters:
[in] group_id Start a group chat
void LLC::Manager::SendInstantMessage ( const std::string &  to_id,
const std::string &  message,
const bool  to_group = false 
)

Send instant message to target agent.

Parameters:
[in] to_id agent id to send message to.
[in] message string of message to send.
[in] to_group true if to_id is a group, not an AV (i.e. this is part of a chat session)
void LLC::Manager::SendLocalChatMessage ( const std::string &  message,
const int  channel = 0 
)

Send a message to local chat.

Parameters:
[in] message string of message to send.
void LLC::Manager::SendTypingSignal ( const std::string &  target_id,
const bool  to_group,
const bool  typing 
)

Send typing state signal.

Parameters:
[in] target_id agent group id to send status to
[in] to_group true if group
[in] typing Started or stopped typing
void LLC::Manager::SetAgentLanguage ( const std::string &  agentId,
const std::string &  language 
)

Set the current agent language.

Parameters:
[in] agentId - UUID of agent
[in] language - Language code
void LLC::Manager::SetAgentLanguageAuto ( const std::string &  agentId,
const bool  val 
)

Get the auto-detect language setting for the agent.

Parameters:
[in] agentId - Agent to query
[in] val - on or off
void LLC::Manager::StartMessagingSystem ( const char *  appname,
const char *  user_settings 
)

Call this first to start the messaging system, otherwise nothing will work!

Parameters:
[in] appname Application name, for example "SLiteChat".
[in] user_settings Name of user settings file, for example "settings.xml".
void LLC::Manager::TerminateFriendship ( const std::string &  agentId  ) 

Terminate friendship with and existing friend.

Parameters:
[in] agentId Agent id of friend to terminate relationship with.
void LLC::Manager::TranslateMessage ( const std::string &  id,
const std::string &  message,
const float  min_conf 
)

Send a request to Google to translate a message.

Parameters:
[in] id A custom, user-defined id
[in] message The text to translate
[in] min_conf A minimum confidence level to accept Google translations

The documentation for this class was generated from the following files:
  • /home/doug/src/oss/slitechat/trunk/LLChatLib/LLChatLib.h
  • /home/doug/src/oss/slitechat/trunk/LLChatLib/LLChatLib.cpp
Generated on Thu Sep 23 17:18:49 2010 for LLChatLib by  doxygen 1.6.3