public RoomPainter(TTClient parent) { client = parent; paintingQueue = new LockFreeQueue<Action>(); chatLines = new string[0]; threadTicker = new Timer(Tick, null, 300, 300); /// 4 fps :D Instance = this; }
public SyncDate() { OnPropertyChanged("Value"); var service = new TTClient(); timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += (s, e) => { OnPropertyChanged("Value"); }; timer.Start(); service.RemoteDatetimeAsync().ContinueWith(t => { if (t.IsCompleted) { gap = t.Result.Subtract(DateTime.Now).Ticks; } }); }
void JoinRoom(int roomIndex, bool resetReader = true) { currentState = State.GettingRoom; if (resetReader) { OnGetInput = null; readerActive = false; } Room toJoin = roomList[roomIndex]; client = new TTClient(userInformation.userid, userInformation.userauth, toJoin.roomid); painter = new RoomPainter(client); client.OnJoinedRoom += new Action(client_OnJoinedRoom); Console.Clear(); Console.SetCursorPosition(0, 0); Console.WriteLine("Now where did I leave my card for the room... "); client.StreamsToSync += new StreamSync(simpleStream.loadStream); client.StreamsToSync += new StreamSync(client_StreamsToSync); client.OnSpeak += RoomPainter.Instance.NewChat; int attempts = 0; while (!client.Connect() && attempts++ < 5) Console.WriteLine("Damnit, where the hell is it... x{0}", attempts); if (!client.isConnected) { DisplayRooms(); return; } }
public static void RegisteredUser(TTClient instance, Registered registeredUsers) { for (int i = 0; i < registeredUsers.user.Length; ++i) instance.RegisterUser(registeredUsers.user[i]); }
public static void NoSong(TTClient instance, SongChange roomInfo) { instance.UpdateRoomInformation(roomInfo.room); }
public static void DeregisteredUser(TTClient instance, DeRegistered deregisteredUsers) { for (int i = 0; i < deregisteredUsers.user.Length; ++i) instance.DeregisterUser(deregisteredUsers.user[i]); }