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

It is not returning the guild id #498

Open
luanluciano93 opened this issue Dec 18, 2021 · 6 comments
Open

It is not returning the guild id #498

luanluciano93 opened this issue Dec 18, 2021 · 6 comments

Comments

@luanluciano93
Copy link
Contributor

It is not returning the guild id

if not guild or not enemyGuild then

@Znote
Copy link
Owner

Znote commented Dec 18, 2021

Could you elaborate further on the problem?

It is correct that the variables guild and enemyGuild does not return the guild id.

local guild, enemyGuild = Guild(guildId), Guild(enemyGuildId)

They are returning the guild objects/metatables. This seems to be the intended behavior.

The guild id's are passed through the function params and is called guildId and enemyGuildId

@luanluciano93
Copy link
Contributor Author

guildId and enemyGuildId are correctly arriving at the local function sendWarStatus, however when passing through the Guild(variable) it is becoming null

@Znote
Copy link
Owner

Znote commented Dec 18, 2021

Replace:

local guild, enemyGuild = Guild(guildId), Guild(enemyGuildId)
if not guild or not enemyGuild then
return
end

With:

local guild = Guild(guildId)
local enemyGuild = Guild(enemyGuildId) 
if not guild then
    print("sendWarStatus: Error: Failed to load guild data from id: ".. guildId)
    return 
end 
if not enemyGuild then
    print("sendWarStatus: Error: Failed to load guild data from id: ".. enemyGuildId)
    return 
end
print("sendWarStatus: Loading guild data: OK")

What messages do you get in console when reproducing this issue?

@luanluciano93
Copy link
Contributor Author

sendWarStatus: Error: Failed to load guild data from id: 2

@Znote
Copy link
Owner

Znote commented Dec 19, 2021

That is very weird, do you have any data associated to guild id 2 in SQL? In the guilds table?
Which server distro are you using, which version?

If there is a bug with initializing a guild through its id, a workaround might be to send the player, and then use player:getGuild() to retrieve the guild object properly.

@luanluciano93
Copy link
Contributor Author

luanluciano93 commented Dec 19, 2021

That is very weird, do you have any data associated to guild id 2 in SQL? In the guilds table?

no

Which server distro are you using, which version?

nekiro tfs 1.4 8.60

I think it's a bug in the distro then, because the variables with guild ids arrive correctly and when passing through Guild(x) it changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants