Setting up the Client - TheSwerik/Swerver GitHub Wiki

  • If you have not already, create a Project for your Client. (Any UI should work)
  • Either add Swerver.Client with NuGet or download from GitHub
  • Inherit from Udp and from Tcp and override ExecuteOnMainThread so that the Action executes on your main Thread. (examples below)
  • Call Client.Init(tcp, udp); with your inherited Udp and Tcp Classes.
    • You can enter a Server-IP there aswell (Client.Init(tcp, udp, ip);)
  • Call Client.Instance.ConnectToServer(); to connect to the Server.
  • For Client sending, write methods that look like ClientSend Welcome and UdpTest.
  • For Client receiving, add methods to the Clients PacketHandlers. Method Examples are ClientHandler's WelcomeReceived and UdpTestReceived.
  • For proper Disconnecting, call Client.Instance.Disconnect();

Next up: Changing Settings