Unsupported PHP app for analysing and displaying stats for Team Fortress 2
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

changed.php 1.0KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?PHP
  2. class ChangedHandler {
  3. /*-------------------------------------------------------------------------*\
  4. * Handles role or name changing events. *
  5. * *
  6. * Line sample: role to "Sniper" *
  7. * name to "Foo" *
  8. \*-------------------------------------------------------------------------*/
  9. public function parseLine($date, $player, $playerdetails, $line) {
  10. $what = substr($line, 0, 4);
  11. $line = substr($line, 8); // role to
  12. $class = Parser::parseString($line);
  13. if ($what != 'role') {
  14. return;
  15. }
  16. if (Game::getCurrent() == null) {
  17. echo "No game in progress; discarding class change\n";
  18. return;
  19. }
  20. if ($player->getOpenSession() == null) {
  21. $player->openSession($date, $playerdetails['uid'], $playerdetails['alias']);
  22. }
  23. $player->getOpenSession()->changeRole($date, $playerdetails['team'], $class);
  24. }
  25. }
  26. ?>