Previous topic

permissions

Next topic

settings

This Page

region

class pyogp.lib.base.region.Region(global_x=0, global_y=0, seed_capability_url=None, udp_blacklist=None, sim_ip=None, sim_port=None, circuit_code=None, agent=None, settings=None, packet_handler=None, event_queue_handler=None, handle=None)

a region container

The Region class is a container for region specific data. It is also a nice place for convenience code.

Example, of initializing a region class:

Initialize the login class

>>> region = Region(256, 256, 'https://somesim.cap/uuid', 'EnableSimulator,TeleportFinish,CrossedRegion', '127.0.0.1', 13000, 650000000, {'agent_id':'00000000-0000-0000-0000-000000000000', 'session_id':'00000000-0000-0000-0000-000000000000', 'secure_session_id:'00000000-0000-0000-0000-000000000000'})

Start the udp and event queue connections to the region

>>> region.connect()

Sample implementations: examples/sample_region_connect.py Tests: tests/region.txt, tests/test_region.py

initialize a region

connect()
connect to the udp circuit code and event queue
connect_child()
connect to the a child region udp circuit code
enable_child_simulator(IP, Port, Handle)
enqueue_message(packet, reliable=False)
queues packets for the messaging system to send
logout()
send a logout packet
onRegionHandshake(packet)
handles the response to receiving a RegionHandshake packet
onStartPingCheck(packet)
sends the CompletePingCheck packet
sendAgentUpdate(BodyRotation=(0.0, 0.0, 0.0, 1.0), HeadRotation=(0.0, 0.0, 0.0, 1.0), State=0, CameraCenter=(0.0, 0.0, 0.0), CameraAtAxis=(0.0, 0.0, 0.0), CameraLeftAxis=(0.0, 0.0, 0.0), CameraUpAxis=(0.0, 0.0, 0.0), Far=0, ControlFlags=0, Flags=0)
sends an AgentUpdate packet
sendCompleteAgentMovement()
initializing on a simulator requires sending CompleteAgentMovement, also required on teleport
sendCompletePingCheck()
sends a CompletePingCheck packet
sendRegionHandshakeReply()
sends a RegionHandshake packet
sendUUIDNameRequest(agent_ids=[])
sends a packet requesting the name corresponding to a UUID
sendUseCircuitCode()
initializing on a simulator requires announcing the circuit code an agent will use
send_message(packet, reliable=False)
send a packet to the host
send_message_next(packet, reliable=False)
inserts this packet at the fron of the queue
send_reliable(packet)
send a reliable packet to the host
class pyogp.lib.base.region.RegionSeedCapability(name, public_url, restclient=None, settings=None)

a seed capability which is able to retrieve other capabilities

initialize the capability

GET(custom_headers={})
call this capability, return the parsed result
POST(payload, custom_headers={})
call this capability, return the parsed result
get(names=[], settings=None)
if this is a seed cap we can retrieve other caps here