Skip to content

Commit

Permalink
fix: TCPTransport is obsolete, use KCPTransport instead
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Oct 22, 2020
1 parent 412b87f commit c031ae9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Assets/Mirror/Runtime/Transport/Tcp/TcpConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace Mirror.Tcp
{
[Obsolete("Use KcpConnection instead")]
internal class TcpConnection : IConnection
{
private readonly TcpClient client;
Expand Down
3 changes: 2 additions & 1 deletion Assets/Mirror/Runtime/Transport/Tcp/TcpTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
using UnityEngine;

namespace Mirror.Tcp
{
{
[Obsolete("Use KcpTransport instead")]
public class TcpTransport : Transport
{
private TcpListener listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ void ParseForTransport()
{
if (transport.Equals("tcp"))
{
#pragma warning disable CS0618 // Type or member is obsolete
TcpTransport newTransport = networkManager.gameObject.AddComponent<TcpTransport>();
#pragma warning restore CS0618 // Type or member is obsolete

//Try to apply port if exists and needed by transport.
if (!string.IsNullOrEmpty(port))
Expand Down
2 changes: 2 additions & 0 deletions Assets/Tests/Runtime/Transport/TransportTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

namespace Mirror.Tests
{
#pragma warning disable CS0618 // Type or member is obsolete
[TestFixture(typeof(TcpTransport), new[] { "tcp4" }, "tcp4://localhost", 7777)]
#pragma warning restore CS0618 // Type or member is obsolete
[TestFixture(typeof(KcpTransport), new[] { "kcp" }, "kcp://localhost", 7777)]
public class AsyncTransportTests<T> where T : Transport
{
Expand Down

0 comments on commit c031ae9

Please sign in to comment.