derek-r-s / light-reflective-mirror Goto Github PK
View Code? Open in Web Editor NEWA relay transport for mirror.
License: MIT License
A relay transport for mirror.
License: MIT License
N2N is good choice to let mirror built-in, what do you guys think about it?
Hi, i've setup relay server exactly the way showed in the youtube videos, but no luck inside Unity to connect to relay server. Please can you send me the discord changel to see what could be? thanks!
The read me says it uses the MIT license but I cannot find it in the repo iself. I assume it is missing?
Hi! When I try to run dotnet lrm.dll it throws an json parse error (LRM.runtimeconfig.json file) In Linux machine
Using LRM v11 and Mirror v42.2.12(current version in assetstore).
When host and client are in the same LAN.(Using kcp direct connect)
Hosting server on like 192.168.0.100,
and client on like 192.168.0.101,
after clicking join server which serverId get from the relayServer,
console show the following log:
Is the LRM not compatible with the LAN or is there a way like network discovery to connect in LAN?
Hi Derek-R-S,
I have some issues using the server on a remote (linux) machine,
The server dll starts e shows up all the standards messages, it receives client connections as well.
The things gets weird on client side when starting mirror as a host/server and the LRM transport does not receives back the "Server Id" from the relay.
Tried on your machine [34.67.125.123] and on a local network machine and it works as expected (very well btw!)
so... is there any config I should pay attention on for a linux (debian10) server?
Thank you for the great project.
It's really good starting point for me.
Absolutely love this asset and the YouTube tutorials, thank you so much for putting them together!
I'm trying to set up an AWS relay server and am not having any luck just yet. I've got LRM installed and running on the EC2 instance without any problem, and I've allowed incoming traffic from ports 7776, 7777, and 8080 on the server.
While following the Unity tutorial, I'm getting a KCP timeout error in Unity after 10 seconds: KCP: Connection timed out after not receiving any message for 10000ms. Disconnecting.
I've tried pasting both the public and private IP addresses of the EC2 instance into the LRM Server IP field with the same result. Can you think of anything I might be missing or if there's something AWS-specific I should be doing?
Thanks again, really appreciate your work on this!
Hello,
I am developing, I have the node server which is launched on debian by "screen -dmSL servrelay dotnet LRM.dll".
And since these last days, the server crashed randomly or so during my test and debug but I did not make any changes in LRM, only listed my game.
I have UseEndpoint, EndpointServerList and EnableNATPunchtroughServer enabled in the config
and i use KcpTransport
this is my log (sorry i have only that):
Unhandled exception. System.ArgumentOutOfRangeException: Length cannot be less than zero. (Parameter 'length')
at System.String.Substring(Int32 startIndex, Int32 length)
at System.Net.HttpListenerRequestUriBuilder.GetPath(String uriString)
at System.Net.HttpListenerRequestUriBuilder.BuildRequestUriUsingRawPath()
at System.Net.HttpListenerRequestUriBuilder.Build()
at System.Net.HttpListenerRequest.FinishInitialization()
at System.Net.HttpConnection.OnReadInternal(IAsyncResult ares)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.Sockets.SocketAsyncEngine.System.Threading.IThreadPoolWorkItem.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
Thanks for help
This would be wonderful to see this amazing unity package on OpenUPM.
My WebGL game crashes when making a request to https://relay.example.com:8080/api/compressed/servers
(where relay.example.com
resolves to a digital ocean vps).
Visiting the url through firefox shows the following:
Secure Connection Failed
An error occurred during a connection to relay.example.com:8080. SSL received a record that exceeded the maximum permissible length.
Error code: SSL_ERROR_RX_RECORD_TOO_LONG
- The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
- Please contact the website owners to inform them of this problem.
If I visit the url with http
instead of https
, everything seems to be fine.
Are there settings in LRM/Mirror that I'm missing that can help with this?
How can I use load balance
Why Room.currentPlayers add 1?
public int currentPlayers { get => clients.Count + 1; } // player count
Would be great having an endpoint for server statistics.
Evn.
Client to Server transport : SimpleWebTransport
Direct connection module transport : KcpTransport
Relay Server hosted on a NAS's VM with public ip address
LightReflectiveMirrorTransport component setup
Relay Server port : 7000
NAT punchthrough port : 7001
Kcp transport port : 7777
SimpleWebTransport port : 7778
The Direct connection works great while all client under same LAN.
But if I change one of my unity editor into iPhone's hotspot network and try to connect to host.
The direct connect will failed.
Host console will show msg "Direct Connect Client Connected" and after a while and new msg "Kicked direct connect client." shows.
Client show msg "KCP: Connection timed out after not receiving any message for 10000ms. Disconnecting."
Hello! I've followed both tutorials and put everything on an EC2 instance on AWS, but nothing seems to be happening. I state that I have a lot of inexperience on the BE side, so I might be doing something wrong.
Nothing seems to happen when I connect to Unity, and doing some Debugging I noticed that this request returns Method Not Implemented. Any idea what I might have been doing wrong?
Use the ver in Release 9.0.
The ServerId on LightReflectiveMirrorTransport component didn't match the value return by the API /api/servers.
For instance, on my Unity host the ServerId value is 19, but the /api/servers return value like this:
[ { "serverId": 963094828, "hostId": 22, "serverName": "Squid_4145's Room", "serverData": "Map 1", "isPublic": true, "maxPlayers": 6, "clients": [] } ]
Seems the hostId is fill into the ServerId on host's LightReflectiveMirrorTransport component.
I'm using v12 and one relay server, and the image attached is (likely) outputted to the console when it crashes.
By crash/freeze, I mean the lobby stops sending and receiving traffic. No disconnect packets are sent from what I've gathered, but the relay itself is still functional, but people just need to restart their lobbies.
I am also using a piece of software called pterodactyl to "host" the web panel for the console, and I'm using AWS Lightsail to host it.
If you need to quickly contact me, my Discord is Virtual#7802
EDIT#1:
After looking through the source code of KCP and the relay, it seems it's just an issue with KCP, so I am going to switch the relay to use websockets or something else and see if that fixes it.
Since there is usually already a Json library is in a Unity project. (But maybe not JSON.Net)
I wish to let user use their Json Library to deserialize json in LRM.
Currently I do some modify like this
Add the delegate in LightReflectiveMirrorTransport
public static System.Func<string, List<Room>> OnDeserializeRoom;
public static System.Func<string, RelayAddress> OnDeserializeRelayAddress;
Then register the delegate. In my case I use LitJson.
(Some script execute before Transport init)
public override void Awake()
{
LightReflectiveMirror.LightReflectiveMirrorTransport.OnDeserializeRoom += (result) =>
{
return LitJson.JsonMapper.ToObject<List<LightReflectiveMirror.Room>>(result);
};
LightReflectiveMirror.LightReflectiveMirrorTransport.OnDeserializeRelayAddress += (result) =>
{
return LitJson.JsonMapper.ToObject<LightReflectiveMirror.RelayAddress>(result);
};
}
I have done this modify in my local branch, if you also think this is a good idea, I will make a pull request.
Or any suggestion about the implementation is welcome.
Hello,
On Ubuntu 18.04 when I run sudo dotnet LRM.dll there is an error about an endpoint service.
Starting Endpoint Service... Server: listening port=7777
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.HttpListener'.
at System.Net.HttpListener.CheckDisposed()
at System.Net.HttpListener.Stop()
at Grapevine.RestServer.Start() in C:\Users\scott\source\grapevine\src\Grapevine\RestServer.cs:line 174
at LightReflectiveMirror.Endpoints.EndpointServer.Start(UInt16 port)
FAILED
Please run as administrator or check if port is in use.
When the Client in Host mode is disconnected, LightReflectiveMirrorTransport._isClient = false will be executed first. When LightReflectiveMirrorTransport.DataReceived is executed and opcode == ServerLeft _isClient is already equal to false, the OnClientDisconnected event cannot be called normally.
LRM version: BleedingEdge-v13.0
Mirror version: v67.1.0
There is a typo in config.json - which should probably be updated at some point. This might require support for both the correct and incorrect spelling to prevent breaking existing LRM servers.
"EnableNATPunchtroughServer":
"NATPunchtroughPort":
Should be:
"EnableNATPunchthroughServer":
"NATPunchthroughPort":
Latest change breaks connecting to relay:
```
private void OnEnable()
{
clientToServerTransport.OnClientConnected = ConnectedToRelay;
...
If I have "Connect on Awake" checked then `ConnectToRelay()` is called before `OnEnable()` so `ConnectedToRelay()` is never called and LRMTransport doesn't know it was actually connected(_connectedToRelay remains false).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.