'pages/home']); }); /* Auth */ router_get($r, '/auth/register', 'auth_controller_register_get'); router_post($r, '/auth/register', 'auth_controller_register_post'); router_get($r, '/auth/login', 'auth_controller_login_get'); router_post($r, '/auth/login', 'auth_controller_login_post'); router_post($r, '/auth/logout', 'auth_controller_logout_post'); /* Characters */ router_get($r, '/characters', 'char_controller_list_get'); router_post($r, '/characters', 'char_controller_list_post'); router_get($r, '/character/create-first', 'char_controller_create_first_get'); router_post($r, '/character/create', 'char_controller_create_post'); router_post($r, '/character/delete', 'char_controller_delete_post'); /* World */ router_get($r, '/world', 'world_controller_get'); router_post($r, '/move', 'world_controller_move_post'); /* Settings */ router_get($r, '/settings', 'settings_controller_get'); /* Auctions */ router_get($r, '/auctions', 'auctions_controller_get'); /* Router */ // [code, handler, params] stopwatch_start('router'); $l = router_lookup($r, $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']); stopwatch_stop('router'); stopwatch_start('handler'); if ($l['code'] !== 200) router_error($l['code']); $l['handler'](...$l['params'] ?? []); stopwatch_stop('handler'); /* Cleanup */ clear_flashes(); /* Stopwatch */ if (env('debug')) echo c_debug_stopwatch();