/** * The standard homepage * * @return Response */ private function game() { // Get the actual values of the vars. $ninja = Player::find(SessionFactory::getSession()->get('player_id')); $playerInfo = $ninja->data(); $clan = $ninja ? Clan::findByMember($ninja) : null; $unreadCount = Message::where(['send_to' => $ninja->id(), 'unread' => 1])->count(); // Assign these vars to the template. $parts = ['main_src' => '/intro', 'body_classes' => 'main-body', 'version' => 'NW Version 1.7.5 2010.12.05', 'ninja' => $ninja, 'player_info' => $playerInfo, 'clan' => $clan, 'unread_message_count' => $unreadCount]; return new StreamedViewResponse('Live by the Shuriken', 'index.tpl', $parts, ['is_index' => true]); }
/** * The standard homepage * * @return ViewSpec */ private function game() { // Get the actual values of the vars. $ninja = new Player(self_char_id()); $playerInfo = $ninja->dataWithClan(); $unreadCount = Message::where(['send_to' => $ninja->id(), 'unread' => 1])->count(); // Assign these vars to the template. $parts = ['main_src' => '/intro', 'body_classes' => 'main-body', 'version' => 'NW Version 1.7.5 2010.12.05', 'ninja' => $ninja, 'player_info' => $playerInfo, 'unread_message_count' => $unreadCount]; return ['template' => 'index.tpl', 'title' => 'Live by the Shuriken', 'parts' => $parts, 'options' => ['is_index' => true]]; }
/** * mark all messages of a type for a ninja as read */ public static function markAsRead(Player $char, $type) { return Message::where(['send_to' => $char->id(), 'type' => $type])->update(['unread' => 0]); }