Esempio n. 1
0
        public PingRequest(FibeClass fibeClass, string[] tagsArr)
        {
            this.ClassRequested = fibeClass;
            client = fibeClass.client;
            Tags   = new ObservableCollection <string>(tagsArr);
            RaisePropertyChanged("tagString");
            When      = DateTime.Now;
            isTalking = false;
            connector = fibeClass.connector;

            Payload p = client.makePayload();

            p.path    = ClassRequested.path.Concat(new String[] { "audio" }).ToArray();
            p.request = "enqueue";
            int timespan = this.timestamp;

            p.addPayload("time", timespan.ToString());
            p.addPayload("tags", tagsArr);
            p.sessionkey = client.SessionKey;
            p.sessionid  = client.SessionID;
            Random rnd = new Random();

            p.identity = packetIdentity = rnd.Next(Int32.MaxValue);
            connector.Send(p);
            connector.ReceivedData += waitForPermit;
        }
Esempio n. 2
0
        public FibeClass JoinClass(String[] path)
        {
            StringBuilder sb = new StringBuilder();
            FibeClass     c;

            foreach (String s in path)
            {
                sb.Append(s);
                if (s != path.Last())
                {
                    sb.Append(", ");
                }
            }

            if (classJoined.ContainsKey(sb.ToString()))
            {
                c = classJoined[sb.ToString()];
            }
            else
            {
                c = new FibeClass(path);
                classJoined.Add(sb.ToString(), c);
                c.client    = this;
                c.Title     = sb.ToString() + " - " + sessionID;
                c.connector = connector;
            }
            return(c);
        }
Esempio n. 3
0
        public PingRequest(FibeClass fibeClass, string[] tagsArr)
        {
            this.ClassRequested = fibeClass;
            client = fibeClass.client;
            Tags = new ObservableCollection<string>(tagsArr);
            RaisePropertyChanged("tagString");
            When = DateTime.Now;
            isTalking = false;
            connector = fibeClass.connector;

            Payload p = client.makePayload();
            p.path = ClassRequested.path.Concat(new String[] {"audio"}).ToArray();
            p.request = "enqueue";
            int timespan = this.timestamp;
            p.addPayload("time", timespan.ToString());
            p.addPayload("tags", tagsArr);
            p.sessionkey = client.SessionKey;
            p.sessionid = client.SessionID;
            Random rnd = new Random();
            p.identity = packetIdentity = rnd.Next(Int32.MaxValue);
            connector.Send(p);
            connector.ReceivedData += waitForPermit;
        }
Esempio n. 4
0
        public FibeClass JoinClass(String[] path)
        {
            StringBuilder sb = new StringBuilder();
            FibeClass c;
            foreach (String s in path)
            {
                sb.Append(s);
                if (s != path.Last()) sb.Append(", ");
            }

            if (classJoined.ContainsKey(sb.ToString()))
            {
                c = classJoined[sb.ToString()];
            } else {
                c = new FibeClass(path);
                classJoined.Add(sb.ToString(), c);
                c.client = this;
                c.Title = sb.ToString() + " - " + sessionID;
                c.connector = connector;
            }
            return c;
        }