Exemplo n.º 1
0
        public NetworkEvent.Type PopEvent(out NetworkConnection con, out BitSlice slice)
        {
            int offset, size;

            slice = default(BitSlice);
            int id;
            var type = m_EventQueue.PopEvent(out id, out offset, out size);

            if (size > 0)
            {
                slice = m_BitStream.GetBitSlice(offset, size);
            }
            con = id < 0 ? default(NetworkConnection) : new NetworkConnection {
                m_NetworkId = id, m_NetworkVersion = m_ConnectionList[id].Version
            };
            DebugLog("PopEvent ID=" + id + " Type=" + type + " Offset=" + offset + " Size=" + size);
            return(type);
        }
Exemplo n.º 2
0
 public NetworkEvent.Type PopEvent <T>(T driver, out BitSlice stream) where T : struct, INetworkDriver
 {
     return(driver.PopEventForConnection(this, out stream));
 }
Exemplo n.º 3
0
        public NetworkEvent.Type PopEventForConnection(NetworkConnection connectionId, out BitSlice slice)
        {
            int offset, size;

            slice = default(BitSlice);
            if (m_ConnectionList[connectionId.m_NetworkId].Version != connectionId.m_NetworkVersion)
            {
                return((int)NetworkEvent.Type.Empty);
            }
            var type = m_EventQueue.PopEventForConnection(connectionId.m_NetworkId, out offset, out size);

            if (size > 0)
            {
                slice = m_BitStream.GetBitSlice(offset, size);
            }
            return(type);
        }