Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

DarkRift Networking 2

Discussion in 'Assets and Asset Store' started by Jamster, Feb 7, 2018.

  1. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    Sorry, I meant the UWP app manifest not the DarkRift server configuration! :)
     
  2. biuyau

    biuyau

    Joined:
    Jun 15, 2013
    Posts:
    5
    Hi Jamster, thanks for the great work.
    I am still figuring out the basics of Darkrift2.

    Meanwhile, I hope you (or someone) could spare some time for a stupid question here:
    I would like to use the logging system you have written, but I have no idea how to use it without writing plugins and using WriteEvent(). Is there a way to use the logging system anything anywhere, say at the client side or a custom server build tutorial introduced in Materia Game, or simply a callback implemented in a monobehaviour and registered to the ClientConnected event.

    Thanks for your kind attention.
     
  3. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    Unfortunetely the log system is very much designed to be used solely by plugins currently, in fact when using a Unity based server, the logging system is setup by default to just forward everything to Unity's logging system!

    As you say, you can make use of it by building a plugin which simply sends log lines to DarkRift if you really want but that's probably not ideal!
     
  4. biuyau

    biuyau

    Joined:
    Jun 15, 2013
    Posts:
    5
    Thanks for the reply!
    so i will probably stick on to making the server logic by combining different plugins
    how about client side? should I use other logging system for the client side application?

    another additional question:
    probably for client side, do darkrift 2 supports auto retry connection? or do we need to monitor the connection state for disconnection and reconnect manually when the network / server resume?
    Thanks in advance.
     
    Last edited: Dec 2, 2019
  5. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    I'm not too informed on logging in Unity I'm afraid, the default Debug class provides the basics and will output to file but I'm sure there are better systems on the asset store/GitHub if you go hunting!

    DarkRift does not currently, you'll get a Disconnected event when the client loses connection and can then try to reconnect to the server yourself if you need. You'll want to store some token on the client to reauthenticate as that client when you reconnect!

    Jamie
     
  6. biuyau

    biuyau

    Joined:
    Jun 15, 2013
    Posts:
    5
    Thanks very much! You are so nice :)

    yet another question...
    If I say...I have a server configured with 3 networklisteners with port 4296, 4297 and 4298 respectively, and I got multiple clients connect to the server through these different ports with different purposes, so probably there will be different plugins with specific API handling the requests/messages/etc from the clients respectively. In such case, how would I tell from the server that which port does a client connect through? I found that the ClientManager accessible by Plugin only return a single port (probably the first NetworkListener). Could I access the specific listener that handle the client that is just connected? Or should I perhaps send a message to the server from the client once connected to tell which type of the client is? I know we could distinguish/filter an action or message by the message tag, but other than that, is there a way to tell the type/port/listener of a specific client, so that we could limit the action/request or even refuse the connection before further handling the first message?

    Thanks again.
     
  7. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    Hmm. You are quite right, there isn't actually a way of working out which listener the client is on, and there probably should be!

    If you could create a feature request here that would be great!

    The best workaround I can think of for now is that you could poll IClient.GetRemoteEndPoint(name) with different names until it doesn't error (e.g. a bichannel listener would response to only 'tcp' or 'udp'), however that is awful. Perhaps that get you till the next update!
     
    BitPax likes this.
  8. Jorge_fmsp

    Jorge_fmsp

    Joined:
    Dec 4, 2019
    Posts:
    1
    Hello, I have some questions:

    We are a team already using DarkRift networking for a project in Unity but we're analyzing the advantages of upgrading to the Pro version; principally the matchmaking plugin that it offers; therefore, we have some inquiries:
    (As important note, the multiplayer is duel-type matches, meaning 1v1)
    • What are the advantages of using the matchmaking plugin over creating an algorithm in the free version? Multithreading? Memory efficient?
    • We're trying to make different lobbies and inside them make the match making. What is the best practice to do it using the plugin? Does the plugin can adapt to have multiple lobbies and inside them make the match between players?
    • Regarding different lobbies, what would be best practices or tips for the development of this? We already have code for this but it's a simple set of lists, which depend on a parameter value to identify to which list the player belongs to.
     
    BitPax likes this.
  9. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    Hey @Jorge_fmsp!

    1. Using the matchmaking in DarkRift should save you a lot of time in development primarily. It's designed to be very efficient and runs fully multithreaded (even if your logic isn't) and its built so that you can add your own matching logic really easily. It also supports things like matching groups together, though I imagine your won't need that for 1v1 matches!

    2. The DarkRift matchmaking will ignore any matches with a suitability score below a set threshold; so when comparing two players, if they're in different lobbies, you can return a score like 0 and DarkRift won't even consider matching them together. The same thing works for different gamemodes etc. if you need that!

    3. It will depend a little bit on your architicture but I imagine any solution will look similar to what you have already. In the end 'lobbies' conceptually are just groupings of players, hence a set of sets is a very good representation for them!

    Jamie
     
    BitPax likes this.
  10. sid999_2015

    sid999_2015

    Joined:
    Jun 15, 2015
    Posts:
    9
    So finally got round to a bit more testing and on startup I get an error in the DarkRiftServer constructor related to Mutex and "Specified method is not supported" (https://github.com/DarkRiftNetworking/DarkRift/issues/89).
     
  11. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    What platform are you trying to run on? The latest version 2.4.5 has a fix for this however is not on the asset store (we skipped a few versions due to stability issues in previouis version on 2.4.x!), you can get it here.

    Jamie
     
  12. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    DarkRift 2019 Development Survey

    To make sure DarkRift continues to serve its users as best as possible, we'd really appreciate if you could take some time to fill out this survey to make sure we're focussed on the things you want. Last year's answers made for very interesting reading and helped shape how we worked on DarkRift this year, the answers you leave will go directly to helping us prioritise the next year!

    https://forms.gle/WnHwKNzwyGBhws5K9

    Jamie
     
    BitPax likes this.
  13. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    50
    So I recently purchased DarkRift 2 Pro version recently to build my game on it. I'm new to multiplayer stuff but DarkRift 2 looks perfect for what I'm trying to do.

    When accessing a database like MySQL, say for account login, does it require a middle man like PHP? Or can DR2 access the database directly?

    Also where should I be looking for a login, database access, and matchmaking examples? And what should I keep in mind for security? :)

    Pretty excited to try this out!
     
    Last edited: Jan 3, 2020
  14. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    It's up to you which you choose! There's advantages to both really. Accessing the database directly will give you a slightly faster result and means a lot less infrastructure to maintain, but means that if the DarkRift server is compromised the attacker can do a lot more so you'll want stricter restrictions on your database users.

    Theres a few community projects on GitHub that cover the basics of those I think, things like MSF have authentication. Matchmaking is covered in the docs since you have pro and databases can be accessed using normal C# DB wrappers.

    Security wise is pretty simple, keep updated and follow the usual best practices for running servers/database really!
     
    BitPax likes this.
  15. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    50
    That's really helpful! Thanks!

    Can I assume the example is pretty secure? The MSF repo had more plugins for DarkRift, is it ok for me to use those? The readme said it's obsolete?

    How can you tell if it's sample code for DarkRift 1 or DarkRift 2 when looking at a project on github?
     
    Last edited: Jan 5, 2020
  16. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    I haven't heard from the author in a while so my best guess is that he's moved onto different projects that don't use DarkRift, looking his GitHub. Perhaps create an issue on the repository and see what he says!

    Plugins for DR2 will have these two lines (or very similar) which are mandatory in DR2 but not DR1!
    Code (CSharp):
    1. public override Version Version => new Version(1, 0, 0);
    2.  
    3. public override bool ThreadSafe => true;
     
    BitPax likes this.
  17. Privateer

    Privateer

    Joined:
    Jun 5, 2016
    Posts:
    21
    Does DarkRift support discovery internally?
     
  18. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    What type of discovery are you looking for?

    If you're looking for a 'game browser' type thing then it doesn't support this out of the box no. DarkRift is a lot lower level then things like Photon which allows it to be faster and more flexible and the cost of more onus on the user to build things like that themselves!
     
  19. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    50
    Are there any tutorials on how to setup DR2 on a Linux Ubuntu VPS (Virtual Private Server) like Digital Ocean?

    I'm currently comparing it to Mirror Networking (https://assetstore.unity.com/packages/tools/network/mirror-129321) and wanted to try both out before making a decision.

    I think DR2's weak point is a lack of a ton of usage code examples and tutorials. It would probably be a game changer if there was a lot more.

    EDIT: I found a tutorial that's really helpful and thought I should post it here:
     
    Last edited: Jan 14, 2020
    LostPanda likes this.
  20. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    Nice tutorial!

    Someone contacted me recently following this tutorial. The only difference is you need to change the port from 26000/udp to 4296/udp and 4296/tcp as it's actually written for another system!

    There's also a tonne of resources on the wiki if you ever need!
     
    BitPax likes this.
  21. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    50
    I'm confused. Wouldn't it be slower using Darkrift inside a virtual machine like Docker? What are the benefits?

    I'll take a closer look at the tutorial links. Appreciate the help!
     
    Last edited: Jan 16, 2020
  22. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    Not really, docker containers these days have negligible performance costs in almost any case. Have a Google, there's wealth of information!

    The advantages are that you can create and destroy servers incredibly easily and even on the fly with much less extra code, know that your test environment is exactly the same as your prod environment, can easily scale your infrastructure, any intrusions in your system can be better contained etc.! I'm a big proponent for docker though, so I'd almost always choose it (and Kubernetes) over a bare metal server.
     
    letscodestuff and BitPax like this.
  23. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    50
    I've been going through the tic-tac-toe tutorial twice now and slowly wrapping my head around how the plugin system works. It's slow going at the moment but I guess progress is progress! (Would be nice if there were wrappers to make things simpler maybe?) I have a few more questions though. :)

    Are certain versions of DR2 more stable (battle tested) than others?

    Where do I have to look to see what version of DR2 I currently have?

    Is there a list of commercial games that use DR2 that I can check out?
     
  24. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    2.3.1 and 2.4.5 are the two versions most people use, so I'd stick to those two personally! Don't use 2.4.0 - 2.4.4 as they were very badly unstable unfortunately.

    You can see the version it at the top of the log files (assuming you've got a default configuration) or you can find it in the properties of the DLLs (on Windows, right click it -> properties -> details I think).

    There's also a DarkRift CLI tool for making it easier to manage versions if you want!

    I don't have a didfinitive list becase I don't tend to get told about them sadly. There's a showcase channel in the Discord that a few people have shared their game in but I don't think many people use it.
     
    BitPax likes this.
  25. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    50
    That's really helpful! Thank you!

    What additional functionality does 2.4.5 have compared to 2.3.1? Are there patch notes I can check out based on version?
     
  26. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    Here's all the patch notes!

    The major points are big performance improvements (up to 40% according to some users!), new documentation website, round trip time measureing, and a lot of fixes.
     
  27. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    50
    I guess I should use 2.4.5? It's probably going to take a while but as soon as I have something to share I'll post it here. Thanks for all the help!
     
    Last edited: Jan 19, 2020
  28. BitPax

    BitPax

    Joined:
    Oct 4, 2019
    Posts:
    50
    I'm slowly making progress. I have a question about how to set it up so things are more modular. Assuming I'd have a base server plugin class that I would inherit from, I'd like to have a lot of little plugins rather than one huge one.

    I'm assuming the plugin would require a consistent ThreadSafe and Version variable.

    Code (CSharp):
    1. public override bool ThreadSafe => false;
    2. public override Version Version => new Version(0, 0, 1);
    Does it make sense to always have OnClientConnected and OnClientDisconnected too?

    Code (CSharp):
    1.  
    2.  private void OnClientConnected(object sender, ClientConnectedEventArgs e) {
    3.             WriteEvent("Client has connected to the server. Connection ID: " + e.Client.ID, DarkRift.LogType.Info);
    4.         }
    5.    
    6.         private void OnClientDisconnected(object sender, ClientDisconnectedEventArgs e) {
    7.             WriteEvent("Client has disconnected from the server. Disconnect ID: " + e.Client.ID, DarkRift.LogType.Info);
    8.         }
    9.  
    I'd like to have many small plugins rather than one that handles everything. I'm thinking I'll inherit the base class and each plugin will do it's thing, like authentication, lobby, room management, matchmaking, etc. Which parts of a DR2 plugin are pretty much required?

    EDIT: Additional question! When using DarkRiftClient.Connect() with a try/catch via a login button and it fails, it stops the execution of the Unity client. What's the best way to set this up when using a login button to connect to the server?
     
    Last edited: Jan 27, 2020
  29. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    Plugins don't need to have consistent threadsafe/verison values, for example the ones definied inside DarkRift are all threadsafe but that doesn't mean yours need to be. If you set one to be not threadsafe however threading is disabled for all.

    OnClientConnected and OnClientDisconnected methods might be useful but not every plugin may require them. I would try building them on the basic Plugin class and only abstract out functinality when there's obviously functionality to be abstracted. Don't try and abstract for the future because you'll probably be wrong!

    DarkRiftClient.ConnectInBackground sounds like the method you want!
     
  30. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    DarkRift 2.5.0 is now available on the website!

    This version has a number of new features that I was waiting to release with server clustering such as faster colouring of log lines, security fixes, significant improvements to testability of plugins, and a number of fixes around network listeners and the default bichannel listener! It also has a recently discussed feature for differing TCP and UDP ports on the bichannel listener.

    Unfortunately this update does not have server clustering included, this has been delayed until a future release so that these fixes and improvements aren't further delayed. It really pains me to break promises like this, but I want to ensure DarkRift isn't held back from progressing by one tricky feature.

    The update is already available on the website here, or through the DarkRift CLI tool!
    https://www.darkriftnetworking.com/DarkRift2/Releases/Free/2.5.0.unitypackage
    https://www.darkriftnetworking.com/DarkRift2/Releases/Pro/2.5.0.unitypackage?invoice=<your invoice number>

     
    LostPanda likes this.
  31. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    DarkRift 2.5.0 is now available on the Asset Store!

    Also, if you haven't already, please fill out the DarkRift development survey! It closes soon!
    https://forms.gle/WnHwKNzwyGBhws5K9
     
    LostPanda likes this.
  32. biuyau

    biuyau

    Joined:
    Jun 15, 2013
    Posts:
    5
    Hi
    I have tried the serialization provided by darkrift2, and I would also like to serialize some class instances as setting files (which hopefully be more readable). I wonder if darkrift2 could provide an API to get the serialized object that is also capable/feasible for saving as files.
    Meanwhile, I am trying to add Json.net to increase the readability of serialization, and also try to figure out the performance difference between sending Json string and darkrift object. However, on the server side, I have no idea on where to put the external newtonsoft.Json.dll, i have tried putting it in the lib or plugins folder, but different runtime errors occured.
    I would like to know where should I put a 3rd party external dll that a custom darkrift plugin is refering?

    thanks in advance!!
     
  33. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    Hi biuyau,

    On the DarkRiftWriter/DarkRiftReader classes there are WriteRaw and ReadRaw methods you can use to do just that! You'll find that the DarkRift serialization is significantly faster than JSON however so you probably only want to send one off objects with it!

    You should be able to put it in a folder called "Plugins/Lib" (i.e. a Lib folder along side your plugin). Make sure that the DLL is build for the same platform you're using. If you're still having touble paste the errors here and I'll have a look!
     
  34. biuyau

    biuyau

    Joined:
    Jun 15, 2013
    Posts:
    5
    Thanks for the prompt reply!
    now I could settle the dll in the lib folder, and I would try further debugging...which I think the error may actually come from dotnet setting..
    As you have mentioned that DarkRift serialization is faster for sending, so probably I would use Json or other serialization just for local saving!?
    I will surely come back to you if I got other question, thanks again
     
  35. ArthurCBSouza

    ArthurCBSouza

    Joined:
    Feb 1, 2013
    Posts:
    3
    Hi folks,

    I considering to buy a pro version for use in my game ( instead to use Photon ), but i have a question.
    Someone was test DarkRift for consoles ( PS4, XBOX, NS ) ?
    May have any reason for not work ?

    Regards
    Arthur
     
  36. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    A few people have used it on console fine but I don't recall which consoles they tried! I'm not aware of any reason DarkRift wouldn't work on a console but you can always ask in the Discord and try and find people who are already using it on those platforms if you want extra confirmation!
     
  37. travakin

    travakin

    Joined:
    Apr 20, 2012
    Posts:
    7
    Hi,

    I am having problems with an error similar to one which was posted here before, except mine is a Windows x86/64 project. I can connect to my server on localhost or to another machine over the local network, but when my testers attempt to join the game over the internet, they get the error:

    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.

    The port is forwarded correctly on the server machine, and it is receiving both UDP and TCP.

    Here is my DarkRift XML Listener configuration:


    <listener name="DefaultNetworkListener" type="CompatibilityBichannelListener">
    <settings
    address="0.0.0.0"
    port="47777"
    ipVersion="IPv4"
    />
    </listener>


    And my gameobjects with the server and client scripts:

    upload_2020-3-21_16-5-17.png

    upload_2020-3-21_16-4-35.png

    Here is the script I am using to initialize the client:

    Code (CSharp):
    1. public class InitializeDarkRiftClient : MonoBehaviour{
    2.  
    3.     [SerializeField]
    4.     UnityClient darkRiftClient;
    5.  
    6.     private void Awake() {
    7.  
    8.         string ip = "127.0.0.1";
    9.  
    10.         if (ClientData.ConnectedIP != "localhost")
    11.             ip = ClientData.ConnectedIP;
    12.  
    13.         IPAddress address = IPAddress.Parse(ip);
    14.         darkRiftClient.Connect(address, 47777, IPVersion.IPv4);
    15.     }
    16. }
    17.  
    ClientData.ConnectedIP is set by a UI element..

    I really appreciate any assistance you can provide!

    Thanks,
     
  38. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    Hey!

    That error sounds like TCP is able to connection but UDP isn't able to connect afterwards. To confirm this you'll be seeing messages at 'Trace' log level from the server saying connections have timed out (you can change the log level that go to the unity console in the configuration file).

    I'd double check the port forwards to make sure UDP is definitely forwarded for the correct port and maybe check there's no firewall rules stopping it (a little tricky with Windows if I remember correctly).

    Jamie
     
  39. travakin

    travakin

    Joined:
    Apr 20, 2012
    Posts:
    7
    Hi Jamie,

    The weird thing is that, upon further investigation, the connections actually work when the server is built as a standalone application, but not in the editor or as a headless instance. In either of the latter cases, one player can connect but any others can't (even if they're on localhost or LAN).

    I can check the log files when I get a chance to see if there is anything going on there...

    Thanks for your time!
     
  40. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    Hmm, that sounds like it could be a firewall thing, perhaps it's somehow got set to block UDP to the Unity Editor?
     
  41. Shablo5

    Shablo5

    Joined:
    Mar 2, 2015
    Posts:
    36
    Any chance you know of any games using darkrift 2 you could point me towards ?
     
  42. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
  43. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    DarkRift 2.6.0 is now available on the website!

    This version primarily fixes some major issues with packet fragmentation on TCP that were introduced with the listener rewrite in 2.5.0. Additionally it adds a new health check plugin which exposes a basic HTTP server on port 10666 with which you can query the server's health in services such as docker/kubernetes.

    MessageReceivedEventArgs are now recycled and reused on both the server and client to reduce garbage and improve message throughput. Note: this may cause some issues in projects upgrading if you store references to these objects outside of your event handlers.

    A new logging system has been added to replace the WriteEvent method. This now allows you to pass a Logger object into children so child classes in your plugins can log more easily, makes logging more terse and helps testability!

    Lastly there's been a wealth of other bug fixes and quality of life improvements, check out the changelog below!

    The update is already available on the website here, or through the DarkRift CLI tool! https://www.darkriftnetworking.com/DarkRift2/Releases/Free/2.6.0.unitypackage https://www.darkriftnetworking.com/DarkRift2/Releases/Pro/2.6.0.unitypackage?invoice=<your invoice number>

     
    LostPanda likes this.
  44. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    DarkRift 2.6.0 is now available on the Asset Store!
     
    LostPanda likes this.
  45. chrisx84

    chrisx84

    Joined:
    Nov 9, 2011
    Posts:
    84
    hey cant compile the server code from the source zip in .NET 4.x
     
  46. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    What's the issue? Getting an error?
     
  47. chrisx84

    chrisx84

    Joined:
    Nov 9, 2011
    Posts:
    84
    hey ya, i even reinstall unity 2019.3 thinking it was me. i copied the source zip to outside of the project folder, unzip, open the .sln, compiled client and got a error pop up as shown in the pic below, then i tried a full solution compile and the console outputted
    Severity Code Description Project File Line Suppression State
    Error NETSDK1045 The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.1. DarkRift.Testing C:\Program Files\dotnet\sdk\2.1.509\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 137

    by the way i did buy the pro version

     
  48. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    The popup error is because at the top you ahve DarkRift.Client selected for some reason (DarkRift.Client can't be run standalone!). Change that to DarkRift.Server.Console.

    The second error could be because of the versions of .NET installed on your machine. I didn't think anything targets .NET 3.1 but might be worth installing that or making sure all the versions are set to those you have installed :)
     
  49. Risky_Crash

    Risky_Crash

    Joined:
    May 26, 2020
    Posts:
    1
    Hey Jamie! Wanted to start by thanking you for making Darkrift and your continued support of it.

    I am currently working on a voxel based game with an authoritative server and I'm running into a weird issue. I send the map data to newly connected clients as a Darkrift message that contains the dimensions of the map as UInt16s followed by an array of bytes (up to a couple hundred kilobytes) that represent block id's. This method works perfectly when I host and connect to the server on localHost, but not when I try to connect to my external IP (with port forwarding). The rest of the game (movement/etc) works fine through the external IP, but the map doesn't load and I get a confusing error. Here is the error text, as printed in Unity on the client side


    Disconnected from server, error: Success


    Disconnected from server, error: Success

    UnityEngine.Debug:Log(Object)

    DarkRift.Client.Unity.UnityClient: Client_Disconnected(Object, DisconnectedEventArgs) (at Assets/DarkRift/DarkRift/Plugins/Client/UnityClient.cs:440)

    DarkRift.Client.DarkRiftClient:DisconnectedHandler(SocketError, Exception)

    DarkRift.Client.NetworkClientConnection:HandleDisconnection(SocketError)

    DarkRift.Client.BichannelClientConnection:HandleDisconnectionDuringBodyReceive(SocketAsyncEventArgs)

    DarkRift.Client.BichannelClientConnection:AsyncReceiveBodyCompleted(Object, SocketAsyncEventArgs)

    System.Threading._ThreadPoolWaitCallback: PerformWaitCallback()


    Any insight or help you can give me that would point me in the right direction would be appreciated. If there's any more details I can tell you that might help, let me know and I will provide them.

    Again, thank you for support.
     
  50. Jamster

    Jamster

    Joined:
    Apr 28, 2012
    Posts:
    1,065
    This looks very much like a bug in 2.5.0, try upgrading to 2.6.0 and I think that will fix it for you!
     
unityunity