Mohaa.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 Lesser 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 Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. namespace GameQ\Protocols;
  19. /**
  20. * Medal of honor: Allied Assault Protocol Class
  21. *
  22. * @package GameQ\Protocols
  23. * @author Bram <https://github.com/Stormyy>
  24. * @author Austin Bischoff <[email protected]>
  25. */
  26. class Mohaa extends Gamespy
  27. {
  28. /**
  29. * String name of this protocol class
  30. *
  31. * @type string
  32. */
  33. protected $name = 'mohaa';
  34. /**
  35. * Longer string name of this protocol class
  36. *
  37. * @type string
  38. */
  39. protected $name_long = "Medal of honor: Allied Assault";
  40. /**
  41. * Normalize settings for this protocol
  42. *
  43. * @type array
  44. */
  45. protected $normalize = [
  46. 'general' => [
  47. // target => source
  48. 'dedicated' => 'dedicated',
  49. 'gametype' => 'gametype',
  50. 'hostname' => 'hostname',
  51. 'mapname' => 'mapname',
  52. 'maxplayers' => 'maxplayers',
  53. 'numplayers' => 'numplayers',
  54. 'password' => 'password',
  55. ],
  56. // Individual
  57. 'player' => [
  58. 'name' => 'player',
  59. 'score' => 'frags',
  60. 'ping' => 'ping',
  61. ],
  62. ];
  63. /**
  64. * Query port is always the client port + 97 in MOHAA
  65. *
  66. * @param int $clientPort
  67. *
  68. * @return int
  69. */
  70. public function findQueryPort($clientPort)
  71. {
  72. return $clientPort + 97;
  73. }
  74. }