Coder Social home page Coder Social logo

telepathy's People

Contributors

imerr avatar james-frowen avatar michalpetryka avatar miwarnec avatar mrgadget1024 avatar nxrighthere avatar paulpach avatar pyrateakananto avatar saguiitay avatar starburst997 avatar uweeby avatar zanecop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

telepathy's Issues

Received message by server is kept in memory. How to clear?

I have a Server receiving messages from a client in Unity, setup like the example in the wiki.
I am sending two different messages on two different key presses, one on space bar press and the other on Q key press.
The message on space bar press is longer than the message on Q press.

Space bar message, server receives: "Client sends message on Space key press."
Q key message, server receives: "Beep beep beep on Q key press!"

If I press space bar first, and send the above message, and then press on Q, the server receives:
"Beep beep beep on Q key press!key press.", which shows that the previous message, sent on space bar was not cleared.
Is this a defect? How do you clear previous messages if not a defect?

Thank you.

Stopping server causes server to freeze

Hi,

Using telepathy on a C# console application, when creating the most barebones app possible, the application freezes when I try to stop telepathy server.

The code is just this:

    class Program
    {
        private static void Main(string[] args)
        {
            Console.WriteLine("Starting Gameplay Server!");

            var server = new Server();
            server.Start(5000);

            Console.WriteLine("Starting server on port [5000]...");

            Thread.Sleep(5000);

            server.Stop();

            Console.WriteLine("Gameplay Server no longer running!");
        }
    }

The last line never gets output to the console. This happens when using either the NUGET package or latest revision from this repo. Might be worth noting Im using Visual Studio 2019 for Mac (on a Mac obviously), in case you are unable to reproduce on windows somehow.

You can download this tiny solution here:
https://drive.google.com/open?id=1ktJGU79feAWd8Y8fbAurAMQUFRG9yEOC

Please let me know if there is anything you want me to try out.

Best,
Allan

Is there any way to get response via telepathy.server/client?

I want to get info from server, like get player info, map parameters, etc. So, when I'm using 'oldschool' tcpListener/tcpClient, I can write in socket from client, and server can answer into same socket, so I can synchronously request data from server like:
...
Message response = client.Send(message);
...

Is there any way to do something like this?

Send: stream.Write exception: System.IO.IOException: Write failure

The headless server comes to a complete halt (cpu usage from 60% to under 10%) and not a total crash. All connected clients stay connected but no network activity, and no new connections can be made.

Until what seems a timeout period lapses, the problematic connection drops, floods the log processing buffers then the game resumes as normal.. sometimes the existing connections can continue from then on, depending on how long it has been down.

All players have various avg ping anywhere from 50ms to 700ms

No reproduce method found yet. I'm still unsure if disconnecting the problematic connection is the correct way to handle this.

This is occurring on a 5month old Mirror, so I can confirm it is not a regression.

Apologies for all the unknowns, will update as I find out more.

Below is the stacktrace I recieve:


Send: stream.Write exception: System.IO.IOException: Write failure ---> System.Net.Sockets.SocketException: Connection timed out
  at System.Net.Sockets.Socket.Send (System.Byte[] buf, Int32 offset, Int32 size, SocketFlags flags) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, Int32 offset, Int32 size) [0x00000] in <filename unknown>:0
  at Telepathy.Common.SendMessage (System.Net.Sockets.NetworkStream stream, System.Byte[] content) [0x00000] in <filename unknown>:0

The following stacktrace is what another person is experiencing, looks to be the same issue:

Send: stream.Write exception: System.IO.IOException: Unable to write data to the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
  at System.Net.Sockets.Socket.Send (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) [0x00016] in <3845a180c26b4889bc2d47593a665814>:0 
  at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x0009b] in <3845a180c26b4889bc2d47593a665814>:0 
   --- End of inner exception stack trace ---
  at System.Net.Sockets.NetworkStream.Write (System.Byte[] buffer, System.Int32 offset, System.Int32 size) [0x000e2] in <3845a180c26b4889bc2d47593a665814>:0 
  at Telepathy.Common.SendMessagesBlocking (System.Net.Sockets.NetworkStream stream, System.Byte[][] messages) [0x00075] in <65650c357bbf4c47b1245de11c332c0e>:0 

