summaryrefslogtreecommitdiff
path: root/modules/mono/editor/GodotTools/GodotTools.IdeConnection/GodotIdeConnectionServer.cs
blob: aa98dc7ca3c9fcb0dda8c816eec1626897fe7268 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using System.Net.Sockets;
using System.Threading.Tasks;

namespace GodotTools.IdeConnection
{
    public class GodotIdeConnectionServer : GodotIdeConnection
    {
        public GodotIdeConnectionServer(TcpClient tcpClient, Func<Message, bool> messageHandler)
            : base(tcpClient, messageHandler)
        {
        }

        protected override bool WriteHandshake()
        {
            return WriteLine(ServerHandshake);
        }

        protected override bool IsValidResponseHandshake(string handshakeLine)
        {
            return handshakeLine == ClientHandshake;
        }
    }
}