@@ -126,22 +126,23 @@ void handle_message(enum MessageType *msg, int msg_len, struct mg_connection * c
126126 log_msg (LOG , "Received a Input from con %lu: %d\n" , con -> id , * msg );
127127 switch (* msg ) {
128128 // All of these cases should be forwarded to frontend
129- case PLS_SEND_SIDES_SWITCHED :
130- case PLS_SEND_GAMEPART :
131- case PLS_SEND_GAMEINDEX :
132- case PLS_SEND_IS_PAUSE :
133- case PLS_SEND_TIME :
134- case PLS_SEND_JSON :
135- case PLS_SEND_OBS_REPLAY_ON :
136- case PLS_SEND_OBS_STREAM_ON :
137- case PLS_SEND_WIDGET_AD_ON :
138- case PLS_SEND_WIDGET_GAMESTART_ON :
139- case PLS_SEND_WIDGET_GAMEPLAN_ON :
140- case PLS_SEND_WIDGET_LIVETABLE_ON :
141- case PLS_SEND_WIDGET_SCOREBOARD_ON :
142- case PLS_SEND_GAME_ACTION :
143- case PLS_SEND_TIMESTAMP :
129+ case PLS_SEND_META :
130+ case PLS_SEND_META_GAME :
131+ case PLS_SEND_META_OBS :
132+ case PLS_SEND_META_WIDGETS :
133+ case PLS_SEND_META_TIME :
134+ case PLS_SEND_GAMES :
144135 case PLS_SEND_GAME :
136+ case PLS_SEND_GAMEACTIONS :
137+ case PLS_SEND_GAMEACTION :
138+ case PLS_SEND_FORMATS :
139+ case PLS_SEND_FORMAT :
140+ case PLS_SEND_TEAMS :
141+ case PLS_SEND_TEAM :
142+ case PLS_SEND_GROUPS :
143+ case PLS_SEND_GROUP :
144+ case PLS_SEND_TIMESTAMP :
145+ case PLS_SEND_JSON :
145146 log_msg (LOG , "clients.boss: %p\n" , clients .boss );
146147 ws_send (clients .boss , (char * )msg , msg_len );
147148 break ;
@@ -151,30 +152,30 @@ void handle_message(enum MessageType *msg, int msg_len, struct mg_connection * c
151152 ws_send (con , tmp , 2 );
152153 break ;
153154 }
154- case DATA_OBS_STREAM_ON : {
155- if (msg_len < 2 ) {
156- log_msg (WARN , "Received DATA_OBS_STREAM_ON without data about the Status\n" );
157- break ;
158- }
159- if (msg [1 ])
160- obs_send_cmd ("{\"op\": 6, \"d\": {\"requestType\": \"StartStream\", \"requestId\": \"1\"}}" );
161- else
162- obs_send_cmd ("{\"op\": 6, \"d\": {\"requestType\": \"StopStream\", \"requestId\": \"2\"}}" );
163- break ;
164- }
165- case DATA_OBS_REPLAY_ON : {
166- if (!replays_instant_working ) break ;
167- if (msg_len < 2 ) {
168- log_msg (WARN , "Received DATA_OBS_STREAM_ON without data about the Status\n" );
169- break ;
170- }
171- if (msg [1 ])
172- // Tell OBS to save replay buffer
173- obs_send_cmd ("{\"op\": 6, \"d\": {\"requestType\": \"SaveReplayBuffer\", \"requestId\": \"save_replay\"}}" );
174- else
175- obs_switch_scene ("live" );
176- break ;
177- }
155+ // case DATA_OBS_STREAM_ON: {
156+ // if (msg_len < 2) {
157+ // log_msg(WARN, "Received DATA_OBS_STREAM_ON without data about the Status\n");
158+ // break;
159+ // }
160+ // if (msg[1])
161+ // obs_send_cmd("{\"op\": 6, \"d\": {\"requestType\": \"StartStream\", \"requestId\": \"1\"}}");
162+ // else
163+ // obs_send_cmd("{\"op\": 6, \"d\": {\"requestType\": \"StopStream\", \"requestId\": \"2\"}}");
164+ // break;
165+ // }
166+ // case DATA_OBS_REPLAY_ON: {
167+ // if (!replays_instant_working) break;
168+ // if (msg_len < 2) {
169+ // log_msg(WARN, "Received DATA_OBS_STREAM_ON without data about the Status\n");
170+ // break;
171+ // }
172+ // if (msg[1])
173+ // // Tell OBS to save replay buffer
174+ // obs_send_cmd("{\"op\": 6, \"d\": {\"requestType\": \"SaveReplayBuffer\", \"requestId\": \"save_replay\"}}");
175+ // else
176+ // obs_switch_scene("live");
177+ // break;
178+ // }
178179 case IM_THE_BOSS :
179180 if (msg_len < 2 || !msg [1 ]) { log_msg (WARN , "Boss sent illegal message\n" ); break ;}
180181 if (clients .boss == con ) {
@@ -192,11 +193,12 @@ void handle_message(enum MessageType *msg, int msg_len, struct mg_connection * c
192193 char tmp [2 ] = {DATA_IM_BOSS , true};
193194 ws_send (clients .boss , tmp , 2 );
194195 break ;
195- case DATA_GAMEINDEX :
196- log_msg (LOG , "Received DATA: Gameindex: %d\n" , ((char * )msg )[1 ]);
197- gameindex = msg [1 ];
198- // Now we go into default
199- __attribute__((fallthrough )); // silence compiler warning
196+ // TODO gameindex is now not available anymore
197+ // case DATA_GAMEINDEX:
198+ // log_msg(LOG, "Received DATA: Gameindex: %d\n", ((char *)msg)[1]);
199+ // gameindex = msg[1];
200+ // // Now we go into default
201+ // __attribute__((fallthrough)); // silence compiler warning
200202 default :
201203 for (Client * c = clients .first ; c != NULL ; c = c -> next ) {
202204 if (c -> con == clients .boss && * msg != DATA_GAME ) continue ;
0 commit comments