Beispiel #1
0
function try_login($email, $password)
{
    $mooege = new LibMooege("http://localhost", 9000);
    // change this line to match your configuration.
    if (!$mooege->connected) {
        // check if we have a succesfull connection there.
        die("Can not connect to mooege!");
    }
    $verified = $mooege->VerifyPassword($email, $password);
    if ($verified) {
        echo "Login succesful!";
    } else {
        echo "Login failed!";
    }
}
Beispiel #2
0
function create_account($email, $password)
{
    $mooege = new LibMooege("http://localhost", 9000);
    // change this line to match your configuration.
    if (!$mooege->connected) {
        // check if we have a succesfull connection there.
        die("Can not connect to mooege!");
    }
    $exists = $mooege->AccountExists($email);
    if ($exists) {
        die("An account already exists for email address: {$email}!");
    }
    $created = $mooege->CreateAccount($email, $password);
    if ($created) {
        echo "Account created successfully!";
    } else {
        echo "Error creating account!";
    }
}
Beispiel #3
0
/**
 * Prints services-info.
 */
function PrintServicesDebugInfo()
{
    $mooege = new LibMooege();
    $created = $mooege->CreateAccount("debug@", "12345678");
    $exists = $mooege->AccountExists("debug@");
    $verified = $mooege->VerifyPassword("debug@", "12345678");
    ?>
    <?php 
    if ($mooege->connected) {
        ?>
        Connected to <?php 
        echo $mooege->servicesAddress;
        ?>
.
        <ul>
            <li>Create account: debug@:12345678 [<?php 
        if ($created) {
            ?>
True<?php 
        } else {
            ?>
False<?php 
        }
        ?>
]</li>   
            <li>Account Exists: debug@ [<?php 
        if ($exists) {
            ?>
True<?php 
        } else {
            ?>
False<?php 
        }
        ?>
]</li>
            <li>Verify Password: 12345678 [<?php 
        if ($verified) {
            ?>
True<?php 
        } else {
            ?>
False<?php 
        }
        ?>
]</li>
        </ul>
    <?php 
    } else {
        ?>
        Not connected to mooege web-services!
    <?php 
    }
    ?>
  
        
    <table border='1'><tr><th>Service</th><th>Query</th><th>Result</th></tr>        
        <tr><td>Core</td><td>Version</td><td><?php 
    echo $mooege->Version();
    ?>
</td></tr>
        <tr><td>Core</td><td>Uptime</td><td><?php 
    echo $mooege->Uptime();
    ?>
</td></tr>
        <tr><td>MooNet</td><td>IsMooNetServerOnline</td><td><?php 
    echo $mooege->IsMooNetServerOnline();
    ?>
</td></tr>
        <tr><td>MooNet</td><td>TotalAccounts</td><td><?php 
    echo $mooege->TotalAccounts();
    ?>
</td></tr>
        <tr><td>MooNet</td><td>TotalToons</td><td><?php 
    echo $mooege->TotalToons();
    ?>
</td></tr>
        <tr><td>MooNet</td><td>OnlinePlayerCount</td><td><?php 
    echo $mooege->OnlinePlayerCount();
    ?>
</td></tr>
        <tr><td>MooNet</td><td>OnlinePlayersList</td><td><?php 
    echo print_r($mooege->OnlinePlayersList());
    ?>
</td></tr>
        <tr><td>GameServer</td><td>IsGameServerOnline</td><td><?php 
    echo $mooege->IsGameServerOnline();
    ?>
</td></tr>
    </table>        
<?php 
}
Beispiel #4
0
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
include "lib/LibMooege.php";
$mooege = new LibMooege("http://localhost", 9000);
// change this line to match your configuration.
?>

 <table border='1'><tr><th>Service</th><th>Query</th><th>Result</th></tr>        
        <tr><td>Core</td><td>Version</td><td><?php 
echo $mooege->Version();
?>
</td></tr>
        <tr><td>Core</td><td>Uptime</td><td><?php 
echo $mooege->Uptime();
?>
</td></tr>
        <tr><td>MooNet</td><td>IsMooNetServerOnline</td><td><?php 
echo $mooege->IsMooNetServerOnline();
?>