Beispiel #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();
        }
Beispiel #2
0
        public ServerFileTransporter(string uniqueName, IServerPacketManager pm)
        {
            var gen = new NetworkPacketFactoryCodeGenerater(Application.StartupPath + "\\ServerFileTrans" + uniqueName + ".dll");

            fileStartTransporter = pm.CreatePacketTransporter("SFTFileStart" + uniqueName, gen.GetFactory <FileStartPacket>(),
                                                              PacketFlags.TCP);
            fileCompleteTransporter = pm.CreatePacketTransporter("SFTFileComplete" + uniqueName, gen.GetFactory <T>(),
                                                                 PacketFlags.TCP);
            filePartTransporter = pm.CreatePacketTransporter("SFTFilePart" + uniqueName, gen.GetFactory <FilePartPacket>(),
                                                             PacketFlags.TCP);
            gen.BuildFactoriesAssembly();
            //fileList = _fileList;
            //cacheDir = TWDir.Cache.CreateSubdirectory("LauncherServer");
        }
        public ServerSyncer(IServerPacketManager packetManager)
        {
            //TODO: cleanup
            var gen         = new NetworkPacketFactoryCodeGenerater(TWDir.Cache.FullName + "\\ServerSyncerGenTemp.dll");
            var timeFactory = gen.GetFactory <TimeUpdatePacket>();

            gen.BuildFactoriesAssembly();

            deltaSnapshotTransporter = packetManager.CreatePacketTransporter("WorldSyncerDeltaSnapshot",
                                                                             new DataPacket.Factory(),
                                                                             Networking.PacketFlags.UDP);
            timeUpdateTransporter = packetManager.CreatePacketTransporter("WorldSyncerTimeUpdate",
                                                                          timeFactory,
                                                                          Networking.PacketFlags.UDP);
        }
Beispiel #4
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();
        }