Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player guild invite/join issue #485

Open
BoozieII opened this issue Aug 15, 2021 · 5 comments
Open

Player guild invite/join issue #485

BoozieII opened this issue Aug 15, 2021 · 5 comments
Labels
bug (1.3/OTBR) OtservBR identified bug Unconfirmed Potential issue / bug that is not yet quite confirmed.

Comments

@BoozieII
Copy link

I have an issue with inviting players to guild on my server, when i try to invite this error message pops up:

string(72) "INSERT INTO guild_invites (player_id, guild_id) VALUES ('53', '3')"
(query`` - SQL `error)
Type: voidQuery (voidQuery is used for update, insert or delete from database)
Field 'date' doesn't have a default value

Now i got around this issue by modifying the /html/engine/function/users.php file and changing the following:
from:

// Invite character to guild
function guild_invite_player($cid, $gid) {
$cid = (int)$cid;
$gid = (int)$gid;
mysql_insert("INSERT INTO guild_invites (player_id, guild_id, date) VALUES ('$cid', '$gid')");

to:

// Invite character to guild
function guild_invite_player($cid, $gid) {
$cid = (int)$cid;
$gid = (int)$gid;
mysql_insert("INSERT INTO guild_invites (player_id, guild_id, date) VALUES ('$cid', '$gid', UNIX_TIMESTAMP(NOW()))");
}

This allows me to send the invite to the player and it shows on the website. However when i then log into the players account and attempt to join, i encounter this error message in red on the guild site.

Join guild request sent from wrong account.

At this point I am unsure what else i could do, as somehow the site doesnt see the logged in account as the right account? even tho it is the player that has been invited. Please help

@Znote Znote added the Unconfirmed Potential issue / bug that is not yet quite confirmed. label Aug 16, 2021
@Znote
Copy link
Owner

Znote commented Aug 16, 2021

Do you use Znote AAC 1.6 or 2.0?
Which server are you using?

@BoozieII
Copy link
Author

I apologise i forgot to mention this information, i am using znote aac 1.6 version and i am running otservbr-global. The latest distro

@Znote
Copy link
Owner

Znote commented Aug 17, 2021

Hmm, I recently did an update to guilds, I might have botched it up somehow.
Try to revert this:
ddd54a9#diff-e4e46ad278c6b7fe37d32dafb04f4d8cb78184ba784c35b8433455b5428ed4b9R366-R372

@BoozieII
Copy link
Author

The above worked, players can join guild now with no problems. Also this was the same issue for leaving the guild, i made similar changes to guilds.php for leaving the guild and that worked as well!

Thanks a bunch!

@Znote Znote added the bug (1.3/OTBR) OtservBR identified bug label Sep 20, 2021
@Emerald2630
Copy link

Issue is created by comparing string with integer with !==. $join_account is integer, $session_user_id is string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (1.3/OTBR) OtservBR identified bug Unconfirmed Potential issue / bug that is not yet quite confirmed.
Projects
None yet
Development

No branches or pull requests

3 participants