Search Unity

Third Party Mirror + Light Reflective Mirror and Namespace

Discussion in 'Multiplayer' started by Akaton97, Jan 5, 2023.

  1. Akaton97

    Akaton97

    Joined:
    Jun 26, 2017
    Posts:
    6
    Hello Guys,
    i have tried to implement LRM recently but i have encounter a prolem, more than an error, regarding the "folder location change" of kcptransport. Forgive me for my question, as it may seems stupid, but i don't know how to import the kcp transport into LRM.

    upload_2023-1-5_12-34-23.png

    folder order attached as img

    Code (CSharp):
    1. using System;
    2. using System.Linq;
    3. using System.Net;
    4. using UnityEngine;
    5. using Mirror;
    6. using Unity.Collections;
    7. using UnityEngine.Serialization;
    8.  
    9. namespace kcp2k
    10. {
    11.     [HelpURL("https://mirror-networking.gitbook.io/docs/transports/kcp-transport")]
    12.     [DisallowMultipleComponent]
    13.     public class KcpTransport : Transport
    14.     {
    15. ......
    the kcp trasnport code

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEditor;
    5. using System.Net;
    6. using System.Reflection;
    7. using System.Linq;
    8. using Mirror;
    9. using Mirror.SimpleWeb;
    10. using System;
    11. using kcp2k;
    12.  
    13. namespace LightReflectiveMirror
    14. {
    15. #if UNITY_EDITOR
    16.     [CustomEditor(typeof(LightReflectiveMirrorTransport))]
    17.     public class LRMInspector : Editor
    18.     {
    19.         int serverPort = 7777;
    20.         string serverIP;
    21.         float invalidServerIP = 0;
    22.         bool usingLLB = false;
    23.         LRMDirectConnectModule directModule;
    24.         string[] tabs = new string[] { "LRM Settings", "NAT Punch", "Load Balancer", "Other" };
    25.         int currentTab = 0;
    26.         Type[] supportedTransports = new Type[3] { typeof(kcpTransport), typeof(SimpleWebTransport), typeof(TelepathyTransport) };
    27.  
    28. ......
    This is the code that return me an error, in particular the invocation of "KcpTransport". So, if i have understand it right, this is a problem of "using" (thus importing) correctly. upload_2023-1-5_12-34-23.png