public void Send() { if (composeBox != null && composeBox.GetText() != "") { string message = composeBox.GetText(); ReceiveNamedMessage(message, myName); Rpc(nameof(ReceiveNamedMessage), message, myName); composeBox.SetText(""); } }
public void Send() { if (composeBox != null && composeBox.GetText() != "" && nameBox != null) { string name = GetName(); string message = name + "(" + myId + "): " + composeBox.GetText(); ReceiveMessage(message); Rpc(nameof(ReceiveMessage), message); composeBox.SetText(""); } }
public void StartClient() { NetworkSession netSes = new NetworkSession(); netSes.initAddress = addressBox.GetText(); netSes.initPort = portBox.GetText(); Session.session.AddChild(netSes); Session.session.netSes = netSes; netSes.isServer = false; netSes.initName = nameBox.GetText(); Session.ChangeMenu(Menu.Menus.Lobby); }
public string GetName() { string name = "Player"; if (nameBox != null) { name = nameBox.GetText(); } return(name); }
public void SaveSettings() { Session.session.masterVolume = masterVolumeSlider.Value; Session.session.sfxVolume = sfxVolumeSlider.Value; Session.session.musicVolume = musicVolumeSlider.Value; Session.session.mouseSensitivityX = mouseXSlider.Value; Session.session.mouseSensitivityY = mouseYSlider.Value; Session.session.userName = userNameBox.GetText(); Sound.RefreshVolume(); Session.SaveSettings(); }
public void Join() { string address = ""; if (addressBox != null) { address = addressBox.GetText(); } ReceiveMessage("Connecting to server: " + address + " on port " + Session.DefaultPort + "..."); Session.session.InitClient(address, (Godot.Object) this, nameof(JoinSucceed), nameof(JoinFail)); }
public void SaveSettings() { Session.session.masterVolume = masterVolumeSlider.Value; Session.session.sfxVolume = sfxVolumeSlider.Value; Session.session.musicVolume = musicVolumeSlider.Value; Session.session.mouseSensitivityX = mouseXSlider.Value; Session.session.mouseSensitivityY = mouseYSlider.Value; Session.session.userName = userNameBox.GetText(); int deviceInt = (int)deviceSlider.Value; Session.session.player1Device = (DeviceManager.Devices)deviceInt; Sound.RefreshVolume(); Session.SaveSettings(); }