예제 #1
0
 public void Send()
 {
     if (composeBox != null && composeBox.GetText() != "")
     {
         string message = composeBox.GetText();
         ReceiveNamedMessage(message, myName);
         Rpc(nameof(ReceiveNamedMessage), message, myName);
         composeBox.SetText("");
     }
 }
예제 #2
0
 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("");
     }
 }
예제 #3
0
    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);
    }
예제 #4
0
    public string GetName()
    {
        string name = "Player";

        if (nameBox != null)
        {
            name = nameBox.GetText();
        }
        return(name);
    }
예제 #5
0
 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();
 }
예제 #6
0
    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));
    }
예제 #7
0
    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();
    }