Code Monkey home page Code Monkey logo

refresh's People

Contributors

ashifter avatar beyley avatar daggintosh avatar dependabot[bot] avatar jvyden avatar manoplay avatar slendy avatar speedyman09 avatar turecross321 avatar uhwot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

refresh's Issues

Match format sometimes not working

Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]: [08/26/23 16:03:03] [Request:Trace] <MainMiddleware:HandleRequest> Handling request with MatchingEndpoints.Match
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]: [08/26/23 16:03:03] [Request:Error] <<HandleRequest>d__17:MoveNext> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:  ---> System.FormatException: The input string '210f108,' was not in a correct format.
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, ReadOnlySpan`1 value, TypeCode type)
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at Refresh.GameServer.Services.MatchService.ConvertHexadecimalIpAddressToString(String hex) in /home/runner/work/Refresh/Refresh/Refresh.GameServer/Services/MatchService.Parsing.cs:line 50
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at Refresh.GameServer.Services.MatchService.ReplaceHexValuesInStringWithIpAddresses(String body) in /home/runner/work/Refresh/Refresh/Refresh.GameServer/Services/MatchService.Parsing.cs:line 27
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at Refresh.GameServer.Services.MatchService.ExtractMethodAndBodyFromJson(String body) in /home/runner/work/Refresh/Refresh/Refresh.GameServer/Services/MatchService.Parsing.cs:line 13
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at Refresh.GameServer.Endpoints.Game.MatchingEndpoints.Match(RequestContext context, GameDatabaseContext database, GameUser user, Token token, MatchService service, String body) in /home/runner/work/Refresh/Refresh/Refresh.GameServer/Endpoints/Game/MatchingEndpoints.cs:line 36
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    --- End of inner exception stack trace ---
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at System.Reflection.RuntimeMethodInfo.InvokeWithManyArguments(RuntimeMethodInfo mi, Int32 argCount, Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at Bunkum.HttpServer.Endpoints.Middlewares.MainMiddleware.InvokeEndpointByRequest(ListenerContext context, Lazy`1 database)
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at Bunkum.HttpServer.Endpoints.Middlewares.MainMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next)
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at Refresh.GameServer.Middlewares.DigestMiddleware.HandleRequest(ListenerContext context, Lazy`1 database, Action next) in /home/runner/work/Refresh/Refresh/Refresh.GameServer/Middlewares/DigestMiddleware.cs:line 85
Aug 26 16:03:03 eve-jvyden-xyz Refresh.GameServer[78559]:    at Bunkum.HttpServer.BunkumHttpServer.HandleRequest(ListenerContext context, Lazy`1 database)

List of #1s achieved on profile

Idea stripped right from osu!

On the profile, there would be a list of levels where the player has achieved the spot with the most score on a level. A bit like this:

image

What URL do I patch it with?

I was looking to play-test this and I was confused whilist patching, it said that I should not patch it with 10061 port then what URL do I patch this with?

Administrative tasks

From the command line or API, administrators should be able to perform a couple tasks.

  • Banning a user
  • Resetting passwords for users, then prompting them for a reset
  • Marking a user as administrator

Implement a proper login flow

Did some discussion on Discord today starting here in #dev-main between @Slendy, @turecross321 and @Beyley. I'll summarize our conversation in this issue.

An initial plan was to implement a traditional IP authentication system, but this turned out to be a pretty bad idea. We then settled on having IP authentication fallback incase the primary authentication system, ticket verification, fails.

Hashing the IP address before storing it in the database was brought up, but was ultimately dismissed as it could cause confusion, and since there are many more hashes than IP addresses it could be easily reversible should a data leak occur.

I came up with some pseudocode describing a potential login flow:

if(canVerifySignature) return login(ticket.username);
else if(serverSettings.allowsIpAuthentication) {
  if(!accountSettings.allowsIpAuthentication) {
    warnUser("ticket verification failed, if this was you enable ip auth");
  }
  requestIpVerification(ticket.username, request.ip);
}
else {
  warnUser("ticket verification failed and server doesn't support ip auth");
}

return Unauthorized;

The idea is to support the edge case of a user not being on PSN/RPCN if it's needed, but recognize that IP verification a bit more insecure/privacy invasive. Because of this, will be off by default both server-side and in account settings, so server maintainers and users get to decide if they are comfortable with storing their IP address short-term/long-term.

LBP3 Community tab

Should be mostly straight-forward, just hook up /lbp/searches to the existing category system

Creator Leaderboards

It would be cool to rank people by the amount of hearts or plays their levels have gotten.

It could encourage making levels, or you know, it could backfire and cause H4H to be an annoyance again.

API Refactor (v3?)

Talked to ture today, discussing various aspects of our APIs. The subject of sorting and listing came up, and I realized that Refresh isn't very great at returning this type of information. It's virtually impossible to have pagination with this system - the database does not return the total number of slots in most cases.

It also might be a good opportunity to have things be properly documented this time. Write some xmldoc, have some sort of script read it and push it out to a big markdown file.

