node.js – Como exibir uma lista de rooms com o Socket.IO?

Olá! Estou desenvolvendo uma aplicação web de um chat utilizando React, NodeJS, Express e Socket.IO e gostaria de exibir uma lista com todas as salas disponíveis para que o usuário possa transitar de uma sala para outra. Eu já fiz algumas pesquisas e descobri que uma forma de alcançar o meu objetivo é utilizando o io.sockets.adapter.rooms. Porém, ao que me parece tal comando só retorna os ID’s das salas. Como eu poderia utilizar o retorno de io.sockets.adapter.rooms para conseguir exibir as rooms aos usuários? Existe alguma outra forma? Muito obrigado.

switch – Connecting three rooms with one router

I have a router that has 1 input (for the Internet connection) and exactly one output for LAN. Recently, I’ve moved to a house that has 3 different rooms and one management box in the wall of the hall and I wanted to connect all rooms together, behind the router.

I have a switch inside the box that connects all rooms in a single LAN – there is also a modem device that converts the fiber signal to RJ-45. Unfortunately, there is no place for my router in the box… But I also wanted to put it inside the middle room for maximum Wi-Fi range, so I hoped it is for the best. I thought I’d have to something like this:

Room A --
        |
Room B --  SWITCH IN THE BOX | -- Room B -- | Router | MODEM IN THE BOX
        |
Room C --

In other words, I hoped that the middle room has 2 RJ-45 sockets. One socket would be taken for sending the modem’s Internet, the other one would go back to the switch in the box (probably using another switch there, too), which then would connect other rooms. It would look like this:

  Modem from the box -> RJ-45 no. 1 -> Router -> Switch in the room -> Other devices from the room
                                                                    -> RJ-45 no. 2, which goes to the main switch from the box -> Other rooms and their devices
  

Unfortunately, each room has only one RJ-45 socket, which made it impossible for me, because the Internet and the LAN would have to be sent over the same cable. Either I would have LAN devices as siblings to the router, or I would have conflicts/loops in the network.

What options do I have now? I recognized the following choices:

  1. Invest in a patchcord splitter in both ends of the cable (which would convert 1-node socket to 2-nodes). This option would halve the performance of the connection, as far as I can understand, which isn’t the brightest idea for the main router? The cables are cat. 5e.
  2. Try to find a “smart” device, something like a switch, which would have multiple ports and would know that the first one is the router – and made the other ones behind it? I’m afraid that this option is either very expensive or impossible to do.
  3. Hire a specialist that would make a new connection in the walls for the router – very expensive for me, as the walls are already finished (painted etc.)

Is there any other option I am missing? Would the first option severely slow my connection?

c – Game with linked lists, tail insertion and moving characters through rooms

i’m making a game like among us in C and i am stuck with the linked lists. So this function called forward_tail_insertion() aim to make the characters move in 3 different direction. If the direction *pointers(forward, left or right) is NULL the code create a new room using the malloc and add it to the list(in the program room_list) and it need to link the new room created with the previous one using the *previous_room pointer. If during the next turn another player what to go forward and there is the room already created by the previous player, he don’t need to create another one but just change the position of the player to the room. I link here two files, the .h containing all the struct and enum definition and the function that i’m trying to do. Thank you to everyone who want to try to solve my problem. The main problem is that the others players doesn’t see the rooms create by the previous players so the code create another different room.

.h file

//libraries used in the project
      #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
//definition used to clean the terminal
#define clr system("clear")
//enumeration type to specify the role/state of the players
typedef enum{
  astronaut = 1,
  impostor = 2,
  murdered = 3,
  defenestrated = 4
}Player_State;
//enumeration type to identify all the players with colors
typedef enum{
  red = 1,
  blue = 2,
  orange = 3,
  yellow = 4,
  purple = 5,
  green = 6,
  black = 7,
  white = 8,
  grey = 9,
  brown = 10
}Player_Name;
//enumeration type to specify the type of room or the things the players can find inside
typedef enum{
  empty = 1,
  simple_quest = 2,
  complex_quest = 3,
  trap_door = 4
}Room_Type;
//struct definition which represent all the rooms generated while playing
typedef struct{
  struct Room* forward;
  struct Room* left;
  struct Room* right;
  struct Room* previous;
  Room_Type Room_Type;
  bool emergency_call;
}Room;
//struct definition for all the players
typedef struct{
  Room* actual_position;
  Player_State Player_State;
  Player_Name Player_Name;
}Player;
//functions declaration of the gamelib.c
void set_game();
void play();
void end_game();

.C file

//pointers initialization to null and start_room type 'empty'


