コード例 #1
0
 public void addToFileServerList(Address fsaddress)
 {
     if (fileServerList.Exists(element => element == fsaddress))
     {
         Isis.WriteLine("The Address " + fsaddress.ToStringVerboseFormat() + "already exists ");
     }
     else
     {
         fileServerList.Add(fsaddress);
     }
 }
コード例 #2
0
        protected void Application_Start(Object sender, EventArgs e)
        {
            Semaphore sem = new Semaphore(0, 1);
            Thread lbFileServerGroupThread = new Thread(delegate()
            {
                //Start the ISIS System
                IsisSystem.Start();

                string groupName        = "FS1";
                string logicalGroupName = "lbalancer-" + groupName;

                fileServerGroupList.TryAdd(logicalGroupName, new FileServerGroupObject());

                Group lbfsgroup = new Group(logicalGroupName);

                lbfsgroup.ViewHandlers += (ViewHandler) delegate(View v)
                {
                    Console.WriteLine("myGroup got a new view event: " + v);

                    Address [] addList = v.GetLiveMembers();
                    for (Int32 index = 0; index < addList.Length; index++)
                    {
                        Isis.WriteLine("The Add List Address " + addList[index].ToStringVerboseFormat());
                        fileServerGroupList[logicalGroupName].addToFileServerList(addList[index]);
                    }

                    Address [] removeList = v.GetFailedMembers();
                    for (Int32 index = 0; index < removeList.Length; index++)
                    {
                        fileServerGroupList[logicalGroupName].removeFromFileServerList(removeList[index]);
                    }
                };

                lbfsgroup.Join();
                sem.Release();
                IsisSystem.WaitForever();
            });

            lbFileServerGroupThread.Start();
            sem.WaitOne();
            Isis.WriteLine("Starting Web Service on the LoadBalancer");

            new AppHost().Init();
        }
コード例 #3
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        isis   = GetComponentInChildren <Isis>();
        horus  = GetComponentInChildren <Horus>();
        anubis = GetComponentInChildren <Anubis>();

        isisAnimator   = isis.GetComponent <Animator>();
        horusAnimator  = horus.GetComponent <Animator>();
        anubisAnimator = anubis.GetComponent <Animator>();
        animator       = GetComponent <Animator>();

        currentPlayer = isis;

        inventory = Inventory.instance;

        lastCheckpoitPos = new Vector2(-7, 2);
    }