private void ActionKeyMappingChat_ActionTriggered(object sender, ActionTriggeredEventArgs e) { ChatScreen chatScreen = new ChatScreen(world.PlayerCharacter.Id); chatScreen.Initialize(this.Manager); chatScreen.Show(); }
private void chatRecieved(object sender, string msg) { ChatScreen.Invoke((MethodInvoker) delegate { ChatScreen.Text += msg + "\n"; }); }
static void Main(string[] args) { var networkClient = new NetworkClient(); var chatClient = new ChatClient(networkClient); var chatLogin = new ChatLogin(chatClient, IPAddress.Parse("127.0.0.1"), 9999); string username = chatLogin.Login(); var messageDisplay = new MessageDisplay(username); var commandFactory = new CommandFactory(chatClient, messageDisplay); var chatScreen = new ChatScreen(chatClient, commandFactory, messageDisplay); chatScreen.Run(); }
private async void bunifuThinButton23_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { FirstName.Text = FirstName.Text.Trim(); LastName.Text = LastName.Text.Trim(); Username.Text = Username.Text.Trim(); Password.Text = Password.Text.Trim(); ConfirmPassword.Text = ConfirmPassword.Text.Trim(); if (AllValid()) { if (getDataFromUser(Username.Text) == "false") { label2.Visible = false; if (registerUser(FirstName.Text, LastName.Text, Username.Text.Trim(), Password.Text) == "easy") { e.Handled = true; e.SuppressKeyPress = true; slideA.Visible = false; slideC.Visible = false; slideC.Left = 53; slideC.Visible = true; slideC.Refresh(); await Loading(); this.Hide(); ChatScreen chat = new ChatScreen(getDataFromUser(Username.Text)); chat.ShowDialog(); } else { ConnectionIssues issues = new ConnectionIssues(); issues.ShowDialog(); SignUp.Enabled = true; } } else { label2.Visible = true; SignUp.Enabled = true; } } } }
//Sign up process private async void bunifuThinButton23_Click(object sender, EventArgs e) { FirstName.Text = FirstName.Text.Trim(); LastName.Text = LastName.Text.Trim(); Username.Text = Username.Text.Trim(); Password.Text = Password.Text.Trim(); ConfirmPassword.Text = ConfirmPassword.Text.Trim(); if (AllValid()) { if (getDataFromUser(Username.Text) == "false") { label2.Visible = false; if (registerUser(FirstName.Text, LastName.Text, Username.Text.Trim(), Password.Text) == "easy") { label1.Visible = false; slideA.Visible = false; slideC.Visible = false; slideC.Left = 53; slideC.Visible = true; slideC.Refresh(); await Loading(); this.Hide(); ChatScreen chat = new ChatScreen(getDataFromUser(Username.Text)); chat.ShowDialog(); } else { ConnectionIssues issues = new ConnectionIssues(); issues.ShowDialog(); SignUp.Enabled = true; } } else { label2.Visible = true; label2.Text = "Username already taken"; SignUp.Enabled = true; } } }
//Code for opening chat private async void bunifuThinButton24_Click(object sender, EventArgs e) { if (Login()) { slideB.Visible = false; slideC.Visible = false; slideC.Left = 53; slideC.Visible = true; slideC.Refresh(); await Loading(); this.Hide(); ChatScreen chat = new ChatScreen(getDataFromUser(Username2.Text)); chat.ShowDialog(); } }
private async void bunifuThinButton24_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { if (Login()) { e.Handled = true; e.SuppressKeyPress = true; slideB.Visible = false; slideC.Visible = false; slideC.Left = 53; slideC.Visible = true; slideC.Refresh(); await Loading(); this.Hide(); ChatScreen chat = new ChatScreen(getDataFromUser(Username2.Text)); chat.ShowDialog(); } } }
public void ToFindDate() { WelcomeScreen.SetActive(true); ChatScreen.SetActive(false); }
public void ToChatService() { WelcomeScreen.SetActive(false); ChatScreen.SetActive(true); }
public ActionResult Message(int convoID, int pageNo)//List of messages within a conversation (accessed from Inbox page) { Conversation convo = db.conversations.ToList().Where(x => x.ID == convoID).FirstOrDefault(); int page = pageNo; int next = page + 15; ViewBag.NextPosts = next; //string myUsername = User.Identity.GetUserName(); string myId = User.Identity.GetUserId(); ActiveProfile active = db.activeprofiles.ToList() .Where(x => x.ApplicationUserId == myId).FirstOrDefault(); ViewBag.MyId = active.ActiveProfileID; ViewBag.ConvoID = convo.ID; int recieverid; bool im_business; if (active.AccountType == "Business") { im_business = true; } else { im_business = false; } ViewBag.isBusiness = im_business; if (convo.FirstPersonID == active.ActiveProfileID) { recieverid = convo.SecondPersonID; } else { recieverid = convo.FirstPersonID; } ViewBag.RecieverID = recieverid; if (convo != null && (convo.FirstPersonID == active.ActiveProfileID || convo.SecondPersonID == active.ActiveProfileID)) { List <Message> messages = db.messages.ToList().Where(x => x.ConversationID == convo.ID).ToList(); if (convo.LastSenderID != active.ActiveProfileID) { convo.Seen = true; db.SaveChanges(); } if (im_business) { PersonalAccount personal = db.personalaccounts.ToList().Where(x => x.ID == recieverid).FirstOrDefault(); ViewBag.RecName = personal.Names + " " + personal.Surname; ChatScreen c = db.chatscreens.ToList().Where(x => x.AccountType == "Business" && x.AccountID == active.ActiveProfileID).FirstOrDefault(); c.hasMessage = false; db.SaveChanges(); } else { BusinessAccount business = db.businessaccounts.ToList().Where(x => x.ID == recieverid).FirstOrDefault(); ChatScreen c = db.chatscreens.ToList().Where(x => x.AccountType == "Personal" && x.AccountID == active.ActiveProfileID).FirstOrDefault(); c.hasMessage = false; ViewBag.RecName = business.BusinessName; } //if (messages.Last().SenderID != active.ActiveProfileID && messages.Last().Seen == false) //{ // messages.Last().Seen = true; // db.SaveChanges(); //} return(View(messages)); } else { return(RedirectToAction("Index", "Home")); } }
/// <summary> /// Joins the room/game listed on the lobby. /// </summary> public void JoinRoom(string room) { if (!this.usePhoton.Player.gameObject.GetComponent<PlayerLocal>()) { // create a player Transform instance this.PlayerLocal = this.usePhoton.Player.gameObject.AddComponent<PlayerLocal>(); this.PlayerLocal.Initialize(this); this.PlayerLocal.name = this.LocalPlayer.Name + this.LocalPlayer.ID; this.chatScreen = this.usePhoton.chatScreen; this.chatScreen.NameSender = this.LocalPlayer.Name; } this.OpJoinRoom(room); this.chatScreen.Initialize(this); }