Compare commits
87 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
899618605d | ||
|
|
488a59ff03 | ||
|
|
8060c6caea | ||
|
|
9c4423a576 | ||
|
|
b283c70078 | ||
|
|
4dda69be16 | ||
|
|
693c493fa3 | ||
|
|
42ceaecde5 | ||
|
|
3ef4f9f348 | ||
|
|
27f4595b62 | ||
|
|
58b23cd7e1 | ||
|
|
18035097d1 | ||
|
|
c311c87386 | ||
|
|
aceb97a399 | ||
|
|
f87613f046 | ||
|
|
36e4a2e952 | ||
|
|
3d63e0f5d7 | ||
|
|
ef25a1f6ce | ||
|
|
289108c67f | ||
|
|
ca4baea151 | ||
|
|
6ff59b4870 | ||
|
|
4577fedd21 | ||
|
|
7991ccb04c | ||
|
|
f4b5a26206 | ||
|
|
656c04e936 | ||
|
|
1c8e280c3b | ||
|
|
a68116b33a | ||
|
|
1c31f8c174 | ||
|
|
9183730d81 | ||
|
|
e5e6325992 | ||
|
|
ba474d1491 | ||
|
|
62fed64661 | ||
|
|
3ead342302 | ||
|
|
d5e49ba7b0 | ||
|
|
1a971c2b5b | ||
|
|
b73b6b52c4 | ||
|
|
aae2a88250 | ||
|
|
d5775cfb66 | ||
|
|
65006e26c7 | ||
|
|
dd2a6bc3ee | ||
|
|
a79d048b28 | ||
|
|
28776ca852 | ||
|
|
8b8e631e1b | ||
|
|
b0180b171e | ||
|
|
b1ac478add | ||
|
|
2f58535da5 | ||
|
|
62a9a1bd80 | ||
|
|
611efd37a1 | ||
|
|
6b0c9e0651 | ||
|
|
fc28471008 | ||
|
|
cd6240d0c7 | ||
|
|
89ff716c78 | ||
|
|
f65752d2d4 | ||
|
|
8197c46237 | ||
|
|
bb7e99a727 | ||
|
|
e1c2e9012d | ||
|
|
71d8009138 | ||
|
|
69a22ac11b | ||
|
|
88efdebc4b | ||
|
|
e83489391c | ||
|
|
26c3e038ff | ||
|
|
1fc0bd9ec6 | ||
|
|
3c4e7dd98e | ||
|
|
f2bfb12dd3 | ||
|
|
592cb8c8b9 | ||
|
|
f25dba8699 | ||
|
|
29a82f28cb | ||
|
|
9fb8dea5b8 | ||
|
|
2b4f74307f | ||
|
|
ff65aa5471 | ||
|
|
77c00ff283 | ||
|
|
58f5165f0c | ||
|
|
1362435096 | ||
|
|
b7b66f31a8 | ||
|
|
6dea374f02 | ||
|
|
ffcbb0c61a | ||
|
|
2d69997fd4 | ||
|
|
1d617983fd | ||
|
|
55fecd2780 | ||
|
|
c276775db6 | ||
|
|
ff96c2bce3 | ||
|
|
2ecfdb18eb | ||
|
|
7c881aaac9 | ||
|
|
c880c904d5 | ||
|
|
f515e278a7 | ||
|
|
cb61131d04 | ||
|
|
2368828f68 |
21
README.md
@@ -1,20 +1,11 @@
|
||||
# SWG Authentication for Wordpress
|
||||
# SWG Authentication for WordPress
|
||||
|
||||
# Usage:
|
||||
1. Upload the plugin files to the `wp-content/plugins/swg-auth/` directory or install the plugin through the WordPress admin panel.
|
||||
2. Activate the plugin through the Wordpress admin panel.
|
||||
3. Point your SWG server's externalAuthURL config flag to `http://url.to.wordpress/?action=swg-auth`.
|
||||
1. Upload the plugin files to the `wp-content/plugins/swg-auth/` directory or install the plugin through the WordPress Admin Panel.
|
||||
2. Activate the plugin through the WordPress Admin Panel.
|
||||
3. Get the SWG Server Config you need from SWG Auth -> Server Config
|
||||
4. Done!
|
||||
|
||||
# Admin Level Checks:
|
||||
Make sure you've got the latest src downloaded and compiled, and add the following to your SWG server cfg:
|
||||
```
|
||||
[ServerUtility]
|
||||
externalAdminLevelsEnabled=true
|
||||
externalAdminLevelsURL=http://url.to.wordpress/?action=swg-auth-admin-level
|
||||
```
|
||||
Anyone with admin access to Wordpress will also have admin level 50 to use god mode in game.
|
||||
|
||||
# Notes:
|
||||
- Existing users should make a Wordpress account with the _same username_ that they were already using in order to gain access to their existing characters
|
||||
- HTTPS is reccomended to avoid sending packets that contain plaintext passwords
|
||||
- Existing users should make a WordPress account with the _same username_ that they were already using in order to gain access to their existing characters
|
||||
- HTTPS is recommended to avoid sending packets that contain plain text passwords
|
||||
|
||||
22
swg-auth/admin/css/swg-auth-dashicons.css
Normal file
@@ -0,0 +1,22 @@
|
||||
@font-face {
|
||||
font-family: 'swg auth dashicons';
|
||||
src: url('../fonts/swg-auth-dashicons.eot');
|
||||
src: url('../fonts/swg-auth-dashicons.eot?#iefix') format('embedded-opentype'),
|
||||
url('../fonts/swg-auth-dashicons.woff') format('woff'),
|
||||
url('../fonts/swg-auth-dashicons.ttf') format('truetype'),
|
||||
url('../fonts/swg-auth-dashicons.svg#swg-auth-dashicons') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
[class*='dashicons-swg']:before{
|
||||
display: inline-block;
|
||||
font-family: 'swg auth dashicons';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
line-height: 1;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale
|
||||
}
|
||||
|
||||
.dashicons-swg:before{content:'\0041';}
|
||||
BIN
swg-auth/admin/fonts/swg-auth-dashicons.eot
Normal file
1
swg-auth/admin/fonts/swg-auth-dashicons.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" ><svg xmlns="http://www.w3.org/2000/svg"><metadata>Generated by Glyphter</metadata><defs><font id="swg-auth-dashicons" horiz-adv-x="0"><font-face units-per-em="1024" ascent="1024" descent="0" font-family="swg-auth-dashicons" font-weight="normal" /><missing-glyph horiz-adv-x="0" /><glyph unicode="A" d="M512.884,1024C512.884,1024,494.159,959.636,494.159,959.636C494.159,959.636,470.754,792.397,470.754,792.397C470.754,792.397,480.01,784.763,480.01,784.763C480.274,784.544,480.534,784.311,480.784,784.078C511.532,755.292,541.547,725.654,570.271,694.663C570.271,694.663,532.694,959.996,532.694,959.996C532.694,959.996,512.884,1024,512.884,1024C512.884,1024,512.884,1024,512.884,1024M314.804,722.073C314.804,722.073,327.429,683.263,327.429,683.263C327.429,683.263,372.572,577.061,372.572,577.061C372.572,577.061,136.196,555.395,136.196,555.395C136.196,555.395,72.5,542.345,72.5,542.345C72.5,542.345,136.114,523.723,136.114,523.723C136.114,523.723,377.553,478.433,377.553,478.433C377.553,478.433,311.984,407.671,311.984,407.671C311.984,407.671,278.573,367.058,278.573,367.058C278.573,367.058,323.654,378.844,323.654,378.844C323.654,378.844,440.783,422.689,440.783,422.689C440.783,422.689,492.136,59.866,492.136,59.866C492.136,59.866,512.88,0,512.88,0C512.88,0,532.027,59.866,532.027,59.866C532.027,59.866,580.349,422.436,580.349,422.436C580.349,422.436,682.242,379.477,682.242,379.477C682.242,379.477,710.953,371.111,710.953,371.111C691.057,405.213,669.532,438.395,646.688,470.728C646.688,470.728,642.471,475.811,642.471,475.811C642.471,475.811,643.008,475.914,643.008,475.914C602.303,533.024,557.513,587.478,510.344,639.689C510.344,639.689,499.564,562.7,499.564,562.7C499.564,562.7,402.789,648.634,402.789,648.634C402.789,648.634,368.19,667.934,368.19,667.934C368.19,667.934,314.804,722.073,314.804,722.073M708.259,716.445C708.259,716.445,679.73,700.729,679.73,700.729C679.73,700.729,613.849,645.936,613.849,645.936C613.849,645.936,660.296,730.648,660.296,730.648C660.296,730.648,669.925,761.553,669.925,761.553C669.925,761.553,708.259,716.445,708.259,716.445M677.138,569.523C693.991,547.96,710.419,526.16,726.7,504.395C726.94,504.07,727.166,503.741,727.378,503.403C729.422,500.205,731.503,497.018,733.601,493.835C733.601,493.835,893.474,525.455,893.474,525.455C893.474,525.455,951.806,542.345,951.806,542.345C951.806,542.345,894.011,555.364,894.011,555.364C894.011,555.364,677.138,569.523,677.138,569.523C677.138,569.523,677.138,569.523,677.138,569.523M214.086,700.133C195.429,737.577,184.214,778.348,175.071,818.872C175.584,843.543,173.582,872.217,192.745,890.894C209.505,909.465,237.59,910.663,260.881,906.494C284.409,902.892,305.127,889.09,326.916,880.093C377.159,848.336,422.828,810.054,468.57,772.357C511.477,732.192,552.816,690.483,591.074,645.871C634.652,598.079,673.872,546.542,712.545,494.834C735.98,458.171,762.627,423.357,784.313,385.715C807.845,335.906,836.251,288.251,853.086,235.581C861.716,212.738,865.972,187.998,867.978,163.799C871.24,134.691,857.386,100.418,826.929,92.014C798.191,84.072,768.221,94.04,742.122,106.165C677.754,136.495,623.184,183.062,569.645,228.991C563.634,240.658,567.136,261.249,584.183,257.014C623.359,225.75,664.825,197.008,708.276,172.011C730.383,161.194,756.616,146.272,781.356,155.881C803.069,169.15,797.192,199.048,793.874,220.248C785.607,255.487,771,289.131,755.894,321.929C694.241,442.133,612.097,550.808,521.613,650.951C476.553,699.538,427.624,745.067,374.434,784.766C344.111,803.372,313.986,825.493,278.809,833.352C261.453,837.464,236.005,838.628,230.278,817.239C221.151,784.468,230.521,750.52,240.229,718.896C245.172,707.654,246.949,690.517,232.078,686.454C223.602,685.591,216.259,692.349,214.086,700.133C214.086,700.133,214.086,700.133,214.086,700.133" class="dashicons-swg"/></font></defs></svg>
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
BIN
swg-auth/admin/fonts/swg-auth-dashicons.ttf
Normal file
BIN
swg-auth/admin/fonts/swg-auth-dashicons.woff
Normal file
1
swg-auth/admin/html/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //Shh...
|
||||
49
swg-auth/admin/html/swg-auth-server-config-html.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Check for the secret keys
|
||||
$loginserver_key = get_option( 'swg-auth-loginserver-key' );
|
||||
$serverutility_key = get_option( 'swg-auth-serverutility-key' );
|
||||
$centralserver_key = get_option( 'swg-auth-centralserver-key' );
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
|
||||
|
||||
<p>This is the SWG Server Configuration you need. Edit these values in your existing configuration files, or else just paste all of it at the bottom of <kbd>localOptions.cfg</kbd>.</p>
|
||||
|
||||
<p><strong>Note:</strong> Always make sure you've downloaded and compiled the latest SWG src.</p>
|
||||
|
||||
<p>
|
||||
<code>
|
||||
[LoginServer]<br>
|
||||
useExternalAuth=true<br>
|
||||
<?php echo ( get_option( 'swg-auth-auth-type' ) === 'JsonWebAPI' ) ? "useJsonWebApi=true<br>" : ''; ?>
|
||||
externalAuthURL=<?php echo get_site_url(); ?>/?action=swg-auth
|
||||
<?php echo ( $loginserver_key !== '' ) ? '<br>externalAuthSecretKey=' . $loginserver_key : ''; ?>
|
||||
</code>
|
||||
</p>
|
||||
<p>
|
||||
<code>
|
||||
[ServerUtility]<br>
|
||||
externalAdminLevelsEnabled=true<br>
|
||||
externalAdminLevelsURL=<?php echo get_site_url(); ?>/?action=swg-auth-admin-level
|
||||
<?php echo ( $serverutility_key !== '' ) ? '<br>externalAdminLevelsSecretKey=' . $serverutility_key : ''; ?>
|
||||
</code>
|
||||
</p>
|
||||
<p>
|
||||
<code>
|
||||
[CentralServer]<br>
|
||||
metricsDataURL=<?php echo get_site_url(); ?>/?action=swg-auth-metrics<br>
|
||||
webUpdateIntervalSeconds=5
|
||||
<?php echo ( $centralserver_key !== '' ) ? '<br>metricsSecretKey=' . $centralserver_key : ''; ?>
|
||||
</code>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
63
swg-auth/admin/html/swg-auth-server-settings-html.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
if ( isset( $_GET['tab'] ) ) {
|
||||
$tab = $_GET['tab'];
|
||||
} else {
|
||||
$tab = 'general';
|
||||
}
|
||||
|
||||
settings_errors();
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
|
||||
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<a href="?page=swg-auth-server-settings&tab=general" class="nav-tab<?php echo $tab === 'general' ? ' nav-tab-active' : '' ?>">General</a>
|
||||
<a href="?page=swg-auth-server-settings&tab=zones" class="nav-tab<?php echo $tab === 'zones' ? ' nav-tab-active' : '' ?>">Zones</a>
|
||||
<a href="?page=swg-auth-server-settings&tab=events" class="nav-tab<?php echo $tab === 'events' ? ' nav-tab-active' : '' ?>">Events</a>
|
||||
<a href="?page=swg-auth-server-settings&tab=advanced" class="nav-tab<?php echo $tab === 'advanced' ? ' nav-tab-active' : '' ?>">Advanced</a>
|
||||
<a href="?page=swg-auth-server-settings&tab=custom" class="nav-tab<?php echo $tab === 'custom' ? ' nav-tab-active' : '' ?>">Custom</a>
|
||||
</h2>
|
||||
|
||||
<form action="options.php" method="post">
|
||||
<?php
|
||||
if ( $tab === 'general' ) {
|
||||
settings_fields( 'swg-auth-general-server-settings' );
|
||||
do_settings_sections( 'swg-auth-general-server-settings' );
|
||||
} elseif ( $tab === 'zones' ) {
|
||||
settings_fields( 'swg-auth-zones-settings' );
|
||||
do_settings_sections( 'swg-auth-zones-settings' );
|
||||
} elseif ( $tab === 'events' ) {
|
||||
settings_fields( 'swg-auth-events-settings' );
|
||||
do_settings_sections( 'swg-auth-events-settings' );
|
||||
} elseif ( $tab === 'advanced' ) {
|
||||
settings_fields( 'swg-auth-advanced-server-settings' );
|
||||
do_settings_sections( 'swg-auth-advanced-server-settings' );
|
||||
} elseif ( $tab === 'custom' ) {
|
||||
?>
|
||||
<style>
|
||||
.form-table th {
|
||||
width: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
textarea {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
settings_fields( 'swg-auth-custom-server-settings' );
|
||||
do_settings_sections( 'swg-auth-custom-server-settings' );
|
||||
}
|
||||
submit_button( 'Save Settings' );
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
22
swg-auth/admin/html/swg-auth-settings-html.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
settings_errors();
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
|
||||
|
||||
<form action="options.php" method="post">
|
||||
<?php settings_fields( 'swg-auth-settings' ); ?>
|
||||
<?php do_settings_sections( 'swg-auth-settings' ); ?>
|
||||
<?php submit_button( 'Save Settings' ); ?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
96
swg-auth/admin/html/swg-auth-user-settings-html.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h3>SWG Settings</h3>
|
||||
|
||||
<?php
|
||||
// We're going to need OCI8 to look up character names.
|
||||
if ( extension_loaded( 'OCI8' ) ) {
|
||||
// Do we have a Station ID on file for this account?
|
||||
$station_id = get_user_meta( $user->ID, 'swg-auth-station-id', true );
|
||||
if ( $station_id ) {
|
||||
// If so, ask Oracle for a list of characters on this account.
|
||||
$connection = swg_auth_oci_connect();
|
||||
$statement = oci_parse( $connection, "SELECT * FROM PLAYERS WHERE STATION_ID='" . $station_id . "'" );
|
||||
$results = oci_execute( $statement );
|
||||
// Create a list of characters.
|
||||
$format = get_option( 'date_format' );
|
||||
echo '<p>Characters associated with this account:</p>';
|
||||
echo '<ul>';
|
||||
while ( $result = oci_fetch_array( $statement, OCI_ASSOC + OCI_RETURN_NULLS ) ) {
|
||||
echo '<li>' . $result['CHARACTER_FULL_NAME'] . ' (Last Login: ' . wp_date( $format, strtotime( $result['LAST_LOGIN_TIME'] ) ) . '; Created: ' . wp_date( $format, strtotime( $result['CREATE_TIME'] ) ) . ')' . '</li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
} else {
|
||||
// No Station ID in user meta
|
||||
echo '<p>Station ID unknown. Waiting for next account authentication...</p>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$is_admin = false;
|
||||
// Collect the user's existing meta values
|
||||
$approved = get_user_meta( $user->ID, 'swg-auth-approved', true );
|
||||
$banned = get_user_meta( $user->ID, 'swg-auth-banned', true );
|
||||
$admin_level = get_user_meta( $user->ID, 'swg-auth-admin-level', true );
|
||||
?>
|
||||
|
||||
<?php if ( user_can( $user, 'administrator' ) ): ?>
|
||||
<?php $is_admin = true; ?>
|
||||
<span class="description">This user is an Administrator and therefore has Game Access and Admin Level 50.</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<table class="form-table">
|
||||
|
||||
<?php if ( $approved === 'on' || $is_admin ): ?>
|
||||
<input type="hidden" name="swg-auth-approved" value="on">
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( get_option( 'swg-auth-approval-required' ) ): ?>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="swg-auth-approved">Approved For Game Access</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type="checkbox" <?php echo ( $approved === 'on' || $is_admin ) ? 'checked disabled' : 'name="swg-auth-approved"'; ?>>
|
||||
<span class="description">Once approved, cannot be unapproved</span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<label for="swg-auth-banned">Banned From Game Access</label>
|
||||
</th>
|
||||
<td>
|
||||
<?php if ( $is_admin ): ?>
|
||||
<input type="checkbox" name="swg-auth-banned" disabled>
|
||||
<?php else: ?>
|
||||
<input type="checkbox" name="swg-auth-banned" <?php echo ( $banned === 'on' ) ? 'checked' : ''; ?>>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>
|
||||
<label for="swg-auth-admin-level">Admin Level (For God Mode)</label>
|
||||
</th>
|
||||
<td>
|
||||
<?php if ( $is_admin ): ?>
|
||||
<input type="hidden" name="swg-auth-admin-level" value="0">
|
||||
<input type="number" value="50" min="0" max="50" disabled>
|
||||
<?php else: ?>
|
||||
<input type="number" name="swg-auth-admin-level" min="0" max="50" value="<?php echo ( $admin_level === null ) ? '0' : esc_attr( $admin_level ); ?>">
|
||||
<?php endif; ?>
|
||||
<span class="description">Must be between 0 and 50</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
1
swg-auth/admin/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //Shh...
|
||||
1
swg-auth/admin/js/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //Shh...
|
||||
9
swg-auth/admin/js/swg-auth-generate-secret-key.js
Normal file
@@ -0,0 +1,9 @@
|
||||
function swg_auth_generate_secret_key( field ) {
|
||||
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
var length = 32;
|
||||
var key = '';
|
||||
for ( var i = 0; i < length; i++ ) {
|
||||
key += chars[ Math.floor( Math.random() * chars.length ) ];
|
||||
}
|
||||
document.getElementById( field ).value = key;
|
||||
}
|
||||
81
swg-auth/admin/swg-auth-admin-menus.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Build the Admin Menus
|
||||
add_action( 'admin_menu', 'swg_auth_admin_menus' );
|
||||
function swg_auth_admin_menus() {
|
||||
|
||||
add_menu_page(
|
||||
'SWG Auth',
|
||||
'SWG Auth',
|
||||
'administrator',
|
||||
'swg-auth-settings',
|
||||
'swg_auth_settings_html',
|
||||
'dashicons-swg',
|
||||
3
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
'swg-auth-settings',
|
||||
'SWG Auth Settings',
|
||||
'Settings',
|
||||
'administrator',
|
||||
'swg-auth-settings',
|
||||
'swg_auth_settings_html',
|
||||
1
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
'swg-auth-settings',
|
||||
'SWG Server Settings (BETA)',
|
||||
'Server Settings',
|
||||
'administrator',
|
||||
'swg-auth-server-settings',
|
||||
'swg_auth_server_settings_html',
|
||||
1
|
||||
);
|
||||
|
||||
add_submenu_page(
|
||||
'swg-auth-settings',
|
||||
'Server Config',
|
||||
'Server Config',
|
||||
'administrator',
|
||||
'swg-auth-server-config',
|
||||
'swg_auth_server_config_html',
|
||||
10
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
// Include the Admin Menu HTML files
|
||||
function swg_auth_settings_html() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return;
|
||||
}
|
||||
include( plugin_dir_path( __FILE__ ) . 'html/swg-auth-settings-html.php' );
|
||||
}
|
||||
|
||||
function swg_auth_server_settings_html() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return;
|
||||
}
|
||||
include( plugin_dir_path( __FILE__ ) . 'html/swg-auth-server-settings-html.php' );
|
||||
}
|
||||
|
||||
function swg_auth_server_config_html() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return;
|
||||
}
|
||||
include( plugin_dir_path( __FILE__ ) . 'html/swg-auth-server-config-html.php' );
|
||||
}
|
||||
|
||||
// Include the Admin CSS
|
||||
add_action( 'admin_enqueue_scripts', 'swg_auth_admin_enqueue_scripts' );
|
||||
function swg_auth_admin_enqueue_scripts() {
|
||||
wp_register_style( 'swg_auth_dashicons', plugins_url( '/swg-auth/admin/css/swg-auth-dashicons.css' ) );
|
||||
wp_enqueue_style( 'swg_auth_dashicons' );
|
||||
}
|
||||
8772
swg-auth/admin/swg-auth-server-settings.php
Normal file
359
swg-auth/admin/swg-auth-settings.php
Normal file
@@ -0,0 +1,359 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
add_action( 'admin_init', 'swg_auth_settings' );
|
||||
function swg_auth_settings() {
|
||||
|
||||
add_settings_section(
|
||||
'swg-auth-general-settings',
|
||||
'General Settings',
|
||||
'swg_auth_general_settings_html',
|
||||
'swg-auth-settings'
|
||||
);
|
||||
|
||||
register_setting(
|
||||
'swg-auth-settings',
|
||||
'swg-auth-approval-required',
|
||||
array(
|
||||
'type' => 'boolean',
|
||||
'description' => 'Whether approval is required for game access.',
|
||||
'sanitize_callback' => '', // TODO: A callback function that sanitizes the option's value.
|
||||
'show_in_rest' => false,
|
||||
'default' => false
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'swg-auth-approval-required',
|
||||
'Account Approval Required',
|
||||
'swg_auth_approval_required_html',
|
||||
'swg-auth-settings',
|
||||
'swg-auth-general-settings',
|
||||
array(
|
||||
//'label_for' => '', // When supplied, the setting title will be wrapped in a <label> element, its for attribute populated with this value.
|
||||
//'class' => '', // CSS Class to be added to the <tr> element when the field is output.
|
||||
)
|
||||
);
|
||||
|
||||
register_setting(
|
||||
'swg-auth-settings',
|
||||
'swg-auth-auth-type',
|
||||
array(
|
||||
'type' => 'string',
|
||||
'description' => 'What type of auth is to be used.',
|
||||
'sanitize_callback' => '', // TODO: A callback function that sanitizes the option's value.
|
||||
'show_in_rest' => false,
|
||||
'default' => 'WebAPI'
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'swg-auth-auth-type',
|
||||
'Auth Type',
|
||||
'swg_auth_auth_type_html',
|
||||
'swg-auth-settings',
|
||||
'swg-auth-general-settings',
|
||||
array(
|
||||
//'label_for' => '', // When supplied, the setting title will be wrapped in a <label> element, its for attribute populated with this value.
|
||||
//'class' => '', // CSS Class to be added to the <tr> element when the field is output.
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_section(
|
||||
'swg-auth-odb-settings',
|
||||
'Oracle Database Connection Settings',
|
||||
'swg_auth_odb_settings_html',
|
||||
'swg-auth-settings'
|
||||
);
|
||||
|
||||
register_setting(
|
||||
'swg-auth-settings',
|
||||
'swg-auth-odb-username',
|
||||
array(
|
||||
'type' => 'string',
|
||||
'description' => 'Oracle Username',
|
||||
'sanitize_callback' => '', // TODO: A callback function that sanitizes the option's value.
|
||||
'show_in_rest' => false,
|
||||
'default' => 'swg'
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'swg-auth-odb-username',
|
||||
'Oracle Username',
|
||||
'swg_auth_odb_username_html',
|
||||
'swg-auth-settings',
|
||||
'swg-auth-odb-settings',
|
||||
array(
|
||||
//'label_for' => '', // When supplied, the setting title will be wrapped in a <label> element, its for attribute populated with this value.
|
||||
//'class' => '', // CSS Class to be added to the <tr> element when the field is output.
|
||||
)
|
||||
);
|
||||
|
||||
register_setting(
|
||||
'swg-auth-settings',
|
||||
'swg-auth-odb-password',
|
||||
array(
|
||||
'type' => 'string',
|
||||
'description' => 'Oracle Password',
|
||||
'sanitize_callback' => '', // TODO: A callback function that sanitizes the option's value.
|
||||
'show_in_rest' => false,
|
||||
'default' => 'swg'
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'swg-auth-odb-password',
|
||||
'Oracle Password',
|
||||
'swg_auth_odb_password_html',
|
||||
'swg-auth-settings',
|
||||
'swg-auth-odb-settings',
|
||||
array(
|
||||
//'label_for' => '', // When supplied, the setting title will be wrapped in a <label> element, its for attribute populated with this value.
|
||||
//'class' => '', // CSS Class to be added to the <tr> element when the field is output.
|
||||
)
|
||||
);
|
||||
|
||||
register_setting(
|
||||
'swg-auth-settings',
|
||||
'swg-auth-odb-sid',
|
||||
array(
|
||||
'type' => 'string',
|
||||
'description' => 'Oracle SID',
|
||||
'sanitize_callback' => '', // TODO: A callback function that sanitizes the option's value.
|
||||
'show_in_rest' => false,
|
||||
'default' => 'swg'
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'swg-auth-odb-sid',
|
||||
'Oracle SID',
|
||||
'swg_auth_odb_sid_html',
|
||||
'swg-auth-settings',
|
||||
'swg-auth-odb-settings',
|
||||
array(
|
||||
//'label_for' => '', // When supplied, the setting title will be wrapped in a <label> element, its for attribute populated with this value.
|
||||
//'class' => '', // CSS Class to be added to the <tr> element when the field is output.
|
||||
)
|
||||
);
|
||||
|
||||
register_setting(
|
||||
'swg-auth-settings',
|
||||
'swg-auth-odb-ip',
|
||||
array(
|
||||
'type' => 'string',
|
||||
'description' => 'Oracle IP Address',
|
||||
'sanitize_callback' => '', // TODO: A callback function that sanitizes the option's value.
|
||||
'show_in_rest' => false,
|
||||
'default' => 'localhost'
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'swg-auth-odb-ip',
|
||||
'Oracle IP Address',
|
||||
'swg_auth_odb_ip_html',
|
||||
'swg-auth-settings',
|
||||
'swg-auth-odb-settings',
|
||||
array(
|
||||
//'label_for' => '', // When supplied, the setting title will be wrapped in a <label> element, its for attribute populated with this value.
|
||||
//'class' => '', // CSS Class to be added to the <tr> element when the field is output.
|
||||
)
|
||||
);
|
||||
|
||||
register_setting(
|
||||
'swg-auth-settings',
|
||||
'swg-auth-odb-port',
|
||||
array(
|
||||
'type' => 'string',
|
||||
'description' => 'Oracle Port',
|
||||
'sanitize_callback' => '', // TODO: A callback function that sanitizes the option's value.
|
||||
'show_in_rest' => false,
|
||||
'default' => '1521'
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'swg-auth-odb-port',
|
||||
'Oracle Port',
|
||||
'swg_auth_odb_port_html',
|
||||
'swg-auth-settings',
|
||||
'swg-auth-odb-settings',
|
||||
array(
|
||||
//'label_for' => '', // When supplied, the setting title will be wrapped in a <label> element, its for attribute populated with this value.
|
||||
//'class' => '', // CSS Class to be added to the <tr> element when the field is output.
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_section(
|
||||
'swg-auth-secret-keys',
|
||||
'Secret Keys',
|
||||
'swg_auth_secret_keys_html',
|
||||
'swg-auth-settings'
|
||||
);
|
||||
|
||||
register_setting(
|
||||
'swg-auth-settings',
|
||||
'swg-auth-loginserver-key',
|
||||
array(
|
||||
'type' => 'string',
|
||||
'description' => 'LoginServer Key',
|
||||
'sanitize_callback' => '', // TODO: A callback function that sanitizes the option's value.
|
||||
'show_in_rest' => false,
|
||||
'default' => ''
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'swg-auth-loginserver-key',
|
||||
'LoginServer Key',
|
||||
'swg_auth_loginserver_key_html',
|
||||
'swg-auth-settings',
|
||||
'swg-auth-secret-keys',
|
||||
array(
|
||||
//'label_for' => '', // When supplied, the setting title will be wrapped in a <label> element, its for attribute populated with this value.
|
||||
//'class' => '', // CSS Class to be added to the <tr> element when the field is output.
|
||||
)
|
||||
);
|
||||
|
||||
register_setting(
|
||||
'swg-auth-settings',
|
||||
'swg-auth-serverutility-key',
|
||||
array(
|
||||
'type' => 'string',
|
||||
'description' => 'ServerUtility Key',
|
||||
'sanitize_callback' => '', // TODO: A callback function that sanitizes the option's value.
|
||||
'show_in_rest' => false,
|
||||
'default' => ''
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'swg-auth-serverutility-key',
|
||||
'ServerUtility Key',
|
||||
'swg_auth_serverutility_key_html',
|
||||
'swg-auth-settings',
|
||||
'swg-auth-secret-keys',
|
||||
array(
|
||||
//'label_for' => '', // When supplied, the setting title will be wrapped in a <label> element, its for attribute populated with this value.
|
||||
//'class' => '', // CSS Class to be added to the <tr> element when the field is output.
|
||||
)
|
||||
);
|
||||
|
||||
register_setting(
|
||||
'swg-auth-settings',
|
||||
'swg-auth-centralserver-key',
|
||||
array(
|
||||
'type' => 'string',
|
||||
'description' => 'CentralServer Key',
|
||||
'sanitize_callback' => '', // TODO: A callback function that sanitizes the option's value.
|
||||
'show_in_rest' => false,
|
||||
'default' => ''
|
||||
)
|
||||
);
|
||||
|
||||
add_settings_field(
|
||||
'swg-auth-centralserver-key',
|
||||
'CentralServer Key',
|
||||
'swg_auth_centralserver_key_html',
|
||||
'swg-auth-settings',
|
||||
'swg-auth-secret-keys',
|
||||
array(
|
||||
//'label_for' => '', // When supplied, the setting title will be wrapped in a <label> element, its for attribute populated with this value.
|
||||
//'class' => '', // CSS Class to be added to the <tr> element when the field is output.
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
function swg_auth_general_settings_html( $args ) {
|
||||
echo '';
|
||||
}
|
||||
|
||||
function swg_auth_approval_required_html( $args ) {
|
||||
?>
|
||||
<label for="swg-auth-approval-required">
|
||||
<input type="checkbox" name="swg-auth-approval-required" <?php echo ( get_option( 'swg-auth-approval-required' ) === 'on' ) ? 'checked' : ''; ?>>
|
||||
Require new accounts to be manually approved before they can login to the game.
|
||||
</label>
|
||||
<?php
|
||||
}
|
||||
|
||||
function swg_auth_auth_type_html( $args ) {
|
||||
$current_value = get_option( 'swg-auth-auth-type' );
|
||||
?>
|
||||
<select name="swg-auth-auth-type">
|
||||
<option value="WebAPI" <?php echo ( $current_value === 'WebAPI' ) ? 'selected="selected"' : ''; ?>>WebAPI</option>
|
||||
<option value="JsonWebAPI" <?php echo ( $current_value === 'JsonWebAPI' ) ? 'selected="selected"' : ''; ?>>JsonWebAPI</option>
|
||||
</select>
|
||||
<?php
|
||||
}
|
||||
|
||||
function swg_auth_odb_settings_html( $args ) {
|
||||
?>
|
||||
<p>The PHP OCI8 extension is <strong><?php echo extension_loaded( 'OCI8' ) ? 'loaded' : 'NOT loaded'; ?></strong>.</p>
|
||||
<p>The connection to Oracle is <strong><?php echo swg_auth_oci_connect() ? 'working' : 'NOT working'; ?></strong>.</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
function swg_auth_odb_username_html( $args ) {
|
||||
?>
|
||||
<input type="text" name="swg-auth-odb-username" value="<?php echo esc_attr( get_option( 'swg-auth-odb-username' ) ); ?>">
|
||||
<?php
|
||||
}
|
||||
|
||||
function swg_auth_odb_password_html( $args ) {
|
||||
?>
|
||||
<input type="text" name="swg-auth-odb-password" value="<?php echo esc_attr( get_option( 'swg-auth-odb-password' ) ); ?>">
|
||||
<?php
|
||||
}
|
||||
|
||||
function swg_auth_odb_sid_html( $args ) {
|
||||
?>
|
||||
<input type="text" name="swg-auth-odb-sid" value="<?php echo esc_attr( get_option( 'swg-auth-odb-sid' ) ); ?>">
|
||||
<?php
|
||||
}
|
||||
|
||||
function swg_auth_odb_ip_html( $args ) {
|
||||
?>
|
||||
<input type="text" name="swg-auth-odb-ip" value="<?php echo esc_attr( get_option( 'swg-auth-odb-ip' ) ); ?>">
|
||||
<?php
|
||||
}
|
||||
|
||||
function swg_auth_odb_port_html( $args ) {
|
||||
?>
|
||||
<input type="text" name="swg-auth-odb-port" value="<?php echo esc_attr( get_option( 'swg-auth-odb-port' ) ); ?>">
|
||||
<?php
|
||||
}
|
||||
|
||||
function swg_auth_secret_keys_html( $args ) {
|
||||
echo '';
|
||||
}
|
||||
|
||||
function swg_auth_loginserver_key_html( $args ) {
|
||||
?>
|
||||
<input type="text" name="swg-auth-loginserver-key" id="swg-auth-loginserver-key" size="40" value="<?php echo esc_attr( get_option( 'swg-auth-loginserver-key' ) ); ?>"> <button type="button" onClick="swg_auth_generate_secret_key( 'swg-auth-loginserver-key' );">Generate New Key</button>
|
||||
<?php
|
||||
}
|
||||
|
||||
function swg_auth_serverutility_key_html( $args ) {
|
||||
?>
|
||||
<input type="text" name="swg-auth-serverutility-key" id="swg-auth-serverutility-key" size="40" value="<?php echo esc_attr( get_option( 'swg-auth-serverutility-key' ) ); ?>"> <button type="button" onClick="swg_auth_generate_secret_key( 'swg-auth-serverutility-key' );">Generate New Key</button>
|
||||
<?php
|
||||
}
|
||||
|
||||
function swg_auth_centralserver_key_html( $args ) {
|
||||
?>
|
||||
<input type="text" name="swg-auth-centralserver-key" id="swg-auth-centralserver-key" size="40" value="<?php echo esc_attr( get_option( 'swg-auth-centralserver-key' ) ); ?>"> <button type="button" onClick="swg_auth_generate_secret_key( 'swg-auth-centralserver-key' );">Generate New Key</button>
|
||||
<?php
|
||||
}
|
||||
|
||||
add_action( 'admin_enqueue_scripts', 'swg_auth_enqueue_admin_scripts' );
|
||||
function swg_auth_enqueue_admin_scripts() {
|
||||
wp_enqueue_script( 'swg-auth-generate-secret-key', plugin_dir_url( __FILE__ ) . 'js/swg-auth-generate-secret-key.js' );
|
||||
}
|
||||
61
swg-auth/admin/swg-auth-user-settings.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Add the User Settings HTML
|
||||
add_action( 'show_user_profile', 'swg_auth_user_settings' );
|
||||
add_action( 'edit_user_profile', 'swg_auth_user_settings' );
|
||||
function swg_auth_user_settings( $user ) {
|
||||
if ( ! current_user_can( 'administrator' ) ) {
|
||||
return;
|
||||
}
|
||||
include( plugin_dir_path( __FILE__ ) . 'html/swg-auth-user-settings-html.php' );
|
||||
}
|
||||
|
||||
// Save the User Settings
|
||||
add_action( 'edit_user_profile_update', 'swg_auth_approved_update' );
|
||||
function swg_auth_approved_update( $user_id ) {
|
||||
if ( ! current_user_can( 'edit_user', $user_id ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( ! isset( $_POST['swg-auth-approved'] ) ) {
|
||||
return update_user_meta( $user_id, 'swg-auth-approved', null );
|
||||
}
|
||||
return update_user_meta( $user_id, 'swg-auth-approved', $_POST['swg-auth-approved'] );
|
||||
}
|
||||
|
||||
add_action( 'edit_user_profile_update', 'swg_auth_banned_update' );
|
||||
function swg_auth_banned_update( $user_id ) {
|
||||
if ( ! current_user_can( 'edit_user', $user_id ) ) {
|
||||
return false;
|
||||
}
|
||||
if ( ! isset( $_POST['swg-auth-banned'] ) ) {
|
||||
return update_user_meta( $user_id, 'swg-auth-banned', null );
|
||||
}
|
||||
return update_user_meta( $user_id, 'swg-auth-banned', $_POST['swg-auth-banned'] );
|
||||
}
|
||||
|
||||
add_action( 'edit_user_profile_update', 'swg_auth_admin_level_update' );
|
||||
function swg_auth_admin_level_update( $user_id ) {
|
||||
if ( ! current_user_can( 'edit_user', $user_id ) ) {
|
||||
return false;
|
||||
}
|
||||
$admin_level = intval( $_POST['swg-auth-admin-level'] );
|
||||
if ( ! is_int( $admin_level ) || $admin_level < 0 || $admin_level > 50 ) {
|
||||
return false;
|
||||
}
|
||||
return update_user_meta( $user_id, 'swg-auth-admin-level', $admin_level );
|
||||
}
|
||||
|
||||
// User Settings Errors
|
||||
add_filter( 'user_profile_update_errors', 'swg_auth_user_settings_errors' );
|
||||
function swg_auth_user_settings_errors( $errors ) {
|
||||
$admin_level = intval( $_POST['swg-auth-admin-level'] );
|
||||
if ( ! is_int( $admin_level ) || $admin_level < 0 || $admin_level > 50 ) {
|
||||
$errors->add( 'swg-auth-invalid-admin-level', '<strong>ERROR:</strong> Admin Level must be between 0 and 50.' );
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
1
swg-auth/includes/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //Shh...
|
||||
41
swg-auth/includes/swg-auth-admin-level-check.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Check if the swg-auth-admin-level action is requested and that a user_name is provided
|
||||
if ( isset( $_GET['action'] ) && $_GET['action'] === 'swg-auth-admin-level' && isset( $_POST['user_name'] ) ) {
|
||||
|
||||
// Check the secret key
|
||||
if ( $_POST['secretKey'] !== get_option( 'swg-auth-serverutility-key', '' ) ) {
|
||||
// If it's incorrect, stop immediately
|
||||
die;
|
||||
}
|
||||
|
||||
// Look up the user
|
||||
$user = get_user_by( 'login', $_POST['user_name'] );
|
||||
// Look up the user's Admin level
|
||||
$level = get_user_meta( $user->ID, 'swg-auth-admin-level', true );
|
||||
|
||||
// If the user is a WordPress Admin, send back level 50
|
||||
if ( user_can( $user, 'administrator' ) ) {
|
||||
$response['message'] = '50';
|
||||
|
||||
// If an Admin Level exists in the user's metadata, send that value
|
||||
} elseif( $level !== null ) {
|
||||
$response['message'] = $level;
|
||||
|
||||
// Not an Admin
|
||||
} else {
|
||||
$response['message'] = '0';
|
||||
}
|
||||
|
||||
// JSON Encode our response so that the SWG server can understand it
|
||||
echo json_encode( $response );
|
||||
|
||||
// Once we've responded, we don't want WordPress to continue
|
||||
die;
|
||||
|
||||
}
|
||||
76
swg-auth/includes/swg-auth-check.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Check if the swg-auth action is requested
|
||||
if ( isset( $_GET['action'] ) && $_GET['action'] === 'swg-auth' ) {
|
||||
|
||||
// What type of auth are we using?
|
||||
$auth_type = get_option( 'swg-auth-auth-type', 'WebAPI' );
|
||||
|
||||
// Parse for the data we need
|
||||
if ( $auth_type === 'WebAPI' ) {
|
||||
$username = $_POST['user_name'];
|
||||
$password = $_POST['user_password'];
|
||||
$station_id = $_POST['stationID'];
|
||||
$ip = $_POST['ip'];
|
||||
$key = $_POST['secretKey'];
|
||||
} elseif ( $auth_type === 'JsonWebAPI' ) {
|
||||
$data = json_decode( file_get_contents( 'php://input' ), true );
|
||||
$username = $data['user_name'];
|
||||
$password = $data['user_password'];
|
||||
$station_id = $data['stationID'];
|
||||
$ip = $data['ip'];
|
||||
$key = $data['secretKey'];
|
||||
}
|
||||
|
||||
// Do we have everything we need continue?
|
||||
if ( ! isset( $username ) || ! isset( $password ) ) {
|
||||
// If not, abort the auth check and return to WordPress
|
||||
return;
|
||||
}
|
||||
|
||||
// Check the secret key
|
||||
if ( $key !== get_option( 'swg-auth-loginserver-key', '' ) ) {
|
||||
// If it's incorrect, stop immediately
|
||||
die;
|
||||
}
|
||||
|
||||
// Ask WordPress to authenticate the username and userpassword
|
||||
$user = wp_authenticate_username_password( null, $username, $password );
|
||||
|
||||
// Check if the authentication request returned an error
|
||||
if ( is_wp_error( $user ) ) {
|
||||
$response['message'] = 'Account does not exist or password was incorrect';
|
||||
|
||||
// WordPress Administrators are always let in
|
||||
} elseif ( user_can( $user, 'administrator' ) ) {
|
||||
$response['message'] = 'success';
|
||||
|
||||
// Check if the user is banned
|
||||
} elseif ( get_user_meta( $user->ID, 'swg-auth-banned', true ) === 'on' ) {
|
||||
$response['message'] = 'This account has been banned';
|
||||
|
||||
// Check if approval is required and if the user is approved
|
||||
} elseif ( get_option( 'swg-auth-approval-required' ) === 'on' && get_user_meta( $user->ID, 'swg-auth-approved', true ) !== 'on' ) {
|
||||
$response['message'] = 'This account has not yet been approved';
|
||||
|
||||
// If we're this far along, success!
|
||||
} else {
|
||||
$response['message'] = 'success';
|
||||
}
|
||||
|
||||
// Save the account's Station ID for later
|
||||
update_user_meta( $user->ID, 'swg-auth-station-id', $station_id );
|
||||
|
||||
// JSON Encode our response so that the SWG server can understand it
|
||||
header('Content-type: application/json');
|
||||
echo json_encode( $response );
|
||||
|
||||
// Once we've responded, we don't want WordPress to continue
|
||||
die;
|
||||
|
||||
}
|
||||
41
swg-auth/includes/swg-auth-metrics-listener.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Check if metrics are being sent
|
||||
if ( isset( $_GET['action'] ) && $_GET['action'] === 'swg-auth-metrics' ) {
|
||||
|
||||
// Decode the metrics data
|
||||
$data = json_decode( file_get_contents( 'php://input' ), true );
|
||||
|
||||
// Check the secret key
|
||||
if ( $data['secretKey'] !== get_option( 'swg-auth-centralserver-key', '' ) ) {
|
||||
// If it's incorrect, stop immediately
|
||||
die;
|
||||
}
|
||||
|
||||
// Add our own timestamp so that we know when this data was received
|
||||
$data['timestamp'] = time();
|
||||
|
||||
// Have we set a new record for the highest population?
|
||||
$old_data = get_option( 'swg-auth-metrics-data' );
|
||||
if ( ! array_key_exists( 'highestPlayerCount', $old_data ) || $old_data['highestPlayerCount'] < $data['totalPlayerCount'] ) {
|
||||
// If so, save the data for our new record
|
||||
$data['highestPlayerCount'] = $data['totalPlayerCount'];
|
||||
$data['highestPlayerCountTimestamp'] = $data['timestamp'];
|
||||
} else {
|
||||
// If not, save the data from our most recent record
|
||||
$data['highestPlayerCount'] = $old_data['highestPlayerCount'];
|
||||
$data['highestPlayerCountTimestamp'] = $old_data['highestPlayerCountTimestamp'];
|
||||
}
|
||||
|
||||
// Put the data into the database for later
|
||||
update_option( 'swg-auth-metrics-data', $data );
|
||||
|
||||
// We're all done. We don't want WordPress to continue
|
||||
die;
|
||||
|
||||
}
|
||||
34
swg-auth/includes/swg-auth-oci.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
function swg_auth_oci_connect() {
|
||||
// Dont even bother if the OCI8 extension isn't installed
|
||||
if ( ! extension_loaded( 'OCI8' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make our connection using values saved in the WordPress database (or these defaults)
|
||||
$connection = oci_connect(
|
||||
get_option( 'swg-auth-odb-username', 'swg' ),
|
||||
get_option( 'swg-auth-odb-password', 'swg' ),
|
||||
'(DESCRIPTION =
|
||||
(ADDRESS_LIST =
|
||||
(ADDRESS =
|
||||
(PROTOCOL = TCP)
|
||||
(HOST = ' . get_option( 'swg-auth-odb-ip', 'localhost' ) . ')
|
||||
(PORT = ' . get_option( 'swg-auth-odb-port', '1521' ) . ')
|
||||
)
|
||||
)
|
||||
(CONNECT_DATA =
|
||||
(SID = ' . get_option( 'swg-auth-odb-sid', 'swg' ) . ')
|
||||
)
|
||||
)'
|
||||
);
|
||||
|
||||
// Send back our connection resource
|
||||
return $connection;
|
||||
}
|
||||
385
swg-auth/includes/swg-auth-webcfg.php
Normal file
@@ -0,0 +1,385 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Is the webcfg action requested?
|
||||
if ( isset( $_GET['action'] ) && $_GET['action'] === 'swg-auth-webcfg' ) {
|
||||
// Begin Outputting CFG
|
||||
?>
|
||||
[BestineEvents]
|
||||
MuseumEventDuration=<?php echo get_option( 'swg-auth-MuseumEventDuration', '1209600' ) . PHP_EOL; ?>
|
||||
PoliticianEventDuration=<?php echo get_option( 'swg-auth-PoliticianEventDuration', '2592000' ) . PHP_EOL; ?>
|
||||
|
||||
[CentralServer]
|
||||
<?php echo get_option( 'swg-auth-enable-corellia', 'on' ) === 'on' ? 'startPlanet=corellia' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-dantooine', 'on' ) === 'on' ? 'startPlanet=dantooine' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-dathomir', 'on' ) === 'on' ? 'startPlanet=dathomir' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-endor', 'on' ) === 'on' ? 'startPlanet=endor' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-lok', 'on' ) === 'on' ? 'startPlanet=lok' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-kashyyyk-dead-forest', 'on' ) === 'on' ? 'startPlanet=kashyyyk_dead_forest' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-kashyyyk-hunting', 'on' ) === 'on' ? 'startPlanet=kashyyyk_hunting' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-kashyyyk-main', 'on' ) === 'on' ? 'startPlanet=kashyyyk_main' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-kashyyyk-north-dungeons', 'on' ) === 'on' ? 'startPlanet=kashyyyk_north_dungeons' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-kashyyyk-pob-dungeons', 'on' ) === 'on' ? 'startPlanet=kashyyyk_pob_dungeons' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-kashyyyk-rryatt-trail', 'on' ) === 'on' ? 'startPlanet=kashyyyk_rryatt_trail' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-kashyyyk-south-dungeons', 'on' ) === 'on' ? 'startPlanet=kashyyyk_south_dungeons' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-mustafar', 'on' ) === 'on' ? 'startPlanet=mustafar' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-naboo', 'on' ) === 'on' ? 'startPlanet=naboo' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-rori', 'on' ) === 'on' ? 'startPlanet=rori' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-talus', 'on' ) === 'on' ? 'startPlanet=talus' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-tatooine', 'on' ) === 'on' ? 'startPlanet=tatooine' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-yavin4', 'on' ) === 'on' ? 'startPlanet=yavin4' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-corellia', 'on' ) === 'on' ? 'startPlanet=space_corellia' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-dantooine', 'on' ) === 'on' ? 'startPlanet=space_dantooine' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-dathomir', 'on' ) === 'on' ? 'startPlanet=space_dathomir' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-endor', 'on' ) === 'on' ? 'startPlanet=space_endor' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-lok', 'on' ) === 'on' ? 'startPlanet=space_lok' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-kashyyyk', 'on' ) === 'on' ? 'startPlanet=space_kashyyyk' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-naboo', 'on' ) === 'on' ? 'startPlanet=space_naboo' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-nova-orion', 'on' ) === 'on' ? 'startPlanet=space_nova_orion' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-tatooine', 'on' ) === 'on' ? 'startPlanet=space_tatooine' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-yavin4', 'on' ) === 'on' ? 'startPlanet=space_yavin4' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-heavy1', 'on' ) === 'on' ? 'startPlanet=space_heavy1' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-light1', 'on' ) === 'on' ? 'startPlanet=space_light1' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-tutorial', 'on' ) === 'on' ? 'startPlanet=tutorial' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-dungeon1', 'on' ) === 'on' ? 'startPlanet=dungeon1' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-adventure1', 'on' ) === 'on' ? 'startPlanet=adventure1' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-adventure2', 'on' ) === 'on' ? 'startPlanet=adventure2' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-npe-falcon', 'on' ) === 'on' ? 'startPlanet=space_npe_falcon' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-npe-falcon-2', 'on' ) === 'on' ? 'startPlanet=space_npe_falcon_2' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-npe-falcon-3', 'on' ) === 'on' ? 'startPlanet=space_npe_falcon_3' . PHP_EOL : ''; ?>
|
||||
<?php echo get_option( 'swg-auth-enable-space-ord-mantell', 'on' ) === 'on' ? 'startPlanet=space_ord_mantell' . PHP_EOL : ''; ?>
|
||||
chatServiceBindInterface=<?php echo get_option( 'swg-auth-chatServiceBindInterface', 'eth0' ) . PHP_EOL; ?>
|
||||
clusterName=<?php echo get_option( 'swg-auth-cluster-name', 'swg' ) . PHP_EOL; ?>
|
||||
customerServiceBindInterface=<?php echo get_option( 'swg-auth-customerServiceBindInterface', 'eth0' ) . PHP_EOL; ?>
|
||||
developmentMode=<?php echo get_option( 'swg-auth-developmentMode', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
metricsDataURL=<?php echo get_site_url(); ?>/?action=swg-auth-metrics
|
||||
<?php echo ( get_option( 'swg-auth-centralserver-key' ) !== '' ) ? 'metricsSecretKey=' . get_option( 'swg-auth-centralserver-key' ) . PHP_EOL : ''; ?>
|
||||
newbieTutorialEnabled=<?php echo get_option( 'swg-auth-newbieTutorialEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
webUpdateIntervalSeconds=<?php echo get_option( 'swg-auth-webUpdateIntervalSeconds', '10' ) . PHP_EOL; ?>
|
||||
|
||||
[CharacterBuilder]
|
||||
itvMinUsageLevel=<?php echo get_option( 'swg-auth-itvMinUsageLevel', '0' ) . PHP_EOL; ?>
|
||||
armorEnabled=<?php echo get_option( 'swg-auth-armorEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
BestResourcesEnabled=<?php echo get_option( 'swg-auth-BestResourcesEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
buffsEnabled=<?php echo get_option( 'swg-auth-buffsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
builderEnabled=<?php echo get_option( 'swg-auth-builderEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
commandsEnabled=<?php echo get_option( 'swg-auth-commandsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
craftingEnabled=<?php echo get_option( 'swg-auth-craftingEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
creditsEnabled=<?php echo get_option( 'swg-auth-creditsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
deedsEnabled=<?php echo get_option( 'swg-auth-deedsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
devEnabled=<?php echo get_option( 'swg-auth-devEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
DraftSchematicsEnabled=<?php echo get_option( 'swg-auth-DraftSchematicsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
factionEnabled=<?php echo get_option( 'swg-auth-factionEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
HeroicFlagEnabled=<?php echo get_option( 'swg-auth-HeroicFlagEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
jediEnabled=<?php echo get_option( 'swg-auth-jediEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
miscitemEnabled=<?php echo get_option( 'swg-auth-miscitemEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
pahallEnabled=<?php echo get_option( 'swg-auth-pahallEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
petsEnabled=<?php echo get_option( 'swg-auth-petsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
questEnabled=<?php echo get_option( 'swg-auth-questEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
resourcesEnabled=<?php echo get_option( 'swg-auth-resourcesEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
shipsEnabled=<?php echo get_option( 'swg-auth-shipsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
skillsEnabled=<?php echo get_option( 'swg-auth-skillsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
vehiclesEnabled=<?php echo get_option( 'swg-auth-vehiclesEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
warpsEnabled=<?php echo get_option( 'swg-auth-warpsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
weaponsEnabled=<?php echo get_option( 'swg-auth-weaponsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
|
||||
[ChatServer]
|
||||
centralServerAddress=<?php echo get_option( 'swg-auth-server-ip', '192.168.0.0' ) . PHP_EOL; ?>
|
||||
clusterName=<?php echo get_option( 'swg-auth-cluster-name', 'swg' ) . PHP_EOL; ?>
|
||||
gatewayServerIP=<?php echo get_option( 'swg-auth-gatewayServerIP', '127.0.0.1' ) . PHP_EOL; ?>
|
||||
gatewayServerPort=<?php echo get_option( 'swg-auth-gatewayServerPort', '5001' ) . PHP_EOL; ?>
|
||||
registrarHost=<?php echo get_option( 'swg-auth-registrarHost', '127.0.0.1' ) . PHP_EOL; ?>
|
||||
registrarPort=<?php echo get_option( 'swg-auth-registrarPort', '5000' ) . PHP_EOL; ?>
|
||||
|
||||
[CommodityServer]
|
||||
minutesActiveToUnaccessed=<?php echo get_option( 'swg-auth-minutesActiveToUnaccessed', '43200' ) . PHP_EOL; ?>
|
||||
minutesUnaccessedToEndangered=<?php echo get_option( 'swg-auth-minutesUnaccessedToEndangered', '7200' ) . PHP_EOL; ?>
|
||||
minutesEmptyToEndangered=<?php echo get_option( 'swg-auth-minutesEmptyToEndangered', '21600' ) . PHP_EOL; ?>
|
||||
minutesEndangeredToRemoved=<?php echo get_option( 'swg-auth-minutesEndangeredToRemoved', '21600' ) . PHP_EOL; ?>
|
||||
minutesVendorAuctionTimer=<?php echo get_option( 'swg-auth-minutesVendorAuctionTimer', '43200' ) . PHP_EOL; ?>
|
||||
minutesVendorItemTimer=<?php echo get_option( 'swg-auth-minutesVendorItemTimer', '43200' ) . PHP_EOL; ?>
|
||||
|
||||
[ConnectionServer]
|
||||
chatServiceBindInterface=<?php echo get_option( 'swg-auth-chatServiceBindInterface', 'eth0' ) . PHP_EOL; ?>
|
||||
clientOverflowLimit=<?php echo get_option( 'swg-auth-clientOverflowLimit', '5242880' ) . PHP_EOL; ?>
|
||||
customerServiceBindInterface=<?php echo get_option( 'swg-auth-customerServiceBindInterface', 'eth0' ) . PHP_EOL; ?>
|
||||
disableWorldSnapshot=<?php echo get_option( 'swg-auth-disableWorldSnapshot', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
pingPort=<?php echo get_option( 'swg-auth-pingPort', '44462' ) . PHP_EOL; ?>
|
||||
validateClientVersion=<?php echo get_option( 'swg-auth-validateClientVersion', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
validateStationKey=<?php echo get_option( 'swg-auth-validateStationKey', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
|
||||
[Custom]
|
||||
dailyMissionXpLimit=<?php echo get_option( 'swg-auth-dailyMissionXpLimit', '10' ) . PHP_EOL; ?>
|
||||
grantElderBuff=<?php echo get_option( 'swg-auth-grantElderBuff', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
reverseEngineeringBonusMultiplier=<?php echo get_option( 'swg-auth-reverseEngineeringBonusMultipliert', '1.0' ) . PHP_EOL; ?>
|
||||
|
||||
[dbProcess]
|
||||
centralServerAddress=<?php echo get_option( 'swg-auth-server-ip', '192.168.0.0' ) . PHP_EOL; ?>
|
||||
databaseProtocol=<?php echo get_option( 'swg-auth-databaseProtocol', 'OCI' ) . PHP_EOL; ?>
|
||||
databasePWD=<?php echo get_option( 'swg-auth-odb-password', 'swg' ) . PHP_EOL; ?>
|
||||
databaseUID=<?php echo get_option( 'swg-auth-odb-username', 'swg' ) . PHP_EOL; ?>
|
||||
DSN=<?php echo get_option( 'swg-auth-DSN', '//127.0.0.1/swg' ) . PHP_EOL; ?>
|
||||
loaderThreads=<?php echo get_option( 'swg-auth-loaderThreads', '1' ) . PHP_EOL; ?>
|
||||
persisterThreads=<?php echo get_option( 'swg-auth-persisterThreads', '1' ) . PHP_EOL; ?>
|
||||
sharedLoginMode=<?php echo get_option( 'swg-auth-sharedLoginMode', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
useTemplates=<?php echo get_option( 'swg-auth-useTemplates', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
|
||||
[Dungeon]
|
||||
Corellian_Corvette_Imperial=<?php echo get_option( 'swg-auth-Corellian_Corvette_Imperial', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
Corellian_Corvette_Neutral=<?php echo get_option( 'swg-auth-Corellian_Corvette_Neutral', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
Corellian_Corvette_Rebel=<?php echo get_option( 'swg-auth-Corellian_Corvette_Rebel', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
Death_Watch=<?php echo get_option( 'swg-auth-Death_Watch', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
Geonosian=<?php echo get_option( 'swg-auth-Geonosian', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
serverSwitch=<?php echo get_option( 'swg-auth-serverSwitch', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
|
||||
[EventTeam]
|
||||
anniversary=<?php echo get_option( 'swg-auth-anniversary', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
forceFoolsDay=<?php echo get_option( 'swg-auth-forceFoolsDay', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
gcwraid=<?php echo get_option( 'swg-auth-gcwraid', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
goldenTicket=<?php echo get_option( 'swg-auth-goldenTicket', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
goldenTicketDropChance=<?php echo get_option( 'swg-auth-goldenTicketDropChance', '2' ) . PHP_EOL; ?>
|
||||
goldenTicketsAvailable=<?php echo get_option( 'swg-auth-goldenTicketsAvailable', '10' ) . PHP_EOL; ?>
|
||||
restussEvent=<?php echo get_option( 'swg-auth-restussEvent', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
restussPhase=<?php echo get_option( 'swg-auth-restussPhase', '2' ) . PHP_EOL; ?>
|
||||
restussProgressionOn=<?php echo get_option( 'swg-auth-restussProgressionOn', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
|
||||
[GameServer]
|
||||
chroniclesXpModifier=<?php echo get_option( 'swg-auth-chroniclesXpModifier', '1.0' ) . PHP_EOL; ?>
|
||||
gcwPointBonus=<?php echo get_option( 'swg-auth-gcwPointBonus', '5.0' ) . PHP_EOL; ?>
|
||||
gcwTokenBonus=<?php echo get_option( 'swg-auth-gcwTokenBonus', '5.0' ) . PHP_EOL; ?>
|
||||
harvesterExtractionRateMultiplier=<?php echo get_option( 'swg-auth-harvesterExtractionRateMultiplier', '5.0' ) . PHP_EOL; ?>
|
||||
xpMultiplier=<?php echo get_option( 'swg-auth-xpMultiplier', '3' ) . PHP_EOL; ?>
|
||||
|
||||
empireday_ceremony=<?php echo get_option( 'swg-auth-empireday_ceremony', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
foolsDay=<?php echo get_option( 'swg-auth-foolsDay', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
halloween=<?php echo get_option( 'swg-auth-halloween', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
lifeday=<?php echo get_option( 'swg-auth-lifeday', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
loveday=<?php echo get_option( 'swg-auth-loveday', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
|
||||
adminGodToAll=<?php echo get_option( 'swg-auth-adminGodToAll', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
adminGodToAllGodLevel=<?php echo get_option( 'swg-auth-adminGodToAllGodLevel', '50' ) . PHP_EOL; ?>
|
||||
aiLoggingEnabled=<?php echo get_option( 'swg-auth-aiLoggingEnabled', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
allowMasterObjectCreation=<?php echo get_option( 'swg-auth-allowMasterObjectCreation', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
allowPlayersToPackVendors=<?php echo get_option( 'swg-auth-allowPlayersToPackVendors', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
centralServerAddress=<?php echo get_option( 'swg-auth-server-ip', '192.168.0.0' ) . PHP_EOL; ?>
|
||||
chroniclesChroniclerGoldTokenChanceOverride=<?php echo get_option( 'swg-auth-chroniclesChroniclerGoldTokenChanceOverride', '15' ) . PHP_EOL; ?>
|
||||
chroniclesChroniclerSilverTokenNumModifier=<?php echo get_option( 'swg-auth-chroniclesChroniclerSilverTokenNumModifier', '2' ) . PHP_EOL; ?>
|
||||
chroniclesQuestorGoldTokenChanceOverride=<?php echo get_option( 'swg-auth-chroniclesQuestorGoldTokenChanceOverride', '15' ) . PHP_EOL; ?>
|
||||
chroniclesQuestorSilverTokenNumModifier=<?php echo get_option( 'swg-auth-chroniclesQuestorSilverTokenNumModifier', '2' ) . PHP_EOL; ?>
|
||||
combatUpgradeReward=<?php echo get_option( 'swg-auth-combatUpgradeReward', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
commoditiesMarketEnabled=<?php echo get_option( 'swg-auth-commoditiesMarketEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
createAppearances=<?php echo get_option( 'swg-auth-createAppearances', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
createZoneObjects=<?php echo get_option( 'swg-auth-createZoneObjects', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
debugMode=<?php echo get_option( 'swg-auth-debugMode', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
deleteEventProps=<?php echo get_option( 'swg-auth-deleteEventProps', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
disableResources=<?php echo get_option( 'swg-auth-disableResources', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
drainRate=<?php echo get_option( 'swg-auth-drainRate', '0.00065' ) . PHP_EOL; ?>
|
||||
enableCovertImperialMercenary=<?php echo get_option( 'swg-auth-enableCovertImperialMercenary', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
enableCovertRebelMercenary=<?php echo get_option( 'swg-auth-enableCovertRebelMercenary', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
enableOvertImperialMercenary=<?php echo get_option( 'swg-auth-enableOvertImperialMercenary', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
enableOvertRebelMercenary=<?php echo get_option( 'swg-auth-enableOvertRebelMercenary', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
enablePreload=<?php echo get_option( 'swg-auth-enablePreload', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
fatalOnGoldPobChange=<?php echo get_option( 'swg-auth-fatalOnGoldPobChange', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
flashSpeederReward=<?php echo get_option( 'swg-auth-flashSpeederReward', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
gcwcitybestine=<?php echo get_option( 'swg-auth-gcwcitybestine', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
gcwcitydearic=<?php echo get_option( 'swg-auth-gcwcitydearic', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
gcwcitykeren=<?php echo get_option( 'swg-auth-gcwcitykeren', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
gcwInvasionCityMaximumRunning=<?php echo get_option( 'swg-auth-gcwInvasionCityMaximumRunning', '1' ) . PHP_EOL; ?>
|
||||
gcwInvasionCycleTime=<?php echo get_option( 'swg-auth-gcwInvasionCycleTime', '1' ) . PHP_EOL; ?>
|
||||
grantGift=<?php echo get_option( 'swg-auth-grantGift', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
hibernateDistance=<?php echo get_option( 'swg-auth-hibernateDistance', '65.0' ) . PHP_EOL; ?>
|
||||
hibernateEnabled=<?php echo get_option( 'swg-auth-hibernateEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
hibernateProxies=<?php echo get_option( 'swg-auth-hibernateProxies', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
idleLogoutTimeSec=<?php echo get_option( 'swg-auth-idleLogoutTimeSec', '300' ) . PHP_EOL; ?>
|
||||
javaConsoleDebugMessages=<?php echo get_option( 'swg-auth-javaConsoleDebugMessages', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
javaEngineProfiling=<?php echo get_option( 'swg-auth-javaEngineProfiling', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
javaLocalRefLimit=<?php echo get_option( 'swg-auth-javaLocalRefLimit', '16' ) . PHP_EOL; ?>
|
||||
javaVMName=<?php echo get_option( 'swg-auth-javaVMName', 'sun' ) . PHP_EOL; ?>
|
||||
maxGoldNetworkId=<?php echo get_option( 'swg-auth-maxGoldNetworkId', '10000000' ) . PHP_EOL; ?>
|
||||
maxItemAttribBonus=<?php echo get_option( 'swg-auth-maxItemAttribBonus', '250' ) . PHP_EOL; ?>
|
||||
maxObjectSkillModBonus=<?php echo get_option( 'swg-auth-maxObjectSkillModBonus', '999' ) . PHP_EOL; ?>
|
||||
maxRespecCount=<?php echo get_option( 'swg-auth-maxRespecCount', '0' ) . PHP_EOL; ?>
|
||||
maxSocketSkillModBonus=<?php echo get_option( 'swg-auth-maxSocketSkillModBonus', '999' ) . PHP_EOL; ?>
|
||||
minRespecIntervalInSeconds=<?php echo get_option( 'swg-auth-minRespecIntervalInSeconds', '43200' ) . PHP_EOL; ?>
|
||||
mountsEnabled=<?php echo get_option( 'swg-auth-mountsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
nameValidationAcceptAll=<?php echo get_option( 'swg-auth-nameValidationAcceptAll', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
regenActionScale=<?php echo get_option( 'swg-auth-regenActionScale', '1.75' ) . PHP_EOL; ?>
|
||||
regenBase=<?php echo get_option( 'swg-auth-regenBase', '0.999' ) . PHP_EOL; ?>
|
||||
regenConstant=<?php echo get_option( 'swg-auth-regenConstant', '0' ) . PHP_EOL; ?>
|
||||
regenerationRate=<?php echo get_option( 'swg-auth-regenerationRate', '0.0064' ) . PHP_EOL; ?>
|
||||
regenHealthScale=<?php echo get_option( 'swg-auth-regenHealthScale', '6' ) . PHP_EOL; ?>
|
||||
regenMindScale=<?php echo get_option( 'swg-auth-regenMindScale', '0.5' ) . PHP_EOL; ?>
|
||||
regenScale=<?php echo get_option( 'swg-auth-regenScale', '2.5' ) . PHP_EOL; ?>
|
||||
reservedObjectIds=<?php echo get_option( 'swg-auth-reservedObjectIds', '1000000' ) . PHP_EOL; ?>
|
||||
respecDurationAllowedInSeconds=<?php echo get_option( 'swg-auth-respecDurationAllowedInSeconds', '2419200' ) . PHP_EOL; ?>
|
||||
rlsDropChance=<?php echo get_option( 'swg-auth-rlsDropChance', '0.5' ) . PHP_EOL; ?>
|
||||
rlsEnabled=<?php echo get_option( 'swg-auth-rlsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
rlsExceptionalDropChance=<?php echo get_option( 'swg-auth-rlsExceptionalDropChance', '25' ) . PHP_EOL; ?>
|
||||
rlsLegendaryDropChance=<?php echo get_option( 'swg-auth-rlsLegendaryDropChance', '5' ) . PHP_EOL; ?>
|
||||
rlsMaxLevelsAbovePlayerLevel=<?php echo get_option( 'swg-auth-rlsMaxLevelsAbovePlayerLevel', '6' ) . PHP_EOL; ?>
|
||||
rlsMaxLevelsBelowPlayerLevel=<?php echo get_option( 'swg-auth-rlsMaxLevelsBelowPlayerLevel', '6' ) . PHP_EOL; ?>
|
||||
rlsMinDistanceFromLastLoot=<?php echo get_option( 'swg-auth-rlsMinDistanceFromLastLoot', '5' ) . PHP_EOL; ?>
|
||||
rlsMinTimeBetweenAwards=<?php echo get_option( 'swg-auth-rlsMinTimeBetweenAwards', '900' ) . PHP_EOL; ?>
|
||||
rlsRareDropChance=<?php echo get_option( 'swg-auth-rlsRareDropChance', '70' ) . PHP_EOL; ?>
|
||||
scriptPath=<?php echo get_option( 'swg-auth-scriptPath', '../../data/sku.0/sys.server/compiled/game/' ) . PHP_EOL; ?>
|
||||
scriptWatcherInterruptTime=<?php echo get_option( 'swg-auth-scriptWatcherInterruptTime', '0' ) . PHP_EOL; ?>
|
||||
scriptWatcherWarnTime=<?php echo get_option( 'swg-auth-scriptWatcherWarnTime', '5000' ) . PHP_EOL; ?>
|
||||
sendBreadcrumbs=<?php echo get_option( 'swg-auth-sendBreadcrumbs', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
sendPlayerTransform=<?php echo get_option( 'swg-auth-sendPlayerTransform', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
serverLoadLevel=<?php echo get_option( 'swg-auth-serverLoadLevel', 'heavy' ) . PHP_EOL; ?>
|
||||
serverSpawnLimit=<?php echo get_option( 'swg-auth-serverSpawnLimit', '60000' ) . PHP_EOL; ?>
|
||||
spaceGcwCorelliaActive=<?php echo get_option( 'swg-auth-spaceGcwCorelliaActive', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
spaceGcwCorelliaDelay=<?php echo get_option( 'swg-auth-spaceGcwCorelliaDelay', '3' ) . PHP_EOL; ?>
|
||||
spaceGcwCorelliaStagger=<?php echo get_option( 'swg-auth-spaceGcwCorelliaStagger', '2' ) . PHP_EOL; ?>
|
||||
spaceGcwDantooineActive=<?php echo get_option( 'swg-auth-spaceGcwDantooineActive', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
spaceGcwDantooineDelay=<?php echo get_option( 'swg-auth-spaceGcwDantooineDelay', '3' ) . PHP_EOL; ?>
|
||||
spaceGcwDantooineStagger=<?php echo get_option( 'swg-auth-spaceGcwDantooineStagger', '0' ) . PHP_EOL; ?>
|
||||
spaceGcwGunshipPlayerCeiling=<?php echo get_option( 'swg-auth-spaceGcwGunshipPlayerCeiling', '10' ) . PHP_EOL; ?>
|
||||
spaceGcwLengthOfBattle=<?php echo get_option( 'swg-auth-spaceGcwLengthOfBattle', '3600.0' ) . PHP_EOL; ?>
|
||||
spaceGcwLokActive=<?php echo get_option( 'swg-auth-spaceGcwLokActive', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
spaceGcwLokDelay=<?php echo get_option( 'swg-auth-spaceGcwLokDelay', '3' ) . PHP_EOL; ?>
|
||||
spaceGcwLokStagger=<?php echo get_option( 'swg-auth-spaceGcwLokStagger', '2' ) . PHP_EOL; ?>
|
||||
spaceGcwLossPointModifier=<?php echo get_option( 'swg-auth-spaceGcwLossPointModifier', '1.0' ) . PHP_EOL; ?>
|
||||
spaceGcwLossTokenModifier=<?php echo get_option( 'swg-auth-spaceGcwLossTokenModifier', '1.0' ) . PHP_EOL; ?>
|
||||
spaceGcwMaxSupportShips=<?php echo get_option( 'swg-auth-spaceGcwMaxSupportShips', '30' ) . PHP_EOL; ?>
|
||||
spaceGcwNabooActive=<?php echo get_option( 'swg-auth-spaceGcwNabooActive', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
spaceGcwNabooDelay=<?php echo get_option( 'swg-auth-spaceGcwNabooDelay', '3' ) . PHP_EOL; ?>
|
||||
spaceGcwNabooStagger=<?php echo get_option( 'swg-auth-spaceGcwNabooStagger', '4' ) . PHP_EOL; ?>
|
||||
spaceGcwPobPlayerCeiling=<?php echo get_option( 'swg-auth-spaceGcwPobPlayerCeiling', '4' ) . PHP_EOL; ?>
|
||||
spaceGcwPointAward=<?php echo get_option( 'swg-auth-spaceGcwPointAward', '2500' ) . PHP_EOL; ?>
|
||||
spaceGcwPrepatoryTime=<?php echo get_option( 'swg-auth-spaceGcwPrepatoryTime', '900.0' ) . PHP_EOL; ?>
|
||||
spaceGcwPvEPointModifier=<?php echo get_option( 'swg-auth-spaceGcwPvEPointModifier', '1.0' ) . PHP_EOL; ?>
|
||||
spaceGcwPvETokenModifier=<?php echo get_option( 'swg-auth-spaceGcwPvETokenModifier', '1.0' ) . PHP_EOL; ?>
|
||||
spaceGcwPvPPointModifier=<?php echo get_option( 'swg-auth-spaceGcwPvPPointModifier', '2.0' ) . PHP_EOL; ?>
|
||||
spaceGcwPvPTokenModifier=<?php echo get_option( 'swg-auth-spaceGcwPvPTokenModifier', '2.0' ) . PHP_EOL; ?>
|
||||
spaceGcwTatooineActive=<?php echo get_option( 'swg-auth-spaceGcwTatooineActive', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
spaceGcwTatooineDelay=<?php echo get_option( 'swg-auth-spaceGcwTatooineDelay', '3' ) . PHP_EOL; ?>
|
||||
spaceGcwTatooineStagger=<?php echo get_option( 'swg-auth-spaceGcwTatooineStagger', '0' ) . PHP_EOL; ?>
|
||||
spaceGcwTokenAward=<?php echo get_option( 'swg-auth-spaceGcwTokenAward', '25' ) . PHP_EOL; ?>
|
||||
spaceGcwTotalSupportSpawn=<?php echo get_option( 'swg-auth-spaceGcwTotalSupportSpawn', '60' ) . PHP_EOL; ?>
|
||||
spaceGcwWinPointModifier=<?php echo get_option( 'swg-auth-spaceGcwWinPointModifier', '2.0' ) . PHP_EOL; ?>
|
||||
spaceGcwWinTokenModifier=<?php echo get_option( 'swg-auth-spaceGcwWinTokenModifier', '2.0' ) . PHP_EOL; ?>
|
||||
spawnAllResources=<?php echo get_option( 'swg-auth-spawnAllResourcess', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
startX=<?php echo get_option( 'swg-auth-startX', '3585.0' ) . PHP_EOL; ?>
|
||||
startY=<?php echo get_option( 'swg-auth-startY', '10.0' ) . PHP_EOL; ?>
|
||||
startZ=<?php echo get_option( 'swg-auth-startZ', '2578.0' ) . PHP_EOL; ?>
|
||||
suiListLimit=<?php echo get_option( 'swg-auth-suiListLimit', '50' ) . PHP_EOL; ?>
|
||||
useTemplates=<?php echo get_option( 'swg-auth-useTemplates', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
veteranDebugEnableOverrideAccountAge=<?php echo get_option( 'swg-auth-veteranDebugEnableOverrideAccountAge', '9999' ) . PHP_EOL; ?>
|
||||
veteranDebugTriggerAll=<?php echo get_option( 'swg-auth-veteranDebugTriggerAll', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
|
||||
[LoginPing]
|
||||
passthroughMode=<?php echo get_option( 'swg-auth-passthroughMode', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
|
||||
[LoginServer]
|
||||
databasePWD=<?php echo get_option( 'swg-auth-odb-password', 'swg' ) . PHP_EOL; ?>
|
||||
databaseUID=<?php echo get_option( 'swg-auth-odb-username', 'swg' ) . PHP_EOL; ?>
|
||||
developmentMode=<?php echo get_option( 'swg-auth-developmentMode', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
DSN=<?php echo get_option( 'swg-auth-DSN', '//127.0.0.1/swg' ) . PHP_EOL; ?>
|
||||
easyExternalAccess=<?php echo get_option( 'swg-auth-easyExternalAccess', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
<?php echo ( get_option( 'swg-auth-loginserver-key' ) !== '' ) ? 'externalAuthSecretKey=' . get_option( 'swg-auth-loginserver-key' ) . PHP_EOL : ''; ?>
|
||||
<?php echo ( get_option( 'swg-auth-useExternalAuth', 'on' ) === 'on' ) ? 'externalAuthURL=' . get_site_url() . '/?action=swg-auth' . PHP_EOL : ''; ?>
|
||||
<?php echo ( get_option( 'swg-auth-auth-type' ) === 'JsonWebAPI' ) ? "useJsonWebApi=true" . PHP_EOL : ''; ?>
|
||||
validateClientVersion=<?php echo get_option( 'swg-auth-validateClientVersion', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
validateStationKey=<?php echo get_option( 'swg-auth-validateStationKey', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
|
||||
[PlanetServer]
|
||||
loadWholePlanet=<?php echo get_option( 'swg-auth-loadWholePlanet', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
numTutorialServers=<?php echo get_option( 'swg-auth-numTutorialServers', '1' ) . PHP_EOL; ?>
|
||||
|
||||
[Quest]
|
||||
CommunityCraftingLimit=<?php echo get_option( 'swg-auth-CommunityCraftingLimit', '200' ) . PHP_EOL; ?>
|
||||
CraftingContract=<?php echo get_option( 'swg-auth-CraftingContract', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
CrowdPleaser=<?php echo get_option( 'swg-auth-CrowdPleaser', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
|
||||
[ScriptFlags]
|
||||
liveSpaceServer=<?php echo get_option( 'swg-auth-liveSpaceServer', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
npeSequencersActive=<?php echo get_option( 'swg-auth-npeSequencersActive', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
spawnersOn=<?php echo get_option( 'swg-auth-spawnersOn', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
|
||||
[ServerMetrics]
|
||||
metricsServerPort=<?php echo get_option( 'swg-auth-metricsServerPort', '0' ) . PHP_EOL; ?>
|
||||
|
||||
[ServerUtility]
|
||||
externalAdminLevelsEnabled=<?php echo get_option( 'swg-auth-externalAdminLevelsEnabled', 'on' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
<?php echo ( get_option( 'swg-auth-serverutility-key' ) !== '' ) ? 'externalAdminLevelsSecretKey=' . get_option( 'swg-auth-serverutility-key' ) . PHP_EOL : ''; ?>
|
||||
externalAdminLevelsURL=<?php echo get_site_url(); ?>/?action=swg-auth-admin-level
|
||||
|
||||
[SharedFile]
|
||||
searchPath0=<?php echo get_option( 'swg-auth-searchPath0', '../../data/sku.0/sys.client/compiled/clientdata/' ) . PHP_EOL; ?>
|
||||
searchPath1=<?php echo get_option( 'swg-auth-searchPath1a', '../../data/sku.0/sys.server/built/game/' ) . PHP_EOL; ?>
|
||||
searchPath1=<?php echo get_option( 'swg-auth-searchPath1b', '../../data/sku.0/sys.shared/built/game/' ) . PHP_EOL; ?>
|
||||
searchPath2=<?php echo get_option( 'swg-auth-searchPath2a', '../../data/sku.0/sys.server/compiled/game/' ) . PHP_EOL; ?>
|
||||
searchPath2=<?php echo get_option( 'swg-auth-searchPath2b', '../../data/sku.0/sys.shared/compiled/game/' ) . PHP_EOL; ?>
|
||||
|
||||
[SharedFoundation]
|
||||
debugReportLongFrames=<?php echo get_option( 'swg-auth-debugReportLongFrames', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
fatalCallStackDepth=<?php echo get_option( 'swg-auth-fatalCallStackDepth', '10' ) . PHP_EOL; ?>
|
||||
frameRateLimit=<?php echo get_option( 'swg-auth-frameRateLimit', '10' ) . PHP_EOL; ?>
|
||||
warningCallStackDepth=<?php echo get_option( 'swg-auth-warningCallStackDepth', '-1' ) . PHP_EOL; ?>
|
||||
|
||||
[SharedLog]
|
||||
#logTarget=file:logs/balance.log{c-!GameBalance}
|
||||
#logTarget=file:logs/commodities.txt{c-!CommoditiesServer}
|
||||
#logTarget=file:logs/cts.txt{d-!CharacterTransfer:p+TransferServer:d+TransferServer:c+CharacterTransfer}
|
||||
#logTarget=file:logs/customerService.log{c-!CustomerService}
|
||||
#logTarget=file:logs/log.txt{c-profile:c-CustomerService:c-stderr}
|
||||
#logTarget=file:logs/population.log{c-!PopulationLog}
|
||||
#logTarget=file:logs/profile.txt{c-!profile}
|
||||
#logTarget=file:logs/serverclock.log{c-!ServerClock}
|
||||
#logTarget=file:logs/startupLog.log{c-*:c+ServerStartup:c+Preload}
|
||||
#logTarget=file:logs/stderr.txt{c-!stderr}
|
||||
#logTarget=file:logs/taskProcessDied.txt{c-!TaskProcessDied}
|
||||
#logTarget=net:<?php echo get_option( 'swg-auth-server-ip', '192.168.0.0' ); ?>:44467
|
||||
|
||||
[SharedNetwork]
|
||||
byteCountWarnThreshold=<?php echo get_option( 'swg-auth-byteCountWarnThreshold', '1000000' ) . PHP_EOL; ?>
|
||||
congestionWindowMinimum=<?php echo get_option( 'swg-auth-congestionWindowMinimum', '0' ) . PHP_EOL; ?>
|
||||
enableFlushAndConfirmAllData=<?php echo get_option( 'swg-auth-enableFlushAndConfirmAllData', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
fragmentSize=<?php echo get_option( 'swg-auth-fragmentSize', '500' ) . PHP_EOL; ?>
|
||||
incomingBufferSize=<?php echo get_option( 'swg-auth-incomingBufferSize', '4194304' ) . PHP_EOL; ?>
|
||||
logBackloggedPacketThreshold=<?php echo get_option( 'swg-auth-logBackloggedPacketThreshold', '0' ) . PHP_EOL; ?>
|
||||
maxOutstandingBytes=<?php echo get_option( 'swg-auth-maxOutstandingBytes', '4194304' ) . PHP_EOL; ?>
|
||||
maxOutstandingPackets=<?php echo get_option( 'swg-auth-maxOutstandingPackets', '400' ) . PHP_EOL; ?>
|
||||
maxRawPacketSize=<?php echo get_option( 'swg-auth-maxRawPacketSize', '500' ) . PHP_EOL; ?>
|
||||
noDataTimeout=<?php echo get_option( 'swg-auth-noDataTimeout', '1000000' ) . PHP_EOL; ?>
|
||||
oldestUnacknowledgedTimeout=<?php echo get_option( 'swg-auth-oldestUnacknowledgedTimeout', '0' ) . PHP_EOL; ?>
|
||||
outgoingBufferSize=<?php echo get_option( 'swg-auth-outgoingBufferSize', '4194304' ) . PHP_EOL; ?>
|
||||
overflowLimit=<?php echo get_option( 'swg-auth-overflowLimit', '0' ) . PHP_EOL; ?>
|
||||
packetHistoryMax=<?php echo get_option( 'swg-auth-packetHistoryMax', '512' ) . PHP_EOL; ?>
|
||||
pooledPacketMax=<?php echo get_option( 'swg-auth-pooledPacketMax', '32000' ) . PHP_EOL; ?>
|
||||
pooledPacketSize=<?php echo get_option( 'swg-auth-pooledPacketSize', '256' ) . PHP_EOL; ?>
|
||||
reportMessages=<?php echo get_option( 'swg-auth-reportMessages', '' ) === 'on' ? 'true' : 'false'; echo PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPorta', '44451' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPortb', '44452' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPortc', '44455' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPortd', '44459' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPorte', '44463' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPortf', '44464' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPortg', '44467' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPorth', '44480' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPorti', '50001' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPortj', '60000' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPortk', '60001' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPortl', '60002' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPortm', '61000' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPortn', '61222' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPorto', '61232' ) . PHP_EOL; ?>
|
||||
reservedPort=<?php echo get_option( 'swg-auth-reservedPortp', '61242' ) . PHP_EOL; ?>
|
||||
|
||||
[TaskManager]
|
||||
clusterName=<?php echo get_option( 'swg-auth-cluster-name', 'swg' ) . PHP_EOL; ?>
|
||||
loginServerAddress=<?php echo get_option( 'swg-auth-server-ip', '192.168.0.0' ) . PHP_EOL; ?>
|
||||
node0=<?php echo get_option( 'swg-auth-server-ip', '192.168.0.0' ) . PHP_EOL; ?>
|
||||
environmentVariable=<?php echo get_option( 'swg-auth-environmentVariablea', 'NLS_LANG=american_america.utf8' ) . PHP_EOL; ?>
|
||||
environmentVariable=<?php echo get_option( 'swg-auth-environmentVariableb', 'PATH+=/usr/lib/jvm/java-11-openjdk/bin:./' ) . PHP_EOL; ?>
|
||||
environmentVariable=<?php echo get_option( 'swg-auth-environmentVariablec', 'LD_LIBRARY_PATH+=/usr/lib/jvm/java-11-openjdk/lib:/usr/lib/jvm/java-11-openjdk/lib/server:./' ) . PHP_EOL; ?>
|
||||
<?php echo get_option( 'swg-auth-custom-server-setting' ); ?>
|
||||
<?php
|
||||
// After outputting the cfg, we don't want WordPress to continue
|
||||
die;
|
||||
}
|
||||
1
swg-auth/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //Shh...
|
||||
1
swg-auth/public/css/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //Shh...
|
||||
101
swg-auth/public/css/swg-auth-metrics-widget.css
Normal file
@@ -0,0 +1,101 @@
|
||||
table.swg-auth-metrics-widget {
|
||||
border: 0px;
|
||||
}
|
||||
table.swg-auth-metrics-widget tr {
|
||||
border: 0px;
|
||||
}
|
||||
table.swg-auth-metrics-widget td {
|
||||
border: 0px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.swg-auth-red-light {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin: 0;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background-color: #FF0000;
|
||||
border-radius: 50%;
|
||||
box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 12px;
|
||||
-webkit-animation: swg-auth-blink-red 0.5s infinite;
|
||||
-moz-animation: swg-auth-blink-red 0.5s infinite;
|
||||
-ms-animation: swg-auth-blink-red 0.5s infinite;
|
||||
-o-animation: swg-auth-blink-red 0.5s infinite;
|
||||
animation: swg-auth-blink-red 0.5s infinite;
|
||||
}
|
||||
@-webkit-keyframes swg-auth-blink-red {
|
||||
from { background-color: #FF0000; }
|
||||
50% { background-color: #AA0000; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 0;}
|
||||
to { background-color: #FF0000; }
|
||||
}
|
||||
@-moz-keyframes swg-auth-blink-red {
|
||||
from { background-color: #FF0000; }
|
||||
50% { background-color: #AA0000; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 0;}
|
||||
to { background-color: #FF0000; }
|
||||
}
|
||||
@-ms-keyframes swg-auth-blink-red {
|
||||
from { background-color: #FF0000; }
|
||||
50% { background-color: #AA0000; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 0;}
|
||||
to { background-color: #FF0000; }
|
||||
}
|
||||
@-o-keyframes swg-auth-blink-red {
|
||||
from { background-color: #FF0000; }
|
||||
50% { background-color: #AA0000; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 0;}
|
||||
to { background-color: #FF0000; }
|
||||
}
|
||||
@keyframes swg-auth-blink-red {
|
||||
from { background-color: #FF0000; }
|
||||
50% { background-color: #AA0000; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #441313 0 -1px 9px, rgba(255, 0, 0, 0.5) 0 2px 0;}
|
||||
to { background-color: #FF0000; }
|
||||
}
|
||||
.swg-auth-yellow-light {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin: 0;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background-color: #FFFF00;
|
||||
border-radius: 50%;
|
||||
box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FFFF00 0 2px 12px;
|
||||
-webkit-animation: swg-auth-blink-yellow 1s infinite;
|
||||
-moz-animation: swg-auth-blink-yellow 1s infinite;
|
||||
-ms-animation: swg-auth-blink-yellow 1s infinite;
|
||||
-o-animation: swg-auth-blink-yellow 1s infinite;
|
||||
animation: swg-auth-blink-yellow 1s infinite;
|
||||
}
|
||||
@-webkit-keyframes swg-auth-blink-yellow {
|
||||
from { background-color: #FFFF00; }
|
||||
50% { background-color: #AAAA00; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FFFF00 0 2px 0; }
|
||||
to { background-color: #FFFF00; }
|
||||
}
|
||||
@-moz-keyframes swg-auth-blink-yellow {
|
||||
from { background-color: #FFFF00; }
|
||||
50% { background-color: #AAAA00; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FFFF00 0 2px 0; }
|
||||
to { background-color: #FFFF00; }
|
||||
}
|
||||
@-ms-keyframes swg-auth-blink-yellow {
|
||||
from { background-color: #FFFF00; }
|
||||
50% { background-color: #AAAA00; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FFFF00 0 2px 0; }
|
||||
to { background-color: #FFFF00; }
|
||||
}
|
||||
@-o-keyframes swg-auth-blink-yellow {
|
||||
from { background-color: #FFFF00; }
|
||||
50% { background-color: #AAAA00; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FFFF00 0 2px 0; }
|
||||
to { background-color: #FFFF00; }
|
||||
}
|
||||
@keyframes swg-auth-blink-yellow {
|
||||
from { background-color: #FFFF00; }
|
||||
50% { background-color: #AAAA00; box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #808002 0 -1px 9px, #FFFF00 0 2px 0; }
|
||||
to { background-color: #FFFF00; }
|
||||
}
|
||||
.swg-auth-green-light {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
margin: 0;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
background-color: #00FF00;
|
||||
border-radius: 50%;
|
||||
box-shadow: rgba(0, 0, 0, 0.2) 0 -1px 7px 1px, inset #304701 0 -1px 9px, #89FF00 0 2px 12px;
|
||||
}
|
||||
86
swg-auth/public/css/swg-auth-resources.css
Normal file
@@ -0,0 +1,86 @@
|
||||
div.swg-auth-single-resource-page {
|
||||
display: flex;
|
||||
flex-flow: row wrap;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
align-content: flex-start;
|
||||
}
|
||||
div.swg-auth-single-resource-page div.swg-auth-resource-class-breadcrumbs {
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
div.swg-auth-single-resource-page div.swg-auth-resource-icon-and-name {
|
||||
width: 50%;
|
||||
}
|
||||
div.swg-auth-single-resource-page div.swg-auth-resource-icon-and-name img {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
div.swg-auth-single-resource-page div.swg-auth-resource-icon-and-name span.swg-auth-resource-name {
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
div.swg-auth-single-resource-page div.swg-auth-resource-deplete-time {
|
||||
width: 50%;
|
||||
margin: auto 0px auto 0px;
|
||||
}
|
||||
div.swg-auth-single-resource-page div.swg-auth-resource-attributes {
|
||||
width: 50%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
div.swg-auth-single-resource-page div.swg-auth-resource-planets {
|
||||
width: 50%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
div.swg-auth-single-resource-page table.swg-auth-single-resource-attribute-table {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
width: auto;
|
||||
}
|
||||
div.swg-auth-single-resource-page table.swg-auth-single-resource-attribute-table tr {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
}
|
||||
div.swg-auth-single-resource-page table.swg-auth-single-resource-attribute-table td {
|
||||
margin: 0px;
|
||||
padding: 0px 20px 0px 10px;
|
||||
border: 0px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
table.swg-auth-resource-page {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
table.swg-auth-resource-page tr {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border-top: 1px solid darkgrey;
|
||||
border-bottom: 1px solid darkgrey;
|
||||
}
|
||||
table.swg-auth-resource-page td {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
}
|
||||
table.swg-auth-resource-page table.swg-auth-resource-attribute-table {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
width: auto;
|
||||
}
|
||||
table.swg-auth-resource-page table.swg-auth-resource-attribute-table tr {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: 0px;
|
||||
}
|
||||
table.swg-auth-resource-page table.swg-auth-resource-attribute-table td {
|
||||
margin: 0px;
|
||||
padding: 0px 8px 0px 0px;
|
||||
border: 0px;
|
||||
}
|
||||
1
swg-auth/public/html/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //Shh...
|
||||
135
swg-auth/public/html/swg-auth-metrics-widget-html.php
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Get the widget title or use a default one
|
||||
$title = ! empty( $instance['title'] ) ? $instance['title'] : 'Server Status';
|
||||
// Filter the widget title for some reason
|
||||
$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
|
||||
|
||||
// This comes before a widget
|
||||
echo $args['before_widget'];
|
||||
|
||||
// If there is a title (which there certainly is), display it now please
|
||||
if ( $title ) {
|
||||
echo $args['before_title'] . $title . $args['after_title'];
|
||||
}
|
||||
|
||||
// Find out if we're supposed to hide the lights
|
||||
$hide_lights = isset( $instance['hide_lights'] ) ? $instance['hide_lights'] : false;
|
||||
|
||||
// Find out if we're supposed to show the highest population
|
||||
$show_highest_population = isset( $instance['show_highest_population'] ) ? $instance['show_highest_population'] : false;
|
||||
|
||||
// Get the latest metrics data from the database
|
||||
$data = get_option( 'swg-auth-metrics-data' );
|
||||
|
||||
// If we want to show the highest population, the code for that can exist in a function
|
||||
if ( $show_highest_population ) {
|
||||
function swg_auth_show_highest_population( $data, $format ) {
|
||||
?>
|
||||
<tr>
|
||||
<td>Highest Population:</td>
|
||||
<td><?php echo array_key_exists( 'highestPlayerCount', $data ) ? $data['highestPlayerCount'] : 'No Population Found'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Record Set On:</td>
|
||||
<td><?php echo array_key_exists( 'highestPlayerCountTimestamp', $data ) ? wp_date( $format, $data['highestPlayerCountTimestamp'] ) : 'No Timestamp Found'; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
// Get the WordPress date and time format
|
||||
$format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
|
||||
|
||||
// If no metrics data exists, just stop here and output an error message
|
||||
if ( ! isset ( $data['clusterName'] ) ):
|
||||
|
||||
?>
|
||||
|
||||
<p>No server has been detected. Please start up your server or check your SWG config.</p>
|
||||
|
||||
<?php
|
||||
// The server is offline if the metrics data is too old
|
||||
elseif ( time() > $data['timestamp'] + $data['webUpdateIntervalSeconds'] + 2 ):
|
||||
?>
|
||||
|
||||
<table class="swg-auth-metrics-widget">
|
||||
<tr>
|
||||
<td>Server:</td>
|
||||
<td><?php echo $data['clusterName']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Status:</td>
|
||||
<td>Offline<?php echo ( $hide_lights ) ? '' : ' <div class="swg-auth-red-light"></div>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Offline Since:</td>
|
||||
<td><?php echo wp_date( $format, $data['timestamp'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Population:</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<?php if ( $show_highest_population ) { swg_auth_show_highest_population( $data, $format ); } ?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
// The server is still loading if the last time it was loading is 0
|
||||
elseif ( $data['lastLoadingStateTime'] === 0 ):
|
||||
?>
|
||||
|
||||
<table class="swg-auth-metrics-widget">
|
||||
<tr>
|
||||
<td>Server:</td>
|
||||
<td><?php echo $data['clusterName']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Status:</td>
|
||||
<td>Loading...<?php echo ( $hide_lights ) ? '' : ' <div class="swg-auth-yellow-light"></div>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Loading Since:</td>
|
||||
<td><?php echo wp_date( $format, $data['timeClusterWentIntoLoadingState'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Population:</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<?php if ( $show_highest_population ) { swg_auth_show_highest_population( $data, $format ); } ?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
// The server is online if the time it began loading is 0
|
||||
elseif ( $data['timeClusterWentIntoLoadingState'] === 0 ):
|
||||
?>
|
||||
|
||||
<table class="swg-auth-metrics-widget">
|
||||
<tr>
|
||||
<td>Server:</td>
|
||||
<td><?php echo $data['clusterName']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Status:</td>
|
||||
<td>Online<?php echo ( $hide_lights ) ? '' : ' <div class="swg-auth-green-light"></div>'; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Online Since:</td>
|
||||
<td><?php echo wp_date( $format, $data['lastLoadingStateTime'] ); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Population:</td>
|
||||
<td><?php echo $data['totalPlayerCount']; ?></td>
|
||||
</tr>
|
||||
<?php if ( $show_highest_population ) { swg_auth_show_highest_population( $data, $format ); } ?>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
// This comes after a widget
|
||||
echo $args['after_widget'];
|
||||
272
swg-auth/public/html/swg-auth-resources-html.php
Normal file
@@ -0,0 +1,272 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Connect to Oracle
|
||||
$connection = swg_auth_oci_connect();
|
||||
|
||||
// Get SWG Server's clock
|
||||
$statement = oci_parse( $connection, "SELECT * FROM CLOCK" );
|
||||
$results = oci_execute( $statement );
|
||||
$clock = oci_fetch_array( $statement );
|
||||
oci_free_statement( $statement );
|
||||
|
||||
// Get the WordPress date format
|
||||
$format = get_option( 'date_format' );
|
||||
|
||||
// If the user wants to view a single resource, ask Oracle for just that resource
|
||||
if ( isset( $_GET['display'] ) && $_GET ['display'] === 'single' && isset( $_GET['resource-name'] ) ) :
|
||||
$statement = oci_parse( $connection, "SELECT * FROM RESOURCE_TYPES WHERE RESOURCE_NAME = '" . $_GET['resource-name'] . "'");
|
||||
$results = oci_execute( $statement );
|
||||
$result = oci_fetch_array( $statement, OCI_ASSOC + OCI_RETURN_NULLS );
|
||||
?>
|
||||
|
||||
<div class="swg-auth-single-resource-page">
|
||||
<div class="swg-auth-resource-class-breadcrumbs">
|
||||
<?php
|
||||
foreach ( $resources[ $result['RESOURCE_CLASS'] ]['classes'] as $class ) {
|
||||
$slug = '';
|
||||
foreach ( $resources as $resource => $metadata ) {
|
||||
if ( end( $metadata['classes'] ) === $class ) {
|
||||
$slug = $resource;
|
||||
break;
|
||||
}
|
||||
}
|
||||
echo '<a href="' . site_url() . '/?page_id=resources&display=class&resource-class=' . $slug . '">' . $class . '</a> > ';
|
||||
}
|
||||
echo '<a href="' . site_url() . '/?page_id=resources&display=single&resource-name=' . $result['RESOURCE_NAME'] . '">' . $result['RESOURCE_NAME'] . '</a>';
|
||||
?>
|
||||
</div>
|
||||
<div class="swg-auth-resource-icon-and-name">
|
||||
<img src="<?php echo plugins_url(); ?>/swg-auth/public/img/resources/<?php echo $resources[ $result['RESOURCE_CLASS'] ]['image'] ?>"><span class="swg-auth-resource-name"><a href="<?php echo site_url() . '/?page_id=resources&display=single&resource-name=' . $result['RESOURCE_NAME']; ?>"><?php echo $result['RESOURCE_NAME']; ?></a></span>
|
||||
</div>
|
||||
<div class="swg-auth-resource-deplete-time">
|
||||
<?php
|
||||
if ( $result['DEPLETED_TIMESTAMP'] > $clock['LAST_SAVE_TIME'] ) {
|
||||
$seconds_left = $result['DEPLETED_TIMESTAMP'] - $clock['LAST_SAVE_TIME'];
|
||||
$depletes_on = strtotime( $clock['LAST_SAVE_TIMESTAMP'] ) + $seconds_left;
|
||||
echo 'Depletes On: ' . wp_date( $format, $depletes_on );
|
||||
} elseif ( $result['DEPLETED_TIMESTAMP'] <= $clock['LAST_SAVE_TIME'] ) {
|
||||
$seconds_ago = $clock['LAST_SAVE_TIME'] - $result['DEPLETED_TIMESTAMP'];
|
||||
$depleted_on = strtotime( $clock['LAST_SAVE_TIMESTAMP'] ) - $seconds_ago;
|
||||
echo 'Depleted On: ' . wp_date( $format, $depleted_on );
|
||||
} else {
|
||||
echo 'Oops. Something went wrong with the depletion calculation...';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="swg-auth-resource-attributes">
|
||||
<p>Attributes:</p>
|
||||
<table class="swg-auth-single-resource-attribute-table">
|
||||
<?php
|
||||
foreach ( swg_auth_parse_resource_attributes( $result['ATTRIBUTES'] ) as $attribute => $value ) {
|
||||
echo '<tr><td>' . $attribute . ':</td><td>' . $value . '</td></tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="swg-auth-resource-planets">
|
||||
<p>Available On:</p>
|
||||
<table class="swg-auth-single-resource-attribute-table">
|
||||
<?php
|
||||
foreach ( swg_auth_get_resource_planets( $result['FRACTAL_SEEDS'] ) as $planet ) {
|
||||
echo '<tr><td>' . $planet . '</td></tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// If the user wants to view a resource class...
|
||||
elseif ( isset( $_GET['display'] ) && $_GET['display'] === 'class' && isset( $_GET['resource-class'] ) ) :
|
||||
// Get the readable name of the class
|
||||
$class_string = end( $resources[ $_GET['resource-class'] ]['classes'] );
|
||||
// Find out which tier this class is in
|
||||
$class_position = array_keys( $resources[ $_GET['resource-class'] ]['classes'], $class_string, true )[0];
|
||||
// Search the resource metadata for final tier subclasses that are included in this class and add them to a SQL clause
|
||||
$search_string = '';
|
||||
foreach ($resources as $resource => $metadata) {
|
||||
if ( isset( $metadata['classes'][ $class_position ] ) && $metadata['classes'][ $class_position ] === $class_string ) {
|
||||
$search_string .= "RESOURCE_CLASS = '" . $resource . "' OR ";
|
||||
}
|
||||
}
|
||||
// Trim off the last " OR " from a couple of lines ago
|
||||
$search_string = substr( $search_string, 0, -4 );
|
||||
// Ask Oracle for all the resources included in the class for which we're searching
|
||||
$statement = oci_parse( $connection, "SELECT * FROM RESOURCE_TYPES WHERE RESOURCE_NAME NOT LIKE '@%' AND RESOURCE_CLASS NOT LIKE 'space%' AND (" . $search_string . ")" );
|
||||
$results = oci_execute( $statement );
|
||||
?>
|
||||
<div class="swg-auth-resource-class-breadcrumbs">
|
||||
<?php
|
||||
$breadcrumb_string = '';
|
||||
foreach ( $resources[ $_GET['resource-class'] ]['classes'] as $class ) {
|
||||
$slug = '';
|
||||
foreach ( $resources as $resource => $metadata ) {
|
||||
if ( end( $metadata['classes'] ) === $class ) {
|
||||
$slug = $resource;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$breadcrumb_string .= '<a href="' . site_url() . '/?page_id=resources&display=class&resource-class=' . $slug . '">' . $class . '</a> > ';
|
||||
}
|
||||
echo substr( $breadcrumb_string, 0, -3 );
|
||||
?>
|
||||
</div>
|
||||
<table class="swg-auth-resource-page">
|
||||
<?php while ( $result = oci_fetch_array( $statement, OCI_ASSOC + OCI_RETURN_NULLS ) ) : ?>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="<?php echo plugins_url(); ?>/swg-auth/public/img/resources/<?php echo $resources[ $result['RESOURCE_CLASS'] ]['image'] ?>">
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?php echo site_url(); ?>/?page_id=resources&display=single&resource-name=<?php echo $result['RESOURCE_NAME']; ?>"><?php echo $result['RESOURCE_NAME']; ?></a>
|
||||
<a href="<?php echo site_url(); ?>/?page_id=resources&display=class&resource-class=<?php echo $result['RESOURCE_CLASS']; ?>"><?php echo end( $resources[ $result['RESOURCE_CLASS'] ]['classes'] ); ?></a>
|
||||
</td>
|
||||
<td>
|
||||
<table class="swg-auth-resource-attribute-table">
|
||||
<tr>
|
||||
<?php
|
||||
foreach ( swg_auth_parse_resource_attributes( $result['ATTRIBUTES'], true ) as $attribute => $value ) {
|
||||
echo '<td>' . $attribute . '<br />' . $value . '</td>';
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ( $result['DEPLETED_TIMESTAMP'] > $clock['LAST_SAVE_TIME'] ) {
|
||||
$seconds_left = $result['DEPLETED_TIMESTAMP'] - $clock['LAST_SAVE_TIME'];
|
||||
$depletes_on = strtotime( $clock['LAST_SAVE_TIMESTAMP'] ) + $seconds_left;
|
||||
echo 'Depletes On<br />' . wp_date( $format, $depletes_on );
|
||||
} elseif ( $result['DEPLETED_TIMESTAMP'] <= $clock['LAST_SAVE_TIME'] ) {
|
||||
$seconds_ago = $clock['LAST_SAVE_TIME'] - $result['DEPLETED_TIMESTAMP'];
|
||||
$depleted_on = strtotime( $clock['LAST_SAVE_TIMESTAMP'] ) - $seconds_ago;
|
||||
echo 'Depleted On<br />' . wp_date( $format, $depleted_on );
|
||||
} else {
|
||||
echo 'Uh-Oh...';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
</table>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<p>Select a resource class to get started:</p>
|
||||
<form method="GET" action="<?php echo site_url(); ?>">
|
||||
<input type="hidden" name="page_id" value="resources" /><input type="hidden" name="display" value="class" /><select name="resource-class">
|
||||
<option value="aluminum">Aluminum</option>
|
||||
<option value="gemstone_armophous">Amorphous Gemstone</option>
|
||||
<option value="bone_avian">Avian Bone</option>
|
||||
<option value="meat_avian">Avian Meat</option>
|
||||
<option value="vegetable_beans">Beans</option>
|
||||
<option value="fruit_berries">Berries</option>
|
||||
<option value="bone">Bone</option>
|
||||
<option value="hide_bristley">Bristley Hide</option>
|
||||
<option value="ore_carbonate">Carbonate Ore</option>
|
||||
<option value="meat_carnivore">Carnivore Meat</option>
|
||||
<option value="cereal">Cereal</option>
|
||||
<option value="chemical">Chemical</option>
|
||||
<option value="copper">Copper</option>
|
||||
<option value="corn">Corn</option>
|
||||
<option value="creature_food">Creature Food</option>
|
||||
<option value="creature_resources">Creature Resources</option>
|
||||
<option value="creature_structural">Creature Structural</option>
|
||||
<option value="seafood_crustacean">Crustacean</option>
|
||||
<option value="gemstone_crystalline">Crystalline Gemstone</option>
|
||||
<option value="corn_domesticated">Domesticated Corn</option>
|
||||
<option value="meat_domesticated">Domesticated Meat</option>
|
||||
<option value="milk_domesticated">Domesticated Milk</option>
|
||||
<option value="oats_domesticated">Domesticated Oats</option>
|
||||
<option value="rice_domesticated">Domesticated Rice</option>
|
||||
<option value="wheat_domesticated">Domesticated Wheat</option>
|
||||
<option value="meat_egg">Egg Meat</option>
|
||||
<option value="energy">Energy</option>
|
||||
<option value="softwood_evergreen">Evergreen Soft Wood</option>
|
||||
<option value="ore_extrusive">Extrusive Ore</option>
|
||||
<option value="metal_ferrous">Ferrous Metal</option>
|
||||
<option value="fiberplast">Fiberplast</option>
|
||||
<option value="seafood_fish">Fish</option>
|
||||
<option value="flora_food">Flora Food</option>
|
||||
<option value="flora_resources">Flora Resources</option>
|
||||
<option value="flora_structural">Flora Structural</option>
|
||||
<option value="fruit_flowers">Flowers</option>
|
||||
<option value="fruit">Fruit</option>
|
||||
<option value="fruit_fruits">Fruits</option>
|
||||
<option value="vegetable_fungi">Fungi</option>
|
||||
<option value="gas">Gas</option>
|
||||
<option value="gemstone">Gemstone</option>
|
||||
<option value="vegetable_greens">Greens</option>
|
||||
<option value="wood_deciduous">Hard Wood</option>
|
||||
<option value="meat_herbivore">Herbivore Meat</option>
|
||||
<option value="hide">Hide</option>
|
||||
<option value="bone_horn">Horn</option>
|
||||
<option value="ore_igneous">Igneous Ore</option>
|
||||
<option value="gas_inert">Inert Gas</option>
|
||||
<option value="petrochem_inert">Inert Petrochemical</option>
|
||||
<option value="inorganic">Inorganic</option>
|
||||
<option value="meat_insect">Insect Meat</option>
|
||||
<option value="ore_intrusive">Intrusive Ore</option>
|
||||
<option value="iron">Iron</option>
|
||||
<option value="gas_inert_known">Known Inert Gas</option>
|
||||
<option value="fuel_petrochem_liquid_known">Known Liquid Petrochem Fuel</option>
|
||||
<option value="radioactive_known">Known Radioactive</option>
|
||||
<option value="gas_reactive_known">Known Reactive Gas</option>
|
||||
<option value="fuel_petrochem_solid_known">Known Solid Petrochem Fuel</option>
|
||||
<option value="hide_leathery">Leathery Hide</option>
|
||||
<option value="fuel_petrochem_liquid">Liquid Petrochem Fuel</option>
|
||||
<option value="ore">Low-Grade Ore</option>
|
||||
<option value="meat">Meat</option>
|
||||
<option value="metal">Metal</option>
|
||||
<option value="milk">Milk</option>
|
||||
<option value="mineral">Mineral</option>
|
||||
<option value="seafood_mollusk">Mollusk</option>
|
||||
<option value="energy_renewable_unlimited">Non Site-Restricted Renewable Energy</option>
|
||||
<option value="metal_nonferrous">Non-Ferrous Metal</option>
|
||||
<option value="oats">Oats</option>
|
||||
<option value="organic">Organic</option>
|
||||
<option value="radioactive">Radioactive</option>
|
||||
<option value="gas_reactive">Reactive Gas</option>
|
||||
<option value="energy_renewable">Renewable energy</option>
|
||||
<option value="meat_reptillian">Reptillian Meat</option>
|
||||
<option value="rice">Rice</option>
|
||||
<option value="hide_scaley">Scaley Hide</option>
|
||||
<option value="seafood">Seafood</option>
|
||||
<option value="ore_sedimentary">Sedimentary Ore</option>
|
||||
<option value="seeds">Seeds</option>
|
||||
<option value="ore_siliclastic">Siliclastic Ore</option>
|
||||
<option value="energy_renewable_site_limited">Site-Restricted Renewable Energy</option>
|
||||
<option value="softwood">Soft Wood</option>
|
||||
<option value="energy_renewable_unlimited_solar">Solar Energy</option>
|
||||
<option value="fuel_petrochem_solid">Solid Petrochem Fuel</option>
|
||||
<option value="steel">Steel</option>
|
||||
<option value="vegetable_tubers">Tubers</option>
|
||||
<option value="vegetable">Vegetables</option>
|
||||
<option value="water">Water</option>
|
||||
<option value="wheat">Wheat</option>
|
||||
<option value="corn_wild">Wild Corn</option>
|
||||
<option value="meat_wild">Wild Meat</option>
|
||||
<option value="milk_wild">Wild Milk</option>
|
||||
<option value="oats_wild">Wild Oats</option>
|
||||
<option value="rice_wild">Wild Rice</option>
|
||||
<option value="wheat_wild">Wild Wheat</option>
|
||||
<option value="energy_renewable_unlimited_wind">Wind Energy</option>
|
||||
<option value="wood">Wood</option>
|
||||
<option value="hide_wooly">Wooly Hide</option>
|
||||
</select>
|
||||
|
||||
<input type="submit"></input>
|
||||
</form>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
|
||||
// Thanks Oracle! ttyl
|
||||
oci_close( $connection );
|
||||
1
swg-auth/public/img/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //Shh...
|
||||
BIN
swg-auth/public/img/resources/aluminum.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
swg-auth/public/img/resources/bone.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
swg-auth/public/img/resources/cereal.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
swg-auth/public/img/resources/copper.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
swg-auth/public/img/resources/creature_food.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
swg-auth/public/img/resources/creature_resources.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
swg-auth/public/img/resources/creature_structural.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
swg-auth/public/img/resources/energy.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
swg-auth/public/img/resources/flora_resources.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
swg-auth/public/img/resources/flora_structural.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
swg-auth/public/img/resources/fuel_petrochem_liquid.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
swg-auth/public/img/resources/fuel_petrochem_solid.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
swg-auth/public/img/resources/gas.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
swg-auth/public/img/resources/gas_inert.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
swg-auth/public/img/resources/gas_reactive.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
swg-auth/public/img/resources/gemstone.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
swg-auth/public/img/resources/hide.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
1
swg-auth/public/img/resources/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //Shh...
|
||||
BIN
swg-auth/public/img/resources/inorganic.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
swg-auth/public/img/resources/iron.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
swg-auth/public/img/resources/liquid_vapors.png
Normal file
|
After Width: | Height: | Size: 9.6 KiB |
BIN
swg-auth/public/img/resources/meat.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
swg-auth/public/img/resources/metal.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
swg-auth/public/img/resources/metal_ferrous.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
swg-auth/public/img/resources/metal_nonferrous.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
BIN
swg-auth/public/img/resources/milk.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
swg-auth/public/img/resources/mineral.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
swg-auth/public/img/resources/ore.png
Normal file
|
After Width: | Height: | Size: 8.3 KiB |
BIN
swg-auth/public/img/resources/ore_carbonate.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
swg-auth/public/img/resources/ore_igneous.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
swg-auth/public/img/resources/ore_sedimentary.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
swg-auth/public/img/resources/ore_siliclastic.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
swg-auth/public/img/resources/organic.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
swg-auth/public/img/resources/petrochem_inert.png
Normal file
|
After Width: | Height: | Size: 9.2 KiB |
BIN
swg-auth/public/img/resources/radioactive.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
swg-auth/public/img/resources/seeds.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
swg-auth/public/img/resources/steel.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
swg-auth/public/img/resources/underground_liquid.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
swg-auth/public/img/resources/water.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
1
swg-auth/public/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //Shh...
|
||||
73
swg-auth/public/swg-auth-metrics-widget.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// This class builds the Server Metrics Widget
|
||||
class SWG_AUTH_METRICS_WIDGET extends WP_Widget {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct(
|
||||
'swg-auth-metrics',
|
||||
'SWG Server Metrics',
|
||||
array(
|
||||
'description' => 'Display information about your server status.',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function widget( $args, $instance ) {
|
||||
// If the widget is to be displayed, enqueue the CSS that we'll need
|
||||
wp_enqueue_style( 'swg-auth-metrics-widget', plugins_url( 'swg-auth/public/css/swg-auth-metrics-widget.css' ) );
|
||||
// Include what will actually be displayed in the widget
|
||||
include( plugin_dir_path( __FILE__ ) . 'html/swg-auth-metrics-widget-html.php' );
|
||||
}
|
||||
|
||||
public function form( $instance ) {
|
||||
// Get whatever settings have been set for this widget, or else use the defaults
|
||||
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
||||
$hide_lights = isset( $instance['hide_lights'] ) ? (bool) $instance['hide_lights'] : false;
|
||||
$show_highest_population = isset( $instance['show_highest_population'] ) ? (bool) $instance['show_highest_population'] : false;
|
||||
// Display some input fields to change the settings
|
||||
?>
|
||||
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'title' ); ?>">Title:</label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input class="checkbox" id="<?php echo $this->get_field_id( 'hide_lights' ); ?>" name="<?php echo $this->get_field_name( 'hide_lights' ); ?>" type="checkbox" <?php checked( $hide_lights ); ?> />
|
||||
<label for="<?php echo $this->get_field_id( 'hide_lights' ); ?>">Hide LED Indicator Lights</label>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<input class="checkbox" id="<?php echo $this->get_field_id( 'show_highest_population' ); ?>" name="<?php echo $this->get_field_name( 'show_highest_population' ); ?>" type="checkbox" <?php checked( $show_highest_population ); ?> />
|
||||
<label for="<?php echo $this->get_field_id( 'show_highest_population' ); ?>">Show Highest Population</label>
|
||||
</p>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
public function update( $new_instance, $old_instance ) {
|
||||
// Start with the settings that already existed
|
||||
$instance = $old_instance;
|
||||
// Set the new name
|
||||
$instance['title'] = $new_instance['title'];
|
||||
// Set the new value for hiding lights
|
||||
$instance['hide_lights'] = isset( $new_instance['hide_lights'] ) ? (bool) $new_instance['hide_lights'] : false;
|
||||
// Set the new value for showing the highest population
|
||||
$instance['show_highest_population'] = isset( $new_instance['show_highest_population'] ) ? (bool) $new_instance['show_highest_population'] : false;
|
||||
// Done. Save settings
|
||||
return $instance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Register the widget
|
||||
add_action( 'widgets_init', 'swg_auth_register_metrics_widget' );
|
||||
function swg_auth_register_metrics_widget() {
|
||||
register_widget( 'SWG_AUTH_METRICS_WIDGET' );
|
||||
}
|
||||
9697
swg-auth/public/swg-auth-resource-metadata.php
Normal file
143
swg-auth/public/swg-auth-resources.php
Normal file
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// This function will produce an array of planet names referenced by the planet's OID
|
||||
function swg_auth_get_planets_list() {
|
||||
// We'll want to turn machine-friendly strings into human-friendly strings
|
||||
$strings = array(
|
||||
'corellia' => 'Corellia',
|
||||
'dantooine' => 'Dantooine',
|
||||
'dathomir' => 'Dathomir',
|
||||
'endor' => 'Endor',
|
||||
'lok' => 'Lok',
|
||||
'naboo' => 'Naboo',
|
||||
'rori' => 'Rori',
|
||||
'talus' => 'Talus',
|
||||
'tatooine' => 'Tatooine',
|
||||
'yavin4' => 'Yavin 4',
|
||||
'kashyyyk_dead_forest' => 'Kashyyyk Dead Forest',
|
||||
'kashyyyk_hunting' => 'Kashyyyk Hunting Grounds',
|
||||
'kashyyyk_main' => 'Kashyyyk',
|
||||
'kashyyyk_north_dungeons' => 'Kashyyyk North Dungeons',
|
||||
'kashyyyk_pob_dungeons' => 'Kashyyyk POB Dungeons',
|
||||
'kashyyyk_rryatt_trail' => 'Kashyyyk Rryatt Trail',
|
||||
'kashyyyk_south_dungeons' => 'Kashyyyk South Dungeons',
|
||||
'mustafar' => 'Mustafar',
|
||||
);
|
||||
// Ask Oracle for planet objects that are actually planets and not other things
|
||||
$connection = swg_auth_oci_connect();
|
||||
$statement = oci_parse( $connection, "SELECT * FROM PLANET_OBJECTS WHERE PLANET_NAME NOT LIKE 'space%' AND PLANET_NAME NOT LIKE 'adventure%' AND PLANET_NAME NOT LIKE 'dungeon%' AND PLANET_NAME NOT LIKE 'tutorial%'");
|
||||
$results = oci_execute( $statement );
|
||||
// Build an array such that a key (planet OID) contains a value (human-friendly string)
|
||||
$planets = array();
|
||||
while ( $result = oci_fetch_array( $statement, OCI_ASSOC ) ) {
|
||||
$planets[ $result['OBJECT_ID'] ] = $strings[ $result['PLANET_NAME'] ];
|
||||
}
|
||||
// Thanks Oracle! ttyl
|
||||
oci_free_statement( $statement );
|
||||
oci_close( $connection );
|
||||
// Return our array( OIDs => strings )
|
||||
return $planets;
|
||||
}
|
||||
|
||||
// This function will return a list of planets on which a resource can be found
|
||||
function swg_auth_get_resource_planets( $fractal_seeds ) {
|
||||
// Get an array of planet names by OID
|
||||
$planets_list = swg_auth_get_planets_list();
|
||||
// Separate the fractal seeds string from Oracle into planet/fractal pairs
|
||||
$fractal_pairs = explode( ':', $fractal_seeds, -1);
|
||||
$response = array();
|
||||
foreach ( $fractal_pairs as $pair ) {
|
||||
// Separate the planet OID from the fractal seed
|
||||
$buffer = explode( ' ', $pair );
|
||||
// Use the OID to get the planet's name
|
||||
$buffer = $planets_list[ $buffer[0] ];
|
||||
// Filter out Kashyyyk zones other than the main one
|
||||
if ( substr( $buffer, 0, 9 ) !== 'Kashyyyk ' ) {
|
||||
// Add the planet name to the list
|
||||
$response[] = $buffer;
|
||||
}
|
||||
}
|
||||
// Returns the list of planets as an array
|
||||
return $response;
|
||||
}
|
||||
|
||||
// This function will parse a resource's attributes string and return it as an array
|
||||
function swg_auth_parse_resource_attributes( $attributes, $shorthand = false ) {
|
||||
// Separate the attributes string into attribute/value pairs
|
||||
$attributes = explode( ':', $attributes, -1 );
|
||||
// We will want human-readable attributes, either initials or names
|
||||
if ( $shorthand === true ) {
|
||||
$strings = array(
|
||||
'res_cold_resist' => 'CR',
|
||||
'res_conductivity' => 'CD',
|
||||
'res_decay_resist' => 'DR',
|
||||
'res_heat_resist' => 'HR',
|
||||
'res_malleability' => 'MA',
|
||||
'res_shock_resistance' => 'SR',
|
||||
'res_toughness' => 'UT',
|
||||
'entangle_resistance' => 'ER',
|
||||
'res_potential_energy' => 'PE',
|
||||
'res_flavor' => 'PF',
|
||||
'res_quality' => 'OQ',
|
||||
);
|
||||
} else {
|
||||
$strings = array(
|
||||
'res_cold_resist' => 'Cold Resistance',
|
||||
'res_conductivity' => 'Conductivity',
|
||||
'res_decay_resist' => 'Decay Resistance',
|
||||
'res_heat_resist' => 'Heat Resistance',
|
||||
'res_malleability' => 'Malleability',
|
||||
'res_shock_resistance' => 'Shock Resistance',
|
||||
'res_toughness' => 'Unit Toughness',
|
||||
'entangle_resistance' => 'Entangle Resistance',
|
||||
'res_potential_energy' => 'Potential Energy',
|
||||
'res_flavor' => 'Potential Flavor',
|
||||
'res_quality' => 'Overall Quality',
|
||||
);
|
||||
}
|
||||
$attributes_list = array();
|
||||
foreach ( $attributes as $attribute ) {
|
||||
// Separate the attribute from its value
|
||||
$buffer = explode( ' ', $attribute );
|
||||
// Add the attribute to the list as name => value
|
||||
$attributes_list[ $strings[ $buffer[0] ] ] = $buffer[1];
|
||||
}
|
||||
// Return an array such that attribute name keys contain the attribute values
|
||||
return $attributes_list;
|
||||
}
|
||||
|
||||
// If the user is on the resources page, enqueue the resources CSS
|
||||
add_action( 'wp_enqueue_scripts', 'swg_auth_enqueue_resources_css' );
|
||||
function swg_auth_enqueue_resources_css() {
|
||||
if ( is_page( 'resources' ) ) {
|
||||
wp_enqueue_style( 'swg-auth-resources', plugin_dir_url( __FILE__ ) . 'css/swg-auth-resources.css' );
|
||||
}
|
||||
}
|
||||
|
||||
// This will build the resource page's contents
|
||||
function swg_auth_resources_html() {
|
||||
// We're going to need the resource metadata
|
||||
$resources = require( 'swg-auth-resource-metadata.php' );
|
||||
// Using an output buffer makes the resources-html.php file a lot nicer to write
|
||||
ob_start();
|
||||
// Include the actual page contents
|
||||
include( plugin_dir_path( __FILE__ ) . 'html/swg-auth-resources-html.php' );
|
||||
// Return the output buffer
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
// Create the resource page (but not if OCI8 isn't available)
|
||||
if ( extension_loaded( 'OCI8' ) ) {
|
||||
new SWG_AUTH_VIRTUAL_PAGE(
|
||||
array(
|
||||
'slug' => 'resources',
|
||||
'post_title' => 'Resources',
|
||||
'post_content' => swg_auth_resources_html(),
|
||||
)
|
||||
);
|
||||
}
|
||||
70
swg-auth/public/swg-auth-virtual-page.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
// No Direct Access
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// This class will build a virtual page
|
||||
class SWG_AUTH_VIRTUAL_PAGE {
|
||||
|
||||
function __construct( $args ) {
|
||||
// Filter the_posts. TODO: Should I be intercepting the WordPress query earlier?
|
||||
add_filter( 'the_posts', array( $this, 'build_page' ) );
|
||||
// Make the arguments accessible for later
|
||||
$this->args = $args;
|
||||
}
|
||||
|
||||
function build_page( $posts ) {
|
||||
global $wp, $wp_query;
|
||||
// Is the user asking for the virtual page?
|
||||
if ( $wp->request === $this->args['slug'] || ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] === $this->args['slug'] ) ) {
|
||||
// Build a post object for the virtual page
|
||||
$post = new stdClass;
|
||||
$post->ID = -1;
|
||||
$post->post_author = 1;
|
||||
$post->post_date = current_time( 'mysql' );
|
||||
$post->post_date_gmt = current_time( 'mysql', true );
|
||||
$post->post_content = "This is not the content you're looking for.";
|
||||
$post->post_title = 'No Title';
|
||||
$post->post_excerpt = '';
|
||||
$post->post_status = 'publish';
|
||||
$post->comment_status = 'closed';
|
||||
$post->ping_status = 'closed';
|
||||
$post->post_password = '';
|
||||
$post->post_name = $this->args['slug'];
|
||||
$post->to_ping = '';
|
||||
$post->pinged = '';
|
||||
$post->post_modified = current_time( 'mysql' );
|
||||
$post->post_modified_gmt = current_time( 'mysql', true );
|
||||
$post->post_content_filtered = '';
|
||||
$post->post_parent = 0;
|
||||
$post->guid = get_site_url() . '/?page_id=' . $this->args['slug'];
|
||||
$post->menu_order = 0;
|
||||
$post->post_type = 'page';
|
||||
$post->post_mime_type = '';
|
||||
$post->comment_count = 0;
|
||||
$post->filter = 'raw';
|
||||
|
||||
// Merge any arguments provided into my post object
|
||||
$post = (object) array_merge( (array) $post, (array) $this->args);
|
||||
// Discard whatever posts WordPress found and put the virtual page in there instead
|
||||
$posts = NULL;
|
||||
$posts[] = $post;
|
||||
|
||||
// Let WordPress know what the query for the virtual page would have looked like
|
||||
$wp_query->is_page = true;
|
||||
$wp_query->is_singular = true;
|
||||
$wp_query->is_home = false;
|
||||
$wp_query->is_archive = false;
|
||||
$wp_query->is_category = false;
|
||||
// Assure WordPress that everything is A-Okay...
|
||||
unset( $wp_query->query['error'] );
|
||||
$wp_query->query_vars['error'] = '';
|
||||
$wp_query->is_404 = false;
|
||||
}
|
||||
// All done. You can have your $posts back now
|
||||
return $posts;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
=== SWG Auth ===
|
||||
Contributors: tekaoh
|
||||
Donate link: https://tekaohswg.github.io/donate.html
|
||||
Tags: admin, integration
|
||||
Requires at least: 2.8
|
||||
Tested up to: 5.4
|
||||
Stable tag: 0.2
|
||||
Requires PHP: 4.3
|
||||
License: The Unlicense
|
||||
License URI: https://unlicense.org
|
||||
|
||||
Star Wars Galaxies Authentication for Wordpress
|
||||
|
||||
== Description ==
|
||||
|
||||
If you're running a Star Wars Galaxies server, now you can use Wordpress to allow users to sign up and change their passwords.
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Upload the plugin files to the `wp-content/plugins/swg-auth/` directory or install the plugin through the WordPress admin panel.
|
||||
2. Activate the plugin through Wordpress admin panel.
|
||||
3. Point your SWG server's externalAuthURL config flag to `http://url.to.wordpress/?action=swg-auth`.
|
||||
4. Done!
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= How do I run a Star Wars Galaxies server? =
|
||||
|
||||
Check out https://swg-source.github.io/ and join that community on discord. If you'd rather build your own VM than download one, you could check out https://tekaohswg.github.io/new.html but be aware that this isn't for the faint of heart.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Once this plugin is installed, your SWG Server will authenticate users with Wordpress.
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 0.1 =
|
||||
* Initial version
|
||||
* Authentication is functional
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= 0.1 =
|
||||
* Initial version
|
||||
@@ -2,62 +2,36 @@
|
||||
/**
|
||||
* Plugin Name: SWG Auth
|
||||
* Plugin URI: https://tekaohswg.github.io/swg-auth-wordpress.html
|
||||
* Description: Star Wars Galaxies Authentication for Wordpress
|
||||
* Version: 0.2
|
||||
* Description: Star Wars Galaxies Authentication for WordPress
|
||||
* Version: 0.13
|
||||
* Author: Tekaoh
|
||||
* Author URI: https://tekaohswg.github.io
|
||||
*/
|
||||
|
||||
// No Direct Access
|
||||
if(!defined('ABSPATH')){
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Run when Wordpress is loaded
|
||||
add_action('wp_loaded', 'swg_auth_run');
|
||||
// Include some includes
|
||||
include( plugin_dir_path( __FILE__ ) . 'includes/swg-auth-oci.php' );
|
||||
|
||||
function swg_auth_run(){
|
||||
// Check if the swg-auth action is requested
|
||||
if($_GET['action'] == 'swg-auth'){
|
||||
// Check if a user_name and user_password are provided
|
||||
if($_POST['user_name'] && $_POST['user_password']){
|
||||
// Ask Wordpress to authenticate the user_name and user_password
|
||||
$userInfo = wp_authenticate_username_password(NULL, $_POST['user_name'], $_POST['user_password']);
|
||||
// Check if the authentication request returned an error
|
||||
if(is_wp_error($userInfo)){
|
||||
// If there was an error, we'll let the client know.
|
||||
$response['message'] = "Account does not exist or password was incorrect";
|
||||
} else {
|
||||
// If there's no error, Success!
|
||||
$response['message'] = "success";
|
||||
}
|
||||
// Json encode our response so that the LoginServer knows what we're talking about
|
||||
echo json_encode($response);
|
||||
// Once we've responded, we don't want Wordpress to continue
|
||||
die;
|
||||
}
|
||||
// If we're here, the swg-auth action was requested but no user_name and user_password were provided. That's weird... Don't return anything
|
||||
die;
|
||||
}
|
||||
// Check if the swg-auth-admin-level action is requested
|
||||
if($_GET['action'] == 'swg-auth-admin-level'){
|
||||
// Check if a user_name is provided
|
||||
if($_POST['user_name']){
|
||||
// Look up the user
|
||||
$userID = get_user_by('login', $_POST['user_name']);
|
||||
// Check if the user is a Wordpress Admin
|
||||
if(user_can($userID, 'administrator')){
|
||||
// Send back level 50
|
||||
$response['message'] = "50";
|
||||
echo json_encode($response);
|
||||
die;
|
||||
}
|
||||
// Not an admin
|
||||
$response['message'] = "0";
|
||||
echo json_encode($response);
|
||||
die;
|
||||
}
|
||||
// If we're here, the swg-auth-admin-level action was requested by no user_name was provided. Don't return anything.
|
||||
die;
|
||||
}
|
||||
// Run when WordPress is loaded
|
||||
add_action( 'wp_loaded', 'swg_auth_run' );
|
||||
function swg_auth_run() {
|
||||
include( plugin_dir_path( __FILE__ ) . 'includes/swg-auth-check.php' );
|
||||
include( plugin_dir_path( __FILE__ ) . 'includes/swg-auth-admin-level-check.php' );
|
||||
include( plugin_dir_path( __FILE__ ) . 'includes/swg-auth-metrics-listener.php' );
|
||||
include( plugin_dir_path( __FILE__ ) . 'includes/swg-auth-webcfg.php' );
|
||||
}
|
||||
|
||||
// Run Admin Stuff
|
||||
include( plugin_dir_path( __FILE__ ) . 'admin/swg-auth-admin-menus.php' );
|
||||
include( plugin_dir_path( __FILE__ ) . 'admin/swg-auth-settings.php' );
|
||||
include( plugin_dir_path( __FILE__ ) . 'admin/swg-auth-server-settings.php' );
|
||||
include( plugin_dir_path( __FILE__ ) . 'admin/swg-auth-user-settings.php' );
|
||||
|
||||
// Run Public Stuff
|
||||
include( plugin_dir_path( __FILE__ ) . 'public/swg-auth-virtual-page.php' );
|
||||
include( plugin_dir_path( __FILE__ ) . 'public/swg-auth-resources.php' );
|
||||
include( plugin_dir_path( __FILE__ ) . 'public/swg-auth-metrics-widget.php' );
|
||||
|
||||
325
swg-auth/uninstall.php
Normal file
@@ -0,0 +1,325 @@
|
||||
<?php
|
||||
|
||||
// Don't run this if you're not actually unstalling
|
||||
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Delete installation settings
|
||||
delete_option( 'swg-auth-approval-required' );
|
||||
delete_option( 'swg-auth-metrics-data' );
|
||||
delete_option( 'swg-auth-odb-username' );
|
||||
delete_option( 'swg-auth-odb-password' );
|
||||
delete_option( 'swg-auth-odb-sid' );
|
||||
delete_option( 'swg-auth-odb-ip' );
|
||||
delete_option( 'swg-auth-odb-port' );
|
||||
delete_option( 'swg-auth-loginserver-key' );
|
||||
delete_option( 'swg-auth-serverutility-key' );
|
||||
delete_option( 'swg-auth-centralserver-key' );
|
||||
|
||||
// Delete user settings
|
||||
swg_auth_delete_user_meta();
|
||||
function swg_auth_delete_user_meta() {
|
||||
$users = get_users();
|
||||
foreach ( $users as $user ) {
|
||||
delete_user_meta( $user->ID, 'swg-auth-approved' );
|
||||
delete_user_meta( $user->ID, 'swg-auth-banned' );
|
||||
delete_user_meta( $user->ID, 'swg-auth-admin-level' );
|
||||
}
|
||||
}
|
||||
|
||||
// Delete SWG server settings
|
||||
delete_option( 'swg-auth-BestResourcesEnabled' );
|
||||
delete_option( 'swg-auth-CommunityCraftingLimit' );
|
||||
delete_option( 'swg-auth-Corellian_Corvette_Imperial' );
|
||||
delete_option( 'swg-auth-Corellian_Corvette_Neutral' );
|
||||
delete_option( 'swg-auth-Corellian_Corvette_Rebel' );
|
||||
delete_option( 'swg-auth-CraftingContract' );
|
||||
delete_option( 'swg-auth-CrowdPleaser' );
|
||||
delete_option( 'swg-auth-DSN' );
|
||||
delete_option( 'swg-auth-Death_Watch' );
|
||||
delete_option( 'swg-auth-DraftSchematicsEnabled' );
|
||||
delete_option( 'swg-auth-Geonosian' );
|
||||
delete_option( 'swg-auth-HeroicFlagEnabled' );
|
||||
delete_option( 'swg-auth-MuseumEventDuration' );
|
||||
delete_option( 'swg-auth-PoliticianEventDuration' );
|
||||
delete_option( 'swg-auth-adminGodToAll' );
|
||||
delete_option( 'swg-auth-adminGodToAllGodLevel' );
|
||||
delete_option( 'swg-auth-aiLoggingEnabled' );
|
||||
delete_option( 'swg-auth-allowMasterObjectCreation' );
|
||||
delete_option( 'swg-auth-allowPlayersToPackVendors' );
|
||||
delete_option( 'swg-auth-anniversary' );
|
||||
delete_option( 'swg-auth-armorEnabled' );
|
||||
delete_option( 'swg-auth-auth-type' );
|
||||
delete_option( 'swg-auth-buffsEnabled' );
|
||||
delete_option( 'swg-auth-builderEnabled' );
|
||||
delete_option( 'swg-auth-byteCountWarnThreshold' );
|
||||
delete_option( 'swg-auth-centralserver-key' );
|
||||
delete_option( 'swg-auth-chatServiceBindInterface' );
|
||||
delete_option( 'swg-auth-chroniclesChroniclerGoldTokenChanceOverride' );
|
||||
delete_option( 'swg-auth-chroniclesChroniclerSilverTokenNumModifier' );
|
||||
delete_option( 'swg-auth-chroniclesQuestorGoldTokenChanceOverride' );
|
||||
delete_option( 'swg-auth-chroniclesQuestorSilverTokenNumModifier' );
|
||||
delete_option( 'swg-auth-chroniclesXpModifier' );
|
||||
delete_option( 'swg-auth-clientOverflowLimit' );
|
||||
delete_option( 'swg-auth-cluster-name' );
|
||||
delete_option( 'swg-auth-combatUpgradeReward' );
|
||||
delete_option( 'swg-auth-commandsEnabled' );
|
||||
delete_option( 'swg-auth-commoditiesMarketEnabled' );
|
||||
delete_option( 'swg-auth-congestionWindowMinimum' );
|
||||
delete_option( 'swg-auth-craftingEnabled' );
|
||||
delete_option( 'swg-auth-createAppearances' );
|
||||
delete_option( 'swg-auth-createZoneObjects' );
|
||||
delete_option( 'swg-auth-creditsEnabled' );
|
||||
delete_option( 'swg-auth-custom-server-setting' );
|
||||
delete_option( 'swg-auth-customerServiceBindInterface' );
|
||||
delete_option( 'swg-auth-dailyMissionXpLimit' );
|
||||
delete_option( 'swg-auth-databaseProtocol' );
|
||||
delete_option( 'swg-auth-debugMode' );
|
||||
delete_option( 'swg-auth-debugReportLongFrames' );
|
||||
delete_option( 'swg-auth-deedsEnabled' );
|
||||
delete_option( 'swg-auth-deleteEventProps' );
|
||||
delete_option( 'swg-auth-devEnabled' );
|
||||
delete_option( 'swg-auth-developmentMode' );
|
||||
delete_option( 'swg-auth-disableResources' );
|
||||
delete_option( 'swg-auth-disableWorldSnapshot' );
|
||||
delete_option( 'swg-auth-drainRate' );
|
||||
delete_option( 'swg-auth-easyExternalAccess' );
|
||||
delete_option( 'swg-auth-empireday_ceremony' );
|
||||
delete_option( 'swg-auth-enable-adventure1' );
|
||||
delete_option( 'swg-auth-enable-adventure2' );
|
||||
delete_option( 'swg-auth-enable-corellia' );
|
||||
delete_option( 'swg-auth-enable-dantooine' );
|
||||
delete_option( 'swg-auth-enable-dathomir' );
|
||||
delete_option( 'swg-auth-enable-dungeon1' );
|
||||
delete_option( 'swg-auth-enable-endor' );
|
||||
delete_option( 'swg-auth-enable-kashyyyk-dead-forest' );
|
||||
delete_option( 'swg-auth-enable-kashyyyk-hunting' );
|
||||
delete_option( 'swg-auth-enable-kashyyyk-main' );
|
||||
delete_option( 'swg-auth-enable-kashyyyk-north-dungeons' );
|
||||
delete_option( 'swg-auth-enable-kashyyyk-pob-dungeons' );
|
||||
delete_option( 'swg-auth-enable-kashyyyk-rryatt-trail' );
|
||||
delete_option( 'swg-auth-enable-kashyyyk-south-dungeons' );
|
||||
delete_option( 'swg-auth-enable-lok' );
|
||||
delete_option( 'swg-auth-enable-mustafar' );
|
||||
delete_option( 'swg-auth-enable-naboo' );
|
||||
delete_option( 'swg-auth-enable-rori' );
|
||||
delete_option( 'swg-auth-enable-space-corellia' );
|
||||
delete_option( 'swg-auth-enable-space-dantooine' );
|
||||
delete_option( 'swg-auth-enable-space-dathomir' );
|
||||
delete_option( 'swg-auth-enable-space-endor' );
|
||||
delete_option( 'swg-auth-enable-space-heavy1' );
|
||||
delete_option( 'swg-auth-enable-space-kashyyyk' );
|
||||
delete_option( 'swg-auth-enable-space-light1' );
|
||||
delete_option( 'swg-auth-enable-space-lok' );
|
||||
delete_option( 'swg-auth-enable-space-naboo' );
|
||||
delete_option( 'swg-auth-enable-space-nova-orion' );
|
||||
delete_option( 'swg-auth-enable-space-npe-falcon' );
|
||||
delete_option( 'swg-auth-enable-space-npe-falcon-2' );
|
||||
delete_option( 'swg-auth-enable-space-npe-falcon-3' );
|
||||
delete_option( 'swg-auth-enable-space-ord-mantell' );
|
||||
delete_option( 'swg-auth-enable-space-tatooine' );
|
||||
delete_option( 'swg-auth-enable-space-yavin4' );
|
||||
delete_option( 'swg-auth-enable-talus' );
|
||||
delete_option( 'swg-auth-enable-tatooine' );
|
||||
delete_option( 'swg-auth-enable-tutorial' );
|
||||
delete_option( 'swg-auth-enable-yavin4' );
|
||||
delete_option( 'swg-auth-enableCovertImperialMercenary' );
|
||||
delete_option( 'swg-auth-enableCovertRebelMercenary' );
|
||||
delete_option( 'swg-auth-enableFlushAndConfirmAllData' );
|
||||
delete_option( 'swg-auth-enableOvertImperialMercenary' );
|
||||
delete_option( 'swg-auth-enableOvertRebelMercenary' );
|
||||
delete_option( 'swg-auth-enablePreload' );
|
||||
delete_option( 'swg-auth-environmentVariablea' );
|
||||
delete_option( 'swg-auth-environmentVariableb' );
|
||||
delete_option( 'swg-auth-environmentVariablec' );
|
||||
delete_option( 'swg-auth-externalAdminLevelsEnabled' );
|
||||
delete_option( 'swg-auth-factionEnabled' );
|
||||
delete_option( 'swg-auth-fatalCallStackDepth' );
|
||||
delete_option( 'swg-auth-fatalOnGoldPobChange' );
|
||||
delete_option( 'swg-auth-flashSpeederReward' );
|
||||
delete_option( 'swg-auth-foolsDay' );
|
||||
delete_option( 'swg-auth-forceFoolsDay' );
|
||||
delete_option( 'swg-auth-fragmentSize' );
|
||||
delete_option( 'swg-auth-frameRateLimit' );
|
||||
delete_option( 'swg-auth-gatewayServerIP' );
|
||||
delete_option( 'swg-auth-gatewayServerPort' );
|
||||
delete_option( 'swg-auth-gcwInvasionCityMaximumRunning' );
|
||||
delete_option( 'swg-auth-gcwInvasionCycleTime' );
|
||||
delete_option( 'swg-auth-gcwPointBonus' );
|
||||
delete_option( 'swg-auth-gcwTokenBonus' );
|
||||
delete_option( 'swg-auth-gcwcitybestine' );
|
||||
delete_option( 'swg-auth-gcwcitydearic' );
|
||||
delete_option( 'swg-auth-gcwcitykeren' );
|
||||
delete_option( 'swg-auth-gcwraid' );
|
||||
delete_option( 'swg-auth-goldenTicket' );
|
||||
delete_option( 'swg-auth-goldenTicketDropChance' );
|
||||
delete_option( 'swg-auth-goldenTicketsAvailable' );
|
||||
delete_option( 'swg-auth-grantElderBuff' );
|
||||
delete_option( 'swg-auth-grantGift' );
|
||||
delete_option( 'swg-auth-halloween' );
|
||||
delete_option( 'swg-auth-harvesterExtractionRateMultiplier' );
|
||||
delete_option( 'swg-auth-hibernateDistance' );
|
||||
delete_option( 'swg-auth-hibernateEnabled' );
|
||||
delete_option( 'swg-auth-hibernateProxies' );
|
||||
delete_option( 'swg-auth-idleLogoutTimeSec' );
|
||||
delete_option( 'swg-auth-incomingBufferSize' );
|
||||
delete_option( 'swg-auth-itvMinUsageLevel' );
|
||||
delete_option( 'swg-auth-javaConsoleDebugMessages' );
|
||||
delete_option( 'swg-auth-javaEngineProfiling' );
|
||||
delete_option( 'swg-auth-javaLocalRefLimit' );
|
||||
delete_option( 'swg-auth-javaVMName' );
|
||||
delete_option( 'swg-auth-jediEnabled' );
|
||||
delete_option( 'swg-auth-lifeday' );
|
||||
delete_option( 'swg-auth-liveSpaceServer' );
|
||||
delete_option( 'swg-auth-loadWholePlanet' );
|
||||
delete_option( 'swg-auth-loaderThreads' );
|
||||
delete_option( 'swg-auth-logBackloggedPacketThreshold' );
|
||||
delete_option( 'swg-auth-loginserver-key' );
|
||||
delete_option( 'swg-auth-loveday' );
|
||||
delete_option( 'swg-auth-maxGoldNetworkId' );
|
||||
delete_option( 'swg-auth-maxItemAttribBonus' );
|
||||
delete_option( 'swg-auth-maxObjectSkillModBonus' );
|
||||
delete_option( 'swg-auth-maxOutstandingBytes' );
|
||||
delete_option( 'swg-auth-maxOutstandingPackets' );
|
||||
delete_option( 'swg-auth-maxRawPacketSize' );
|
||||
delete_option( 'swg-auth-maxRespecCount' );
|
||||
delete_option( 'swg-auth-maxSocketSkillModBonus' );
|
||||
delete_option( 'swg-auth-metricsServerPort' );
|
||||
delete_option( 'swg-auth-minRespecIntervalInSeconds' );
|
||||
delete_option( 'swg-auth-minutesActiveToUnaccessed' );
|
||||
delete_option( 'swg-auth-minutesEmptyToEndangered' );
|
||||
delete_option( 'swg-auth-minutesEndangeredToRemoved' );
|
||||
delete_option( 'swg-auth-minutesUnaccessedToEndangered' );
|
||||
delete_option( 'swg-auth-minutesVendorAuctionTimer' );
|
||||
delete_option( 'swg-auth-minutesVendorItemTimer' );
|
||||
delete_option( 'swg-auth-miscitemEnabled' );
|
||||
delete_option( 'swg-auth-mountsEnabled' );
|
||||
delete_option( 'swg-auth-nameValidationAcceptAll' );
|
||||
delete_option( 'swg-auth-newbieTutorialEnabled' );
|
||||
delete_option( 'swg-auth-noDataTimeout' );
|
||||
delete_option( 'swg-auth-npeSequencersActive' );
|
||||
delete_option( 'swg-auth-numTutorialServers' );
|
||||
delete_option( 'swg-auth-odb-password' );
|
||||
delete_option( 'swg-auth-odb-username' );
|
||||
delete_option( 'swg-auth-oldestUnacknowledgedTimeout' );
|
||||
delete_option( 'swg-auth-outgoingBufferSize' );
|
||||
delete_option( 'swg-auth-overflowLimit' );
|
||||
delete_option( 'swg-auth-packetHistoryMax' );
|
||||
delete_option( 'swg-auth-pahallEnabled' );
|
||||
delete_option( 'swg-auth-passthroughMode' );
|
||||
delete_option( 'swg-auth-persisterThreads' );
|
||||
delete_option( 'swg-auth-petsEnabled' );
|
||||
delete_option( 'swg-auth-pingPort' );
|
||||
delete_option( 'swg-auth-pooledPacketMax' );
|
||||
delete_option( 'swg-auth-pooledPacketSize' );
|
||||
delete_option( 'swg-auth-questEnabled' );
|
||||
delete_option( 'swg-auth-regenActionScale' );
|
||||
delete_option( 'swg-auth-regenBase' );
|
||||
delete_option( 'swg-auth-regenConstant' );
|
||||
delete_option( 'swg-auth-regenHealthScale' );
|
||||
delete_option( 'swg-auth-regenMindScale' );
|
||||
delete_option( 'swg-auth-regenScale' );
|
||||
delete_option( 'swg-auth-regenerationRate' );
|
||||
delete_option( 'swg-auth-registrarHost' );
|
||||
delete_option( 'swg-auth-registrarPort' );
|
||||
delete_option( 'swg-auth-reportMessages' );
|
||||
delete_option( 'swg-auth-reservedObjectIds' );
|
||||
delete_option( 'swg-auth-reservedPorta' );
|
||||
delete_option( 'swg-auth-reservedPortb' );
|
||||
delete_option( 'swg-auth-reservedPortc' );
|
||||
delete_option( 'swg-auth-reservedPortd' );
|
||||
delete_option( 'swg-auth-reservedPorte' );
|
||||
delete_option( 'swg-auth-reservedPortf' );
|
||||
delete_option( 'swg-auth-reservedPortg' );
|
||||
delete_option( 'swg-auth-reservedPorth' );
|
||||
delete_option( 'swg-auth-reservedPorti' );
|
||||
delete_option( 'swg-auth-reservedPortj' );
|
||||
delete_option( 'swg-auth-reservedPortk' );
|
||||
delete_option( 'swg-auth-reservedPortl' );
|
||||
delete_option( 'swg-auth-reservedPortm' );
|
||||
delete_option( 'swg-auth-reservedPortn' );
|
||||
delete_option( 'swg-auth-reservedPorto' );
|
||||
delete_option( 'swg-auth-reservedPortp' );
|
||||
delete_option( 'swg-auth-resourcesEnabled' );
|
||||
delete_option( 'swg-auth-respecDurationAllowedInSeconds' );
|
||||
delete_option( 'swg-auth-restussEvent' );
|
||||
delete_option( 'swg-auth-restussPhase' );
|
||||
delete_option( 'swg-auth-restussProgressionOn' );
|
||||
delete_option( 'swg-auth-reverseEngineeringBonusMultipliert' );
|
||||
delete_option( 'swg-auth-rlsDropChance' );
|
||||
delete_option( 'swg-auth-rlsEnabled' );
|
||||
delete_option( 'swg-auth-rlsExceptionalDropChance' );
|
||||
delete_option( 'swg-auth-rlsLegendaryDropChance' );
|
||||
delete_option( 'swg-auth-rlsMaxLevelsAbovePlayerLevel' );
|
||||
delete_option( 'swg-auth-rlsMaxLevelsBelowPlayerLevel' );
|
||||
delete_option( 'swg-auth-rlsMinDistanceFromLastLoot' );
|
||||
delete_option( 'swg-auth-rlsMinTimeBetweenAwards' );
|
||||
delete_option( 'swg-auth-rlsRareDropChance' );
|
||||
delete_option( 'swg-auth-scriptPath' );
|
||||
delete_option( 'swg-auth-scriptWatcherInterruptTime' );
|
||||
delete_option( 'swg-auth-scriptWatcherWarnTime' );
|
||||
delete_option( 'swg-auth-searchPath0' );
|
||||
delete_option( 'swg-auth-searchPath1a' );
|
||||
delete_option( 'swg-auth-searchPath1b' );
|
||||
delete_option( 'swg-auth-searchPath2a' );
|
||||
delete_option( 'swg-auth-searchPath2b' );
|
||||
delete_option( 'swg-auth-sendBreadcrumbs' );
|
||||
delete_option( 'swg-auth-sendPlayerTransform' );
|
||||
delete_option( 'swg-auth-server-ip' );
|
||||
delete_option( 'swg-auth-serverLoadLevel' );
|
||||
delete_option( 'swg-auth-serverSpawnLimit' );
|
||||
delete_option( 'swg-auth-serverSwitch' );
|
||||
delete_option( 'swg-auth-serverutility-key' );
|
||||
delete_option( 'swg-auth-sharedLoginMode' );
|
||||
delete_option( 'swg-auth-shipsEnabled' );
|
||||
delete_option( 'swg-auth-skillsEnabled' );
|
||||
delete_option( 'swg-auth-spaceGcwCorelliaActive' );
|
||||
delete_option( 'swg-auth-spaceGcwCorelliaDelay' );
|
||||
delete_option( 'swg-auth-spaceGcwCorelliaStagger' );
|
||||
delete_option( 'swg-auth-spaceGcwDantooineActive' );
|
||||
delete_option( 'swg-auth-spaceGcwDantooineDelay' );
|
||||
delete_option( 'swg-auth-spaceGcwDantooineStagger' );
|
||||
delete_option( 'swg-auth-spaceGcwGunshipPlayerCeiling' );
|
||||
delete_option( 'swg-auth-spaceGcwLengthOfBattle' );
|
||||
delete_option( 'swg-auth-spaceGcwLokActive' );
|
||||
delete_option( 'swg-auth-spaceGcwLokDelay' );
|
||||
delete_option( 'swg-auth-spaceGcwLokStagger' );
|
||||
delete_option( 'swg-auth-spaceGcwLossPointModifier' );
|
||||
delete_option( 'swg-auth-spaceGcwLossTokenModifier' );
|
||||
delete_option( 'swg-auth-spaceGcwMaxSupportShips' );
|
||||
delete_option( 'swg-auth-spaceGcwNabooActive' );
|
||||
delete_option( 'swg-auth-spaceGcwNabooDelay' );
|
||||
delete_option( 'swg-auth-spaceGcwNabooStagger' );
|
||||
delete_option( 'swg-auth-spaceGcwPobPlayerCeiling' );
|
||||
delete_option( 'swg-auth-spaceGcwPointAward' );
|
||||
delete_option( 'swg-auth-spaceGcwPrepatoryTime' );
|
||||
delete_option( 'swg-auth-spaceGcwPvEPointModifier' );
|
||||
delete_option( 'swg-auth-spaceGcwPvETokenModifier' );
|
||||
delete_option( 'swg-auth-spaceGcwPvPPointModifier' );
|
||||
delete_option( 'swg-auth-spaceGcwPvPTokenModifier' );
|
||||
delete_option( 'swg-auth-spaceGcwTatooineActive' );
|
||||
delete_option( 'swg-auth-spaceGcwTatooineDelay' );
|
||||
delete_option( 'swg-auth-spaceGcwTatooineStagger' );
|
||||
delete_option( 'swg-auth-spaceGcwTokenAward' );
|
||||
delete_option( 'swg-auth-spaceGcwTotalSupportSpawn' );
|
||||
delete_option( 'swg-auth-spaceGcwWinPointModifier' );
|
||||
delete_option( 'swg-auth-spaceGcwWinTokenModifier' );
|
||||
delete_option( 'swg-auth-spawnAllResourcess' );
|
||||
delete_option( 'swg-auth-spawnersOn' );
|
||||
delete_option( 'swg-auth-startX' );
|
||||
delete_option( 'swg-auth-startY' );
|
||||
delete_option( 'swg-auth-startZ' );
|
||||
delete_option( 'swg-auth-suiListLimit' );
|
||||
delete_option( 'swg-auth-useExternalAuth' );
|
||||
delete_option( 'swg-auth-useTemplates' );
|
||||
delete_option( 'swg-auth-validateClientVersion' );
|
||||
delete_option( 'swg-auth-validateStationKey' );
|
||||
delete_option( 'swg-auth-vehiclesEnabled' );
|
||||
delete_option( 'swg-auth-veteranDebugEnableOverrideAccountAge' );
|
||||
delete_option( 'swg-auth-veteranDebugTriggerAll' );
|
||||
delete_option( 'swg-auth-warningCallStackDepth' );
|
||||
delete_option( 'swg-auth-warpsEnabled' );
|
||||
delete_option( 'swg-auth-weaponsEnabled' );
|
||||
delete_option( 'swg-auth-webUpdateIntervalSeconds' );
|
||||
delete_option( 'swg-auth-xpMultiplier' );
|
||||
114
trunk/readme.txt
Normal file
@@ -0,0 +1,114 @@
|
||||
=== SWG Auth ===
|
||||
Contributors: tekaoh
|
||||
Tags: admin, integration
|
||||
Requires at least: 2.8
|
||||
Tested up to: 5.5
|
||||
Stable tag: 0.13
|
||||
Requires PHP: 4.3
|
||||
License: The Unlicense
|
||||
License URI: https://unlicense.org
|
||||
|
||||
Star Wars Galaxies Authentication for WordPress
|
||||
|
||||
== Description ==
|
||||
|
||||
If you're running a Star Wars Galaxies server, now you can use WordPress to manage your users.
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Upload the plugin files to the `wp-content/plugins/swg-auth/` directory or install the plugin through the WordPress Admin Panel.
|
||||
2. Activate the plugin through the WordPress Admin Panel.
|
||||
3. Get the SWG Server Config you need from SWG Auth -> Server Config
|
||||
4. Done!
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 0.13 =
|
||||
* Add server settings to admin dashboard (beta)
|
||||
|
||||
= 0.12 =
|
||||
* Show a list of characters associated with an account
|
||||
* Support JsonWebAPI for authentication
|
||||
* Optionally display the highest population achieved on your server
|
||||
* Minor appearance tweaks
|
||||
|
||||
= 0.11 =
|
||||
* Secret keys can now be used to secure communications from SWG Server
|
||||
* Fixed an issue where some settings couldn't be changed
|
||||
|
||||
= 0.10 =
|
||||
* Better quality code
|
||||
* Don't explode if you don't have OCI8 installed
|
||||
|
||||
= 0.9 =
|
||||
* Resources browser lets you see what resources are available on your server
|
||||
* Some other minor fixes
|
||||
|
||||
= 0.8 =
|
||||
* Fixed an issue where yellow and red LED indicators didn't appear
|
||||
|
||||
= 0.7 =
|
||||
* A new widget lets you display your server status and population
|
||||
|
||||
= 0.6 =
|
||||
* Return a proper error message if you try to submit an invalid admin level
|
||||
* Fixed an issue where SWG User Settings didn't appear on your own profile
|
||||
* Bug Fixes
|
||||
|
||||
= 0.5 =
|
||||
* Manually set the admin level of any user
|
||||
|
||||
= 0.4 =
|
||||
* Optionally, you can require that new accounts have to be specifically approved for game access
|
||||
* You can now ban an account from the game from the WordPress Admin Panel
|
||||
|
||||
= 0.3 =
|
||||
* Added an admin menu that provides you with the server config you need
|
||||
* Bug fixes
|
||||
|
||||
= 0.2 =
|
||||
* WordPress can now take requests for admin level checks
|
||||
|
||||
= 0.1 =
|
||||
* Authentication is functional
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= 0.13 =
|
||||
* Web Configs
|
||||
|
||||
= 0.12 =
|
||||
* New features
|
||||
|
||||
= 0.11 =
|
||||
* Secret Keys and Bug Fixes
|
||||
|
||||
= 0.10 =
|
||||
* Big fixes
|
||||
|
||||
= 0.9 =
|
||||
* New Resources Browser
|
||||
|
||||
= 0.8 =
|
||||
* Bug fix
|
||||
|
||||
= 0.7 =
|
||||
* Metrics Widget!
|
||||
|
||||
= 0.6 =
|
||||
* Bug fixes
|
||||
|
||||
= 0.5 =
|
||||
* New features
|
||||
|
||||
= 0.4 =
|
||||
* New features and Security enhancements
|
||||
|
||||
= 0.3 =
|
||||
* Bug fixes
|
||||
|
||||
= 0.2 =
|
||||
* New features
|
||||
|
||||
= 0.1 =
|
||||
* Initial version
|
||||