Disconnect is never called!

Hey everyone, I noticed an odd issue. When message is recieved, or the client connects, both of those messages are called. But disconnect is never called! i dont know why this is

Send timeout not working

Hello,

I am unable to set a working send timeout. It does not seem to be taken into account.
Tested with V2 (2021 branch)

Jaze

Not supporting ipv6

There is no ipv6 support because of this:
listener = new TcpListener(new IPEndPoint(IPAddress.Any, port));

To fix this, you could do this:

listener = new TcpListener(IPAddress.IPv6Any, port);
listener.Server.SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.IPv6Only, false);

This would listen to IPv4 and IPv6.

Question : how to send big data ?

Hello.

I tried to use client.send() with a bytearray so big that it didn't work.
What are your tips to send big data like an image ?

Thank you.

ReadSafely ambiguous call in ReadExactly

I as able to get a Telepathy test running great as a standalone, but when I move the directory into my Unity project file system I got this error. Any recommendations on fixing it?

Windows 10, Unity version 2018.3.0f2

image

Server disconnects client after ~3 seconds.

The title says it all. Here is the server and client code.

Server code:

using System;
using System.Text;
using Telepathy;

namespace TelepathyTestServer {
    class Program {
        static void Main(string[] args) {
            const int MaxMessageSize = 8 * 1024;

            Encoding utf8 = Encoding.UTF8;

            Server server = new Server(MaxMessageSize);

            server.OnConnected = (connectionId) => {
                Console.WriteLine("Client [{0}] connected.", connectionId);
                byte[] msg = utf8.GetBytes("Hello from server.");
                server.Send(connectionId, new ArraySegment<byte>(msg));
            };

            server.OnData = (connectionId, data) => {
                Console.WriteLine(connectionId + " Data: " + utf8.GetString(data.Array, 0, data.Count));
            };

            server.OnDisconnected = (connectionId) => Console.WriteLine("Client [{0}] disconnected.", connectionId);

            server.Start(5200);

            while (true) {

                server.Tick(100);

                System.Threading.Thread.Sleep(1);
            }
        }
    }
}

Client code:

using System;
using System.Text;
using Telepathy;

