예제 #1
0
    public void ConnectMaster(string masterIP, int masterPort, string username, string password)
    {
        if (MasterClient.ServerConnection != null)
        {
            MasterClient.Disconnect("Reconnect");
        }

        NetOutgoingMessage msgOut = MasterClient.CreateMessage();

        msgOut.Write((byte)MasterMessageType.NewAccountConnection);
        msgOut.Write(username);
        msgOut.Write(password);

        MasterClient.Connect(masterIP, masterPort, msgOut);
    }
 public void Connect(string ip = "", int port = 0)
 {
     _client.Connect(ip, port, OnConnected, OnClose);
 }