public void MessageReceived(string json) { if (asymkey != null) { json = RSA.Decrypt(asymkey, json); } else if (symkey != null) { json = TDES.Decrypt(symkey, json); } JSONObject jo = new JSONObject(json); callback?.Invoke(this, jo); }
void HandleRecvMessage(NetworkMessageType type, IntPtr data) { Try(() => { switch (type) { case NetworkMessageType.Get: OnRecvGet((GetMessage)data); break; case NetworkMessageType.Set: OnRecvSet((SetMessage)data); break; case NetworkMessageType.Delete: OnRecvDelete((DeleteMessage)data); break; case NetworkMessageType.Fence: OnRecvFence((FenceMessage)data); break; case NetworkMessageType.Text: OnRecvText((TextMessage)data); break; case NetworkMessageType.Screenshot: OnRecvScreenshot(data); break; case NetworkMessageType.Query: OnRecvQuery((QueryMessage)data); break; case NetworkMessageType.RequestServerLiveEdit: OnRecvPropertyRequest(); break; default: break; } }); OnPostRecvMessageCallback?.Invoke(type); }