set_mods.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?php
  2. /*
  3. *
  4. * OGP - Open Game Panel
  5. * Copyright (C) 2008 - 2018 The OGP Development Team
  6. *
  7. * http://www.opengamepanel.org/
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  22. *
  23. */
  24. function exec_ogp_module() {
  25. @$arch = $_POST['arch'];
  26. @$os = $_POST['os'];
  27. @$protocol = $_POST['protocol'];
  28. @$query_name = $_POST['query_name'];
  29. @$installer = $_POST['installer'];
  30. @$control_protocol_type = $_POST['control_protocol_type'];
  31. @$control_protocol = $_POST['control_protocol'];
  32. @$query_diff = $_POST['query_diff'];
  33. @$map_location = $_POST['map_location'];
  34. @$maplist_file = $_POST['maplist_file'];
  35. @$max_players_amount = $_POST['max_players_amount'];
  36. @$exec_path = $_POST['exec_path'];
  37. @$server_exec_name = $_POST['server_exec_name'];
  38. @$key_name = $_POST['key_name'];
  39. @$game_name = $_POST['game_name'];
  40. @$pid_file_cli = $_POST['pid_file_cli'];
  41. @$hostname_cli = $_POST['hostname_cli'];
  42. @$players_cli = $_POST['players_cli'];
  43. @$map_cli = $_POST['map_cli'];
  44. @$query_port_cli = $_POST['query_port_cli'];
  45. @$port_cli = $_POST['port_cli'];
  46. @$ip_cli = $_POST['ip_cli'];
  47. @$game_type_cli = $_POST['game_type_cli'];
  48. @$cli_option = $_POST['cli_option'];
  49. @$separator = $_POST['separator'];
  50. @$main_params = $_POST['main_params'];
  51. @$main_params_inputs = "
  52. <input type='hidden' name='arch' value='".$arch."'/>
  53. <input type='hidden' name='os' value='".$os."'/>
  54. <input type='hidden' name='protocol' value='".$protocol."'/>
  55. <input type='hidden' name='query_name' value='".$query_name."'/>
  56. <input type='hidden' name='installer' value='".$installer."'/>
  57. <input type='hidden' name='control_protocol_type' value='".$control_protocol_type."'/>
  58. <input type='hidden' name='control_protocol' value='".$control_protocol."'/>
  59. <input type='hidden' name='query_diff' value='".$query_diff."'/>
  60. <input type='hidden' name='map_location' value='".$map_location."'/>
  61. <input type='hidden' name='maplist_file' value='".$maplist_file."'/>
  62. <input type='hidden' name='max_players_amount' value='".$max_players_amount."'/>
  63. <input type='hidden' name='exec_path' value='".$exec_path."'/>
  64. <input type='hidden' name='server_exec_name' value='".$server_exec_name."'/>
  65. <input type='hidden' name='key_name' value='".$key_name."'/>
  66. <input type='hidden' name='game_name' value='".$game_name."'/>
  67. <input type='hidden' name='pid_file_cli' value='".$pid_file_cli."'/>
  68. <input type='hidden' name='hostname_cli' value='".$hostname_cli."'/>
  69. <input type='hidden' name='players_cli' value='".$players_cli."'/>
  70. <input type='hidden' name='map_cli' value='".$map_cli."'/>
  71. <input type='hidden' name='query_port_cli' value='".$query_port_cli."'/>
  72. <input type='hidden' name='port_cli' value='".$port_cli."'/>
  73. <input type='hidden' name='ip_cli' value='".$ip_cli."'/>
  74. <input type='hidden' name='game_type_cli' value='".$game_type_cli."'/>
  75. <input type='hidden' name='cli_option' value='".$cli_option."'/>
  76. <input type='hidden' name='separator' value='".$separator."'/>
  77. ";
  78. if (!isset($_GET['mod_num']))
  79. $mod_num = 0;
  80. else
  81. $mod_num = $_GET['mod_num'] + 1;
  82. if(isset($_POST['add_mod']))
  83. {
  84. $_SESSION['mods'][$mod_num]['mod_name'] = $_POST['mod_name'];
  85. $_SESSION['mods'][$mod_num]['mod_key'] = $_POST['mod_key'];
  86. $_SESSION['mods'][$mod_num]['mod_installer_name'] = $_POST['mod_installer_name'];
  87. }
  88. @$mods = $_SESSION['mods'];
  89. $template = "";
  90. if ($mods)
  91. {
  92. foreach($mods as $mod)
  93. {
  94. $template .= " ";
  95. $template .= $mod['mod_name'];
  96. }
  97. echo "<p><b>Added Mods:</b>".$template."</p>";
  98. }
  99. ?>
  100. <table BORDER=1>
  101. <?php
  102. if( isset( $_POST['set_mods'] ) )
  103. {
  104. ?>
  105. <form action="home.php?m=config_games&p=set_params&type=cleared" method="POST">
  106. <?php
  107. }
  108. else
  109. {
  110. ?>
  111. <form action="home.php?m=config_games&p=set_mods&type=cleared&mod_num=<?php echo $mod_num; ?>" method="POST">
  112. <?php
  113. }
  114. ?>
  115. <input type="hidden" name="main_params"/>
  116. <?php
  117. echo $main_params_inputs;
  118. if(isset($_POST['add_mods']))
  119. {
  120. ?>
  121. <tr>
  122. <td>
  123. Set Mods
  124. </td>
  125. <td>
  126. </tr>
  127. <tr>
  128. <td>
  129. Mod #<?php echo $mod_num; ?>
  130. <input type="hidden" name="mod_num" value="<?php echo $mod_num; ?>"/>
  131. </td>
  132. </tr>
  133. <tr>
  134. <td>
  135. Mod Name
  136. </td>
  137. <td>
  138. <input type="text" name="mod_name" value=""/>
  139. </td>
  140. </tr>
  141. <tr>
  142. <td>
  143. Mod Key
  144. </td>
  145. <td>
  146. <input type="text" name="mod_key" value=""/>
  147. </td>
  148. </tr>
  149. <tr>
  150. <td>
  151. Mod Installer name
  152. </td>
  153. <td>
  154. <input type="text" name="mod_installer_name" value=""/>
  155. </td>
  156. </tr>
  157. <tr>
  158. <td>
  159. <input type="submit" name="add_mod" value="Add Mod"/>
  160. <input type="submit" name="set_mods" value="Continue"/>
  161. </td>
  162. </form>
  163. </tr>
  164. <?php
  165. }
  166. else
  167. {
  168. ?>
  169. <tr>
  170. <td>
  171. <input type="submit" name="add_mods" value="Add Mods"/>
  172. <input type="submit" name="set_mods" value="Continue"/>
  173. </td>
  174. </form>
  175. </tr>
  176. <?php
  177. }
  178. ?>
  179. </table>
  180. <?php
  181. }