mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-12-15 00:19:47 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26c486ef27 | ||
|
|
ddd54a932e |
@@ -13,8 +13,6 @@ We use github to distribute our versions, stable are tagged as releases, while d
|
|||||||
* [Stable](https://github.com/Znote/ZnoteAAC/releases)
|
* [Stable](https://github.com/Znote/ZnoteAAC/releases)
|
||||||
* [Development](https://github.com/Znote/ZnoteAAC/archive/master.zip)
|
* [Development](https://github.com/Znote/ZnoteAAC/archive/master.zip)
|
||||||
|
|
||||||
**NOTE:** Development version supports TFS 1.3, but you can expect bugs to occur.
|
|
||||||
|
|
||||||
### Compatible OT distributions
|
### Compatible OT distributions
|
||||||
Znote AAC primarily aims to be compatible with [Forgotten Server](https://github.com/otland/forgottenserver)
|
Znote AAC primarily aims to be compatible with [Forgotten Server](https://github.com/otland/forgottenserver)
|
||||||
Forgotten Server is commonly known as TFS (The Forgotten Server) and Znote AAC supports these versions:
|
Forgotten Server is commonly known as TFS (The Forgotten Server) and Znote AAC supports these versions:
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
// Verify the PHP version, gives tutorial if fail.
|
// Verify the PHP version, gives tutorial if fail.
|
||||||
if (version_compare(phpversion(), '5.3.3', '<')) die('PHP 5.3.3 or higher is required');
|
if (version_compare(phpversion(), '5.6', '<')) die('PHP version 5.6 or higher is required.');
|
||||||
if (!isset($filepath)) $filepath = '../';
|
if (!isset($filepath)) $filepath = '../';
|
||||||
|
|
||||||
$version = '1.5_SVN';
|
$version = '1.6';
|
||||||
session_start();
|
session_start();
|
||||||
ob_start();
|
ob_start();
|
||||||
require_once $filepath.'config.php';
|
require_once $filepath.'config.php';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
$time = time();
|
$time = time();
|
||||||
if (!isset($version)) $version = '1.5_SVN';
|
if (!isset($version)) $version = '1.6';
|
||||||
|
|
||||||
if (!function_exists("elapsedTime")) {
|
if (!function_exists("elapsedTime")) {
|
||||||
function elapsedTime($l_start = false, $l_time = false) {
|
function elapsedTime($l_start = false, $l_time = false) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
-- Start of Znote AAC database schema
|
-- Start of Znote AAC database schema
|
||||||
|
|
||||||
SET @znote_version = '1.5_SVN';
|
SET @znote_version = '1.6';
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `znote` (
|
CREATE TABLE IF NOT EXISTS `znote` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ function get_guild_rank_data($gid) {
|
|||||||
// Creates a guild, where cid is the owner of the guild, and name is the name of guild.
|
// Creates a guild, where cid is the owner of the guild, and name is the name of guild.
|
||||||
function create_guild($cid, $name) {
|
function create_guild($cid, $name) {
|
||||||
$cid = (int)$cid;
|
$cid = (int)$cid;
|
||||||
$name = sanitize($name);
|
$name = trim(preg_replace('/\s\s+/', ' ', str_replace("\n", " ", sanitize($name))));
|
||||||
$time = time();
|
$time = time();
|
||||||
|
|
||||||
// Create the guild
|
// Create the guild
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ function elapsedTime($l_start = false, $l_time = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$time = time();
|
$time = time();
|
||||||
$version = '1.5_SVN';
|
$version = '1.6';
|
||||||
|
|
||||||
$aacQueries = 0;
|
$aacQueries = 0;
|
||||||
$accQueriesData = array();
|
$accQueriesData = array();
|
||||||
|
|||||||
48
guilds.php
48
guilds.php
@@ -351,13 +351,25 @@ if (user_logged_in() === true) {
|
|||||||
|
|
||||||
// Uninvite and joinguild is also used for visitors who reject their invitation.
|
// Uninvite and joinguild is also used for visitors who reject their invitation.
|
||||||
if (!empty($_POST['uninvite'])) {
|
if (!empty($_POST['uninvite'])) {
|
||||||
//
|
// Is this action being triggered by a vice leader+, or the invited player?
|
||||||
guild_remove_invitation($_POST['uninvite'], $gid);
|
$u_player = (int)$_POST['uninvite'];
|
||||||
header('Location: guilds.php?name='. $_GET['name']);
|
$u_player = user_character_name($u_player);
|
||||||
exit();
|
$u_player = (int)user_character_account_id($u_player);
|
||||||
|
if (in_array($highest_access, array(2,3)) || $u_player === $session_user_id) {
|
||||||
|
guild_remove_invitation($_POST['uninvite'], $gid);
|
||||||
|
header('Location: guilds.php?name='. $_GET['name']);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!empty($_POST['joinguild'])) {
|
if (!empty($_POST['joinguild'])) {
|
||||||
$joining_player_id = (int)$_POST['joinguild'];
|
$joining_player_id = (int)$_POST['joinguild'];
|
||||||
|
$join_account = (int)user_character_account_id(user_character_name($joining_player_id));
|
||||||
|
|
||||||
|
if ($join_account !== $session_user_id) {
|
||||||
|
echo '<font color="red" size="4">Join guild request sent from wrong account.</font>';
|
||||||
|
include 'layout/overall/footer.php';
|
||||||
|
exit();
|
||||||
|
}
|
||||||
// Join a guild
|
// Join a guild
|
||||||
if ($inv_data !== false) foreach ($inv_data as $inv) {
|
if ($inv_data !== false) foreach ($inv_data as $inv) {
|
||||||
if ((int)$inv['player_id'] == $joining_player_id) {
|
if ((int)$inv['player_id'] == $joining_player_id) {
|
||||||
@@ -383,6 +395,14 @@ if (user_logged_in() === true) {
|
|||||||
if (!empty($_POST['leave_guild'])) {
|
if (!empty($_POST['leave_guild'])) {
|
||||||
$name = sanitize($_POST['leave_guild']);
|
$name = sanitize($_POST['leave_guild']);
|
||||||
$cidd = user_character_id($name);
|
$cidd = user_character_id($name);
|
||||||
|
|
||||||
|
$leave_account = (int)user_character_account_id($name);
|
||||||
|
if ($leave_account !== $session_user_id) {
|
||||||
|
echo '<font color="red" size="4">Leave guild request sent from wrong account.</font>';
|
||||||
|
include 'layout/overall/footer.php';
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
// If character is offline
|
// If character is offline
|
||||||
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($cidd, 'online');
|
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($cidd, 'online');
|
||||||
else $chardata['online'] = (user_is_online_10($cidd)) ? 1 : 0;
|
else $chardata['online'] = (user_is_online_10($cidd)) ? 1 : 0;
|
||||||
@@ -482,9 +502,8 @@ if ($highest_access >= 2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['disband'])) {
|
if (!empty($_POST['disband'])) {
|
||||||
//
|
// $gidd = (int)$_POST['disband'];
|
||||||
$gidd = (int)$_POST['disband'];
|
$members = get_guild_players($gid);
|
||||||
$members = get_guild_players($gidd);
|
|
||||||
$online = false;
|
$online = false;
|
||||||
|
|
||||||
// First figure out if anyone are online.
|
// First figure out if anyone are online.
|
||||||
@@ -534,8 +553,8 @@ if ($highest_access >= 2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['change_ranks'])) {
|
if (!empty($_POST['change_ranks'])) {
|
||||||
$c_gid = (int)$_POST['change_ranks'];
|
//$c_gid = (int)$_POST['change_ranks'];
|
||||||
$c_ranks = get_guild_rank_data($c_gid);
|
$c_ranks = get_guild_rank_data($gid);
|
||||||
$rank_data = array();
|
$rank_data = array();
|
||||||
$rank_ids = array();
|
$rank_ids = array();
|
||||||
|
|
||||||
@@ -560,10 +579,13 @@ if ($highest_access >= 2) {
|
|||||||
$name = sanitize($_POST['remove_member']);
|
$name = sanitize($_POST['remove_member']);
|
||||||
$cid = user_character_id($name);
|
$cid = user_character_id($name);
|
||||||
|
|
||||||
if ($config['ServerEngine'] !== 'TFS_10') guild_remove_member($cid);
|
$p_guild = get_player_guild_data($cid);
|
||||||
else guild_remove_member_10($cid);
|
if ($p_guild['guild_id'] == $gid) {
|
||||||
header('Location: guilds.php?name='. $_GET['name']);
|
if ($config['ServerEngine'] !== 'TFS_10') guild_remove_member($cid);
|
||||||
exit();
|
else guild_remove_member_10($cid);
|
||||||
|
header('Location: guilds.php?name='. $_GET['name']);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($_POST['forumGuildId'])) {
|
if (!empty($_POST['forumGuildId'])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user