This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/beta5/library/preJoin.inc

46 lines
1,007 B
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
//-----------------------------------------------------------------------
// LegacyWorlds Beta 5
// Game libraries
//
// beta5/library/preJoin.inc
//
// This function lets a player who had registered into the game
//
// Copyright(C) 2004-2008, DeepClone Development
//-----------------------------------------------------------------------
class beta5_preJoin {
public function __construct($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
public function run($account) {
// Get the planet name from the queue
$q = $this->db->query("SELECT p_name FROM planet_reg_queue WHERE account = $account");
if (!($q && dbCount($q))) {
$this->db->end(false);
return false;
}
list($pName) = dbFetchArray($q);
// Delete the registration entry
$this->db->query("DELETE FROM planet_reg_queue WHERE account = $account");
// Register
if ($this->lib->call('register', $account, $pName, null)) {
$this->db->end(false);
return false;
}
return true;
}
}
?>