Jump to content

RaddMan

Inactive Member
  • Posts

    13
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by RaddMan

  1. Basically i have little problem with this code , it fetches all tables from DB correctly and i can create an account ( at least it lets me on the website ) but it will not put it into DB for some reason, so it says acc created succesfully but can't login with it. when i create an acc throuhg db itself, it lets me log in to the website somehow....

     

    @ EDIT repairing account table helped ... (i mean duplicate -> delete ->rename ) 

    		<div class="page-header">
    			<h1>Register</h1>
    		</div>
    <?php
    
    if(isset($_SESSION['id'])) {
    ?>
    		<div class="alert alert-warning" role="alert">
    			To create acc you need to be <a href="index.php?page=logout">Logout</a>.
    		</div>
    <?php
    } else {
    
    ?>
    <?php
    //Verificare daca inregistrarea e dezactivata.
    $rg = mysqli_query($sqlHp, "SELECT * FROM ".SQL_HP_DB.".settings WHERE id=8");
    $reg = mysqli_fetch_assoc($rg);
    if ($reg['value'] == 'nu') {
    echo '<div class="alert alert-danger" role="alert">
    			Registration is <strong>OFF</strong>!
    		</div>'; }
    
    else {
    if(!isset($_POST['register'])) {
    	?>
    		<div class="alert alert-info" role="alert">
    			<strong>Warning!</strong> All tables have to be filled in.<br> <strong>Warning!</strong>
    			e-mail has to be valid!
    		</div>
    		<div class="alert alert-danger" role="alert">
    			<strong>Warning!</strong> By Registering you accept 
    			<a href="index.php?page=rules">T&C</a>.
    		</div>
    <?php } ?>
    
    <?php
    if(isset($_POST['register']) && isset($_POST['agreed'])) {
    	$actions = array(
    			
    			'username' => sanitize(stripInput($_POST['username'])),
    			'password' => sanitize(stripInput($_POST['password'])),
    			'usermail' => sanitize(stripInput($_POST['usermail'])),
    			'realname' => sanitize(stripInput($_POST['realname'])),
    			'socialid' => sanitize(stripInput($_POST['socialid'])),
    	);
    	$errors = array();
    	
    	$check_login = "SELECT * FROM account.account WHERE login = '{$actions['username']}'";
    	$check_login = $sqlServ->query($check_login);
    	$rows_login = $check_login->num_rows;
    
    	$check_email = "SELECT * FROM account.account WHERE email = '{$actions['usermail']}'";
    	$check_email = $sqlServ->query($check_email);
    	$rows_email = $check_email->num_rows;
    	if($rows_login >= 1) {
    		echo '<div class="alert alert-danger" role="alert">';
    		echo '	Invalid name!';
    		echo '</div>';
    	} else if($rows_email >= 1) {
    		echo '<div class="alert alert-danger" role="alert">';
    		echo '	Email is invalid!';
    		echo '</div>';
    	} else {
    		if(filter_var($actions['usermail'], FILTER_VALIDATE_EMAIL)) {
    			if($_POST['password'] == $_POST['rpassword']) {
    				$query = "INSERT INTO account.account (login, password, real_name, social_id, email, create_time)
    						VALUES (?, PASSWORD(?), ?, ?, ?, NOW())";
    				$sanitize = array(
    						':user' => $actions['username'],
    						':pass' => $actions['password'],
    						':mail' => $actions['usermail'],
    						':name' => $actions['realname'],
    						':soid' => $actions['socialid'],
    				);
    				$insert = $sqlServ->prepare($query);
    				$insert->bind_param('sssss', $sanitize[':user'], $sanitize[':pass'], $sanitize[':name'], $sanitize[':soid'], $sanitize[':mail']);
    				$insert->execute();
    				echo '<div class="alert alert-success" role="alert">';
    				echo '	Acc <strong>' . $actions['username'] . '</strong> Created Successfully!';
    				echo '</div>';
    			} else {
    				echo '<div class="alert alert-danger" role="alert">';
    				echo '	Passwords do not match!';
    				echo '</div>';
    			}
    		} else {
    			echo '<div class="alert alert-success" role="alert">';
    			echo '	E-mail not valid!';
    			echo '</div>';
    		}
    	}
    }
    ?>
    	<div class="well">
    		<div class="table-responsive">
    			<form action="<?= $_SERVER['PHP_SELF'] ?>?page=register" method="post">
    				<table class="table table-striped">
    					<tbody>
    						<tr>
    							<td>Login:</td>
    							<td><input type="text" class="form-control" name="username" pattern=".{5,16}" maxlength="16" placeholder="Login" required title="5-16 chars"></td>
    						</tr>
    						<tr>
    							<td>Pass:</td>
    							<td><input type="password" class="form-control" name="password" pattern=".{5,16}" maxlength="16" placeholder="Pass" required title="5-16 chars"></td>
    						</tr>
    						<tr>
    							<td>Repeat Pass:</td>
    							<td><input type="password" class="form-control" name="rpassword" pattern=".{5,16}" maxlength="16" placeholder="Repeat Pass" required title="5-16 chars"></td>
    						</tr>
    						<tr>
    							<td>E-Mail:</td>
    							<td><input type="text" class="form-control" name="usermail" pattern=".{7,64}" maxlength="64" placeholder="[email protected]" required title="max 64 chars."></td>
    						</tr>
    						<tr>
    							<td>Char Del Code:</td>
    							<td><input type="username" AUTOCOMPLETE="off" maxlength="7" class="form-control" name="socialid" placeholder="7 chars" required></td>
    						</tr>
    						<tr>
    							<td>Name:</td>
    							<td><input type="username" class="form-control" name="realname" pattern=".{3,15}" maxlength="15" placeholder="Your Name.." required title="max 15 chars."></td>
    						</tr>
    						<tr>
    							<td>I agree to <a href="index.php?page=rules">T&C
    								</a> <input type="checkbox" name="agreed"></td>
    							</td>
    							<td><input type="submit" class="btn btn-s btn-success" name="register" value="Register"></td>
    						</tr>
    					</tbody>
    				</table>
    			</form>
    		</div>
    	</div>
    <?php }} ?>
    
  2. Hey guys, is there a way to somehow run the quest on refine? i mean for example.

    you have sword +8 and upgrade it to +9 then the chat message comes up saying "Player "xxx" has successfully upgraded sword to +9 , well done from Metin2 Team" i'd really appreciate your help :)

    • Love 1
  3. Hey guys, i was wondering wether addon_type works for other bonuses not just the skill damage and average damage, looking through items in DB only difference between a normal item (say battle sword) and item with random bonuses (say poison sword) only thing that changes is addon_type, just wondering if i put the value to -2, -3 -4 and so on, will it give different bonuses ?

    had a look in source but doesn't seem to have that kind of thing in there ;/

    thanks for your replies

  4. I will try it in the evening and let you guys know, i tried it the way @r00t shown here but it accepted all items, not just ones from the table :) will definately try @metin2team way because it looks the best to me :)

    @ edit @metin2team way works as charm :) thank you guys for help , if any1 wants to do different items for for example bow then just add ...and item.get_sub_type() == 3 then , but chceck in navicat subtype table in item proto for the number

  5. Figured out that socket_pct 8 sets that weapons +2, +3, +4 shine like +7, +8, +9 if that's useful to any1 :)

    @edit

    Works same for armors ;) so socket_pct 8 makes armors +2/+3/+4 skine like +7, +8, +9

    Also im guessing if u want to start 'blue stars' from +0 it will be socket_pct 10 (not tested tho) Hope its useful to any1 ;)

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.