Bf1942.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. * Class Battlefield 1942
  21. *
  22. * @package GameQ\Protocols
  23. * @author Austin Bischoff <[email protected]>
  24. */
  25. class Bf1942 extends Gamespy
  26. {
  27. /**
  28. * String name of this protocol class
  29. *
  30. * @type string
  31. */
  32. protected $name = 'bf1942';
  33. /**
  34. * Longer string name of this protocol class
  35. *
  36. * @type string
  37. */
  38. protected $name_long = "Battlefield 1942";
  39. /**
  40. * query_port = client_port + 8433
  41. * 23000 = 14567 + 8433
  42. *
  43. * @type int
  44. */
  45. protected $port_diff = 8433;
  46. /**
  47. * The client join link
  48. *
  49. * @type string
  50. */
  51. protected $join_link = "bf1942://%s:%d";
  52. /**
  53. * Normalize settings for this protocol
  54. *
  55. * @type array
  56. */
  57. protected $normalize = [
  58. // General
  59. 'general' => [
  60. // target => source
  61. 'dedicated' => 'dedicated',
  62. 'gametype' => 'gametype',
  63. 'hostname' => 'hostname',
  64. 'mapname' => 'mapname',
  65. 'maxplayers' => 'maxplayers',
  66. 'numplayers' => 'numplayers',
  67. 'password' => 'password',
  68. ],
  69. // Individual
  70. 'player' => [
  71. 'name' => 'playername',
  72. 'kills' => 'kills',
  73. 'deaths' => 'deaths',
  74. 'ping' => 'ping',
  75. 'score' => 'score',
  76. ],
  77. 'team' => [
  78. 'name' => 'teamname',
  79. ],
  80. ];
  81. }