Previous topic

Modules

Next topic

agentdomain

This Page

agent

class pyogp.lib.base.agent.Home(params)

contains the parameters describing an agent’s home location as returned in login_response[‘home’]

initialize the Home object by parsing the data passed in

class pyogp.lib.base.agent.Agent(settings=None, firstname='', lastname='', password='', agent_id=None)

The Agent class is a container for agent specific data.

Example, of login via the agent class: Initialize the login class

>>> client = Agent()
>>> client.login('https://login.agni.lindenlab.com/cgi-bin/login.cgi', 'firstname', 'lastname', 'secret', start_location = 'last')

Sample implementations: examples/sample_agent_login.py Tests: tests/login.txt, tests/test_agent.py

initialize this agent

Name()
returns a concatenated firstname + ‘ ‘ + lastname
instant_message(ToAgentID=None, Message=None, _ID=None)
sends an instant message to another avatar, wrapping Agent().send_ImprovedInstantMessage() with some handy defaults
login(loginuri, firstname=None, lastname=None, password=None, login_params=None, start_location=None, handler=None, connect_region=True)
login to a login endpoint using the Login() class
logout()
logs an agent out of the current region. calls Region()._kill_coroutines() for all child regions, and Region().logout() for the host region
onAgentDataUpdate(packet)
callback handler for received AgentDataUpdate messages which populates various Agent() attributes
onAgentGroupDataUpdate(packet)
callback handler for received AgentGroupDataUpdate messages which updates stored group instances in the group_manager
onAgentMovementComplete(packet)
callback handler for received AgentMovementComplete messages which populates various Agent() and Region() attributes
onAlertMessage(packet)
callback handler for received AlertMessage messages. logs and raises an event
onChatFromSimulator(packet)
callback handler for received ChatFromSimulator messages which parses and fires a ChatReceived event. (not implemented
onEnableSimulator(packet)
callback handler for received EnableSimulator messages. stores the region data for later connections
onEstablishAgentCommunication(message)
callback handler for received EstablishAgentCommunication messages. try to enable the event queue for a neighboring region based on the data received
onHealthMessage(packet)
callback handler for received HealthMessage messages which populates Agent().health
onImprovedInstantMessage(packet)
callback handler for received ImprovedInstantMessage messages. much is passed in this message, and handling the data is only partially implemented
say(Message, Type=1, Channel=0)

queues a packet to send open chat via ChatFromViewer

Channel: 0 is open chat Type: 0 = Whisper

1 = Say 2 = Shout
send_AgentDataUpdateRequest()
queues a packet requesting an agent data update
send_ImprovedInstantMessage(AgentID=None, SessionID=None, FromGroup=None, ToAgentID=None, ParentEstateID=None, RegionID=None, Position=None, Offline=None, Dialog=None, _ID=None, Timestamp=None, FromAgentName=None, Message=None, BinaryBucket=None, AgentDataBlock={}, MessageBlockBlock={})
sends an instant message packet to ToAgentID. this is a multi-purpose message for inventory offer handling, im, group chat, and more
sigint_handler(signal, frame)
catches terminal signals (Ctrl-C) to kill running client instances