public GameMain(bool join) { InitializeComponent(); new DatabaseConn("", "").DownloadAndSet(); TopMost = true; FormBorderStyle = FormBorderStyle.FixedSingle; WindowState = FormWindowState.Maximized; MaximizeBox = false; conn = new Thread(new ServerComponents(this).connection); conn.Start(); while (!connected) { Thread.Sleep(1); } if (join) { var message = new ClientMessage.JoinMessage(); message.room_code = Prompt.ShowDialog("Enter the room code", "Prompt"); var message1 = JsonConvert.SerializeObject(message); //Console.WriteLine(message1); ServerComponents.SendMessage(server, message1); } //Console.WriteLine("ORIGINAL SIZE: " + Width); }
private void setImage(string image) { var message = new ClientMessage.ImageMessage(); message.image = image; ServerComponents.SendMessage(server, JsonConvert.SerializeObject(message)); }
private void setName(string name) { var message = new ClientMessage.NameMessage(); message.name = name; ServerComponents.SendMessage(server, JsonConvert.SerializeObject(message)); }
private void setMoney(int money) { var message = new ClientMessage.MoneyMessage(); message.money = money; ServerComponents.SendMessage(server, JsonConvert.SerializeObject(message)); }
private void submit_Click(object sender, EventArgs e) { setBet = currentBet; setC = currentChoice; var message = new ClientMessage.BetMessage(); message.bet = setBet >= 100 ? setBet : 100;; message.choice = setC; ServerComponents.SendMessage(server, JsonConvert.SerializeObject(message)); }