package Ġcom . nak or ad io . geo leg . controllers Ċ Ċ import Ġcom . nak or ad io . geo leg . model . Technical Error Ċ import Ġcom . nak or ad io . geo leg . services . Scenario Loader Ċ import Ġjavax . servlet . http . HttpServletResponse Ċ import Ġorg . slf 4 j . Logger Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . springframework . stereotype . Controller Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġorg . springframework . web . bind . annotation . PathVariable Ċ import Ġorg . springframework . web . servlet . Model AndView Ċ Ċ const Ġval ĠCOOKIE _ NAME Ġ= Ġ" y ummy " Ċ Ċ /* Ċ Handles Ġthe Ġscanned ĠQR Ġcodes Ċ Ġ*/ Ċ @ Controller Ċ class ĠQR Controller ( ĊĠĠĠ Ġval Ġloader : ĠScenario Loader Ċ ) Ġ{ ĊĊĠĠĠ Ġvar Ġlogger : ĠLogger Ġ= ĠLoggerFactory . getLogger ( this :: class . java ) ĊĊĠĠĠ Ġval Ġscenario Ġ= Ġloader . table . scenarios [ 0 ] ĊĠĠĠ Ġval Ġscenario Name Ġ= Ġscenario . name ĊĠĠĠ Ġval Ġquest 0 Secret Ġ= Ġscenario . quest s [ 0 ]. secret ĊĠĠĠ Ġval Ġquest 1 Secret Ġ= Ġscenario . quest s [ 1 ]. secret ĊĠĠĠ Ġval Ġquest 2 Secret Ġ= Ġscenario . quest s [ 2 ]. secret ĊĠĠĠ Ġval Ġquest 3 Secret Ġ= Ġscenario . quest s [ 3 ]. secret ĊĠĠĠ Ġval Ġquest 4 Secret Ġ= Ġscenario . quest s [ 4 ]. secret ĊĠĠĠ Ġval Ġquest 5 Secret Ġ= Ġscenario . quest s [ 5 ]. secret ĊĠĠĠ Ġval Ġquest 6 Secret Ġ= Ġscenario . quest s [ 6 ]. secret ĊĠĠĠ Ġval Ġquest 7 Secret Ġ= Ġscenario . quest s [ 7 ]. secret ĊĠĠĠ Ġval Ġquest 8 Secret Ġ= Ġscenario . quest s [ 8 ]. secret ĊĠĠĠ Ġval Ġquest 9 Secret Ġ= Ġscenario . quest s [ 9 ]. secret ĊĊĠĠĠ Ġ// ĠCode s Ġare Ġrandom Ġstrings Ġto Ġavoid Ġguess ing Ġand Ġfor Ġflexible Ġreplacing ĊĠĠĠ Ġpublic Ġval ĠQR _ CODE _ MAPPING Ġ= Ġmap Of ( ĊĠĠĠĠĠĠĠ Ġ" gt f 9 2 j gf " Ġto ĠPair (" init ", Ġ"/ engine / init /$ scenario Name "), ĊĠĠĠĠĠĠĠ Ġ" 9 xs 4 tu 3 v " Ġto ĠPair (" ky lt ti ", Ġ"/ engine / complete /$ scenario Name / 1 /$ quest 1 Secret "), ĊĠĠĠĠĠĠĠ Ġ" sn w xf q gj " Ġto ĠPair (" sil ta ", Ġ"/ engine / complete /$ scenario Name / 2 /$ quest 2 Secret "), ĊĠĠĠĠĠĠĠ Ġ" 4 c 8 cz et 6 " Ġto ĠPair (" ku usi ", Ġ"/ engine / complete /$ scenario Name / 3 /$ quest 3 Secret "), ĊĠĠĠĠĠĠĠ Ġ" kv 9 6 gn we " Ġto ĠPair (" kal lio ", Ġ"/ engine / complete /$ scenario Name / 4 /$ quest 4 Secret "), ĊĠĠĠĠĠĠĠ Ġ" 6 ec p 9 8 eu " Ġto ĠPair (" ke lo ", Ġ"/ engine / complete /$ scenario Name / 5 /$ quest 5 Secret "), ĊĠĠĠĠĠĠĠ Ġ" v yr us m vm " Ġto ĠPair (" mast o ", Ġ"/ engine / complete /$ scenario Name / 6 /$ quest 6 Secret "), ĊĠĠĠĠĠĠĠ Ġ" 2 dj z av s 8 " Ġto ĠPair (" he lik opt eri ", Ġ"/ engine / complete /$ scenario Name / 7 /$ quest 7 Secret "), ĊĠĠĠĠĠĠĠ Ġ" not Ġused , Ġshared ĠQR Ġkv 9 6 gn we " Ġto ĠPair (" kal lio ", Ġ"/ engine / complete /$ scenario Name / 8 /$ quest 8 Secret "), ĊĠĠĠĠĠĠĠ Ġ" hj 7 hu jue " Ġto ĠPair (" S ii lo ", Ġ"/ engine / complete /$ scenario Name / 9 /$ quest 9 Secret "), ĊĠĠĠĠĠĠĠ Ġ" 4 4 b 6 b sc n " Ġto ĠPair (" compatibility ", Ġ"/ compatibility / qr ? qr = ok ") ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġ@ GetMapping ("/ manual qr ") ĊĠĠĠ Ġfun Ġmanual (): ĠModelAndView Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠModelAndView (" manual QR ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ GetMapping ("/ qr /{ qr Code }") ĊĠĠĠ Ġfun Ġprocess Code ( ĊĠĠĠĠĠĠĠ Ġ@ PathVariable Ġqr Code : ĠString , ĊĠĠĠĠĠĠĠ Ġresponse : ĠHttpServletResponse ĊĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠ ĠQR _ CODE _ MAPPING [ qr Code ]?. run Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlogger . info (" QR Ġcode Ġ$ qr Code Ġredirect ing Ġto Ġ$ this ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġresponse . send Redirect ( this . second ) ĊĠĠĠĠĠĠĠ Ġ} Ġ?: Ġrun Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthrow ĠTechnical Error (" Unknown ĠQR Ġcode Ġ$ qr Code ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