Пример #1
0
        private static void HandleClientMutation(WebClient client, Type type, object buff, int tracker)
        {
            if (!SignalMap.MutationHandlers.ContainsKey(type))
            {
                // Handle unused mutation
                return;
            }

            var properties = SignalMap.MutationHandlers[type];
            var args       = GetArgs(client, buff, properties);

            Action complete = () =>
            {
                var response = properties.Target.Invoke(null, args);
                CompleteClientMutation(client, response, tracker);
            };

            if (properties.HandleInMain)
            {
                ExecuteInMain.ExecuteNextFrame(complete);
            }
            else
            {
                complete.Invoke();
            }
        }
Пример #2
0
 private static void OnConnected(WebClient client)
 {
     client.Session.BinaryMessageReceived += (_, message) => ExecuteInMain.HandleError(() => DecodeMessage(client, message));
 }