Пример #1
0
        private void WebSock_MessageReceived(object sender, MessageReceivedEventArgs e)
        {
            try {
                var message = JsonConvert.DeserializeObject <BaseMessage>(e.Message);
                LastSequence = message.Sequence;

                var newMessage = MessageInitializer.BuildMessage((int)message.OpCode, message.OpCode == GatewayOpCode.Dispatch ? e.Message : message.Data.ToString());
                HandlerManager.GetHandler((int)message.OpCode)?.Invoke(null, newMessage);
            } catch {
            }
        }
Пример #2
0
 public void PreInitialize()
 {
     MessageInitializer.Initialize();
     HandlerManager.RegisterAll();
 }