Obs: não delete esse formulário pré-definido, preencha-o corretamente para postar o seu tópico!
Descreva em algumas palavras a base utilizada. (Nome do servidor / Nome do cliente / Nome do website / etc.).
Base:
TFS 1.4, Znote, UniservZ, guild in website.
Qual é a sua pergunta?
oi, tem um error no minha guild creada no website do jogo, tentanto invitar um jogador de outra acc, faz este error cuando tenta aceitar a invitacao:
Join guild request sent from wrong account.
tem alguna informacao como solucionar?, mto obrigado.
Uma cosa mais, tenho certeza, tou usando conta correita pra aceitar, acho q problema fica em
Você tem o código disponível? Se tiver poste-o na caixa de código que está dentro do spoiler abaixo:
Spoiler
-------------------MEU GUILD.PHP do Znote (nao tudo, so a parte da join guild------------------
<?php } ?>
<!-- Leader stuff -->
<?php
// Only guild leaders
if (user_logged_in() === true) {
// Uninvite and joinguild is also used for visitors who reject their invitation.
if (!empty($_POST['uninvite'])) {
// Is this action being triggered by a vice leader+, or the invited player?
$u_player = (int)$_POST['uninvite'];
$u_player = user_character_name($u_player);
$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'])) {
$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
if ($inv_data !== false) foreach ($inv_data as $inv) {
if ((int)$inv['player_id'] == $joining_player_id) {
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($joining_player_id, 'online');
else $chardata['online'] = (user_is_online_10($joining_player_id)) ? 1 : 0;
if ($chardata['online'] == 0) {
// Ensure player is not already a member of another guild
if (get_character_guild_rank($joining_player_id) === false) {
if (guild_player_join($joining_player_id, (int)$gid)) {
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">Failed to find guild position representing member.</font>';
} else {
$already_guild = get_player_guild_data($joining_player_id);
$already_guild_name = get_guild_name($already_guild['guild_id']);
echo "<font color='red' size='4'>You are already <strong>{$already_guild['rank_name']}</strong> of another guild: <strong><a href='guilds.php?name={$already_guild_name}'>{$already_guild_name}</a></strong>.<br>You need to leave that guild first before you can join another one.</font>";
}
} else echo '<font color="red" size="4">Character must be offline before joining guild.</font>';
}
}
}
if (!empty($_POST['leave_guild'])) {
$name = sanitize($_POST['leave_guild']);
$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 ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($cidd, 'online');
else $chardata['online'] = (user_is_online_10($cidd)) ? 1 : 0;
if ($chardata['online'] == 0) {
if ($config['ServerEngine'] !== 'TFS_10') guild_player_leave($cidd);
else guild_player_leave_10($cidd);
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">Character must be offline first!</font>';
}
if ($highest_access >= 2) {
// Guild leader stuff
// Change Guild Nick
if (!empty($_POST['player_guildnick'])) {
if ($config['guild_allow_nicknames']) {
$p_cid = user_character_id($_POST['player_guildnick']);
$p_guild = get_player_guild_data($p_cid);
if (preg_match("/^[a-zA-Z_ ]+$/", $_POST['guildnick']) || empty($_POST['guildnick'])) {
// Only allow normal symbols as guild nick
$p_nick = sanitize($_POST['guildnick']);
if ($p_guild['guild_id'] == $gid) {
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($p_cid, 'online');
else $chardata['online'] = (user_is_online_10($p_cid)) ? 1 : 0;
if ($chardata['online'] == 0) {
if ($config['ServerEngine'] !== 'TFS_10') update_player_guildnick($p_cid, $p_nick);
else update_player_guildnick_10($p_cid, $p_nick);
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">Character not offline.</font>';
}
} else echo '<font color="red" size="4">Character guild nick may only contain a-z, A-Z and spaces.</font>';
} else echo '<font color="red" size="4">Change guild nickname feature has been disabled.</font>';
}
// Promote character to guild position
if (!empty($_POST['promote_character']) && !empty($_POST['promote_position'])) {
// Verify that promoted character is from this guild.
$p_rid = $_POST['promote_position'];
$p_cid = user_character_id($_POST['promote_character']);
$p_guild = get_player_guild_data($p_cid);
if ($p_guild['guild_id'] == $gid) {
// Do the magic.
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($p_cid, 'online');
else $chardata['online'] = (user_is_online_10($p_cid)) ? 1 : 0;
if ($chardata['online'] == 0) {
if ($config['ServerEngine'] !== 'TFS_10') update_player_guild_position($p_cid, $p_rid);
else update_player_guild_position_10($p_cid, $p_rid);
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">Character not offline.</font>';
}
}
if (!empty($_POST['invite'])) {
if (user_character_exist($_POST['invite'])) {
// Make sure they are not in another guild
if ($config['ServerEngine'] != 'TFS_10') {
$charname = sanitize($_POST['invite']);
$playerdata = mysql_select_single("SELECT `id`, `rank_id` FROM `players` WHERE `name`='$charname' LIMIT 1;");
$charid = $playerdata['id'];
$membership = ($playerdata['rank_id'] > 0) ? true : false;
} else {
$charid = user_character_id($_POST['invite']);
$membership = mysql_select_single("SELECT `rank_id` FROM `guild_membership` WHERE `player_id`='$charid' LIMIT 1;");
}
if (!$membership) {
//
$status = false;
if ($inv_data !== false) {
foreach ($inv_data as $inv) {
if ($inv['player_id'] == user_character_id($_POST['invite'])) $status = true;
}
}
foreach ($players as $player) {
if ($player['name'] == $_POST['invite']) $status = true;
}
if ($status == false) {
guild_invite_player($charid, $gid);
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">That character is already invited(or a member) on this guild.</font>';
} else echo '<font color="red" size="4">That character is already in a guild.</font>';
} else echo '<font color="red" size="4">That character name does not exist.</font>';
}
// Guild Message (motd)
if (!empty($_POST['motd'])) {
$motd = sanitize($_POST['motd']);
mysql_update("UPDATE `guilds` SET `motd`='$motd' WHERE `id`='$gid' LIMIT 1;");
header('Location: guilds.php?name='. $_GET['name']);
exit();
}
// First figure out if anyone are online.
foreach ($members as $member) {
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data(user_character_id($member['name']), 'online');
else $chardata['online'] = (user_is_online_10(user_character_id($member['name']))) ? 1 : 0;
if ($chardata['online'] == 1) {
$online = true;
}
}
if (!$online) {
// Then remove guild rank from every player.
if ($config['ServerEngine'] !== 'TFS_10') foreach ($members as $member) guild_player_leave(user_character_id($member['name']));
else foreach ($members as $member) guild_player_leave_10(user_character_id($member['name']));
// Remove all guild invitations to this guild
if ($inv_count > 0) guild_remove_invites($gidd);
// Then remove the guild itself.
guild_delete($gidd);
header('Location: success.php');
exit();
} else echo '<font color="red" size="4">All members must be offline to disband the guild.</font>';
}
if (!empty($_POST['new_leader'])) {
$new_leader = (int)$_POST['new_leader'];
$old_leader = guild_leader($gid);
if ($online == false) {
if (guild_change_leader($new_leader, $old_leader)) {
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">Something went wrong when attempting to change leadership.</font>';
} else echo '<font color="red" size="4">The new and old leader must be offline to change leadership.</font>';
}
Antes de fazer a sua pergunta, tenha certeza de ter lido as regras da seção e o guia abaixo:
https://forums.otserv.com.br/index.php?/forums/topic/168583-regras-da-seção/
https://forums.otserv.com.br/index.php?/forums/topic/165121-como-fazer-uma-pergunta-ou-o-grande-guia-do-usuário-com-dúvidas/
Obs: não delete esse formulário pré-definido, preencha-o corretamente para postar o seu tópico!
Descreva em algumas palavras a base utilizada. (Nome do servidor / Nome do cliente / Nome do website / etc.).
Base:
TFS 1.4, Znote, UniservZ, guild in website.
Qual é a sua pergunta?
oi, tem um error no minha guild creada no website do jogo, tentanto invitar um jogador de outra acc, faz este error cuando tenta aceitar a invitacao:
Join guild request sent from wrong account.
tem alguna informacao como solucionar?, mto obrigado.
Uma cosa mais, tenho certeza, tou usando conta correita pra aceitar, acho q problema fica em
Você tem o código disponível? Se tiver poste-o na caixa de código que está dentro do spoiler abaixo:
-------------------MEU GUILD.PHP do Znote (nao tudo, so a parte da join guild------------------
<?php } ?>
<!-- Leader stuff -->
<?php
// Only guild leaders
if (user_logged_in() === true) {
// Uninvite and joinguild is also used for visitors who reject their invitation.
if (!empty($_POST['uninvite'])) {
// Is this action being triggered by a vice leader+, or the invited player?
$u_player = (int)$_POST['uninvite'];
$u_player = user_character_name($u_player);
$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'])) {
$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
if ($inv_data !== false) foreach ($inv_data as $inv) {
if ((int)$inv['player_id'] == $joining_player_id) {
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($joining_player_id, 'online');
else $chardata['online'] = (user_is_online_10($joining_player_id)) ? 1 : 0;
if ($chardata['online'] == 0) {
// Ensure player is not already a member of another guild
if (get_character_guild_rank($joining_player_id) === false) {
if (guild_player_join($joining_player_id, (int)$gid)) {
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">Failed to find guild position representing member.</font>';
} else {
$already_guild = get_player_guild_data($joining_player_id);
$already_guild_name = get_guild_name($already_guild['guild_id']);
echo "<font color='red' size='4'>You are already <strong>{$already_guild['rank_name']}</strong> of another guild: <strong><a href='guilds.php?name={$already_guild_name}'>{$already_guild_name}</a></strong>.<br>You need to leave that guild first before you can join another one.</font>";
}
} else echo '<font color="red" size="4">Character must be offline before joining guild.</font>';
}
}
}
if (!empty($_POST['leave_guild'])) {
$name = sanitize($_POST['leave_guild']);
$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 ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($cidd, 'online');
else $chardata['online'] = (user_is_online_10($cidd)) ? 1 : 0;
if ($chardata['online'] == 0) {
if ($config['ServerEngine'] !== 'TFS_10') guild_player_leave($cidd);
else guild_player_leave_10($cidd);
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">Character must be offline first!</font>';
}
if ($highest_access >= 2) {
// Guild leader stuff
// Change Guild Nick
if (!empty($_POST['player_guildnick'])) {
if ($config['guild_allow_nicknames']) {
$p_cid = user_character_id($_POST['player_guildnick']);
$p_guild = get_player_guild_data($p_cid);
if (preg_match("/^[a-zA-Z_ ]+$/", $_POST['guildnick']) || empty($_POST['guildnick'])) {
// Only allow normal symbols as guild nick
$p_nick = sanitize($_POST['guildnick']);
if ($p_guild['guild_id'] == $gid) {
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($p_cid, 'online');
else $chardata['online'] = (user_is_online_10($p_cid)) ? 1 : 0;
if ($chardata['online'] == 0) {
if ($config['ServerEngine'] !== 'TFS_10') update_player_guildnick($p_cid, $p_nick);
else update_player_guildnick_10($p_cid, $p_nick);
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">Character not offline.</font>';
}
} else echo '<font color="red" size="4">Character guild nick may only contain a-z, A-Z and spaces.</font>';
} else echo '<font color="red" size="4">Change guild nickname feature has been disabled.</font>';
}
// Promote character to guild position
if (!empty($_POST['promote_character']) && !empty($_POST['promote_position'])) {
// Verify that promoted character is from this guild.
$p_rid = $_POST['promote_position'];
$p_cid = user_character_id($_POST['promote_character']);
$p_guild = get_player_guild_data($p_cid);
if ($p_guild['guild_id'] == $gid) {
// Do the magic.
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($p_cid, 'online');
else $chardata['online'] = (user_is_online_10($p_cid)) ? 1 : 0;
if ($chardata['online'] == 0) {
if ($config['ServerEngine'] !== 'TFS_10') update_player_guild_position($p_cid, $p_rid);
else update_player_guild_position_10($p_cid, $p_rid);
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">Character not offline.</font>';
}
}
if (!empty($_POST['invite'])) {
if (user_character_exist($_POST['invite'])) {
// Make sure they are not in another guild
if ($config['ServerEngine'] != 'TFS_10') {
$charname = sanitize($_POST['invite']);
$playerdata = mysql_select_single("SELECT `id`, `rank_id` FROM `players` WHERE `name`='$charname' LIMIT 1;");
$charid = $playerdata['id'];
$membership = ($playerdata['rank_id'] > 0) ? true : false;
} else {
$charid = user_character_id($_POST['invite']);
$membership = mysql_select_single("SELECT `rank_id` FROM `guild_membership` WHERE `player_id`='$charid' LIMIT 1;");
}
if (!$membership) {
//
$status = false;
if ($inv_data !== false) {
foreach ($inv_data as $inv) {
if ($inv['player_id'] == user_character_id($_POST['invite'])) $status = true;
}
}
foreach ($players as $player) {
if ($player['name'] == $_POST['invite']) $status = true;
}
if ($status == false) {
guild_invite_player($charid, $gid);
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">That character is already invited(or a member) on this guild.</font>';
} else echo '<font color="red" size="4">That character is already in a guild.</font>';
} else echo '<font color="red" size="4">That character name does not exist.</font>';
}
// Guild Message (motd)
if (!empty($_POST['motd'])) {
$motd = sanitize($_POST['motd']);
mysql_update("UPDATE `guilds` SET `motd`='$motd' WHERE `id`='$gid' LIMIT 1;");
header('Location: guilds.php?name='. $_GET['name']);
exit();
}
if (!empty($_POST['disband'])) {
// $gidd = (int)$_POST['disband'];
$members = get_guild_players($gid);
$online = false;
// First figure out if anyone are online.
foreach ($members as $member) {
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data(user_character_id($member['name']), 'online');
else $chardata['online'] = (user_is_online_10(user_character_id($member['name']))) ? 1 : 0;
if ($chardata['online'] == 1) {
$online = true;
}
}
if (!$online) {
// Then remove guild rank from every player.
if ($config['ServerEngine'] !== 'TFS_10') foreach ($members as $member) guild_player_leave(user_character_id($member['name']));
else foreach ($members as $member) guild_player_leave_10(user_character_id($member['name']));
// Remove all guild invitations to this guild
if ($inv_count > 0) guild_remove_invites($gidd);
// Then remove the guild itself.
guild_delete($gidd);
header('Location: success.php');
exit();
} else echo '<font color="red" size="4">All members must be offline to disband the guild.</font>';
}
if (!empty($_POST['new_leader'])) {
$new_leader = (int)$_POST['new_leader'];
$old_leader = guild_leader($gid);
$online = false;
if ($config['ServerEngine'] !== 'TFS_10') {
$newData = user_character_data($new_leader, 'online');
$oldData = user_character_data($old_leader, 'online');
} else {
$newData['online'] = (user_is_online_10($new_leader)) ? 1 : 0;
$oldData['online'] = (user_is_online_10($old_leader)) ? 1 : 0;
}
if ($newData['online'] == 1 || $oldData['online'] == 1) $online = true;
if ($online == false) {
if (guild_change_leader($new_leader, $old_leader)) {
header('Location: guilds.php?name='. $_GET['name']);
exit();
} else echo '<font color="red" size="4">Something went wrong when attempting to change leadership.</font>';
} else echo '<font color="red" size="4">The new and old leader must be offline to change leadership.</font>';
}
if (!empty($_POST['change_ranks'])) {
//$c_gid = (int)$_POST['change_ranks'];
$c_ranks = get_guild_rank_data($gid);
$rank_data = array();
$rank_ids = array();
// Feed new rank data
foreach ($c_ranks as $rank) {
$tmp = 'rank_name!'. $rank['level'];
if (!empty($_POST[$tmp])) {
$rank_data[$rank['level']] = sanitize($_POST[$tmp]);
$rank_ids[$rank['level']] = $rank['id'];
}
}
foreach ($rank_data as $level => $name) {
guild_change_rank($rank_ids[$level], $name);
}
header('Location: guilds.php?name='. $_GET['name']);
exit();
}
if (!empty($_POST['remove_member'])) {
$name = sanitize($_POST['remove_member']);
$cid = user_character_id($name);
$p_guild = get_player_guild_data($cid);
if ($p_guild['guild_id'] == $gid) {
if ($config['ServerEngine'] !== 'TFS_10') guild_remove_member($cid);
else guild_remove_member_10($cid);
header('Location: guilds.php?name='. $_GET['name']);
exit();
}
}
Você tem alguma imagem que possa auxiliar no problema? Se sim, anexe-a dentro do spoiler abaixo:
Share this post
Link to post