Example #1
0
 public void ProcessComponentMessage(Guid clientId, JediumBehaviourMessage message)
 {
     if (_behaviours.ContainsKey(message.GetBehaviourType()))
     {
         _behaviours[message.GetBehaviourType()].ProcessMessage(clientId, message);
     }
 }
Example #2
0
 public void AddSendMessage(JediumBehaviourMessage obj)
 {
     if (!_sendQueues.ContainsKey(obj.GetBehaviourType()))
     {
         //new queue
         ConcurrentQueue <JediumBehaviourMessage> c_q = new ConcurrentQueue <JediumBehaviourMessage>();
         c_q.Enqueue(obj);
         _sendQueues.Add(obj.GetBehaviourType(), c_q);
     }
     else
     {
         _sendQueues[obj.GetBehaviourType()].Enqueue(obj);
     }
 }
        public override bool ProcessUpdate(JediumBehaviourMessage message)
        {
            if (!Initialized)
            {
                return(false);
            }

            if (message == null)
            {
                return(false); //no empty
            }
            if (message.GetBehaviourType() != GetComponentTypeIndex())
            {
                return(false);
            }

            JediumCharacterControllerMessage msg = (JediumCharacterControllerMessage)message;

            //_charAnimator.SetFloat("V",msg.V);
            //_charAnimator.SetFloat("H",msg.H);
            //_charAnimator.SetBool("Jump",msg.Jump);
            _walkBeh.SetVH(msg.V, msg.H, msg.Jump);
            _lastV    = msg.V;
            _lastH    = msg.H;
            _lastJump = msg.Jump;
            //_charAnimator.SetBool("Jump",msg.);

            return(true);
            // throw new System.NotImplementedException();
        }
Example #4
0
        public override bool ProcessUpdate(JediumBehaviourMessage message)
        {
            if (message == null) //empty update
            {
                return(false);
            }

            if (message.GetBehaviourType() != TYPEBEHAVIOUR.GetTypeIndex(GetComponentType()))
            {
                Debug.Log("WRONG MESSAGE TYPE:" + message.GetBehaviourType() + ";" + message.GetType());
                return(false);
            }

            JediumTestBehaviourMessage tmsg = (JediumTestBehaviourMessage)message;

            Debug.Log("__GOT TEST MESSAGE:" + tmsg.SomeTestMessage);
            return(true);
        }