Search Unity

Darknet

Discussion in 'Multiplayer' started by alanis, Oct 8, 2009.

  1. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Additional Resources (Examples)
    Requires that you own and have downloaded the .Net assembly for DarkNet. (not the one here in the forums) This is a Visual Studio 2008 project that includes a sample server and a sample client (although I was to lazy to make the send button work in the client right now because Unity is my goal, not Windows)

    Also, DarkNet is currently windows only and this zip obviously does not include any DLL's from the DarkNet set, you have to buy it to use DarkNet.
     

    Attached Files:

  2. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    More candy for the community on this project, a Unity package that uses the dll made for Unity, screenshot shows what you see from the debug console, you use this in conjunction with the above VS 2008 server, and with both, you have a Unity client talking to a DarkNet server :)

    The level of difficulty for this project, Beginner.
    This is the absolute minimum you need to get up and running. Hopefully he can update the contents of the packages on TheGameCreators or his own store with the latest of the library files. I will not supply them with these packages, you have to get them.
     

    Attached Files:

  3. alanis

    alanis

    Joined:
    Mar 4, 2009
    Posts:
    99
    Hey zumwalt,

    I am glad you got it working ok for you.

    I was checking the darknet server source file, this is for the pro version of VS2008 right?

    tried to open the solution on the express version of VS2008 but wrong version error gave me express.

    So I assume is for the pro.

    I will check it out on my developer machine windows box which has the VS2008 pro version installed. but atm is not functional , my power supply is fried, got to wait for new power supply to arrive.

    anyways please post here your experiences with darknet-unity and how you like it and what you think about it. is it good enough for mmo?
    some sort of a review will be great if you have the time to evaluate it.
    I am exited already. :D

    I see that dreamora was going to give it a try, please post your thoughts aswell if you can.


    thanks again
     
  4. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    You do need Unity pro, but for vs 2008, just browse into the project for the server, grab the cs filed and make your own form in c# then copy/paste the appropriate lines. I will see about pulling out an older machine I have and put express on it then test but I am pretty sure that will work, as far as is it good enough for an MMO, he has some info about someone using it already for a space based MMO, so I don't see why not.

    I am going to do some stress testing with it over the next few nights then will see about setting up a master server using it, just for kicks, and if that works out well, I'll post IP info and probably a VS 2008 project for it as well. Debating on using MySQL for the database end of it or a simple lightweight database for demo purposes. FYI you also need the C# version of his DLL which you can only get by purchasing the product. He distributes a C++ version, a C# 2008 version and a DBPro version, still waiting to hear back from him when the finalized glossy Unity version is up and ready to be downloaded, using the last known version he posted in the forums at the moment.

    Edit:
    come to think of it, it should surely work because DarkGDK is express only and this is also made to work with DarkGDK I think
     
  5. alanis

    alanis

    Joined:
    Mar 4, 2009
    Posts:
    99
    Thanks,

    OOPS, my bad, I tried to open it with C++ so thats why it gave me version error, sorry :oops:

    ok so i finally got it to open with express vs2008 C# :D

    it throws me error location not trusted when I open it, but it open ok. tried to compile but throws me bunch of errors:
    Error The name 'mn' does not exist in the current context in Form1.cs

    Warning 67 Could not resolve this reference. Could not locate the assembly "MikeNet". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. DarkNetClient

    but I assume this is due of missing libraries so I guess I need to purchase darknet and hoping this error will go away.

    It would of being great if Michael will do a trial version for darknet so people can evaluate before purchase. something like limiting connections to the server or 30 days trial version. I mean price wise is not bad at all, but a trial will be even better before purchase.

    anyways keep us posted.

    Sad to hear it currently only works on unity pro, I hope Michael can come up a solution for indie version of unity

    hey, regarding the master server I thiink it will be a great idea, specially add mysql so we can see the power to it.

    signme up if you need testers, I can help you test connect to the master server from my end.


    cheers
     
  6. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    You are correct, this server uses the MikeNet.dll that comes with the purchase of his package, notice that if you look at your reference list, that the MikeNet.DLL has a yellow warning because the file is missing, so once you purchase it, and download the .Net version, take the DLL in the ZIP that you get and make a reference to it in the project, then all should be well. I did not include any of the DarkNet libraries with any of these packages I have made, you have to buy his stuff to use his stuff :)

    Once you have purchased, downloaded, unzipped, then in the project, right click on References, click on Add Reference, click on the Browse tab, navigate to where you decompiled the zip that includes the .NET assembly for DarkNet, choose the only DLL in the folder which should be MikeNet.dll, click on OK. Now simply build the solution and run it, should give you a form like the image above, click on Start Server and you should see that it start up a basic DarkNet server. You MUST click on stop server instead of just plainly closing the form (or update the code so that it does the proper shutdown on form closing event) otherwise you will get an error since you are closing out of the application without shutting down DarkNet hook.

    I'll post up a test client build to see how a deployed version will work for people, something simple and generic and get some web logs going.
     
  7. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Sweet, great thing :)

    Small recommendation from my end: As long as MikeNet blows up insanely due to policy issues, I would recommend to change the C# projects to not build for any CPU but build for X86.
    Took me a bit (+ fusion log) to realize that it was x86 / x64 related that it crashes on startup when it tries to use the assembly.
     
  8. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Noted and change made to the program configuration, I have added an app.config on my end, this will house a few keys that will need manually changed based on your webserver and mysql server.

    To keep this as simple as possible, I will also create a MySQL script that you can use to create a table in the database of your choice on the web server, then you will supply the app.config a username, password and database for the server to talk to. Since the client side will have no direct access to the database, it will request stats from the database through calls to the server, this can then feed back into Unity.

    Let me know if you have any issues with the DarkNet.CS file and I will fix any bugs you come across that I can fix. As long as it doesn't have anything to do with any library direct problems that is :) Those I will turn over to him, but since I did the initial conversion of the cs file for Unity, I'll take first wack at fixing any syntax issues :)
     
  9. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Yeah direct database connections, unless its berkley or sqlite, are a security nightmare so good basic approach there :)


    Okey. Will naturally also send you corrections / fixes on things should I find them :)

    So far it seems to work nicely.

    The only thing I had to realize aside of the VC# project config thingy was that localhost / 127.0.0.1 don't work.
    That localhost does not work is nothing new to me, never did on my Vista64 system, potentially due to the firewall. But at least so far 127.0.0.1 worked but I got an error (code 10049) from DarkNet. No problem though as my network works with in LAN loopback as well as with global loopback.
     
  10. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Yea, vista local loopback seems goofed on other things, I didn't think of that, since I always use my assigned IP by my router with anything. Just keep posting any gotcha's you find, I will do the same, so far this thing seems like it is working very nicely. I am using MySQL 5.0.67 community nt locally, and my remote is only 5.0.45 community nt remotely, I think I will initially setup the table to house the security for user login for the game, since this is one of the few things needed, also later adding in some basic player info, like last known location, some log time, maybe grab some ip or host data, junk that is basically public and no one will have to fill in. This way I can limit number of active players initially by simply publishing generic demo logins that can be shared for now for testing.
     
  11. alanis

    alanis

    Joined:
    Mar 4, 2009
    Posts:
    99
    This is great news,

    I am glad you guys are as exited as I am right now, too bad I can not be of any help or contribution since it only works for unity pro version, cant wait for Michael to come up with a solution for indie.

    But I will keep my eye on this thread, and will follow on it religiously.

    I am glad you thought of the mysql not being called directly from client and its a great choice from requesting stats via the server instead for security issues.
    I have seen several mmo setups that use a separate db backend server which is used as a proxy to the sql to avoid load to the main server I think.
    Altho I am not quite sure how the stats are being requested, if it is:
    client -> main server, then main server contacts db proxy server to retrieve stats and then pas it on to client thru db proxy or main server.

    or to lower the load to main server:

    client -> db proxy server, then db proxy server connects to mysql and send back statas thru db server.

    something like that I think. I guess you option is also good since it is relayng thru the main server, but I wonder if the db proxy can help or is used to lower the load to the main server.

    Now, I wonder if the same darknet can or will let you create other servers aswell and use them like for in this case to create a db proxy server and main server aswell.

    anyways, I am glad you guys doing this, keep up the good work and keep us updated on changes or mods.


    regards
     
  12. MichaelPryor

    MichaelPryor

    Joined:
    Oct 13, 2009
    Posts:
    14
    Thankyou for testing and thanks for your support!

    Currently DarkNet is 32bit only, but I am working on a 64 bit version.

    To use the loop back adress you should do the following:
    - Use mnDNS to determine the IP of localhost.
    - Use mnSetLocal to bind to localhost using the IP returned by mnDNS.
    - Use mnConnect on the client side to connect to the localhost.

    Note that you have to use mnSetLocal on both the client and server side on Vista.

    I haven't made any changes to the DLL as it seems to be working fine. I will update the documentation with a 'getting started' guide for Unity. If there is any information that you think should be in this guide please post it here.
     
  13. alanis

    alanis

    Joined:
    Mar 4, 2009
    Posts:
    99
    Hi Michael,

    Any news on the work around for darknet for unity indie?
    will this be an option or definately not going to be possible?


    let me know
    thanks
     
  14. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Thanks for those informations.
    I knew there was a difference between the above sources and what I worked through in the samples.
    All working now with loopback :)


    I've not checked that yet but if not offered, a list of the error numbers if possible would be great (that wouldn't be unity only)



    @Zumwalt: Suggestion for a function addition to the DarkNet.cs :
    Code (csharp):
    1. public static string mnGetString( Int64 Packet, uint Length, bool NullTerminated) {
    2.             System.IntPtr ptr = DarkNet.mnGetStringC(Packet, 0, true);
    3.             string str = Marshal.PtrToStringAnsi(ptr);
    4.             DarkNet.mnFreeString(ptr);
    5.             return str;
    6.         }
    Don't see why to handle it ugly if it goes fine too.
    I actually even added an mnAddString(...) that just wraps the other one to potentially get the StringC to really be a StringC one while the AddString does exactly that (might be of use for potential optimizations).
    But I guess I'm kind of just me.
     
  15. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Remember other than the one string return that he stated earlier (and I hope I didn't tweak that one when I blanketly fixed all the others), is that you have to use LPStr unmanaged hook to receive the real results.
     
  16. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    all functions that accept strings (aside of one) have the marshalas block in for the lpstr, don't worry :)
    and from what I've seen all works fine as well (I'm testing it against the sample servers with a converted sample client script)
     
  17. MichaelPryor

    MichaelPryor

    Joined:
    Oct 13, 2009
    Posts:
    14
    When using the networking module the error code is usually from winsock. The other modules will usually give an error code which is an HRESULT return value.

    You can google the error code, or you can determine what most DarkNet error codes mean using this application (screenshot attached):
    www.darknetworking.net/DarkNetErrorCode.exe

    That makes sense, I have updated the DarkNet.cs file. You can now use mnGetString in the standard way:
    Code (csharp):
    1. string str = DarkNet.mnGetString(Packet,0,true);
    or you can carry on using mnGetStringC as before.

    You can get the new DarkNet.cs file here:
    www.DarkNetworking.net/DarkNet.cs

    I haven't had time to look into it much but I don't think it is going to happen any time soon, if at all. I will have a good look into it some time after Christmas where I have a week free to do some serious work on DarkNet.
     

    Attached Files:

  18. alanis

    alanis

    Joined:
    Mar 4, 2009
    Posts:
    99
    so, how is the project doing?
    any news?
     
  19. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Which project? DarkNet ? I don't think he will get around to doing any further research on making it work for Indy until after christmas like he states, other than that, this thing works with Unity Pro and Windows.
     
  20. alanis

    alanis

    Joined:
    Mar 4, 2009
    Posts:
    99
    Oh definately, he stated that he will be workin gon it after Xmas

    I am talking on your project zumwalt,

    the one you were workin gon, did you get to test it our with sql database.?
     
  21. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Yes, got side tracked on another project that has a roll out of November 1, so am concentrating on that at the moment and will get back on mine for more stress testing after their roll out. I have my server talking to MySQL and SQL, was thinking about setting up Oracle and postgresql.
     
  22. alanis

    alanis

    Joined:
    Mar 4, 2009
    Posts:
    99
    Thank you for the update,

    please keep us posted

    regards
     
  23. MichaelPryor

    MichaelPryor

    Joined:
    Oct 13, 2009
    Posts:
    14
    Hi guys,

    Version 2.0 has been released and a normal DLL version of DarkNet is now officially supported. This is compatible with versions of Unity that can call DLLs.

    Here is the DarkNet website:
    http://www.darknetworking.net/.

    And here is DarkNet on TGC, providing a brief changes list.
    http://www.thegamecreators.com/?m=view_product&id=2070

    Most importantly:
    - Rewritten from scratch.
    - Open source (to those that purchase it).
    - Brand new comprehensive documentation.

    Enjoy!
     
  24. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Awesome! Been waiting on this for a while, you da man (and ya I am one of the lucky purchasers :))

    Edit:
    Spoke to soon, the .NET version will not work with U3

     
    Last edited: Oct 6, 2010
  25. MichaelPryor

    MichaelPryor

    Joined:
    Oct 13, 2009
    Posts:
    14
    Sorry for late reply, I did not have email subscription set up.

    What could the reasons for this be?

    Note that some of the command names have changed and commands do not have a prefix of mn anymore.

    Here is a list of networking commands, those tagged with CPP_DLL are accessible:
    http://www.darknetworking.net/GeneratedDocumentation/html/namespacemn.html

    Also, the DLL is now compiled with visual studio 2010 instead of 2008, could that make a difference?
     
  26. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    the cpp one is definitely not workable on the webplayer but also the frameworks it uses will prevent it from working as the paranoia security level of U3 webplayer will fight it unless it was developed with it in mind
     
  27. MichaelPryor

    MichaelPryor

    Joined:
    Oct 13, 2009
    Posts:
    14
    Ah right sorry didn't read your post properly, so the issue is that the DLL requires .NET v4.0? And Unity only works with DLLs designed for 3.0 and older? I will see what I can do about this, there's no reason why I shouldn't be able to compile for an older .NET.
     
  28. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    didn't say anyhting on .NET 4 though if it was used that could have an impact, unsure.
    But I actually realize that the dll on its own will never work on the webplayer anyway or as it was mentioned "that can call DLLs" which means windows standalone only.

    the error there seems like UT cut a bit too much, U3 is suffering rather badly from overparanoid framework cuts, a problem that at least for part of my contract work prevents any considering of moving on to U3 at all until UT has fixed this (U2 was already too restricted but U3 is 10 times worse, feels like someone took the list from iPhone and brought it over to desktop)
     
  29. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Try to compile with Framework 2.0 if possible, there are some serious issues with compiling with 3.5 even (found this out in some of my own wrapper code work) If you are using the <T> template class that 4.0 offers, you will have to normalize them. I actually had convinced a company to purchase Unity with U3 came out based on several enhancements, then they contacted me later about the restrictions and backed out, I couldn't convince them otherwise though because the functions they want to use it for really would have had no effect on them for these tight restrictions. Not sure what they moved too, but I agree that the restrictions are way too thick at the moment, seriously way to thick.

    See if you can compile from Framework 2.0, 3.0, 3.5 and have those as separate builds. For some reason, the source wasn't available in my download from the game creators website, otherwise I would have already tried to rip it down some.
     
  30. MichaelPryor

    MichaelPryor

    Joined:
    Oct 13, 2009
    Posts:
    14
    DarkNet doesn't use anything fancy so should compile fine in 2.0. Does anyone know how to select what version of the .NET framework to compile for in visual studio C++?

    The source is in there, I just checked its in this directory: DarkNet v2.0\Project\MikeNet.
     
  31. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Honestly I couldn't figure it out, I feel out of place in native C++ to tell it what assembly to use, It is not a problem with C#, but C++ on the other hand, nada comes to mind.
     
  32. psyclone

    psyclone

    Joined:
    Nov 17, 2009
    Posts:
    245
    Unity 3 uses a modified version of Mono, which is tagged at .NET 2.0 compliant, and this embedded into the .NET scripts etc that are compilied.

    A Binary DLL plugin (C++) dos not have this restriction but is only available to the PRO version, but if the complie is against .NET 4.0 the system on which it runs will need to have .NET 4.0 installed, and this will need to be listed as a requirement.
     
  33. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    I think you are missing the point, DarkNet for .Net CLR to run Native with Unity is compiled with Framework 4.0, and Unity with Mono will not import the class references because of the framework version. In C++, I do not know of a way to force the framework to 2.0 and I think that is his problem also and that is where we are looking for some guidance. See image, the Framework version is set to 4.0 and it is not something that can be changed directly in Visual Studio 2010, so "how" can we do this?

    $FrameworkReferenceMikeNet.jpg
     
  34. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Son of a gun, I finally found the setting, compiling now to test:
    Web Reference:
    http://msdn.microsoft.com/en-us/library/bb772098(VS.90).aspx

    Steps to accomplish this, will notify if it works
     
  35. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Ok, compile complete, sits in Unity real pretty like, no MONO errors, clean import, next phase, testing a client/server build, making a demo package now, he will have to update his source that is distributed because if I make a package, I can't include the DLL, should have something posted in the next hour or so, taking this one step at a time because I want to deploy this to Andriod / iPhone and Web, so seeing if I can make it work that way also for the demo.

    Additional information, the C++ has to be compiled with embedding the manifest for it to work.
    See attached image, also, the two C# demo's, have to be set to framework 2.0, then the Linq reference has to be removed, then the new Managed DLL has to be used for it to work, the New one has to have the embedded manifest otherwise they will not work with C#

    $ManifestEmbeded.jpg

    Now that I have C# working with a sever and a client, going to work the code into Unity 3 and testing, first, lunch break..
     
    Last edited: Oct 20, 2010
  36. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Back from lunch, unfortunately I am stuck at this:
    My code for Unity 3 for this is
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using System.Threading;
    5.  
    6. public class Client : MonoBehaviour
    7. {
    8.  
    9.     // Use this for initialization
    10.     void Start()
    11.     {
    12.         StartClient();
    13.     }
    14.  
    15.     // Update is called once per frame
    16.     void Update()
    17.     {
    18.  
    19.     }
    20.  
    21.     void StartClient()
    22.     {
    23.         // Operations
    24.         const int OP_FLOAT = 0;
    25.         const int OP_STRING = 1;
    26.         const int OP_INT = 2;
    27.  
    28.         // Connect to server
    29.         uint iReturn = 0;
    30.         Debug.Log("DarkNet version: " + mnCLR.GetVersion());
    31.  
    32.         long RecvPacket = mnCLR.CreatePacket();
    33.         long SendPacket = mnCLR.CreatePacket();
    34.         mnCLR.SetMemorySize(SendPacket, 1024);
    35.  
    36.         mnCLR.Start(1, 0);
    37.  
    38.         // Determine IP of local host
    39.         string LocalHost = mnCLR.DNS_B("127.0.0.1");
    40.  
    41.         long profile = mnCLR.CreateInstanceProfile();
    42.         mnCLR.SetProfileLocal(profile, LocalHost, 0, LocalHost, 0);
    43.         mnCLR.SetProfileModeUDP(profile, 2);
    44.         mnCLR.SetProfileNumOperationsUDP(profile, 3);
    45.         int siReturn = mnCLR.Connect(0, LocalHost, 6565, LocalHost, 6565, 5000, true, profile);
    46.         switch (siReturn)
    47.         {
    48.             case (1):
    49.                 Debug.Log("Connected to server");
    50.                 break;
    51.             case (0):
    52.                 Debug.Log("Connection timed out");
    53.                 break;
    54.             case (-1):
    55.                 Debug.Log("Error occurred whilst connecting");
    56.                 break;
    57.             case (-2):
    58.                 Debug.Log("The connection request was rejected because the server is full.");
    59.                 break;
    60.         }
    61.  
    62.  
    63.         // Main loop
    64.         long SendTimer = 0;
    65.         long SendFreq = 2000;
    66.  
    67.         while (mnCLR.ClientConnected(0, 0) == 1)
    68.         {
    69.             // Use less CPU
    70.             Thread.Sleep(1);
    71.  
    72.             // TCP packets
    73.             iReturn = mnCLR.RecvTCP(0, RecvPacket, 0);
    74.  
    75.             if (iReturn > 0)
    76.             {
    77.                 Debug.Log("New TCP packet received");
    78.             }
    79.              
    80.             for (uint cl = 1; cl <= mnCLR.GetMaxClients(0); cl++)
    81.             {
    82.                 for (uint op = 0; op < mnCLR.GetMaxOperations(0); op++)
    83.                 {
    84.                     iReturn = mnCLR.RecvUDP(0, RecvPacket, cl, op);
    85.                     if (iReturn > 0)
    86.                     {
    87.                         // Decide what to do depending on operation
    88.                         switch (op)
    89.                         {
    90.                             case (OP_FLOAT):
    91.                                 {
    92.                                     float fl = mnCLR.GetFloat(RecvPacket);
    93.                                     Debug.Log("Float received from server, that was originally sent by client " + cl + ": " + fl);
    94.                                 }
    95.                                 break;
    96.  
    97.                             case (OP_STRING):
    98.                                 {
    99.                                     string str = mnCLR.GetString(RecvPacket, 0, true);
    100.                                     Debug.Log("String received from server, that was originally sent by client " + cl + ": " + str);
    101.                                 }
    102.                                 break;
    103.  
    104.                             case (OP_INT):
    105.                                 {
    106.                                     int i = mnCLR.GetInt(RecvPacket);
    107.                                     Debug.Log("Integer received from server, that was originally sent by client " + cl + ": " + i);
    108.                                 }
    109.                                 break;
    110.  
    111.                             default:
    112.                                 Debug.Log("Invalid operation");
    113.                                 break;
    114.                         }
    115.                     }
    116.                 }
    117.             }
    118.  
    119.             // Send messages every SendFreq ms
    120.             if ((System.DateTime.Now.Millisecond + (System.DateTime.Now.Second * 1000) + (System.DateTime.Now.Minute * 60 * 1000)) - SendTimer > SendFreq)
    121.             {
    122.                 // Operation
    123.  
    124.                 uint op = (uint)Random.Range(0, 3); // Random number between 0 and 2
    125.                 mnCLR.AddSizeT(SendPacket, op);
    126.  
    127.                 // Decide what to do depending on operation
    128.                 switch (op)
    129.                 {
    130.                     case (OP_FLOAT):
    131.                         {
    132.                             float fl = (Random.Range(0, 10) * 1.0f) + (Random.Range(0, 10) * 0.1f);
    133.                             mnCLR.AddFloat(SendPacket, fl);
    134.  
    135.                             Debug.Log("Float sent to server: " + fl);
    136.                         }
    137.                         break;
    138.  
    139.                     case (OP_STRING):
    140.                         {
    141.                             string str = System.DateTime.Now.ToString();
    142.  
    143.                             mnCLR.AddString(SendPacket, str, 0, true);
    144.  
    145.                             Debug.Log("String sent to server: " + str);
    146.                         }
    147.                         break;
    148.  
    149.                     case (OP_INT):
    150.                         {
    151.                             int i = Random.Range(0, int.MaxValue);
    152.                             mnCLR.AddInt(SendPacket, i);
    153.  
    154.                             Debug.Log("Integer sent to server: " + i);
    155.                         }
    156.                         break;
    157.  
    158.                     default:
    159.                         Debug.Log("Invalid operation");
    160.                         //Debug.Log("Press any key to continue...");
    161.                         //Console.ReadKey();
    162.                         break;
    163.                 }
    164.  
    165.                 // Send packet
    166.                 mnCLR.SendUDP(0, SendPacket, 0, false, true);
    167.  
    168.                 // Update timer
    169.                 SendTimer = ((System.DateTime.Now.Millisecond + (System.DateTime.Now.Second * 1000) + (System.DateTime.Now.Minute * 60 * 1000)));
    170.             }
    171.         }
    172.     }
    173. }
    174.  
    I am not sure if it is giving the error in this code of if it doesn't like something in the library yet...
    FYI Line 25 code is
    How is that NOT supported?
     
    Last edited: Oct 20, 2010
  37. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    U3 is to locked down, I do not have U2 installed on this machine so I can't test to see if it is relaxed enough to work, but it appears that this will not work with U3, all of the functions of DarkNet that I have tried so far come back with that same error, it is just on the wrong line so it is not reporting back to me right. Anyway, U3, lockdown, can't use native assembly code for Windows.

    Edit: was just tested in U2.6.1f and it totally crashed that version, went ahead and submitted the project as a bug, but doubt what ever is "unsupported" will be supported, just no clue what it is to try to work around.
     
    Last edited: Oct 20, 2010