Exemplo n.º 1
0
        /// <summary>
        /// Collect data and provides.
        /// </summary>
        /// <param name="type"></param>
        private void Broadcast(Protocol.Type type = Protocol.Type.TYPE_UPDATE)
        {
            // Create snapshot.
            Protocol.Protocol protocol = new Protocol.Protocol
            {
                Type   = type,
                Length = _Length
            };

            foreach (ExtendedPlayer player in _Players)
            {
                if (player.Jumping > 0)
                {
                    player.Player.Position.Jumping = true;
                }
                else
                {
                    player.Player.Position.Jumping = false;
                }

                protocol.Players.Add(player.Player);
            }

            // Provide for broadcasting
            SnapshotCreated?.Invoke(new SnapshotArguments(protocol));
        }
Exemplo n.º 2
0
        public void should_read_resource_record(string resource, Protocol.Type type, Class pClass, int ttl)
        {
            var content = GetContentResource(resource);
            var rr      = new ResourceRecord(new RecordReader(content));

            Assert.AreEqual(rr.Class, pClass);
            Assert.AreEqual(rr.Type, type);
            Assert.AreEqual(rr.Ttl, ttl);
        }
Exemplo n.º 3
0
        public bool sendMessage(Protocol.Type protocol, string text, NetIncomingMessage recipient)
        {
            NetOutgoingMessage om = peer.CreateMessage();

            om.Write((int)protocol);
            om.Write(text);
            peer.SendMessage(om, recipient.SenderConnection, NetDeliveryMethod.ReliableOrdered);
            //peer.sen
            peer.FlushSendQueue();
            return(true);
        }
Exemplo n.º 4
0
    public void Init() {
        m_iLv = 1;
        maxExp = Protocol.ExpList[m_iLv];
        m_iExp = 0;
        maxHP = 10;
        m_iHp = 10;
        maxMP = 10;
        m_iMp = 0;
        m_tType = Protocol.Type.FIRE;

        updateCharacterPanel();
        m_sState = State.NORMAL;
    }
 public void setType(Protocol.Type newType) { Type = newType; }