Brainstorm Posted March 24, 2011 Share Posted March 24, 2011 Hi and thanks for looking in ! What shodd be greate to have is an tool that can sett max level, server type, server name and exp rate, ext (I do not know if this is the right place to poist this) Quote Link to comment Share on other sites More sharing options...
r.v Posted March 24, 2011 Share Posted March 24, 2011 Something like this? ps, this is not secure, and hasn't got everything. It runs on a webserver with php.. <?php // Database info $db_host = "127.0.0.1"; $db_user = "user"; $db_pass = "password"; $db_database = "auth"; // Conf info $world = 'worldserver.conf'; $filesize = filesize($world); if($_SERVER['REQUEST_METHOD'] === 'POST'): // Save to file // Read current data $fh = fopen($world,"r"); $old_worldconfig = fread($fh, $filesize); fclose($fh); // Update database servername $link = mysql_connect($db_host,$db_user,$db_pass); mysql_select_db($db_database,$link); $sql = mysql_query("UPDATE `realmlist` SET `name` = '".$_POST['servername']."' WHERE `id` = '".$_POST['realmid']."'"); mysql_close($link); // Update config $new_worldconfig = preg_replace('/MaxPlayerLevel = ([0-9]{1,3})/','MaxPlayerLevel = '.$_POST['maxplayerlevel'],$old_worldconfig); $new_worldconfig = preg_replace('/GameType = ([0-9]{1,2})/','GameType = '.$_POST['gametype'],$new_worldconfig); $new_worldconfig = preg_replace('/Motd = "([.|\s|\S]*?)"/','Motd = "'.$_POST['motd'].'"',$new_worldconfig); $new_worldconfig = preg_replace('/Rate.XP.Kill = ([0-9]{1,4})/','Rate.XP.Kill = '.$_POST['rate_xp_kill'],$new_worldconfig); $new_worldconfig = preg_replace('/Rate.XP.Quest = ([0-9]{1,4})/','Rate.XP.Quest = '.$_POST['rate_xp_quest'],$new_worldconfig); $new_worldconfig = preg_replace('/Rate.XP.Explore = ([0-9]{1,4})/','Rate.XP.Explore = '.$_POST['rate_xp_explore'],$new_worldconfig); $fh = fopen($world,"w+"); fwrite($fh,$new_worldconfig); fclose($fh); die("Config updated!"); else : // Read current data $fh = fopen($world,"r"); $old_worldconfig = fread($fh, $filesize); preg_match('/RealmID = ([0-9]{1,3})/',$old_worldconfig, $realmid); preg_match('/MaxPlayerLevel = ([0-9]{1,3})/',$old_worldconfig, $cur_maxlevel); preg_match('/GameType = ([0-9]{1,2})/',$old_worldconfig, $gametype); preg_match('/Motd = "([.|\s|\S]*?)"/',$old_worldconfig, $motd); preg_match('/Rate.XP.Kill = ([0-9]{1,4})/',$old_worldconfig, $rate_xp_kill); preg_match('/Rate.XP.Quest = ([0-9]{1,4})/',$old_worldconfig, $rate_xp_quest); preg_match('/Rate.XP.Explore = ([0-9]{1,4})/',$old_worldconfig, $rate_xp_explore); // Get realm info from database $link = mysql_connect($db_host,$db_user,$db_pass); mysql_select_db($db_database,$link); $sql = mysql_query("SELECT * FROM `realmlist` WHERE `id` = '".$realmid[1]."'"); if($sql){ $row = mysql_fetch_assoc($sql); $servername = $row['name']; } else { $servername = ''; } mysql_close($link); fclose($fh); // Build form ?> <form method="POST"> <input type="hidden" name="realmid" value="<?php echo (isset($realmid[1])?$realmid[1]:'1');?>" /> <label for="servername">Servername</label> <input type="text" name="servername" value="<?php echo $servername;?>" /><br /><br /> <label for="motd">MOTD</label> <textarea name="motd"><?php echo (isset($motd[1])?$motd[1]:'');?></textarea><br /><br /> <label for="gametype">Gametype</label> <select name="gametype"> <option value="0"<?php echo(isset($gametype[1]) && $gametype[1]==0?' selected="selected"':'');?>>NORMAL (0)</option> <option value="1"<?php echo(isset($gametype[1]) && $gametype[1]==1?' selected="selected"':'');?>>PVP (1)</option> <option value="4"<?php echo(isset($gametype[1]) && $gametype[1]==4?' selected="selected"':'');?>>NORMAL (4)</option> <option value="6"<?php echo(isset($gametype[1]) && $gametype[1]==6?' selected="selected"':'');?>>RP (6)</option> <option value="8"<?php echo(isset($gametype[1]) && $gametype[1]==8?' selected="selected"':'');?>>RPPVP (8)</option> <option value="16"<?php echo(isset($gametype[1]) && $gametype[1]==16?' selected="selected"':'');?>>FFA_PVP (16)</option> </select><br /><br /> <label for="maxplayerlevel">Max playerlevel</label> <input type="text" name="maxplayerlevel" value="<?php echo (isset($cur_maxlevel[1])?$cur_maxlevel[1]:''); ?>" /><br /><br /> <label for="rate_xp_kill">rate_xp_kill</label> <input type="text" name="rate_xp_kill" value="<?php echo (isset($rate_xp_kill[1])?$rate_xp_kill[1]:''); ?>" /><br /><br /> <label for="rate_xp_quest">rate_xp_quest</label> <input type="text" name="rate_xp_quest" value="<?php echo (isset($rate_xp_quest[1])?$rate_xp_quest[1]:''); ?>" /><br /><br /> <label for="rate_xp_explore">rate_xp_explore</label> <input type="text" name="rate_xp_explore" value="<?php echo (isset($rate_xp_explore[1])?$rate_xp_explore[1]:''); ?>" /><br /><br /> <input type="submit" name="submit" value="Save" /> </form> <?php endif;?> Quote Link to comment Share on other sites More sharing options...
Brainstorm Posted March 25, 2011 Author Share Posted March 25, 2011 Yes like that exept an exe not php or html format.. Quote Link to comment Share on other sites More sharing options...
Admin/Master Developers SkyFire Posted March 25, 2011 Admin/Master Developers Share Posted March 25, 2011 Navicat, HeidiSql have free versions. It's all the editor you need. Quote Link to comment Share on other sites More sharing options...
Brainstorm Posted March 27, 2011 Author Share Posted March 27, 2011 Navicat, HeidiSql have free versions. It's all the editor you need. Yes it is. but im requesting an tool that has the specific changing.. an tool that helps it being easyer to modify the server.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.