示例#1
0
        public ArrayList GetPeople()
        {
            ArrayList people = new ArrayList();

            if (HttpContext.Current.Request["people"] != null)
            {
                string[] pp = HttpContext.Current.Request["people"].Split(',');
                foreach (string p in pp)
                {
                    try {
                        int           id = int.Parse(p);
                        PersonMonitor m  = new PersonMonitor(id);
                        people.Add(m);
                    } catch {
                    }
                }
            }
            else
            {
                foreach (string mon in Login.GetMonitors())
                {
                    Monitor m = Monitor.FromString(mon);
                    if (m == null)
                    {
                        continue;
                    }
                    if (!(m is PersonMonitor))
                    {
                        continue;
                    }
                    people.Add(m);
                }
            }

            for (int i = 0; i < people.Count; i++)
            {
                PersonMonitor m    = (PersonMonitor)people[i];
                Hashtable     info = new Hashtable();
                info["Id"]   = m.Person;
                info["Name"] = m.Display();
                info["Link"] = m.Link();
                info["Key"]  = Reps.FormatPersonName(m.Person, "now", "lastname");
                people[i]    = info;
            }

            people.Sort(new NameSorter());

            return(people);
        }
示例#2
0
    // display person information
    private void ShowPlayersInfo()
    {
        IPlayerSelection ps = FrameworkManager.GenericInstance.GenericPlayerSelection;
        PersonMonitor    bm = BeckonManager.BeckonInstance.PersonMonitor;

        GUI.Box(new Rect(40, Screen.height - 250, 900, 200), "Beckon Debug Info. Frame: " + BeckonManager.BeckonInstance.LastFrame);
        Rect  rect        = new Rect(50, Screen.height - 250, 900, 25);
        float labelHeight = 25;

        GUI.color = Color.red;
        GUI.Label(rect, "expectedPlayersCount = " + ps.ExpectedPlayerCount);
        rect.y += labelHeight;
        List <int> pointerControllingTrackedObjects = new List <int>(ps.PointerControllingTrackedObjects);

        if (pointerControllingTrackedObjects.Count == 0)
        {
            GUI.Label(rect, "Mouse controling persons: None");
        }
        else
        {
            GUI.Label(rect, "Mouse controling persons: " + string.Join(", ", pointerControllingTrackedObjects.ConvertAll <string>((i) => { return(i.ToString()); }).ToArray()));
        }
        rect.y += labelHeight;
        GUI.Label(rect, "All Persons in System: " + string.Join(", ", pointerControllingTrackedObjects.ConvertAll <string>((i) => { return(i.ToString()); }).ToArray()));
        rect.y += labelHeight;
        int index = 0;

        foreach (int personID in bm.TrackedObjectsInSystem)
        {
            OmekFramework.Common.BasicTypes.SpaceTypes.Vector3 center2D, center3D;
            BeckonData.Persons[(uint)personID].CenterOfMass3D.Get(out center3D);
            BeckonData.Persons[(uint)personID].CenterOfMass2D.Get(out center2D);
            GUI.Label(rect, string.Format("{0} : Person {1}, GameID {2}, State: {6} ,Position {3}, Image Position {4}, PosType {5}",
                                          index++,
                                          personID,
                                          ps.PlayerIdOfTrackedObjectId(personID),
                                          center3D.ToString("0.00"),
                                          center2D.ToString("0.0"),
                                          bm.GetPositionType((uint)personID),
                                          bm.GetInferredState((uint)personID)));
            rect.y += labelHeight;
        }
    }