namespace ClientTest {
    class Program {
        static void Main(string[] args) {
            const int MaxMessageSize = 8 * 1024;

            Encoding utf8 = Encoding.UTF8;

            Client client = new Client(MaxMessageSize);

            client.OnConnected = () => {
                Console.WriteLine("Connected to server.");
                byte[] msg = utf8.GetBytes("Hello from client.");
                client.Send(new ArraySegment<byte>(msg));
            };

            client.OnData = (data) => Console.WriteLine(utf8.GetString(data.Array, 0, data.Count));

            client.OnDisconnected = () => Console.WriteLine("Disconnected from server.");

            client.Connect("127.0.0.1", 5200);
            System.Threading.Thread.Sleep(100);

            while (true) {

                client.Tick(100);

                System.Threading.Thread.Sleep(1);
            }
        }
    }
}```

客户端收到多条回复信息。

图片
我在使用时出现了服务器发送了一次消息,但 客户端在OnData收到多条信息的情况。我把 state.receivePipe.TryDequeue();方法放到 OnData?.Invoke(message); 之前可以避免这个问题。
这么做会出现其他问题吗?或者有其他更好的解决方法?

How do you Install Telepathy in Unity?

Sorry if this is a dumb question but how do you install Telepathy in a empty Unity Project?

Right now I'm using Unity's new Transport Layer directly, would you recommend using the Telepathy library over that?

I'm using Unity 2019.3.12f1.

Thanks in advance.

Server.Send: invalid connectionId:

Hi,

Doing some stress testing with sending large amounts of messages (about 250 per second of 10 bytes each) to 16 connected clients and sometimes getting this the Unity console: Server.Send: invalid connectionId: [number]

Doesn't happen when I don't send as much (about 25).

Is this a sign the system can't cope or could there be something else going on?

Thanks

client disconnect causes server freeze

Describe the bug

When a client completely shuts off their internet, other users experience a complete drop in server response. The server produces no error logs and in the case that the client reconnects in a timely manner, everything resumes back to normal. This shutting off of the internet is not equivalent to force closing the game, where that still acts like a clean break from the server.

Desktop (please complete the following information):

  • OS: windows and osx
  • Build target: standalone and editor
  • Unity version: 2018.2

Moving MirrorNetworking/Mirror#152 here, this is a Telepathy issue, not a Mirror issue

Calling Telepathy.Server.Stop() never returns

screen shot 2019-01-18 at 6 05 34 pm

How to reproduce - Copy the starter code into a new c# visual studio project(and add the main/updates methods, of course). Start the server, "server" as a console application. Call "server.Stop()" with a Console.WriteLine() right after. The Console.WriteLine() won't ever get called, I have to ctrl+c the program to end it.

using System;
using Networking = Telepathy;

class Server
    {
        public static Networking.Server server { get; protected set; }

        public static void Main(string[] args)
        {
            /* START SERVER */
            server = new Networking.Server();
            server.Start(1337);
            Console.WriteLine("Server started!");


            /* UPDATE SERVER */
            while (!(Console.KeyAvailable && Console.ReadKey(true).Key == ConsoleKey.Escape))
            {
                ReceivePackets();
            }


            /* STOP SERVER */
            server.Stop();
            Console.WriteLine("Stopped server");
        }

The "ReceivePackets()" method obviously has more stuff, but this issue still occurs even when using the starter code on the readme.

What platforms does Telepathy support?

Hi developers! I was looking for a good networking library to use with Unity as Unity is in this weird transitioning period from UNet to their new transport layer. Telepathy looks pretty promising! I do want to make my game cross-platform, so I'm wondering what platforms do you support/have tested on. Thanks!

client.Disconnect() don't work as expected! ( Infinity loops )

Hi guys - i found critical problem! If we try connect to unavailable host like this 185.137.235.2 port 54300

we cannot close ReceiveThread after that! Always!
as result we cannot close game - it will freeze infinity
and Unity Editor will freeze to!

i spend over one day to find the problem!

after try connect to unavailable host, ReceiveThreadFunction will block on client.Connect(ip, port)
here: https://github.com/vis2k/Telepathy/blob/d7b78b415cd37843cc7c07b5c805bf43c3a3637f/Telepathy/Client.cs#L54

after that, when we call call client.Disconnect() we expect get exception in ReceiveThreadFunction
like this: System.Net.Sockets.SocketException (0x80004005): interrupted

BUT problem is - it never happens!
As result game or editor will freeze infinity!

After research i found your 'dirty hook':

client.Client = null; // clear internal IPv4 socket until Connect()
https://github.com/vis2k/Telepathy/blob/d7b78b415cd37843cc7c07b5c805bf43c3a3637f/Telepathy/Client.cs#L136

as i understand you make it for IpV6 - but as result, you broke SocketException
if remove this code:
client.Client = null; // clear internal IPv4 socket until Connect()

all work fine!

and additional - if use client.Client = null; we also cannot use async variant of Connect - need timeout for connection!

client.BeginConnect(ip, port, null, null);
it will get null pointer exception - because it required client.Client

About using Telepathy in a Unity-WebGL project

Hello,

I am working on a Unity-WebGL project. I have tested Telepathy in the Unity Play Mode, and it worked perfectly.

However, after I built the project, it doesn't work in my web browser. The error message is attached.

image

Do people have some clues on what's happening here? Thank you so much for your time.

Best,
Zhen

Unable to parse file Assets/Mirror/Runtime/Transport/Telepathy/Telepathy.dll.meta: [Parser Failure at line 30: Expect ':' between key and value within mapping]

After upgrading to last asset store version 16.1.1 I got this error (also easch time I clean the library folder) :

Unable to parse file Assets/Mirror/Runtime/Transport/Telepathy/Telepathy.dll.meta: [Parser Failure at line 30: Expect ':' between key and value within mapping]

0x00007FF633309E8C (Unity) StackWalker::GetCurrentCallstack
0x00007FF63330DE41 (Unity) StackWalker::ShowCallstack
0x00007FF631A06225 (Unity) GetStacktrace
0x00007FF633F8947E (Unity) DebugStringToFile
0x00007FF6319DBF2B (Unity) YAMLRead::InitParser
0x00007FF6319D8194 (Unity) YAMLRead::YAMLRead
0x00007FF6310DD563 (Unity) AssetImporter::ReadImportSettings
0x00007FF6310D5517 (Unity) AssetImporter::ApplyImportSettings
0x00007FF631BF5955 (Unity) FindOrProduceImporter
0x00007FF631BFCA0D (Unity) ImportToObjects
0x00007FF631BFC4EE (Unity) ImportAsset
0x00007FF631BFC18B (Unity) AssetImportWorker::Import
0x00007FF631BE2097 (Unity) AssetImportManager::ImportInProcess
0x00007FF631BE12AD (Unity) AssetImportManager::Import
0x00007FF631B7BD28 (Unity) ImportAndPostprocessOutOfDateAssets
0x00007FF631B83B6B (Unity) RefreshInternalV2
0x00007FF631B867E6 (Unity) StopAssetImportingV2
0x00007FF631B7DC16 (Unity) InitialScriptRefreshV2
0x00007FF6310B6192 (Unity) Application::InitializeProject
0x00007FF631A35904 (Unity) WinMain
0x00007FF634A27792 (Unity) __scrt_common_main_seh
0x00007FFC7A587BD4 (KERNEL32) BaseThreadInitThunk
0x00007FFC7C3ECE51 (ntdll) RtlUserThreadStart

Failed to connect (0x80004005)

When hosting a server, I am only able to connect to my own local IP address Using a public IP address fails completely. However, port forwarding has already been done, and the port forwarding was tested with a different application. A netstat command shows that the port is in fact listening.

`Client Recv: failed to connect to ip=[my ip here] port=7777 reason=System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