One of my personal gripes is the PascalCase types - JSON REST APIs typically use camelCase. Also, it may be better to have dedicated Request/Response types for each endpoint when applicable. This is something SoundShapesServer has done and I'm starting to grow fond of it. I might also break out the types for GameEndpoints, as well.

The biggest challenge by far with implementing all of this is going to be keeping support for v2. I don't know of any applications built on v2, so it might just be safe to scrap it and not have to deal with the baggage.

Groups, aka "Clans"

A group that a user can form, and other users can join it. (if the group is open as opposed to invite-only)

We can probably represent groups with a dollar sign or some other symbols?
$Clan for example, no spaces should be allowed.

  • If #44 is implemented, we could also have a group leaderboard instead of just an individual user leaderboard

  • Users can transfer their levels to a clan, and they will share a single earth - and can be searched for in-game like normal levels

  • Photos of clan members can also be shown

Recent Activity

  • List of events in Realm
  • Photos uploaded, news, new scores, etc.
  • Should be exposed to API

TEX to PNG

  • Option to cache on disk/always convert
  • Pull from API (e.g. /api/v2/asset/{hash}/image returns a image/png)

Maintenance mode

Instance owners should be able to lock down a server to only allow administrators to log in/access the website. Helpful for those who are under attack/assessing damage, or simply want to do manual database work without noise.

Roles

Similar to Discord. Will be pretty helpful for larger instances

  • User can have multiple roles (?)
  • Roles detail what actions can be taken by the user (can this user post comments, can this user ban other users, etc.)
  • Roles may optionally display a badge on the users profile
  • Has default roles (User, Admin) but still configurable by administrator

To implement:

  • Administrator role
  • User role (default)
  • Restricted role
  • Banned role

Score submission

Submitted scores should be exposed to API, but not score submission itself for obvious reasons

User content metadata tracking

  • Track who uploaded an asset, and when
  • Track type of asset (#22)
  • Track dependencies of asset
  • Add migration to backfill data into database from DataStore
  • Track size of asset (#66)

We can use this information to be able to purge unused assets/delete assets by a certain user

Implement Missing Level Categories

Including but not limited to:

  • lbpcool/lbp2cool (lbp1, lbp 2 and lbp vita cool levels)
  • thumbs (highest rated)
  • mostHearted
  • mmpicks (team picks, depends on #68)
  • mostUniquePlays
  • busiest

News

Format for LBP1 was recently uncovered:

<news>
    <subcategory>
        <title></title>
        <item>
            <subject></subject>
            <timestamp></timestamp>
            <content></content>
        </item>
        </subcategory>
</news>

News in LBP2 is handled in recent activity
#16

Thanks to @W0lf4llo for bringing this to my attention.

Rooms don't expire

After someone opens the game and uses the /match endpoint, their room will show indefinitely until the server is restarted.

Discord Webhook

Should be a worker that just scans for recent Events about every 5 minutes or so

Worker to add missing photo associations

We can use the new Worker system to periodically check for new users, and then look for unattributed users in photo subjects.

So userA uploads a photo with userB, without userB being registered. userB gets tracked in the uploaded photo with a username (missing their GameUser association), and then userB registers. At this point, the uploaded photo still hasn't tracked their signup accordingly, so our worker runs and updates the photo to add the GameUser to the photo subject.

Server announcements

Instance owners should be able to create 'announcements' that show up in-game and on the website as a banner, similar to a notification but not quite.

For the API, they should be included in the /api/v3/instance endpoint.

Related: #17

Mod Filter

A mod filter should be implemented with 3 modes

  1. strict: only game files usually sent by users (.tex, .jpg, .plan, text strings, ect) can be uploaded
  2. lenient: game file types, such as .mol, .anim, .gmat, .mat and .bev are allowed on the server, but .ff files are still unallowed
  3. none: lets users upload anything they want

Login/Registration security

  • Enforce tighter rate limits on these endpoints
  • Don't allow user to be registered immediately, wait for game handshake to activate account
    - [ ] Trial period for new users? Don't allow commenting/relations through API for a little while, but may be too strong of a measure Unnecessary for now, we'll gague later
  • Simple password requirements (8 characters, don't want to be too strict on this)
  • Email verification. Must-have.
  • Users should not be able to steal accounts from other platforms. A PSN account should not be able to be logged into from RPCS3 if not explicitly allowed by that user.

Notifications

  • Notifications store title, text, FontAwesome icon, date, and color (as hex string)
  • Stored per-user, can be retrieved through API
  • Can clear notifications individually and all at once (history does not get preserved!)
  • Notifications can also show at announce screen, sorted by most recent to oldest

Extend Tokens

  • Track Platform and GameVersion (this should also track if the token is an API token aswell) (#37)
  • Login date (2866173)
  • Add support for passing in a token in Bunkum (PlanetBunkum/Bunkum@d7a4617)
  • Maybe point to recent events? Could be used to display more information to user through API if a level upload was rejected for example. Would also be good for audit log

Support the command-line properly

Right now, we just do string comparisons on args[0] on startup to check for commands. This isn't ideal, since it doesn't provide a help menu or any real documentation.

I've had success with CommandLineParser in other projects, so this could be a good start.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.