示例#1
0
        public ServerStaticWorldObjectSyncer(IServerPacketManager pm)
        {
            var gen =
                new Networking.NetworkPacketFactoryCodeGenerater(TWDir.GenerateRandomCacheFile("", ".dll"));

            updateTransporter = pm.CreatePacketTransporter("StaticWorldObjectSyncer_UpdatePacket", gen.GetFactory <StaticWorldObjectUpdatePacket>(), Networking.PacketFlags.TCP);
            deleteTransporter = pm.CreatePacketTransporter("StaticWorldObjectSyncer_DeletePacket", gen.GetFactory <StaticWorldObjectDeletePacket>(), Networking.PacketFlags.TCP);

            gen.BuildFactoriesAssembly();
        }
        public ClientVersioningSyncer(VersioningSystem sys, IClientPacketManager pm)
        {
            this.sys = sys;
            var gen = new NetworkPacketFactoryCodeGenerater(TWDir.GenerateRandomCacheFile("CVS", "dll"));

            revisionTransporter = pm.CreatePacketTransporter("Versioning_Revision",
                                                             gen.GetFactory <RevisionPacket>(), PacketFlags.TCP);
            requestRevisionTransporter = pm.CreatePacketTransporter("Versioning_RequestRevision",
                                                                    gen.GetFactory <RevisionRequestPacket>(), PacketFlags.TCP);
            commandTransporter = pm.CreatePacketTransporter("Versioning_CMD",
                                                            new BytePacket.Factory(), PacketFlags.TCP);

            fileTransporter = new ClientFileTransporter <RevisionFilePacket>("Versioning_File", pm, TWDir.Cache.CreateSubdirectory("Versioning").FullName);
            fileTransporter.StartReceiving();

            gen.BuildFactoriesAssembly();
        }
示例#3
0
        public ServerVersioningSyncer(VersioningSystem sys, IServerPacketManager pm)
        {
            this.sys = sys;
            var gen = new NetworkPacketFactoryCodeGenerater(TWDir.GenerateRandomCacheFile("CVS", "dll"));

            revisionTransporter = pm.CreatePacketTransporter("Versioning_Revision",
                                                             gen.GetFactory <RevisionPacket>(), PacketFlags.TCP);
            requestRevisionTransporter = pm.CreatePacketTransporter("Versioning_RequestRevision",
                                                                    gen.GetFactory <RevisionRequestPacket>(), PacketFlags.TCP);
            requestRevisionTransporter.EnableReceiveCallbackMode(onRequestRevision);
            commandTransporter = pm.CreatePacketTransporter("Versioning_CMD",
                                                            new BytePacket.Factory(), PacketFlags.TCP);
            commandTransporter.EnableReceiveCallbackMode(onCommandReceived);

            fileTransporter = new ServerFileTransporter <RevisionFilePacket>("Versioning_File", pm);

            gen.BuildFactoriesAssembly();
        }