$v->day = 1; $v->date = 0; $v->timestamp = 0; $v->ts = null; $v->ts_last = -1; $v->combat_actions = array(2, 3, 4, 10, 15, 16, 19, 22, 23, 26); //Log and line stuff. $v->line = 0; $v->byte_count = 0; $v->killed_bosses = array(); $params = array(); $encounter = null; //Now we need to parse it. while ($parser->parseLine(true)) { $v->line++; $v->byte_count += $parser->getBytes(); if ($v->line % 100000 == 0) { $params['milestone'][] = $v->byte_count; } //Check if time rolled over. $v->ts = $parser->getSeconds(); if ($v->ts < $v->ts_last) { $v->date += 86400; } $v->timestamp = $v->date + ($v->ts_last = $v->ts); //We want to see if this is a permitted action to start combat. $is_action = in_array($parser->type_id, $v->combat_actions); //Starting condition to get us in combat. if (!$v->combat && $is_action) { $v->combat = true; $encounter = new Encounter($v->timestamp, $v->line, $encounter, $v->killed_bosses);