Coder Social home page Coder Social logo

dynamictournament's People

Contributors

mrgunflame avatar

Watchers

 avatar

dynamictournament's Issues

Use wp user capabilities

We should use wp capabilities to decide if a logged in user is allowed to edit the tournament scores. Probably also split up administration (edit team data) and moderation (edit scores only).

NextMatches::{winner_mut, loser_mut, winner_match_mut, loser_match_mut} are unsound

These methods use get_unchecked_mut to skip out-of-bounds checking. Since Matches can now publicly created, this can cause UB without unsafe.

Example:

// Random oob indexes here.
let m = NextMatches::new(Some((128, 0), Some((128)));

// But `matches` has length 0.
let mut matches = Matches::<u8>::new();

// UB
let _ref = m.winner_mut(&mut matches).unwrap();
_ref.is_empty();

Both methods should make use of their Option return type to check if they are out-of-bounds. Since this involves more runtime checks there should also be alternative unsafe {winner_mut_unchecked, loser_mut_unchecked, winner_match_mut_unchecked, loser_match_mut_unchecked}.

Allow binding the http server to a unix socket

Allow the http server to bind to a unix socket. This is convenient and more performant than using a TCP socket when no external communication is required.

  • Update the bind config value to either parse into an SocketAddr or PathBuf.
  • Error out on non-unix targets when parsing a PathBuf
  • Update the http::bind function to accept either value (enum)
  • Implement the server loop using UnixListener and UnixStream

Fullscreen mode

A fullscreen mode for the bracket view. This setting should preferably be available without having to interact with the page (e.g. url path, query).

RFC: Version 4 API changes

Tracking potential changes for the planned v4 API.

Custom fields

Allow the creation of completely custom fields. This can be applied to both teams and players (as part of a team or standalone). The change allows for greater flexibility for what fields are needed where. The custom fields should be displayed on the Entrants/Team page. It may also be useful add an extra flag to define whether the field would be displayed.

Custom fields will also make roles obsolete. They can be implemented using custom fields instead.

If fields are predefined for every tournament this also allows better input and group support. A field could for example be:

  • Any string/[u]int/bool
  • A value of a list of possible values (selection)
  • A [u]int grouped as average/median/highest/lowest/etc..

String id fields

The current versions all use json integers to represent ids. This however prevents bigger id values (e.g. u64) to be represented in json. Moving to string-encoded strings removes this limitation and virtually no added runtime costs.

Required system options

Currently systems only support options with a default value. This is fine for elimination style brackets, but can be rather limiting for group-stage style brackets.

Database table prefixes

Add the option to configure a prefix for database tables. This prevents potential conflicts when sharing the same database with other applications or running multiple dynamic-tournament instances using the same database.

  • Include new config option under the database section called prefix (or similar)
  • Load the prefix into the database connector
  • Include the prefix in any database queries

Loading a bracket while the auth token is still refreshing prevents WebSocket authentication

When loading the Bracket component while the auth token is still being refreshed the WebSocket connection will not be authenticated. This usually happen if /tournaments/:id/brackets/:id is opening directly.

This can be solved by either:

  • prevent opening the WebSocket connection until the token is either refreshed or invalidated or
  • send a Authorize frame to the server once the auth token has been acquired (this seems to be the better option).

Remove debug/trace logging at compile time when building in release mode

There is an excessive amount of debug/trace logging in the web frontend slowing down the client and increasing file sizes. The release_max_level_warn feature of the log limits the logs emitted. It does need to be added when the crate is being built, adding it permanently will break logging of other crates.

Stabilize and implement a stable binary websocket protocol

The currently used websocket protocol is not yet stable and not well defined. The following things need to be decided upon:

  • Endianess (LE/BE): LE
  • Which varint format to use (and how to convert signed ints): ULEB128 for unsigned intergers and zigzag for converting signed integers
  • Should requests/responses have a different format: Yes, this allows for better efficiency and keeps variants low.

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.