netrunner icon indicating copy to clipboard operation
netrunner copied to clipboard

Add server-side deck validation

Open zaroth opened this issue 10 years ago • 3 comments

While the current architecture of all deck validation happening client-side in javascript is workable, it causes a number of issues that can't be ignored in the long run:

  • security (decks loaded, submitted and validated in javascript allow for many shenanigans, e.g. swapping your deck for an invalid one last second before starting a hosted game, which won't be noticed by the opponent)
  • speed (even currently solution for many players complaining about site slowness is to delete some of their decks - validation is a huge part of that)
  • tool flexibility (once the validation code is out of cljs and in a separate module, it will be far easier to unit test it)

Code sharing between server Clojure code and Clojurescript is supported by lein-cljsbuild and can be achieved e.g. via .cljc files described in https://github.com/emezeske/lein-cljsbuild/blob/master/doc/CROSSOVERS.md

zaroth avatar May 10 '16 09:05 zaroth

Obviously server-side validation would happen only on saving a deck and its status would be stored in database together with the deck - this would stop decks from being validated over and over again. JS validation should be used only live, when editing a deck.

zaroth avatar May 11 '16 21:05 zaroth

Since the new privacy rework by @nealterrell reloads all the cards in a deck on the server-side, maybe the whole deck functionality could be rewritten to manage the deck mainly on the server-side, just passing a deck-id around or something.

Saintis avatar Aug 04 '16 12:08 Saintis

Done!

nealterrell avatar Feb 17 '18 04:02 nealterrell