Search Unity

[Released 2.4.4] MNF : Mobile & Network & Framework

Discussion in 'Assets and Asset Store' started by MNF_Devloper, Feb 11, 2016.

  1. planetmatrix

    planetmatrix

    Joined:
    Dec 8, 2015
    Posts:
    38
    Hi there,

    Apologies for the late reply.

    I finally got time to get back to the project and to MNF. On a quick test sprint, Hotspot connection looks fine. How ever will update you in a couple of days time.

    Many thanks
    Great Day!
     
    Last edited: Jun 21, 2019
  2. ModernWestern

    ModernWestern

    Joined:
    Oct 22, 2017
    Posts:
    2
    Hi,

    I'm developing an android game (iOS later) where the player could choose between become server or client (Host/guest), once the host player is created, all the other players could join to the game as guests (1 player host - 9 player guests) receiving and sending "strings" all the time, it's not a chat, it's a "words" game, now the real question ¿Does MNF support LAN hosting? I mean, does it work with near players without wifi connection, only the active router? but at the same time the game should work over wifi, me in my place, you in your place, different wifi connections... As you noticed Im quite new in this, I think I need something P2P... please correct me if I'm wrong.

    To resume all this ¿Is MNF what I need? Thanks.
     
    Last edited: Jun 21, 2019
  3. MNF_Devloper

    MNF_Devloper

    Joined:
    Dec 22, 2015
    Posts:
    145
    Hi, ModernWestern.

    MNF can not support Lan hosting.

    However, it is guaranteed to work correctly when connected to the same network. It supports both Wi-Fi, Wi-Fi Direct and Hotspot environment.
    - Wi-Fi Direct (Only Android), Hotspot (iOS & Android) is a feature provided directly from the device.

    And I think that the game you talked about should be developed with Server / Client (TCP) model rather than P2P (UDP).
     
  4. planetmatrix

    planetmatrix

    Joined:
    Dec 8, 2015
    Posts:
    38
    Hey Paul,

    In Hotspot environment - iOS and IPPluse Scene, the mobile device on which the hotspot is running disconnects exactly after 20 seconds, means in the dropdown device list on the other device, the hotspot device disappears after 20 seconds. Please check the log image https://imgur.com/a/BHITvQv

    We tried commenting the line IPPulse.Instance.RemoveTimeoutDevice(20); in IPPulseEventTrigger.cs
    It solved the above problem, but when devices goes in background the list does not refresh itself.
     
    MNF_Devloper likes this.
  5. MNF_Devloper

    MNF_Devloper

    Joined:
    Dec 22, 2015
    Posts:
    145
    Hi, planetmatrix.
    Would you like to change the SendIPPulseThread () function as shown below?


    void SendIPPulseThread(bool isSignal)
    {
    // send i'm here.
    if (IsPause == true)
    {
    lock (deviceList)
    {
    foreach (var endPoint in deviceList)
    {
    try
    {
    var buffer = Encoding.Unicode.GetBytes(ImHereGeneratedKey);
    IPPulseUdpClient.Send(buffer, buffer.Length, endPoint.pulseIPEndPoint);
    }
    catch (Exception e)
    {
    IPPulseLogWriter.WriteException(e, "SendThread()");
    }
    }
    }
    Utility.Sleep(200);
    return;
    }

    // send multicast
    try
    {
    var buffer = Encoding.Unicode.GetBytes(MulticastGeneratedKey);
    MulticastUdpClient.Send(buffer, buffer.Length, new IPEndPoint(multicastAddress, multicastPort));
    }
    catch (Exception e)
    {
    IPPulseLogWriter.WriteException(e, "SendIPPulseMessage() - MulticastUdpClient");
    }

    // send ippulse
    List<string> copiedIPList = Instance.GetNetworkIPList();
    if (copiedIPList.Count == 0)
    {
    IPPulseLogWriter.WriteError("SendIPPulseMessage() -> NetworkIPList is empty");
    return;
    }

    string ipListString = string.Join(", ", copiedIPList);
    foreach (var ip in copiedIPList)
    {
    if (Instance.MulticastResponseIPList.Contains(ip) == true)
    {
    IPPulseLogWriter.WriteSystem("Send skip because multicast address : {0}", ip);
    continue;
    }

    IPPulseLogWriter.WriteSystem("Sending .. {0} -> {1} area[1 ~ 254]", ipListString, ip);

    var buffer = Encoding.Unicode.GetBytes(IPPulseGeneratedKey);

    byte[] ipBytes = IPAddress.Parse(ip).GetAddressBytes();
    byte myLastIP = ipBytes[3];
    for (byte i = 1; i < 255; ++i)
    {
    ipBytes[3] = i;

    try
    {
    var toIPAddress = new IPAddress(ipBytes);
    IPPulseUdpClient.Send(buffer, buffer.Length, new IPEndPoint(toIPAddress, pulsePort));
    }
    catch (Exception e)
    {
    IPPulseLogWriter.WriteException(e, "SendIPPulseMessage() - IPPulseUdpClient");
    }

    Utility.Sleep(20);
    }
    }
    }
     
  6. zubair_saqib

    zubair_saqib

    Joined:
    Sep 21, 2014
    Posts:
    11
    Hello @MNF_Devloper ,
    I bought the MNF from the asset store release 2.4.4. Import it into the Unity 2019.1.9.f1. And build out the example projects for the windows, than try to test the basic server and client module by running one instance in the editor and other from the build application, it was working fine. But any other module I try to run like chat server client, it does not work in gives me the socket exception error or nothing find in the look around etc.
    So I build the application for android with build environment set to IL2CPP and try to run again nothing works they cannot connect to each other despite being on the same WIFI. I tested your provided Android 9 APK as well with the other instance running in the editor and that did not work as well. I am OnePlus 7 Android 9 for the Android side and for PC I am on windows 10. Please help.
     
    MNF_Devloper likes this.
  7. MNF_Devloper

    MNF_Devloper

    Joined:
    Dec 22, 2015
    Posts:
    145
    Hi, zubair_saqib.

    I am sorry for the inconvenience of using MNF.

    I need your help to solve the problem.

    1. I want to know verify that the test environment is the same WiFi.
    2. Log file required at the time of MNF test.

    First, if the above two things are confirmed, I think you can solve your problem.

    In addition, MNF is unable to run the MNF server & CLA on a single PC.
     
  8. zubair_saqib

    zubair_saqib

    Joined:
    Sep 21, 2014
    Posts:
    11
    Hello @MNF_Devloper ,

    1. Yes both the PC and the Android device are on the same wife network.
    2.Please find the log files of Pc and Android in the attachment.

    I have build both Pc and Android build with IL2CPP backend with .Net 4 Support. Also in the screen shoot.
     

    Attached Files:

  9. RYUDAESUE

    RYUDAESUE

    Joined:
    Nov 17, 2014
    Posts:
    1
    Hello @MNF_Devloper ,

    Can I change ScreenShareMessageDefine.MaxImageSize?Or can i send a bigger data?

    P.S.
    I couldn't find a way to make the maximum transmission size larger, so I realized how to divide and transmit packets.

    The method was implemented as follows:
    1. Divide the data beyond its maximum transferable size. You also get the rest of the data lost in the process of sharing.
    2. Set start and end to size 1 byte[] and insert data in between.
    3. Combine the data on the receiving end and draw it on the texture.

    But there's a problem with this method. Continuous transfer causes the memory to be occupied and out of memory is memory.

    Code (CSharp):
    1.  
    2. 2019-07-30 04:01:08.574 18506-18633/test.test.test E/Unity: OutOfMemoryException: Out of memory
    3.         at (wrapper managed-to-native) System.Object.__icall_wrapper_ves_icall_array_new_specific(intptr,int)
    4.       at MNF.Message.MessageBuffer`1[TMessageHeader]..ctor (System.Int32 messageBufferSize) [0x00014] in \Assets\MNF\Library\Message\MessageFactory.cs:19
    5.       at MNF.Message.Serializer`1[T]..ctor (System.Int32 messageBufferSize) [0x00010] in \Assets\MNF\Library\Message\MessageFactory.cs:66
    6.       at MNF_Common.VideoStreamMessageSerializer..ctor () [0x00000] in \Assets\MNF\Script\Advanced\Protocol\VideoStream\VideoStreamMessage.cs:18
    7.         at (wrapper managed-to-native)
    8.  
     
    Last edited: Jul 29, 2019
  10. Dohwan_Jadeworks

    Dohwan_Jadeworks

    Joined:
    Nov 29, 2018
    Posts:
    1
    Hello @MNF_Devloper ,

    Sorry, I am not good at english.

    I am using 7_FileTrans sample.

    I should support auto reconnect to server in my client, so call [ FileTransClientButtonTrigger / OnStartClient() ] methond inside [ FileTransClientSession / OnConnectFail ]. In Unity Editor, everything fine.

    However, In android system ( Galaxy Note 9, Andorid 9) to call OnStartClient method works only a few times (2 ~ 3 tims), and then program shot down.

    I tested client only in android system. On clicking the button what call OnStartClient method 2, 3 tims, and also programs shut down.

    Is there any soution?

    thanks.
     

    Attached Files:

  11. daon_master

    daon_master

    Joined:
    Jan 18, 2019
    Posts:
    1
    Hello @MNF_Devloper ,

    ConnectionReset event fires when internet is broken on android
    But
    ConnectionReset event doesn't come out when internet is lost in ios. What should we do with this problem?

    unity 2019.1.5f1
    mnf 2.4.4
     
  12. TripleType

    TripleType

    Joined:
    Jan 17, 2015
    Posts:
    7
    hello

    scene name : 7_FileTransClient, 7_FileTransServer
    send file... server to client. good.
    How do I send a file from the client to the server?
     
  13. Fangh

    Fangh

    Joined:
    Apr 19, 2013
    Posts:
    274
    Hello. I downloaded the test apk.
    How can I test the Wi-Fi direct ?
    When I launch a Basic Chat Server and click "Chat Server Start" nothing happens.
     
  14. mahmoudsaberamin

    mahmoudsaberamin

    Joined:
    May 25, 2017
    Posts:
    12
    Hi I want to make a p2p connection via unet with 2 android devices without them connecting to the same wifi. something like shareit app.does this plugin support this operation
     
  15. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
    @MNF_Devloper : Does this plugin allow for an Android phone to act as a P2P hole punch Server?
     
  16. leedongwon

    leedongwon

    Joined:
    Jun 20, 2019
    Posts:
    8
    Hello
    You want to test MNF's 11_ChatServer, 11_ChatClient in UWP environment.
    Build after Switch Platform with UWP results in an error and does not build.

    OS : windows 10 home
    unity : 2019.4.23f1
    MNF : 2.4.4

    Error :
    Code (CSharp):
    1. Exception: C:\Program Files\2019.4.23f1\Editor\Data\il2cpp\build/deploy/net471/UnityLinker.exe did not run properly!
    2.  
    3. Failed running "C:\Program Files\2019.4.23f1\Editor\Data\il2cpp\build/deploy/net471/UnityLinker.exe" @D:/Project/HoloLens/MNFChat/Temp/StagingArea/Data/Managed/response.rsp
    4.  
    5. stdout:
    6. Fatal error in Unity CIL Linker
    7. Mono.Cecil.ResolutionException: Failed to resolve I18N.Common.MonoSafeEncoding
    8.    ��ġ: Mono.Linker.BCL.EventTracingForWindows.IsEventSourceImplementation(TypeDefinition type, LinkContext context)
    9.    ��ġ: Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
    10.    ��ġ: Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
    11.    ��ġ: Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
    12.    ��ġ: Unity.Linker.Steps.UnityMarkStep.InitializeAssembly(AssemblyDefinition assembly)
    13.    ��ġ: Mono.Linker.Steps.MarkStep.Initialize()
    14.    ��ġ: Mono.Linker.Steps.MarkStep.Process(LinkContext context)
    15.    ��ġ: Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
    16.    ��ġ: Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
    17.    ��ġ: Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)
    18.    ��ġ: Mono.Linker.Pipeline.Process(LinkContext context)
    19.    ��ġ: Unity.Linker.UnityDriver.Run()
    20.    ��ġ: Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling()
    21.    ��ġ: Unity.Linker.UnityDriver.RunDriver()
    22. stderr:
    23.  
    24. UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <fc4e84dee5004858ad88e6706bb25889>:0)
    25. UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <fc4e84dee5004858ad88e6706bb25889>:0)
    26. UnityEditorInternal.AssemblyStripper.RunAssemblyLinker (System.Collections.Generic.IEnumerable`1[T] args, System.String& out, System.String& err, System.String linkerPath, System.String workingDirectory) (at <fc4e84dee5004858ad88e6706bb25889>:0)
    27. UnityEditorInternal.AssemblyStripper.StripAssembliesTo (System.String outputFolder, System.String& output, System.String& error, System.Collections.Generic.IEnumerable`1[T] linkXmlFiles, UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <fc4e84dee5004858ad88e6706bb25889>:0)
    28. UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <fc4e84dee5004858ad88e6706bb25889>:0)
    29. UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String managedAssemblyFolderPath, UnityEditorInternal.BaseUnityLinkerPlatformProvider unityLinkerPlatformProvider, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at <fc4e84dee5004858ad88e6706bb25889>:0)
    30. UnityEditorInternal.IL2CPPBuilder.Run () (at <fc4e84dee5004858ad88e6706bb25889>:0)
    31. UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <fc4e84dee5004858ad88e6706bb25889>:0)
    32. PostProcessWinRT.RunIL2CPPForProjectBuild () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1929)
    33. PostProcessWinRT.RunIL2CPP () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:1900)
    34. PostProcessWinRT.Process () (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/PostProcessWinRT.cs:217)
    35. UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:85)
    36. Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    37. UnityEditor.UWP.BuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/PlatformDependent/MetroPlayer/Extensions/Managed/ExtensionModule.cs:89)
    38. UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <fc4e84dee5004858ad88e6706bb25889>:0)
    39. UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <fc4e84dee5004858ad88e6706bb25889>:0)
    40. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    Is there a solution?

    I would appreciate it if you could reply by email.
    meetupar123@gmail.com

    Please reply as soon as possible.
     
    Last edited: Jun 22, 2021
  17. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
    i don't use email. I can PM.
     
  18. akashpatel5291

    akashpatel5291

    Joined:
    Jun 25, 2022
    Posts:
    4
    Hello,
    I come here to know that it's possible to connect android TV and mobile device(android/ios) over same WIFI connection using this plugin,
    I try your test apk on 2 mobile devices its working as expected but gives error while installing your android apk in TV.
    I am trying with ( mnf_android_9_0.apk ).
     
  19. akashpatel5291

    akashpatel5291

    Joined:
    Jun 25, 2022
    Posts:
    4
    Hello,
    I try this package for connect local wifi in my game,
    Any how client disconnect from server side ( assume that server device kill application and again start server ), when server again started client are not connected to that server, need to restart application from client side.

    I check this on test apk from google drive ( latest one ) with chat server and chat client.

    How can i fixed this.

    Is there any way to reconnect server after lost connection without reopen client application/scene

    Thanks,
     
    Last edited: Jul 6, 2022
  20. akashpatel5291

    akashpatel5291

    Joined:
    Jun 25, 2022
    Posts:
    4
    abhisood2011 likes this.
  21. Brother_77

    Brother_77

    Joined:
    Feb 8, 2019
    Posts:
    233
    Could this asset be used for Android and iOS crossplay ?

    For a simple UI turn based game, 1 vs 1 matchmaking ?
     
    Last edited: Aug 8, 2023