Exemple #1
0
		public void SendLogoutChatAlert()
		{
			SpottedScript.Controls.ChatClient.Shared.AlertStub alertStub = new SpottedScript.Controls.ChatClient.Shared.AlertStub(
				Guid.NewGuid().Pack(),
				SpottedScript.Controls.ChatClient.Shared.ItemType.LogoutAlert,
				DateTime.Now.Ticks.ToString(),
				new Chat.RoomSpec(SpottedScript.Controls.ChatClient.Shared.RoomType.BuddyAlerts, Model.Entities.ObjectType.Usr, this.K).Guid.Pack(),
				this.NickName,
				this.StmuParams,
				this.K,
				this.HasPic ? this.Pic.ToString() : "0");
			Chat.SendJsonChatItem(alertStub);
		}
Exemple #2
0
			protected override void Execute()
			{
				Usr myUsr = new Usr(UsrK);
				//get logged on buddies...
				Query q = new Query();
				q.TableElement = Usr.BuddyJoin;
				q.QueryCondition = new And(myUsr.BuddiesFullQ, Usr.LoggedInChatQ);
				q.Columns = new ColumnSet(Usr.Columns.K);
				UsrSet loggedOnBuddies = new UsrSet(q);
				Guid myRoom = new Chat.RoomSpec(SpottedScript.Controls.ChatClient.Shared.RoomType.BuddyAlerts, Model.Entities.ObjectType.Usr, myUsr.K).Guid;
				if (loggedOnBuddies.Count > 0)
				{
					int[] loggedOnBuddyKs = loggedOnBuddies.ToList().ConvertAll(u1 => u1.K).ToArray();
					List<Guid> buddyRooms = new List<Guid>();
					foreach (int buddyK in loggedOnBuddyKs)
					{
						buddyRooms.Add(new Chat.RoomSpec(SpottedScript.Controls.ChatClient.Shared.RoomType.BuddyAlerts, Model.Entities.ObjectType.Usr, buddyK).Guid);
					}
					
					ChatLibrary.ChatServerInterface cs = (ChatLibrary.ChatServerInterface)Activator.GetObject(typeof(ChatLibrary.ChatServerInterface), Bobs.Vars.ChatServerAddress);
					cs.JoinRoom(buddyRooms.ToArray(), myUsr.K);
					cs.JoinRoom(myRoom, loggedOnBuddyKs);
				}
				if (SendLoginChatItem)
				{
					SpottedScript.Controls.ChatClient.Shared.AlertStub alertStub = new SpottedScript.Controls.ChatClient.Shared.AlertStub(
						Guid.NewGuid().Pack(),
						SpottedScript.Controls.ChatClient.Shared.ItemType.LoginAlert,
						DateTime.Now.Ticks.ToString(),
						myRoom.Pack(),
						myUsr.NickName,
						myUsr.StmuParams,
						myUsr.K,
						myUsr.HasPic ? myUsr.Pic.ToString() : "0");
					Chat.SendJsonChatItem(alertStub);
				}
			}