start_room = (Room *) malloc(sizeof(Room));

  //set the position of all players to the first room which is empty
  for(int i = 0; i < players_number; i++){
    players(i).actual_position = start_room;
    //printf("All rooms: %sn", print_room_type(room_list(i).Room_Type));
  }

  start_room -> forward = NULL;
  start_room -> right = NULL;
  start_room -> left = NULL;
  start_room -> previous = NULL;
  start_room -> Room_Type = 1;

  int loop_check1 = 1;
  int choice_menu = 0;

  do{
    //sleep(2);
    printf("nSettings completed.n");
    //sleep(2);
    printf("                                             What now?n");
    printf("n                                        1) Print the playersn");
    printf("                                        2) Start a gamen");
    sleep(2);
    printf("Choice: ");
    scanf("%d", &choice_menu);

    switch(choice_menu){
      case 1:
        loop_check1 = 0;
        print_players();
        break;
      case 2:
        loop_check1 = 1;
        start_game();
        break;
      default:
        printf("nWrong command. Retry...n");
        break;
    }
    while(getchar() != 'n');
  }while(loop_check1);
}

void play(){
  clr;
  sleep(2);
  printf("                                     GAMEn");
  printf("Number of astronauts: %dn", players_number);
  printf("Number of impostors: %dn", impostors_number);
  printf("Quest to complete in order to win: %dn", quest_to_finish);
  printf("First room: %sn", print_room_type(start_room -> Room_Type));
  //sleep(5);

  int action_choice = 0;
  int room_l = 0;

  do{
    //randomize the turn
    turn_temp = (rand() % players_number);
    impostor_check = turn_temp + 1;
    printf("nTurn of the %s playern",print_color_players(players(turn_temp).Player_Name));
    sleep(2);

    //check if the player is murdered or defenestrated
    if(players(turn_temp).Player_State == 3){
      printf("nThe %s astronaut has been killedn",print_color_players(players(turn_temp).Player_Name));
    }else if(players(turn_temp).Player_State == 4){
      printf("nThe %s %s has been defenestratedn",print_color_players(players(turn_temp).Player_Name),print_state_players(players(turn_temp).Player_State));
    }else{
      //if the randomized number is equal to one of the impostor so it's his turn
      if(impostor_check == impostors1 || impostor_check == impostors2 || impostor_check == impostors3){
        printf("nImpostor's Turnn");

        printf("nYour position: %pn",players(turn_temp).actual_position);
        printf("Type Room: %sn",print_room_type(players(turn_temp).actual_position -> Room_Type));

        //check if there are others players in the same room
        printf("nPlayer's in the room: ");
        for(int i = 0; i < players_number; i++){
          if(players(turn_temp).actual_position == players(i).actual_position && players(turn_temp).Player_Name != players(i).Player_Name){
            printf("%s ",print_color_players(players(i).Player_Name));
          }
        }
        printf("n");

        do{
          printf("n1) Progressn");
          printf("2) Emergency Calln");
          printf("3) Kill Astronautn");
          printf("4) Use Trap Doorn");
          printf("5) Sabotagen");
          printf("nChoice: ");
          scanf("%d",&action_choice);
          if(action_choice < 1 || action_choice > 5){
            printf("Wrong Value. Retry...n");
          }else if(action_choice == 1){
            progress();
          }else if(action_choice == 2){
            emergency_call_f();
          }else if(action_choice == 3){
            kill_astronaut();
          }else if(action_choice == 4){
            use_trap_door();
          }else{
            sabotage();
          }
        }while((action_choice < 1 || action_choice > 5) && sabotage_check == 0);
      }else{
        printf("nAstronaut's Turnn");

        printf("nYour position: %pn",players(turn_temp).actual_position);
        printf("Type Room: %sn",print_room_type(players(turn_temp).actual_position -> Room_Type));

        printf("nPlayer's in the room:");
        for(int i = 0; i < players_number; i++){
          if((players(turn_temp).actual_position == players(i).actual_position) && players(turn_temp).Player_Name != players(i).Player_Name){
            printf("%s ",print_color_players(players(i).Player_Name));
          }
        }

        printf("n");

        do{
          printf("n1) Progressn");
          printf("2) Do questn");
          printf("3) Emergency Calln");
          printf("nChoice: ");
          scanf("%d",&action_choice);
          if(action_choice < 1 || action_choice > 3){
            printf("Wrong Value. Retry...n");
          }else if(action_choice == 1){
            progress();
          }else if(action_choice == 2){
            do_quest();
          }else{
            emergency_call_f();
          }
        }while((action_choice != 1 && action_choice != 2 && action_choice != 3) && quest_check == 0);
      }
    }
  }while(game_in_progress);
}

void end_game(){

}

static void progress(){
  int choice = 0;
  do{
    printf("nPossible choicesn");
    printf("n1) Forwardn");
    printf("2) Leftn");
    printf("3) Rightn");
    printf("4) No Moven");
    printf("n Choice: ");
    scanf("%d", &choice);
    if(choice < 1 || choice > 4){
      printf("nWrong value. Retry..n");
    }
  }while(choice < 1 || choice > 4);

  if(choice == 1){
    room_forward_tail_insertion();
  }

}

