Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server
You last visited: Today at 11:11

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



request MT2GS CMS ip logs

Discussion on request MT2GS CMS ip logs within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
.Rebel's Avatar
 
elite*gold: 60
Join Date: May 2010
Posts: 766
Received Thanks: 1,025
request MT2GS CMS ip logs

hi people i am not a php programer but want ask if someone have the ip logs for this script

all ip login get log if someone have or know where i can find i apreciate
.Rebel is offline  
Old 04/01/2013, 04:09   #2
 
elite*gold: 0
Join Date: Mar 2010
Posts: 25
Received Thanks: 8
Still looking for it? I have it, I made it on my own, maybe I can share.
FSXraptor is offline  
Old 04/03/2013, 18:20   #3
 
elite*gold: 0
Join Date: Mar 2010
Posts: 25
Received Thanks: 8
Well i got requests to share so here it is.

First if you don't have the table `loginlog2` inside your `log` database, or if it has a different structure than the one below, you'll need to run the following query.

Code:
SET FOREIGN_KEY_CHECKS=0;

DROP TABLE IF EXISTS `loginlog2`;
CREATE TABLE `loginlog2` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` text CHARACTER SET latin1,
  `is_gm` int(11) DEFAULT NULL,
  `login_time` datetime DEFAULT NULL,
  `channel` int(11) DEFAULT NULL,
  `account_id` int(11) DEFAULT NULL,
  `pid` int(11) DEFAULT NULL,
  `client_version` text CHARACTER SET latin1,
  `ip` text CHARACTER SET latin1,
  `logout_time` datetime DEFAULT NULL,
  `playtime` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Then you have to create a php (text) file named loginlog.php and put the following code in it.


PHP Code:
<?PHP

// Do we have rights to see this page?
if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=7) {
  
    
// Check if we have used the search function
    // and modify the url.
    
if(!isset($_GET['filter']) && empty($_GET['filter'])) {
      
$_GET['filter']='';
      
$url_extension '';
    }
    else {
      
$url_extension '&filter='.$_GET['filter'];
    }

?>
<h2>Admin - Search login log</h2>
<p>In this page you can find certain information about the ingame logins of users accounts.<br/>
The search function reffers to full user account IDs.</p>
<form action="index.php" method="GET">
<input type="hidden" name="s" value="admin"/>
<input type="hidden" name="a" value="loginlog"/>
  <table>
    <tr>
      <td class="topLine" width="350"><b>Search account ID:</b></td>
      <td class="thell" width="550" style="text-align:center;"><input type="text" name="filter" value="<?PHP if(isset($_GET['filter'])) echo $_GET["filter"]; ?>" maxlength="40" size="40"/></td>
      <td class="tdunkel" width="250" style="text-align:center;"><input type="submit" name="search" value="Search"/></td>
    </tr>
  </table>
</form>
<?PHP

  
// How many results do we want per page?
  
$pageEntries 100;

  
// Do we see a page other than number 1?
  // If yes keep it, but if no then we see page number 1.
  
if(isset($_GET['p'])) {
    if(!
checkInt($_GET['p']) || !($_GET['p']>0)) $actPage 1;
    else 
$actPage $_GET['p'];
  }
  else { 
$actPage 1; }

  
// Find out how many are the total logins of the given account.
  
$sqlCmd "SELECT COUNT(*) as sumLogin  
  FROM log.loginlog2 
  WHERE loginlog2.account_id = '"
.mysql_real_escape_string($_GET['filter'])."'
  ORDER BY loginlog2.login_time DESC"
;
  
  
$sqlQry mysql_query($sqlCmd,$sqlServ);  
  
$getSum mysql_fetch_object($sqlQry);
  
$cPage calcPages($getSum->sumLogin,$actPage,$pageEntries);

  
// How many pages to display before and after the current page,
  // in the page navigation bar.
  
$maxRange 5;
  
  
// From the current page, how many pages before and
  // after will the far left and far right page links
  // be in the page navigation bar?
  
$maxStep 15;

  if((
$actPage-$maxRange)>0$sStart $actPage-$maxRange;
  else 
$sStart 1;
  if((
$actPage+$maxRange)<=$cPage[0]) $sEnd $actPage+$maxRange;
  else 
$sEnd $cPage[0];
  
  
// Page navigation bar start
  
echo '<table>
  <tr>
  <td class="tdunkel">'
;
  
  
// Far left page number-link.
  
if(($actPage-$maxStep)>0) echo '<a href="index.php?s=admin&a=loginlog'.$url_extension.'&p='.($actPage-$maxStep).'">'.($actPage-$maxStep).'</a> &laquo;';
  else echo 
'<a href="index.php?s=admin&a=loginlog'.$url_extension.'&p=1">1</a> &laquo;';
  echo
'</td>';
  
  
// Middle group of page numbers
  
for($i=$sStart;$i<=$sEnd;$i++) {
    
$sClass = ($i==$actPage) ? "topLine" "thell";
    echo
'<td class="'.$sClass.'" style="text-align:center;">';
    echo
'<a href="index.php?s=admin&a=loginlog'.$url_extension.'&p='.$i.'">'.$i.'</a>';
    echo
'</td>';
  }
  
  echo
'<td class="tdunkel" style="text-align:right;">';
  
  
// Far right page number-link.
  
if(($actPage+$maxStep)<=$cPage[0]) echo '&raquo; <a href="index.php?s=admin&a=loginlog'.$url_extension.'&p='.($actPage+$maxStep).'">'.($actPage+$maxStep).'</a>';
  else echo 
'&raquo; <a href="index.php?s=admin&a=loginlog'.$url_extension.'&p='.$cPage[0].'">'.$cPage[0].'</a>';
  echo
'</td>';
  echo
'</tr>';
  echo
'</table>'
  
// Page navigation bar end
  
?>
<table>
<tr>
  <td class="topLine"><b><center>Type</center></b></td>
  <td class="topLine"><b><center>Login time</center></b></td>
  <td class="topLine"><b><center>Channel</center></b></td>
  <td class="topLine"><b><center>Account ID</center></b></td>
  <td class="topLine"><b><center>Character ID</center></b></td>
  <td class="topLine"><b><center>ΙΡ</center></b></td>
  <td class="topLine"><b><center>Logout time</center></b></td>
</tr>
<?PHP

  
// Fetch the data from MySQL. IPs inside the table are stored after being
  // converted with INET_ATON(). See http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_inet-aton
  // Also see http://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/1714179-how-convert-numeric-ip-dotted-quad-representation-log-database.html
  
  
$sqlCmd "SELECT type,is_gm,login_time,channel,account_id,pid,INET_NTOA(ip) AS finalIP,logout_time FROM log.loginlog2
  WHERE loginlog2.account_id = '"
.mysql_real_escape_string($_GET['filter'])."'
  ORDER BY loginlog2.login_time DESC
  LIMIT "
.$cPage[1].",".$pageEntries;

  echo
'Current search filter: &laquo;<b>'.$_GET['filter'].'</b>&raquo;';
  
$sqlQry mysql_query($sqlCmd,$sqlServ);
  
$x=$cPage[1]+1;
  while(
$getLogin mysql_fetch_object($sqlQry)) {
  
    
$zF = ($x%2==0) ? "thell" "tdunkel";
    echo 
"<tr>";
    echo 
"<td class=\"$zF\"><center>".$getLogin->type."</center></td>";
    echo 
"<td class=\"$zF\"><center>".$getLogin->login_time."</center></td>";
    echo 
"<td class=\"$zF\"><center>".$getLogin->channel."</center></td>";
    echo 
"<td class=\"$zF\"><center><a href='index.php?s=admin&a=users&acc=".$getLogin->account_id."'>".$getLogin->account_id."</a></center></td>";
    echo 
"<td class=\"$zF\"><center><a href='index.php?s=admin&a=charlist&filter=".$getLogin->pid."'>".$getLogin->pid."</a></center></td>";
    echo 
"<td class=\"$zF\"><a href='index.php?s=admin&a=iplist&filter=".$getLogin->finalIP."'>".$getLogin->finalIP."</a></td>";
    echo 
"<td class=\"$zF\"><center>".$getLogin->logout_time."</center></td>";
    echo 
"</td>";
    echo 
"</tr>";

    
$x++;
    
  }
  }
  
// oops, looks like our session timed out - 
  // we are not logged in etc..
  
else {
   echo
'<p>You do NOT have access to this page.</p>';
  }
?>
</table>

Upload the loginlog.php file to your /admin folder and visit the page /index.php?s=admin&a=loginlog.
FSXraptor is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Request] Script to look at Chat logs or Players IP?
09/11/2010 - Shaiya Private Server - 1 Replies
Is there any script to look at the chat logs or players IPs? My database has that stuff empty.. so... any help would be appreciated. So please, post the script if you have it :p share summm luv.
What do the Logs log?
04/27/2010 - Dekaron Private Server - 8 Replies
Hi, Some time ago i had my own P-server but a half year ago I closed it and deleted all files. So i remember that there were logs in some of the folders (In the folders from "Dekaronserver.exe", "Loginserver.exe" and "Sessionserver.exe" i guess, but i am not 100% sure). Can someone tell exactly what they log? (for example: IP adress on which account, if a player drops an item and more...) I would give you a thanks, because I really need to know it xP



All times are GMT +2. The time now is 11:11.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.