Ejemplo n.º 1
0
        public void Init(NetConfiguration configuration)
        {
            byteOrder = configuration.byteOrder;
            //NetDebug.Log("NetCustomSerializer: init");
            Type[] types = ReflectionTool.FastGetChildTypes(typeof(INetSerializable));
            foreach (var t in types)
            {
                //NetDebug.Log("Add Msg Type:" + t.Name);
                typeDic.Add(t.Name, t);
            }

            //reader = new NetDataReader(byteOrder);
            //writer = new NetDataWriter(byteOrder);
        }
Ejemplo n.º 2
0
        public NetworkCommon(NetConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new Exception("NetConfiguration is null ! ");
            }

            this.configuration = configuration;

            this.configuration.Init(this);

            if (configuration.UseMultithreading)
            {
                ReceiveEventInit();
                SendEventInit();
            }
        }