+
+
+// Called by gotonext() when the march list is empty.
+//
+function load_new_march_list() {
+ fetchm = async() => {
+ response = await fetch("/ctdl/r/");
+ march_list = await(response.json());
+ if (response.ok) {
+ march_list = march_list.filter(function(room) {
+ return room.hasnewmsgs;
+ });
+ march_list = march_list.sort(function(a,b) {
+ if (a.floor != b.floor) {
+ return(a.floor - b.floor);
+ }
+ if (a.rorder != b.rorder) {
+ return(a.rorder - b.rorder);
+ }
+ return(a.name < b.name);
+ });
+ march_list.push({name:"_BASEROOM_",known:true,hasnewmsgs:true,floor:0});
+ gotonext();
+ }
+ }
+ fetchm();
+}