File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -79,10 +79,10 @@ pub fn set_waiting() {
7979 state. set ( AppState :: Waiting ) ;
8080}
8181
82- pub fn set_scanning ( player : Option < String > ) {
82+ pub fn set_scanning ( room : Option < String > , player : Option < String > ) {
8383 let capture = {
8484 let state = AppState :: acquire ( ) ;
85- if !matches ! ( state. as_ref( ) , AppState :: Waiting { .. } ) {
85+ if !matches ! ( state. as_ref( ) , AppState :: Waiting ) {
8686 return ;
8787 }
8888
@@ -93,7 +93,9 @@ pub fn set_scanning(player: Option<String>) {
9393 logging ! ( "Core" , "Setting to state SCANNING." ) ;
9494
9595 thread:: spawn ( move || {
96- let room = Room :: create ( ) ;
96+ let room = room
97+ . and_then ( |room| Room :: from ( & room) )
98+ . unwrap_or_else ( Room :: create) ;
9799
98100 let ( sender, receiver) = mpsc:: channel ( ) ;
99101 let room2 = room. clone ( ) ;
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ fn set_state_ide() -> Status {
1616 Status :: Ok
1717}
1818
19- #[ get( "/scanning?<player>" ) ]
20- fn set_state_scanning ( player : Option < String > ) -> Status {
21- controller:: set_scanning ( player) ;
19+ #[ get( "/scanning?<room>&< player>" ) ]
20+ fn set_state_scanning ( room : Option < String > , player : Option < String > ) -> Status {
21+ controller:: set_scanning ( room , player) ;
2222 Status :: Ok
2323}
2424
You can’t perform that action at this time.
0 commit comments