Cs16.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * This file is part of GameQ.
  4. *
  5. * GameQ is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GameQ is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. namespace GameQ\Protocols;
  19. /**
  20. * Class Cs16
  21. *
  22. * @package GameQ\Protocols
  23. * @author Austin Bischoff <[email protected]>
  24. */
  25. class Cs16 extends Source
  26. {
  27. /**
  28. * String name of this protocol class
  29. *
  30. * @type string
  31. */
  32. protected $name = 'cs16';
  33. /**
  34. * Longer string name of this protocol class
  35. *
  36. * @type string
  37. */
  38. protected $name_long = "Counter-Strike 1.6";
  39. /**
  40. * In the case of cs 1.6 we offload split packets here because the split packet response for rules is in
  41. * the old gold source format
  42. *
  43. * @param $packet_id
  44. * @param array $packets
  45. *
  46. * @return string
  47. * @throws \GameQ\Exception\Protocol
  48. */
  49. protected function processPackets($packet_id, array $packets = [])
  50. {
  51. // The response is gold source if the packets are split
  52. $this->source_engine = self::GOLDSOURCE_ENGINE;
  53. // Offload to the parent
  54. $packs = parent::processPackets($packet_id, $packets);
  55. // Reset the engine
  56. $this->source_engine = self::SOURCE_ENGINE;
  57. // Return the result
  58. return $packs;
  59. }
  60. }