Exemplo n.º 1
0
        internal void RegisterControlMessage <T>(MyControlMessageEnum msg, ControlMessageHandler <T> handler, MyMessagePermissions permission) where T : struct
        {
            MyControlMessageCallback <T> callback = new MyControlMessageCallback <T>(handler, MySyncLayer.GetSerializer <T>(), permission);

            m_controlMessageHandlers.Add((int)msg, callback);
            m_controlMessageTypes.Add(typeof(T), msg);
        }
Exemplo n.º 2
0
        protected void RegisterControlMessage <T>(MyControlMessageEnum msg, ControlMessageHandler <T> handler) where T : struct
        {
            MyControlMessageCallback <T> callback = new MyControlMessageCallback <T>(handler, MySyncLayer.GetSerializer <T>());

            m_controlMessageHandlers.Add((int)msg, callback);
            m_controlMessageTypes.Add(typeof(T), msg);
        }