Commit graph

139 commits

Author SHA1 Message Date
Slendy
d4b9ca666b
Add ordering to LBP2 search 2023-06-06 23:16:54 -05:00
Josh
a69d94054b
Simplify filters and make cross control slots not show by default (#782)
* Simplify filters and make cross control slots not show by default
Also sort author levels by oldest levels first rather than newest levels first.

* Fix unit test expecting slots to sorted by timestamp descending

* Remove errant whitespace
2023-06-05 22:53:41 +00:00
Slendy
c9784cf8c9
Fix hearted profiles being sorted in reverse order 2023-05-31 21:25:35 -05:00
Slendy
0b936d3e5d
Implement deleting playlists
Also fixes playlists visually not updating in-game when modifying them
2023-05-31 20:37:17 -05:00
Slendy
cd926a8415
Refactor LBP3 text search to use the category system 2023-05-31 20:35:39 -05:00
Josh
0c1e350fa3
Rewrite gameserver slot filter system (#763)
* Initial implementation of new slot sorting and filtering system

* Initial implementation of filtering for lbp3 community tab

* Add support for organization on lbp3

* Add playlist and user categories

* Implement unit tests for all filters
Refactor more systems to use PaginationData

* Fix PlayerCountFilter test

* Add more unit tests and integration tests for the filter system

* Fix LBP2 move filter and gameFilterType

* Fix sort by likes in LBP3 category

* Add sort for total plays

* Remove extra whitespace and make styling more consistent

* Order hearted and queued levels by primary key ID

* Fix query without order warnings
2023-05-31 21:33:39 +00:00
Josh
1bf4ed6218
Add more unit tests (#757)
* Reorganize tests into unit/integration pattern

* Make DbSets virtual so they can be overridden by tests

* Add MessageControllerTests

* Implement DigestMiddlewareTests

* Refactor SMTPHelper to follow DI pattern which allows for mocking in unit tests.

* Fix MailQueueService service registration and shutdown

* Implement tests for Status and StatisticsController and reorganize tests

* Start working on UserControllerTests

* Start refactoring tests to use In-Memory EF provider

* Refactor integration tests to reset the database every time
Change default unit testing database credentials

* Update credentials to use default root with different passwords

* Throw exception when integration db is not available instead of falling back to in-memory

* Evaluate DbConnected every time

* Remove default DbContext constructor

* Setup DbContexts with options builder

* Convert remaining Moq DbContexts to InMemory ones

* Add more tests and use Assert.IsType for testing status code

* Add collection attribute to LighthouseServerTest

* Remove unused directives and calculate digest in tests

* Fix digest calculation in tests

* Add test database call

* Clear rooms after each test

* Fix CommentControllerTests.cs

* Disable test parallelization for gameserver tests

* Fix failing tests

Fix SlotTests

Make CreateUser actually add user to database

Fix dbConnected Lazy and change expected status codes

Properly Remove fragment from url for digest calculation

Fix digest calculation for regular requests

[skip ci] Remove unused directive

Don't use Database CreateUser function

Get rid of userId argument for generating random user

Rewrite logic for generating random users

Fix integration tests

* Implement changes from self-code review

* Fix registration tests

* Replace MailQueueService usages with IMailService
2023-05-15 15:00:33 -05:00
jackcaver
9deff7ce63
Implement basic filters and LBP2 CrossController fixes (#758)
* implement basic filters and lbp2cc fixes

* lbp3 hide lbp2cc slots

* hide lbp2cc levels from hearted and most played categories in lbp3 and basic filters for lbp3

---------

Co-authored-by: jackcaver <jackcaver@users.noreply.github.com>
Co-authored-by: koko <koko@drones.gay>
2023-05-04 14:42:31 +00:00
Slendy
38e97a904a
Make FriendsController return text/xml 2023-05-02 21:05:41 -05:00
Josh
3aa9033b67
Rewrite captcha system (#754)
Rewrite captcha and remove many unused directives
2023-04-29 04:32:42 +00:00
W0lf4llo
aefecc7b12
Make LBP2 lucky dip prefer newer levels and make player count more accurate (#744)
* Lucky Dip, Newest Levels, & Recently Played change

* almost broke prod :disaster:

* Update ProjectLighthouse.Servers.GameServer/Controllers/Slots/SlotsController.cs

I forgor lol

Co-authored-by: koko <koko@drones.gay>

* Remove TimestampMicros and add random slot selection with bias

* playersInPod count filters by platform

* Hope this actually commits now, idk github

* Apply suggestions from code review

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse.Servers.GameServer/Controllers/StatisticsController.cs

Co-authored-by: Josh <josh@slendy.pw>

* Fix random bias ordering

---------

Co-authored-by: koko <joebiden@kitgaming67.com>
Co-authored-by: koko <koko@drones.gay>
Co-authored-by: Slendy <josh@slendy.pw>
2023-04-29 04:32:36 +00:00
Josh
eb79d7cf48
Optimize slot endpoints (#750)
* Remove AsEnumerable usage in SlotsController

* Remove AsEnumerable usages from LBP3 categories

* Fix typo in OrderBy statement
2023-04-26 20:13:27 +00:00
Slendy
ddee367586
Add more logging to resources and matching
Change uploading to use ReadAllAsync instead of readFromPipeReader
2023-04-20 11:00:55 -05:00
Slendy
f03d1d7c17
Utilize EF 7 bulk delete operations instead of RemoveRange 2023-04-18 20:45:42 -05:00
Slendy
d8c36923d9
Fix deserialized PhotoSubject bounds not being set in database entity 2023-04-11 20:27:43 -05:00
Slendy
5fbaa5df20
Fix level republishing not updating resource or rootLevel 2023-04-11 20:23:43 -05:00
Slendy
4150e44f80
Refactor code for reading the body of a request 2023-04-06 22:23:49 -05:00
Josh
2210541894
Fix memory leak in GameServer (#731)
* Convert entities to serializable after aggregating rather before

* Cache instances of CustomXmlSerializer and create readonly constants for reused settings

* Change CustomXmlSerializer and serializer cache to work with deserializer
2023-04-02 23:45:19 +00:00
Josh
0253864f5e
Add LBP1 level scoreboards (#728)
* Add missing lbp1 scoreboard endpoint

* Allow all score types to be fetched

* Make lbp1 scores start at highest

* Fix query to use ScoreType from options

* Implement multi-type scoreboard response
2023-03-31 21:08:27 +00:00
Josh
50d1d9c7e5
Fix doubly sanitized strings (#727)
* Add migration to de-sanitize database strings

* Remove SanitizationHelper functions related to XML sanitization

* Remove sanitization usage from website

* Implement suggested changes
2023-03-30 23:03:08 +00:00
Slendy
ff470bcb34
Fix certain scores not being uploaded 2023-03-29 23:36:47 -05:00
Slendy
b0858448c8
Fix LBP3 playlist editing 2023-03-29 19:34:16 -05:00
Slendy
8376928a6c
Fix score uploading on story levels 2023-03-29 13:32:48 -05:00
Slendy
6fcc51fca3
Make BackgroundHash not nullable 2023-03-29 13:06:01 -05:00
Slendy
3ebdc03951
Properly serialize slot resources 2023-03-28 15:19:25 -05:00
Slendy
e3843cb8c4
Fix content-type for planetStats 2023-03-28 14:40:05 -05:00
Slendy
90f79d67c4
Fix level publishing 2023-03-28 14:26:09 -05:00
Slendy
deac39ef97
Fix ScoreboardResponse returning points as count 2023-03-28 14:03:35 -05:00
Slendy
1e8ef8c679
Serialization refactor hotfixes
Fixes user heart count
Fixes searches not working
Fixes text/plain content not outputting
2023-03-28 10:33:03 -05:00
Josh
329ab66043
Refactor serialization system (#702)
* Initial work for serialization refactor

* Experiment with new naming conventions

* Mostly implement user and slot serialization.
Still needs to be fine tuned to match original implementation
Many things are left in a broken state like website features/api endpoints/lbp3 categories

* Fix release building

* Migrate scores, reviews, and more to new serialization system.
Many things are still broken but progress is steadily being made

* Fix Api responses and migrate serialization for most types

* Make serialization better and fix bugs
Fix recursive PrepareSerialization when recursive item is set during root item's PrepareSerialization, items, should be properly indexed in order but it's only tested to 1 level of recursion

* Fix review serialization

* Fix user serialization producing malformed SQL query

* Remove DefaultIfEmpty query

* MariaDB doesn't like double nested queries

* Fix LBP1 tag counter

* Implement lbp3 categories and add better deserialization handling

* Implement expression tree caching to speed up reflection and write new serializer tests

* Remove Game column from UserEntity and rename DatabaseContextModelSnapshot.cs back to DatabaseModelSnapshot.cs

* Make UserEntity username not required

* Fix recursive serialization of lists and add relevant unit tests

* Actually commit the migration

* Fix LocationTests to use new deserialization class

* Fix comments not serializing the right author username

* Replace all occurrences of StatusCode with their respective ASP.NET named result
instead of StatusCode(403) everything is now in the form of Forbid()

* Fix SlotBase.ConvertToEntity and LocationTests

* Fix compilation error

* Give Location a default value in GameUserSlot and GameUser

* Reimplement stubbed website functions

* Convert grief reports to new serialization system

* Update DatabaseModelSnapshot and bump dotnet tool version

* Remove unused directives

* Fix broken type reference

* Fix rated comments on website

* Don't include banned users in website comments

* Optimize score submission

* Fix slot id calculating in in-game comment posting

* Move serialization interfaces to types folder and add more documentation

* Allow uploading of versus scores
2023-03-28 00:39:54 +00:00
Josh
b2a1d3958f
Allow head requests to status endpoints (#717) 2023-03-24 00:31:56 +00:00
Josh
fa5ff0b490
Add a discord webhook for when users join for the first time. (#698)
* Add a discord webhook for when users join for the first time.

* Fix compilation error related to embed colors

* Make config migration backup use the version of the stored file

* Make DiscordConfiguration not halt startup

* Allow the registration message to be configured

* Clean up registration announcement and add userId variable

* Fix userid resolution and convert newline string to actual character
Also make WebhookHelper not fail if all destinations aren't configured
2023-03-23 00:57:28 +00:00
Josh
b87c16ab7c
Make in-game email system not lock after one attempt (#712) 2023-03-18 20:33:37 -05:00
W0lf4llo
9b014fa01c
StasticsHelper + Community Tab Performance Fix (#713)
* Player count shows per game

* Fixed LBP3 categories lagigng & StatisticsHelper

Co-authored-by: koko <sudokoko@users.noreply.github.com>

* Fixed "planetStats" mmPicksCount

* Hopefully the final update to this PR!
(Bug fixes)

* Update ProjectLighthouse/Types/Entities/Level/Slot.cs

Co-authored-by: koko <68549366+sudokoko@users.noreply.github.com>

* Update ProjectLighthouse.Servers.GameServer/Controllers/Slots/SlotsController.cs

I'm trusting you that nothing breaks here lol

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse.Servers.GameServer/Controllers/Slots/SlotsController.cs

bad slendy >:(

Co-authored-by: koko <68549366+sudokoko@users.noreply.github.com>

---------

Co-authored-by: koko <sudokoko@users.noreply.github.com>
Co-authored-by: koko <68549366+sudokoko@users.noreply.github.com>
Co-authored-by: Josh <josh@slendy.pw>
2023-03-17 03:51:55 +00:00
Slendy
9d25f56e64
Fix hearted and queued levels on LBP Vita 2023-03-04 21:41:49 -06:00
Josh
017dcd6888
Make PhotoSubjects use a one to many relationship (#687)
* Attempt to remodel PhotoSubject and Photo relationship

* Fix migration name

* Use exactName for migration lock

* Revert "Use exactName for migration lock"

This reverts commit 76cee6a3ff.

* Set command timeout to 5 minutes for database migrations

* Delete unused PhotoSubjects in migration

* Clean up website queries and finalize subject refactor

* Add migration to remove PhotoSubjectCollection

* Add grace period for container startup and optimize startup

* Make config backup copy original file

* Allow docker entrypoint to fix data permissions
2023-02-24 04:20:55 +00:00
Josh
35ea2682b9
Replace Location table with packed 64-bit int (#679)
* Replace Location table with packed 64 bit int

* Remove double Include and fix Slot documentation

* Fix compilation errors from merge

* Fix namespaces and add expected values to unit tests
2023-02-21 14:53:38 -06:00
Slendy
a796cb9185
Add basic checks to grief reporting 2023-02-18 07:15:39 -06:00
Josh
64b95e807d
Refactor Database class (#616)
Refactor Database into DatabaseContext
Moved into separate folder so it actually has a namespace instead sitting in the root
2023-02-15 23:54:30 -06:00
Josh
f1c5ad4002
Major refactor and reorganization of types (#652)
* Start of reorganization and cleanup

* Remove duplicate title id

* Refactor types

* Fix Release building

* Move classes in /Types to a Types namespace

* Fix compilation error (RoomVisualizerPage strikes again)

* Fix bugs created from auto merge

* Fix auto-merge compilation error

* Changes from review/fix failed merge
2023-02-13 22:02:58 -06:00
Slendy
bff915e304
Use pipelines to read request bodies instead of stream 2023-02-11 21:11:20 -06:00
Slendy
84325596ee
Clamp minimum and maximum players on slot publish 2023-02-11 19:13:01 -06:00
Slendy
14fa5e9328
Properly dispose of StreamReaders 2023-02-11 19:08:44 -06:00
Slendy
75a5e70635
Fix Enumerable usage in CommentController 2023-02-11 19:08:03 -06:00
Zaprit
96c34c83a7
Feature/user blocking hotfix 1 (#668)
* Changed CommentController to use an AsyncEnumerable to attempt to fix the current issue

* Made comments & reviews from blocked users on levels not appear
2023-02-11 17:30:27 -05:00
Zaprit
3fcfaaf5cc
Profile Blocking (#662)
* Added blocked user DB object

* Added user blocking functions

* Fixed DB Migration

* Updated DB Functions

* Added blocked user support to website

* Fixed DB Migration

* I forgot to save 🫠

* More migration pain

* Fixed Unblock label

* Update ProjectLighthouse.Servers.Website/Pages/UserPage.cshtml

sounds cool

Co-authored-by: koko <68549366+sudokoko@users.noreply.github.com>

* Removed unnecessary imports in database

* Removed unnecessary  imports in UserPage.cshtml.cs

* Made comments in-game respect blocked users

* Update ProjectLighthouse/Database.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Database.cs

Co-authored-by: Josh <josh@slendy.pw>

* DB Code cleanup

* Cleaned up userPage block detection code

* Get only the creator id in lieu of the whole object

* Fixed null condition when not logged in

* Fixed null condition when not logged in

* Potential DB Optimisation

* Apply suggestions from code review

Co-authored-by: Josh <josh@slendy.pw>

* Fix errors and null warning

* Use explicit type in lieu of var

* changed block icons

* Optimize blocked user check and save changes when unblocking

---------

Co-authored-by: koko <68549366+sudokoko@users.noreply.github.com>
Co-authored-by: Josh <josh@slendy.pw>
2023-02-11 08:25:06 +00:00
Josh
ace3678da7
Add some resource tests and other small changes (#638)
* Cleanup custom icon resources and add resource tests

* Don't delete old custom icons
2023-01-20 00:18:57 -06:00
HomicidalChicken
326b9e5529
Move filter to separate config and add more scanning (#603)
* Create .gitattributes

Added a .gitattributes file that excludes the local customWordFilter.txt file from merged updates, allowing server operators to maintain their own word filter list and not have it overwritten.

* Update .gitignore

Added chatCensoredList to gitignore

* Update .gitignore

* Dynamic censor list file changes

Removed .gitattributes file, attempted to make chatCensoredList.txt into a dynamic file loaded at runtime instead.

* Added additional censorship coverage

Censorship now covers:
Level titles
Level descriptions
Reviews
Comments

* Delete chatCensoredList.txt

* Update .gitignore

Co-authored-by: Josh <josh@slendy.pw>

* Update filter verbiage

* Update ProjectLighthouse.Servers.GameServer/Controllers/CommentController.cs

Co-authored-by: Josh <josh@slendy.pw>

* Update ProjectLighthouse/Helpers/CensorHelper.cs

Co-authored-by: Josh <josh@slendy.pw>

* Add CensorConfiguration and add more filters

Co-authored-by: Josh <josh@slendy.pw>
2023-01-19 21:24:45 -06:00
Slendy
73a871f187
Change redis object prefix 2023-01-10 21:50:13 -06:00
Josh
b5877bc10c
Remove duplicate scores (#622)
* Remove duplicate scores

* Optimize score migration
2023-01-10 17:36:43 -06:00