public IPAddress GetAddress(Config config, int x, int y)
 {
     IPAddress address;
     if (addresses.TryGetValue(string.Format("{0}_{1}", x, y), out address))
         return address;
     if (fallback != null)
         return fallback.GetAddress(config, x, y);
     return null;
 }
Exemple #2
0
        public Kugelmatik(Config config, ClusterConfig clusterConfig)
        {
            this.Config = config;
            this.ClusterConfig = clusterConfig;

            IAddressProvider addressProvider;
            if (!string.IsNullOrWhiteSpace(config.AddressFile))
                addressProvider = new FileAddressProvider(config.AddressFile);
            else if (!string.IsNullOrWhiteSpace(config.FixedIP))
                addressProvider = new FixedAddressProvider(config.FixedIP);
            else
                addressProvider = new KugelmatikAddressProvider();

            InitClusters(addressProvider);
        }
Exemple #3
0
 public static Config GetDefault()
 {
     Config config = new Config();
     config.ProtocolPort = 14804;
     config.KugelmatikWidth = 1;
     config.KugelmatikHeight = 1;
     config.VerbosePacketSending = true;
     config.VerbosePacketReceive = true;
     config.FixedIP = "";
     config.AddressFile = "";
     config.AcknowlegdeTime = 20;
     config.WaitTime = 0;
     config.IgnorePacketsWhenOffline = true;
     config.IgnoreGuaranteedWhenOffline = true;
     config.IgnoreGuaranteed = false;
     return config;
 }
Exemple #4
0
 public Kugelmatik(Config config, ClusterConfig clusterConfig, IAddressProvider addressProvider)
 {
     this.Config = config;
     this.ClusterConfig = clusterConfig;
     InitClusters(addressProvider);
 }
 public IPAddress GetAddress(Config config, int x, int y)
 {
     byte lanID = (byte)((y + 1) * 10 + (x + 1));
     return new IPAddress(new byte[] { 192, 168, 88, lanID });
 }
 public IPAddress GetAddress(Config config, int x, int y)
 {
     return Address;
 }