public ClientStaticWorldObjectSyncer(IClientPacketManager pm, IStaticWorldObjectFactory worldObjectFactory) { this.worldObjectFactory = worldObjectFactory; var gen = new Networking.NetworkPacketFactoryCodeGenerater(TWDir.Cache + "\\ClientStaticWorldObjectSyncer" + (new Random()).Next(0, 100000) + ".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 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(); }