Skip to content

Commit

Permalink
Update Server.ts
Browse files Browse the repository at this point in the history
To remove check on protocol version
  • Loading branch information
cristian-recoseanu committed Jul 20, 2023
1 parent 93b1b3d commit 1e0aed7
Showing 1 changed file with 18 additions and 27 deletions.
45 changes: 18 additions & 27 deletions code/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,36 +230,27 @@ try

if(message)
{
if(message.protocolVersion == "1.0.0")
switch(message.messageType)
{
switch(message.messageType)
case MessageType.Command:
{
case MessageType.Command:
{
rootBlock.ProcessMessage(msg, extWs);
isMessageValid = true;
}
break;
case MessageType.Subscription:
{
let message = JSON.parse(msg) as ProtocolSubscription;
sessionManager.ModifySubscription(extWs, message);
isMessageValid = true;
}
break;
default:
{
isMessageValid = false;
errorMessage = `Invalid message type received: ${message.messageType}`;
}
break;
rootBlock.ProcessMessage(msg, extWs);
isMessageValid = true;
}
}
else
{
isMessageValid = false;
errorMessage = `Unsupported protocol version`;
status = NcMethodStatus.ProtocolVersionError;
break;
case MessageType.Subscription:
{
let message = JSON.parse(msg) as ProtocolSubscription;
sessionManager.ModifySubscription(extWs, message);
isMessageValid = true;
}
break;
default:
{
isMessageValid = false;
errorMessage = `Invalid message type received: ${message.messageType}`;
}
break;
}
}
else
Expand Down

0 comments on commit 1e0aed7

Please sign in to comment.