| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | | +-------------------------------------------------------------------------+ */ require_once "../../include/session.php"; require_once "../../include/fields.php"; require_once "include/snapshot_include.php"; //Page details; $headingTitle = formatVariable(trim($_SESSION["userinfo"]["firstname"] . " " . $_SESSION["userinfo"]["lastname"]) . "'s Snapshot"); $pageTitle = APPLICATION_NAME . " - " . $headingTitle; $phpbms->cssIncludes[] = "pages/base/snapshot.css"; $phpbms->jsIncludes[] = "modules/base/javascript/snapshot.js"; $snapshot = new snapshot($db); if (isset($_POST["cmd"])) { $snapshot->process($_POST); } $snapshot->getWidgets(); $phpbms->jsIncludes = $snapshot->merge($phpbms->jsIncludes, "jsIncludes"); $phpbms->cssIncludes = $snapshot->merge($phpbms->cssIncludes, "cssIncludes"); require "header.php"; ?> <div class="bodyline"> <h1><?php echo $headingTitle; ?> </h1>
<?php chdir(dirname(__FILE__)); include_once '../init.php'; //do things. require_once $_INICONF['webdocroot'] . '/includes/class/class.snapshot.php'; $snapshot = new snapshot($_INICONF); if (!empty($_POST)) { if (!empty($_POST['action'])) { $type = !empty($_POST['type']) ? $_POST['type'] : 'custom'; $profile_name = !empty($_POST['profile_name']) ? $_POST['profile_name'] : 'totallybogus87asjhfiuf9832hsdkjsdf'; $profile_data = $snapshot->get($profile_name, $type); $_VIEW->assign('profile', $profile_name); if ($_POST['action'] == 'download') { header("Content-Type: application/json"); header("Content-Disposition: {$profile_name}"); echo json_encode($profile_data); die; } if ($_POST['action'] == 'view') { if (!empty($profile_data)) { $_VIEW->assign('profile_data', $profile_data); $_VIEW->assign('_MSGS', $_MSGS); $_VIEW->display('serverProfileView.tpl'); die; } else { $_MSGS[] = array('type' => 'error', 'msg' => "Unable to view configuration profile `{$profile_name}`."); } } if ($_POST['action'] == 'delete') { $removed = $snapshot->delete($profile_name, $type);
//isset($iniinfo['TamingDisabled']) ? $iniinfo['TamingDisabled'] : $defaults['TamingDisabled']; $iniinfo['name'] = $defaults['name']; $iniinfo['ClassName'] = $ClassName; if (isset($defaults['thumbnail'])) { $iniinfo['thumbnail'] = $defaults['thumbnail']; } $taming_combined[$ClassName] = $iniinfo; } } } if (!empty($_POST)) { //We are updating. Good thing we already have a combined list of the defaults plus the current config. //So, we should just be able to foreach through the combined list, look for changes in the postdata, and then write() the ini file. //Make a snapshot, just in case. We make it before we change anything. require_once $_INICONF['webdocroot'] . '/includes/class/class.snapshot.php'; $snapshot = new snapshot($_INICONF); $saved = $snapshot->create(null, 'snapshot'); $taming_towrite = array(); $post_keys = array_keys($_POST); foreach ($taming_combined as $id => $info) { $taming_combined[$id]['TamingDisabled'] = in_array("TamingDisabled_{$id}", $post_keys) ? 1 : 0; if (!empty($taming_combined[$id]['TamingDisabled'])) { //we just plain ol' don't include the ones that we want to be tameable. we need to list only the ones that are untamable $taming_towrite[] = '"' . $taming_combined[$id]['ClassName'] . '"'; } } $iniGame->gameini['/script/shootergame.shootergamemode']['PreventDinoTameClassNames'] = $taming_towrite; $iniGame->write(); //there were diffs, make sure we send a message telling them to restart ARK dedicated server. $_SESSION['need_to_restart'] = true; }
| | | - Redistributions in binary form must reproduce the above copyright | | notice, this list of conditions and the following disclaimer in the | | documentation and/or other materials provided with the distribution. | | | | - Neither the name of Kreotek LLC nor the names of its contributore may | | be used to endorse or promote products derived from this software | | without specific prior written permission. | | | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | | +-------------------------------------------------------------------------+ */ include_once "../../include/session.php"; include_once "include/snapshot_include.php"; $snapshot = new snapshot($db); if (isset($_GET["uuid"])) { $_GET["cmd"] = "remove"; $snapshot->process($_GET); } //endif
$where_is_lane_node = new DecisionTreeNode("where_is_lane", [new Edge("left", 0, $left_lane_num_turns_left_node), new Edge("right", 0, $right_lane_num_turns_left_node), new Edge("same", 0, $num_lengths_ahead_node)]); $space_in_lane_node = new DecisionTreeNode("space_in_this_lane", [new Edge("yes", 0, $where_is_lane_node), new Edge("no", null, null)]); return new DecisionTree($space_in_lane_node); } // Set up the initial snapshot $track = new Track(3000, 2000, 80, 840, 2160, 840, 840, 420.169, 20); $lane_score_tree = initializeLaneScoreTree(); $game_state = new GameState($horses, $track); $animation_array = array(); $done = false; $ts = 1; $ts_scale = 0.01; $total_distance = 840 + 1320; $final_placement = 0; while (!$done) { $snapshot = new snapshot($ts, $track); $dt = ($snapshot->get_ts() - $game_state->get_ts()) * $ts_scale; $num_horses_finished = 0; foreach ($horses as $horse) { // gather some useful info into one place $horseid = $horse->get_id(); /** @var horse_details $horse_detail */ $horse_detail = $game_state->get_details($horseid); $old_pos_x = $horse_detail->get_position_x(); $old_pos_y = $horse_detail->get_position_y(); $boost = $horse_detail->get_boost(); if ($horse_detail->get_lap_counter() > 0 && $horse_detail->get_section() > 0) { $this_horse_finished = true; } else { $this_horse_finished = false; }