Файл: city.php
Строк: 57
<?php
include_once("settings.php");
include_once("game_header.php");
include_once("players.php");
include_once("player_chat.php");
include_once("drop.php");
include_once("room.php");
//check player state
checkPlayerState($player);
//get room info
$room = new CRoom($db,$room_id);
$description = $room->getRoomDesc();
$caption = $room->getRoomCaption();
$smarty->assign('CAPTION',$caption);
$smarty->assign('DESCRIPTION',$description);
$players = new CPlayers($db);
$drop = new CDrop($db,$room_id,$vnum);
$player_chat = new CPlayerChat($db,$vnum);
$chat_msg=$player_chat->getLastMessage($room_id,15);
foreach($chat_msg as $k => $v){
$chat_msg[$k]['pdata']=getChatTime($v['pdata']);
}
$smarty->assign_by_ref("chat_msg",$chat_msg);
//get players in room
$players = new CPlayers($db);
$players_in_room=$players->getPlayersInRoomAndName($room_id);
foreach($players_in_room as $v){
$skill->setVnum($v['vnum']);
$player_level=$skill->getSkillLevel(SKILL_HP);
$smarty->append("players_in_room",array(
'VNUM' => $v['vnum'],
'NAME' => $v['name'],
'LEVEL' => $player_level,
'COLOR' => $v['online']==1?"blue":"gray",
'TIME_ACTIVE' => getTimes($v['active']),
'CLAN' => $v['clan'],
));
}
//get room exits
$exits = $room->getRoomExits();
foreach($exits as $v)
{
$D = "D".$v['direction'];
$smarty->assign($D,$v['direction']);
}
//get drop things in room
$things_drop=$drop->getCountThingsInRoom();
$smarty->assign("THINGS_DROP",$things_drop);
$city=$smarty->fetch($templ_path.'/city_one.tpl');
$smarty->assign('MAIN',$city);
echo($smarty->fetch($templ_path.'/game.tpl'));
?>