public static void Speak(this Extension E, PlayerSpeakEventArgs e, HSpeech Speech) { try { switch (Speech) { case HSpeech.Say: E.Contractor.SendToServer(HMessage.Construct(Data.Default.HostSay, e.Message, e.Theme.Juice(), 0)); break; case HSpeech.Shout: E.Contractor.SendToServer(HMessage.Construct(Data.Default.HostShout, e.Message, e.Theme.Juice())); break; case HSpeech.Whisper: E.Contractor.SendToServer(HMessage.Construct(Data.Default.HostWhisper, e.Message, e.Theme.Juice())); //This will DC you COME BACK TO THIS break; default: break; } } catch (Exception error) { MessageBox.Show(error.ToString()); } }
private void OnPlayerShout(HMessage obj) { try { var args = new PlayerSpeakEventArgs(obj, HSpeech.Shout); if (MSpeechChckbx.Checked) if (CurPlayer.PlayerIndex == args.PlayerIndex) E.Speak(args, args.Speech); } catch (Exception error) { MessageBox.Show(error.ToString()); } }