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);
)
- You can enter a Server-IP there aswell (
- Call
Client.Instance.ConnectToServer();
to connect to the Server. - For Client sending, write methods that look like
ClientSend
Welcome
andUdpTest
. - For Client receiving, add methods to the Clients
PacketHandlers
. Method Examples areClientHandler
'sWelcomeReceived
andUdpTestReceived
. - For proper Disconnecting, call
Client.Instance.Disconnect();
Next up: Changing Settings