UnityEngine.Debug:Log (object)
NetworkSystem/<>c:b2_0 (string) (at Assets/Scripts/NetworkSystem.cs:15)
Telepathy.Client:ReceiveThreadFunction (Telepathy.ClientConnectionState,string,int,int,bool,int,int,int) (at Assets/Imports/Telepathy/Client.cs:156)
Telepathy.Client/<>cDisplayClass14_0:b__0 () (at Assets/Imports/Telepathy/Client.cs:240)
System.Threading.ThreadHelper:ThreadStart ()`

Broadcast sending

Hello, I am new to networking and trying to connect 2 android devices, that are in a one wifi net, using unity. Changed in your sample client.Connect("localhost", 1337); to client.Connect("255.255.255.255", 1337); in order to find server and connect to it, however it does not work. How can I detect all the available servers?
Thanks in advance!

Disconnect overtakes final message

When I send a message and disconnect a client immediately afterwards (in the same tick) it seems like this last message is being dropped. I was wondering if the framework shouldn't make sure that no messages are lost, meaning that message and disconnect are processed in the appropriate order.

This is a simple code example in C#:

var message = new FinalMessage();
client.Send(message.Serialize());
client.Disconnect();

The FinalMessage will not arrive at the host.

Which package structures here?

Hi. Thanks for your sharing!
Can I know the structure of packages. I mean HEAD END? CRC?
I just need to connect to my server in C# from GO lang. Thanks.

Client immediately disconnects when reconnecting an on-going game

In our game all players join in a lobby level, after which they start the game and join the next level. This works fine, however if a player disconnects and tries to reconnect the on-going game again, they get immediately kicked out. We get the following message in our output log:

Closing connection: connection(0). Received message Mirror.SpawnMessage that required authentication, but the user has not authenticated yet.

We simply start the server with NetworkManager.StartServer and connect using NetworkManager.StartClient.

Send timeout does not work

Hello,

I am unable to set a working send timeout. NetworkStream seems to not take it into account since it works in an asynchronous way.

Jaze

How do I clear the queue for the current connection?

I used to do this in ReceiveLoop, but now it doesn't work. And when the limit is exceeded, the client is disconnected. How to clear the queue for the current connection when the limit is exceeded without losing the connection?

Questions: Why not use Tasks? Would a single send thread be more optimal?

Hello, I've just been reading through the source code to learn about socket programming and had a couple of questions. FYI I have a basic understanding of sockets and threads so please bare with me if the answers to these are obvious. :)

  • How come this project uses threads over tasks?
  • Why does each connection have it's own send thread instead of having a single send thread?
  • If the app has 1000 clients/threads, won't the overhead of changing the thread context make for worse performance?

Server.Send exception: System.ObjectDisposedException: Cannot access a disposed object.

Hi! What can cause this error?I use mirror
Server.Send exception: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.TcpClient'.
at System.Net.Sockets.TcpClient.GetStream () [0x00019] in <3845a180c26b4889bc2d47593a665814>:0
at Telepathy.Server.Send (System.Int32 connectionId, System.Byte[] data) [0x00010] in :0

Server data never gets received by client

I'm using Unity 2019.2.19f1

I'm using the unity sample script in the readme.

The connection works fine.

Sending messages from the client works fine, but the client can't receive messages that are sent by the server.

msg.connectionId

Why does the msg.connectionId always increase even when someone disconnects?

e.g

Server starts.

Client1 connects // msg.connectionId = 1
client1 disconnects

client1 reconnects // msg.connectionId = 2

why doesn't the disconnect takes away the connection id?

Telepathy hangs itself on Linux x64 hosts

Problem: Telepathy never shuts down the server instance on Linux x64 with NET Core 2.x installed, outputting "Server: Stopping..." and hanging indefinitely.
Confirmed affected platforms: Linux
Confirmed affected versions of Telepathy: master
Can be reproduced? Yes, with repro project

Bug reproduction instructions:
Either build the solution in the project archive above or run dotnet TelepathyHangsItself.dll in the Build directory. Do not worry - there is no malicious code, it simply just runs a thread with the example code in the readme, waits until you press a key and goes home. On Windows, it will exit gracefully, on Linux it hangs after the stopping server message and never says "The bug reproduction project exited successfully".

Additional thoughts:
May be related to #46. Regression?

Exceptions are still thrown each time a player disconnects.

MirrorNetworking/Mirror@cb3d9f0
Replacing thread abort with thread interrupt is not a solution to the issue.

Thread.Abort, Thread.Interrupt are intended to be used only in extreme conditions, Telepathy should get rid of them.

  1. Exceptions are still thrown.
    Exception thrown: 'System.Threading.ThreadInterruptedException' in System.Private.CoreLib.dll

  2. Thread.Interrupt is not a graceful way to stop the thread, you should use something like ManualResetEvent to stop the thread and then Thread.Join

LINK
LINK
LINK

Packets sent from remote connections are unreliable

I thought Telepathy would be ideal for my project as we need to send larger amounts of data during the session.

In the current world I am testing, the host must send the client two larger packets. One 10MB packet and one 35MB packet.

When I test locally, with two instances of the game on the same machine, Telepathy works beautifully for this. However, as soon as someone from outside my network tries to connect the host never receives the packet sent from the client after the client receives the first big packet.

So if I skip the 10MB packet, it will fail to send the packet immediately after.

This packet that fails to send is a struct that contains only a single integer, and it fails 100% of the time.

This is the log from the client's side:

[Info   :NebulaMultiplayerMod] Server connection established
[Debug  :NebulaMultiplayerMod] Packet Sent: HandshakeRequest
[Debug  :NebulaMultiplayerMod] Sending NebulaMessage of type NebulaModel.Packets.Session.HandshakeRequest to client 0
[Debug  :NebulaMultiplayerMod] Packet Received: HandshakeResponse
[Info   :NebulaMultiplayerMod] Requesting GameHistoryData from the server
[Debug  :NebulaMultiplayerMod] Packet Sent: GameHistoryDataRequest
[Debug  :NebulaMultiplayerMod] Sending NebulaMessage of type NebulaModel.Packets.GameHistory.GameHistoryDataRequest to client 0
[Debug  :NebulaMultiplayerMod] Packet Sent: ILSRequestgStationPoolSync
[Debug  :NebulaMultiplayerMod] Sending NebulaMessage of type NebulaModel.Packets.Logistics.ILSRequestgStationPoolSync to client 0
[Debug  :NebulaMultiplayerMod] Packet Sent: TrashSystemRequestDataPacket
[Debug  :NebulaMultiplayerMod] Sending NebulaMessage of type NebulaModel.Packets.Trash.TrashSystemRequestDataPacket to client 0
[Debug  :NebulaMultiplayerMod] Packet Sent: PlayerUpdateLocalStarId
[Debug  :NebulaMultiplayerMod] Sending NebulaMessage of type NebulaModel.Packets.Players.PlayerUpdateLocalStarId to client 0
[Debug  :NebulaMultiplayerMod] Packet Sent: ILSArriveStarPlanetRequest
[Debug  :NebulaMultiplayerMod] Sending NebulaMessage of type NebulaModel.Packets.Logistics.ILSArriveStarPlanetRequest to client 0
[Debug  :NebulaMultiplayerMod] Packet Sent: PlayerUpdateLocalStarId
[Debug  :NebulaMultiplayerMod] Sending NebulaMessage of type NebulaModel.Packets.Players.PlayerUpdateLocalStarId to client 0
[Debug  :NebulaMultiplayerMod] Packet Sent: ILSArriveStarPlanetRequest
[Debug  :NebulaMultiplayerMod] Sending NebulaMessage of type NebulaModel.Packets.Logistics.ILSArriveStarPlanetRequest to client 0
[Info   :NebulaMultiplayerMod] Requesting planet model for 60 Gruis I (ID: 101) from host
[Info   :NebulaMultiplayerMod] Requesting planet model for 60 Gruis II (ID: 102) from host
[Info   :NebulaMultiplayerMod] Requesting planet model for 60 Gruis III (ID: 103) from host
[Info   :NebulaMultiplayerMod] Requesting planet model for 60 Gruis IV (ID: 104) from host
[Info   :NebulaMultiplayerMod] Creating NebulaNetwork.PacketProcessors.Planet.PlanetDataRequest
[Info   :NebulaMultiplayerMod] Requesting DysonSphere for system 60 Gruis (Index: 0)
[Info   :NebulaMultiplayerMod] Creating NebulaNetwork.PacketProcessors.Universe.DysonSphereLoadRequest
[Debug  :NebulaMultiplayerMod] Packet Received: GameHistoryDataResponse
[Info   :NebulaMultiplayerMod] Parsing History data from the server.
[Debug  :NebulaMultiplayerMod] Packet Received: ILSgStationPoolSync
[Debug  :NebulaMultiplayerMod] Packet Received: TrashSystemResponseDataPacket
[Debug  :NebulaMultiplayerMod] Packet Received: ILSArriveStarPlanetResponse
[Debug  :NebulaMultiplayerMod] Packet Received: ILSArriveStarPlanetResponse
[Info   :NebulaMultiplayerMod] Processing NebulaNetwork.PacketProcessors.Planet.PlanetDataResponse
[Info   :NebulaMultiplayerMod] Parsing 81742 bytes of data for planet 60 Gruis I (ID: 101)
[Info   :NebulaMultiplayerMod] Parsing 8718 bytes of data for planet 60 Gruis II (ID: 102)
[Info   :NebulaMultiplayerMod] Parsing 82610 bytes of data for planet 60 Gruis III (ID: 103)
[Info   :NebulaMultiplayerMod] Parsing 81742 bytes of data for planet 60 Gruis IV (ID: 104)
[Info   :NebulaMultiplayerMod] Processing NebulaNetwork.PacketProcessors.Universe.DysonSphereData
[Info   :NebulaMultiplayerMod] Requested factory for planet 60 Gruis III (ID: 103) from host
[Info   :NebulaMultiplayerMod] Creating NebulaNetwork.PacketProcessors.Planet.FactoryLoadRequest

This "FactoryLoadRequest" NetworkMessage is the packet that contains only a single integer, and it fails to arrive on the host, no error is given.
The DysonSphereData packet is a NetworkMessage that contains a 10MB byte array in this instance.

This is reproducible 100% of the time.

I've been banging my head against my desk trying to figure out a way to solve this and I just have no idea what is going on. This happens with multiple versions of Telepathy. I've tested the latest version, 1.8, the version that shipped with Mirror 26.2.2, and the 2.0 version from the 2021_worse_in_ccu_tests branch and the behavior is identical for all of them.

EDIT: Also to be super clear since Telepathy can also be used standalone, I am using it within Mirror! So I'm not positive if the issue is with Telepathy itself or perhaps with the TelepathyTransport

Data are far larger in V2

Hello,

I've upgraded to V2 (2021 branch) to test it. It seems messages of "max message size" length are always sent, instead of only what is necessary.

Edit : this is only the case on reception side, i.e. messages of appropriate size are sent through the network, but OnData returns a message a max message size at the reception.

BR,
Jaze

ObjectDisposedException in editor

We are facing an ObjectDisposedException exception when running our app.

It seems it has to be related with the fact that we have two Telepathy clients in our scene (Main app) (one for handling communication with a first server, and a second for communication for another) as when we disable the second client, the exception doesn't occur anymore.

The strange part is that this exception occurs in the other app (Server app).

server_disposed_exception

Any support here would be welcome.

Thanks, cheers

Latest version does not work with Mirror

Upgrading Telepathy on Mirror causes the transport layer loading to fail on TypeLoadExcpeption.

Steps to reproduce:

  1. Create a new project and download Mirror from Asset Store (happens with a local build also).
  2. Build the latest version (b2818cb when writing this) of Telepathy.
  3. Copy Telepathy.dll (and Telepathy.pdb) to Assets/Mirror/Plugins and replacing the old files.
  4. Run the example scene
  5. Following error is given:
TypeLoadException: Could not load type 'Mirror.TelepathyTransport' from assembly 'Mirror.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Mirror.NetworkManager.InitializeTransport ()
Mirror.NetworkManager.Awake ()

Failed to connect

I can connect to myself, but others cannot.

Client Recv: failed to connect to ip=(my ip here) port=7777 reason=System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

UnityEngine.Debug:Log (object)
NetworkSystem/<>c:<Awake>b2_0 (string) (at Assets/Scripts/NetworkSystem.cs:15)
Telepathy.Client:ReceiveThreadFunction (Telepathy.ClientConnectionState,string,int,int,bool,int,int,int) (at Assets/Imports/Telepathy/Client.cs:156)
Telepathy.Client/<>cDisplayClass14_0:<Connect>b__0 () (at Assets/Imports/Telepathy/Client.cs:240)
System.Threading.ThreadHelper:ThreadStart ()

Client.Connect blocks code in Unity 2019.2.3f1

Hi,

Using Telepathy via Mirror. When I connect the client to an IP address that doesn't respond, at first the main thread code will continue to run. But after approx. 5 seconds, the main thread gets blocked for 30 seconds or so... After that the disconnect event is fired and code resumes as normal.

Any idea what causes this? And if this is not fixable, any way to reduce the timeout?

Thanks.

Which ports needs to be open (and or forwarded, NAT stuff etc) and with which associated protocol ?

Hi, the title of the issue is self explanatory, right now doing tests with vivox and it uses telepathy transport with 7777 port (which is open and forwarded in both tcp and udp).

Some people were able to host it, i have no idea why but when i tried, even allocating local ips on win defender, or it was able to be hosting it but not the voice packets and some people arent
able to open a room either / host a game.

The vivox demo/sdk is based on tanks network.

So i ask, which exact ports and their protocols needs port forwarding to hosting local computer / ip needs to be opened and/or forwarded :).

[email protected].

P.S i'm not looking for help on the voice packets part already in contact with vivox.

Cheers :)

Latest commit for IPv6 Support breaks Telepathy completely in Mirror DLL form

Your latest IPv6 commit broke Telepathy including the version that is currently in Mirror.

To replicate this break, simply build any of the examples that come with Mirror like Tanks and run the standalone as LAN Host and use the Editor as a client. You will get an error saying:

FormatException: An invalid IP address was specified.

Investigating deeper points to line 111 of Client.cs.

Workarounds such as mine which as follows work but this is applying a band-aid fix and might be overkill.

if (!IPAddress.TryParse(ip, out IPAddress parsedIp))
            {
                switch (ip)
                {
                    case "0.0.0.0":
                        parsedIp = IPAddress.Any;
                        break;
                    case "0:0:0:0:0:0:0:0":
                    case "::":
                        parsedIp = IPAddress.IPv6Any;
                        break;
                    case "localhost":
                    case "127.0.0.1":
                        parsedIp = IPAddress.Loopback;
                        break;
                    case "0:0:0:0:0:0:0:1":
                    case "::1":
                        parsedIp = IPAddress.IPv6Loopback;
                        break;
                    default:
                        IPAddress[] serverAddresses = Dns.GetHostAddresses(ip);
                        parsedIp = serverAddresses[0];  // Dirty hack.
                        break;
                }

                client = new TcpClient(parsedIp.AddressFamily);
            }
            else
            {
                // We could not parse the IP address ... maybe it's a hostname
                // like DESKTOP-ABC123 or gameserver.mirror-networking.com
                // So we'll let the TcpClient do it's job.
                client = new TcpClient(ip);
            }

See the private channel for more information about this. Replicated with many developers and locally here.

::ffff: what dose it mean?

I get this string when I use server.GetClientAddress(int id);

What does ::ffff: mean? It will change in different situation?

Exception is thrown when client is disconnected from server.

The exception is thrown every time the client disconnects from the server.
NOTE: I'm the running on Linux platform with the NET Core version: "2.2.207".

Exception thrown: 'System.PlatformNotSupportedException' in System.Threading.Thread.dll Server client thread exception: System.PlatformNotSupportedException: Thread abort is not supported on this platform. at System.Threading.Thread.Abort() at Telepathy.ThreadExtensions.AbortAndJoin(Thread thread) in C:\Projects\PartyServer\PartyServer\Messaging\Transport\Telepathy\ThreadExtensions.cs:line 14 at Telepathy.Server.<>c__DisplayClass8_0.<Listen>b__1() in C:\Projects\PartyServer\PartyServer\Messaging\Transport\Telepathy\Server.cs:line 150

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.