static void do_quest(){
  if(players(turn_temp).actual_position -> Room_Type == 2){
    printf("nSimple quest completedn");
    quest_counter += 1;
    quest_check = 1;
  }else if(players(turn_temp).actual_position -> Room_Type == 3){
    printf("nComplex quest completedn");
    quest_counter += 2;
    quest_check = 1;
  }else{
    printf("nThe room doesn't have questn");
    quest_check = 0;
  }
  if(quest_to_finish == quest_counter){
    printf("nAstronauts completed all the quests, so they won the game!n");
    quest_check = 1;
  }
}

static void emergency_call_f(){

}

static void kill_astronaut(){

}

static void use_trap_door(){

}

static void sabotage(){
  if(players(turn_temp).actual_position -> Room_Type == 2){
    printf("nSimple quest sabotagedn");
    players(turn_temp).actual_position -> Room_Type = 1;
    sabotage_check = 1;
  }else if(players(turn_temp).actual_position -> Room_Type == 3){
    printf("nComplex quest sabotagedn");
    players(turn_temp).actual_position -> Room_Type = 1;
    sabotage_check = 1;
  }else{
    printf("nThe room doesn't have questn");
    sabotage_check = 0;
  }
}

static void start_game(){
  play();
}

static void room_forward_tail_insertion(){
  //new -> previous = 'previous room';
  if(room_list==NULL){
    room_list=start_room;
  }
  if(players(turn_temp).actual_position -> forward == NULL){
    Room* new = (Room*) malloc(sizeof(Room));
    new -> forward = NULL;
    new -> left = NULL;
    new -> right = NULL;
    new -> Room_Type = random_room_type();
    room_list = new;
    room_list -> forward = new;
    players(turn_temp).actual_position = new;
  }else{
    players(turn_temp).actual_position = room_list -> forward;
  }
}

exchange – How to fix issues with Room Finder not loading rooms

We have multiple users experience issues with room finder. Room finder will not load the available rooms.

I didn’t setup the rooms so I think there may be something wrong with how the rooms are setup.

Is there a missing setting or anything else I could check or test?

Thank you

online resources – Is there a hotel search engine that would let me search for ski-in/ski-out rooms?

This year I’ve purchased two skiing passes and could travel to most ski resorts in America without paying extra for lift tickets. For optimal experience its always best to book a ski-in/ski-out hotel room or chalet, but most of them are quite expensive – far surpassing the costs of the flight ticket.

Is there a hotel/apartment search engine that would let me select “ski-in/ski-out” in the amenities filter? I can find such places in Google search but its not very efficient as I’m trying to find the cheapest offers around the US.

Any references to good javascript algorithms for drawing 3d rooms like retro doom? [closed]

Ive got a basic idea here: https://ibb.co/KsK5Yz4 I can have a enemy that can move towards you and hit you but you can also shoot the enemy with your gun. So everything but a 3d world to move around in at the moment the background is static and you can not move the player either. Ive, also got sprite animation for the enemies and weapons.

So, I lack what I need to do in order to create a 3d room to move around in.
Any, libraries to achieve this can webgl do this or is there any others you recommend to do this task Im asking.

php – Puedo hacer rooms dinamicas con socket.io

Tengo un servidor node.js y con socket.io funcionando, del lado del cliente tengo un index.html donde introduces el usuario y escojes el room al que quieres conectarte. Seria posible generar las rooms dinámicamente.
Yo habia pensado, en lugar de llamar al index.html, crear un index.php y así poder generar dinámicamente las rooms pero no me funciona. Parece que el servidor no acepta index.php
Gracias.

zoom.us – Zoom breakout rooms retaining main room settings on Windows (v 5.3.0)

When I enter a breakout room, if the main room had settings for chat to Host Only, then the breakout room will retain those settings and won’t allow me to chat to everyone. This was not a problem I had on my Mac. Also, the screen share settings are retained as well. Any help would be appreciated!

Rooms for Rent @ Best Deal Price

Searching for a friendly roommates in the location of your choice in Los Angeles? Visit Bedpage and browse for the rooms available for rent at affordable cost. From the available listings based on your requirements choose the right room and have friendly roommates who makes your living comfortable.

.

blender – What is the workflow of modeling 3D rooms?

I’m always struggling with creating flexible, reusable rooms for my underground-set games. When creating reusable rooms I have encountered the following problems:

  • Size – levels can have wildly different sizes and separate objects for all of the sizes seems repetitive and unnecessary
  • Holes in the room – i.e. windows, doors. There may be rooms with exactly the same size but different placement of doors, windows, etc… that only multiplies the amount of possible combinations

Possible solutions:

  • Not creating whole rooms but creating separate walls, floors, roofs so I can mix and match in the engine later?
    • Those parts would still require different sizes, unless I am to put 1 object per square meter or similar
  • Creating flexible Blender model so I can quickly change it export different variations of the room?

Thanks for any ideas, opinions, experiences