コード例 #1
0
        public void LoadData(MyRakNetPeer peer, Assembly assembly)
        {
            m_peer = peer;

            m_idToType           = new List <Type>();
            m_typeToId           = new Dictionary <Type, int>();
            m_perPlayerStateData = new Dictionary <ulong, List <MyStateDataEntry> >();

            for (int i = 0; i < MaxClients; i++)
            {
                m_freeClientIndexes.Enqueue(i);
            }

            m_peer.OnClientLeft   += m_peer_OnClientLeft;
            m_peer.OnClientJoined += m_peer_OnClientJoined;

            RegisterFromAssembly(peer.GetType().Assembly);

            RegisterFromAssembly(assembly);

            if (MyPlugins.GameAssembly != null)
            {
                RegisterFromAssembly(MyPlugins.GameAssembly);
            }

            if (MyPlugins.UserAssembly != null)
            {
                RegisterFromAssembly(MyPlugins.UserAssembly);
            }

            Static = this;
        }
コード例 #2
0
 public void UnloadData()
 {
     if (Static != null)
     {
         Static.Dispose();
         Static = null;
     }
 }
コード例 #3
0
        public void LoadData(MyRakNetPeer peer, Assembly assembly)
        {
            m_peer = peer;

            m_idToType = new List<Type>();
            m_typeToId = new Dictionary<Type, int>();

            RegisterFromAssembly(peer.GetType().Assembly);

            RegisterFromAssembly(assembly);

            if (MyPlugins.GameAssembly != null)
                RegisterFromAssembly(MyPlugins.GameAssembly);

            if (MyPlugins.UserAssembly != null)
                RegisterFromAssembly(MyPlugins.UserAssembly);

            Static = this;
        }
コード例 #4
0
        public void LoadData(MyRakNetPeer peer, Assembly assembly)
        {
            m_peer = peer;

            m_idToType = new List <Type>();
            m_typeToId = new Dictionary <Type, int>();

            RegisterFromAssembly(peer.GetType().Assembly);

            RegisterFromAssembly(assembly);

            if (MyPlugins.GameAssembly != null)
            {
                RegisterFromAssembly(MyPlugins.GameAssembly);
            }

            if (MyPlugins.UserAssembly != null)
            {
                RegisterFromAssembly(MyPlugins.UserAssembly);
            }

            Static = this;
        }
コード例 #5
0
 public void UnloadData()
 {
     if (Static != null)
     {
         Static.Dispose();
         Static = null;
     }
 }