public function create_inventory($user_uuid) { if (!isset($user_uuid) or empty($user_uuid)) { return null; } $inventory_uuid = UUID::random(); $inventory = array('Textures' => array('folderName' => 'Textures', 'type' => 0, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Sounds' => array('folderName' => 'Sounds', 'type' => 1, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Calling Cards' => array('folderName' => 'Calling Cards', 'type' => 2, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Landmarks' => array('folderName' => 'Landmarks', 'type' => 3, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'My Inventory' => array('folderName' => 'My Inventory', 'type' => 9, 'version' => 1, 'folderID' => $inventory_uuid, 'agentID' => $user_uuid, 'parentFolderID' => UUID::ZERO), 'Photo Album' => array('folderName' => 'Photo Album', 'type' => 15, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Clothing' => array('folderName' => 'Clothing', 'type' => 5, 'version' => 3, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Objects' => array('folderName' => 'Objects', 'type' => 6, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Notecards' => array('folderName' => 'Notecards', 'type' => 7, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Scripts' => array('folderName' => 'Scripts', 'type' => 10, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Body Parts' => array('folderName' => 'Body Parts', 'type' => 13, 'version' => 5, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Trash' => array('folderName' => 'Trash', 'type' => 14, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Lost And Found' => array('folderName' => 'Lost And Found', 'type' => 16, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Animations' => array('folderName' => 'Animations', 'type' => 20, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid), 'Gestures' => array('folderName' => 'Gestures', 'type' => 21, 'version' => 1, 'folderID' => UUID::random(), 'agentID' => $user_uuid, 'parentFolderID' => $inventory_uuid)); $modified_inventory = Event::until('opensim.model.os.inventoryfolder.create_inventory', array($inventory_uuid, $inventory)); if (!is_null($modified_inventory)) { $inventory = $modified_inventory; } $this->insert($inventory); return $inventory; }
/** * Get the evaluated string content of the view. * * @return string */ public function render() { Event::fire("laravel.composing: {$this->view}", array($this)); // If there are listeners to the view engine event, we'll pass them // the view so they can render it according to their needs, which // allows easy attachment of other view parsers. if (Event::listeners(static::engine)) { $result = Event::until(static::engine, array($this)); if (!is_null($result)) { return $result; } } return $this->get(); }
public function render() { static::$render_count++; Event::fire("laravel.composing: {$this->view}", array($this)); $contents = null; if (Event::listeners(static::engine)) { $result = Event::until(static::engine, array($this)); if (!is_null($result)) { $contents = $result; } } if (is_null($contents)) { $contents = $this->get(); } static::$render_count--; if (static::$render_count == 0) { Section::$sections = array(); } return $contents; }
/** * Get the evaluated string content of the view. * * @return string */ public function render() { static::$render_count++; Event::fire("laravel.composing: {$this->view}", array($this)); $contents = null; // If there are listeners to the view engine event, we'll pass them // the view so they can render it according to their needs, which // allows easy attachment of other view parsers. if (Event::listeners(static::engine)) { $result = Event::until(static::engine, array($this)); if (!is_null($result)) { $contents = $result; } } if (is_null($contents)) { $contents = $this->get(); } static::$render_count--; if (static::$render_count == 0) { //Section::$sections = array(); } return $contents; }
public function create_account($user, $default_avatar_name = 'ruth') { // Check if user already exists $user_account = self::where_PrincipalID($user->uuid)->first(); if (!isset($user_account)) { $ServiceURLs = 'HomeURI= GatekeeperURI= InventoryServerURI= AssetServerURI='; $user_account = new self(); $user_account->PrincipalID = $user->uuid; $user_account->ScopeID = UUID::ZERO; $user_account->FirstName = $user->avatar_first_name; $user_account->LastName = $user->avatar_last_name; $user_account->Email = $user->email; $user_account->ServiceURLs = $ServiceURLs; $user_account->Created = time(); $user_account->UserLevel = 0; $user_account->UserFlags = 0; $user_account->UserTitle = ''; $user_account->save(); } // Set passwords $account_auth = Auth::where_UUID($user->uuid)->first(); // Check if there is no // password already set for this account if (!isset($account_auth)) { $account_auth = new Auth(); if ($user->status == 'active') { $account_auth->passwordHash = $user->hash; $account_auth->passwordSalt = $user->salt; } else { $account_auth->passwordHash = $user->status; $account_auth->passwordSalt = $user->status; } $account_auth->UUID = $user->uuid; $account_auth->webLoginKey = UUID::ZERO; $account_auth->accountType = 'UserAccount'; $account_auth->save(); } // Set home location $home_location = \Settings\Model\Setting::where_module_slug('opensim')->where_slug('opensim_home_location')->first(); if (isset($home_location->value) and \Opensim\UUID::is_valid($home_location->value)) { $home_location_data = array('UserID' => $user->uuid, 'HomeRegionID' => $home_location->value, 'HomePosition' => '<0,0,0>', 'HomeLookAt' => '<0,0,0>', 'LastRegionID' => $home_location->value, 'LastPosition' => '<128,128,22>', 'LastLookAt' => '<0,1,0>', 'Online' => 'False', 'Login' => $user->created_at->getTimestamp(), 'Logout' => $user->created_at->getTimestamp()); Griduser::insert($home_location_data); } // create inventory $account_inventory = InventoryFolder::where_agentID($user->uuid)->get(); if (!isset($account_inventory) or empty($account_inventory)) { $account_inventory = new InventoryFolder(); $account_inventory = $account_inventory->create_inventory($user->uuid); } else { $acc_inv = array(); foreach ($account_inventory as $folder_name => $folder) { $acc_inv[$folder->foldername] = array('folderName' => $folder->foldername, 'type' => $folder->type, 'version' => $folder->version, 'folderID' => $folder->folderid, 'agentID' => $folder->agentid, 'parentFolderID' => $folder->parentfolderid); } $account_inventory = $acc_inv; } // Load avatar initial items items $items = Event::until('opensim.load.avatar.items', array($default_avatar_name, $user, $account_inventory)); if (is_null($items)) { $items = \Opensim\load_ruth_items($user->uuid, $account_inventory); } if (isset($items) and !empty($items)) { $invento = InventoryItem::insert($items); } // Load Avatar appearance $items_array = Event::until('opensim.load.avatar.appearance', array($default_avatar_name, $user)); if (is_null($items_array)) { $items_array = \Opensim\load_ruth_appearance($user->uuid); } // Save appearance $avatar_apearance = \Opensim\Model\Os\Avatar::insert($items_array); }