Base: Large plugin refactor

- Merge WebSocketProtocol into WebSocketServer
  - Having them separated was not doing anything productive
- Request: Move SessionPtr to RequestHandler
  - Less copying to do for batch requests
- Fully modularize EventHandler
  - Make BroadcastEvent a stored callback that WebSocketServer sets
- Return early on high volume events to avoid unnecessary compute
  - These events will only generate a json object when it is actually
needed
This commit is contained in:
tt2468
2021-09-04 10:04:00 -07:00
parent 537595658d
commit 7e1e1bc33c
22 changed files with 486 additions and 407 deletions

View File

@ -86,6 +86,11 @@ const std::map<std::string, RequestMethodHandler> RequestHandler::_handlerMap
{"StopStream", &RequestHandler::StopStream},
};
RequestHandler::RequestHandler(SessionPtr session) :
_session(session)
{
}
RequestResult RequestHandler::ProcessRequest(const Request& request)
{
if (!request.RequestData.is_object() && !request.RequestData.is_null())