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

Award based on PIREP DEP & ARR Airport? #860

Closed
Da-Geek opened this issue Oct 10, 2020 · 5 comments · Fixed by #865
Closed

Award based on PIREP DEP & ARR Airport? #860

Da-Geek opened this issue Oct 10, 2020 · 5 comments · Fixed by #865
Labels

Comments

@Da-Geek
Copy link
Contributor

Da-Geek commented Oct 10, 2020

Describe the solution you'd like
I would like to create some Awards, that is given if a PIREP is created based on a specific Departure and Arrival Airport.

Additional context
I have a bunch "Tours" that are 3 or 5 Legs long,
I want my pilots to be able to fly 1 or more of the legs, and for each
leg they get an Award ONLY if the flight has the correct Departure and Arrival Airports.

@Da-Geek
Copy link
Contributor Author

Da-Geek commented Oct 10, 2020

I think this might need to be another "Award Class", I just need a little help with how to full the PIREP info
during the check() function, and I might be able to create the AwardClass myself, the Award Documentation
URL is showing a 404 right now.

@nabeelio
Copy link
Owner

Yes that would be an award class. Docs are here: https://docs.phpvms.net/developers/awards
See https://docs.phpvms.net/developers/awards#accessing-information for how you can access the user and the last PIREP.

@Da-Geek
Copy link
Contributor Author

Da-Geek commented Oct 10, 2020

Yup it looks like it has enough info in that Document to get me started creating another Award Class, to grab the PIREP info, I'll have a play around with some code and see if I can get it going.
A bit of a blocker for me is not having a clear way to display the current Awards issued to a Pilot, I know I can look at {{ $user->awards }} to give an array, I just need to work out how to Display that in a Friendly way

@YashGovekar
Copy link
Contributor

Describe the solution you'd like
I would like to create some Awards, that is given if a PIREP is created based on a specific Departure and Arrival Airport.

Additional context
I have a bunch "Tours" that are 3 or 5 Legs long,
I want my pilots to be able to fly 1 or more of the legs, and for each
leg they get an Award ONLY if the flight has the correct Departure and Arrival Airports.

You can also add a PIREPAccepted EventListener for your Tour assuming that it is inside your modules folder.

@nabeelio
Copy link
Owner

Like @YashGovekar said, an award class for this probably isn't the best way, though you could do it but it would require a lot of setup. The tour module could just assign a user an award based on some parameters. I might have to expand on this a bit, I have to think about it. I might just change the user_awards table a bit.

@nabeelio nabeelio linked a pull request Oct 12, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants