-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement in-game and website notifications (#932)
* Implement notifications logic, basic calls, and admin command * Remove unnecessary code * Add ability to stack notifications and return manually created XML * Remove test that is no longer needed and is causing failures * Apply suggestions from code review * Merge notifications with existing announcements page * Order notifications by descending ID instead of ascending ID * Move notification send task to moderation options under user Also restyles the buttons to line up next to each other like in the slot pages. * Style/position fixes with granted slots/notification partials * Fix incorrect form POST route * Prevent notification text area from breaking out of container * Actually use builder result for notification text * Minor restructuring of the notifications page * Add notifications for team picks, publish issues, and moderation * Mark notifications as dismissed instead of deleting them * Add XMLdoc to SendNotification method * Fix incorrect URL in announcements webhook * Remove unnecessary inline style from granted slots partial * Apply suggestions from code review * Apply first batch of suggestions from code review * Apply second batch of suggestions from code review * Change notification icon depending on if user has unread notifications * Show unread notification icon if there is an announcement posted * Remove "potential" wording from definitive fixes in error docs * Remove "Error code:" from publish notifications * Send notification if user tries to unlock a mod-locked level * Change notification timestamp format to include date * Add clarification to level mod-lock notification message * Change team pick notifications to moderation notifications Apparently the MMPick type doesn't show a visual notification. * Apply suggestions from code review * Add obsolete to notification types that display nothing in-game * Remove unused imports and remove icon switch case in favor of bell icon * Last minute fixes * Send notification upon earth wipe and clarify moderation case notifications * Add check for empty/too long notification text
- Loading branch information
Showing
33 changed files
with
708 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
# Errors | ||
|
||
Here's a list of error codes, as well as their explanations and potential fixes, that are displayed within in-game and | ||
website notifications to indicate what went wrong. | ||
|
||
## Level Publishing | ||
|
||
- `LH-PUB-0001`: The level failed to publish because the slot is null. | ||
- **Note:** The slot name will not be displayed in the notification if this error occurs. | ||
- `LH-PUB-0002`: The level failed to publish because the slot does not include a `rootLevel`. | ||
- `LH-PUB-0003`: The level failed to publish because the resource list is null. | ||
- `LH-PUB-0004`: The level failed to publish because the level name is too long. | ||
- **Fix:** Shorten the level name to something below 64 characters. | ||
- `LH-PUB-0005`: The level failed to publish because the level description is too long. | ||
- **Fix:** Shorten the level description to something below 512 characters. | ||
- `LH-PUB-0006`: The level failed to publish because the server is missing resources required by the level. | ||
- **Potential Fix:** Remove any resources that are not available on the server from the level. | ||
- `LH-PUB-0007`: The level failed to publish because the root level is not a valid level. | ||
- `LH-PUB-0008`: The level failed to publish because the root level is not an LBP3 Adventure level. | ||
- `LH-PUB-0009`: The level failed to publish because the the user has reached their level publishing limit. | ||
- **Fix:** Delete some of your previously published levels to make room for new ones. | ||
|
||
## Level Republishing | ||
|
||
- `LH-REP-0001`: The level failed to republish because the old slot does not exist. | ||
- `LH-REP-0002`: The level failed to republish because the original publisher is not the current publisher. | ||
- **Potential Fix:** Copying the level to another slot on your moon typically fixes this issue. | ||
- `LH-REP-0003`: The level could not be unlocked because it was locked by a moderator. | ||
- **Potential Fix:** Ask a server administrator/moderator to unlock the level for you. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
ProjectLighthouse.Servers.Website/Pages/Admin/AdminSendNotificationPage.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@page "/admin/user/{id:int}/sendNotification" | ||
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Admin.AdminSendNotificationPage | ||
|
||
@{ | ||
Layout = "Layouts/BaseLayout"; | ||
Model.Title = $"Send notification to {Model.TargetedUser!.Username}"; | ||
} | ||
|
||
@await Html.PartialAsync("Partials/AdminSendNotificationPartial", Model.TargetedUser) |
Oops, something went wrong.