Exemplo n.º 1
0
    public virtual void initKBEngine()
    {
        // 如果此处发生错误,请查看 Assets\Scripts\kbe_scripts\if_Entity_error_use______git_submodule_update_____kbengine_plugins_______open_this_file_and_I_will_tell_you.cs

        Dbg.debugLevel = debugLevel;

        KBEngineArgs args = new KBEngineArgs();

        args.ip                              = ip;
        args.port                            = port;
        args.clientType                      = clientType;
        args.syncPlayerMS                    = syncPlayerMS;
        args.threadUpdateHZ                  = threadUpdateHZ;
        args.serverHeartbeatTick             = serverHeartbeatTick;
        args.useAliasEntityID                = useAliasEntityID;
        args.isOnInitCallPropertysSetMethods = isOnInitCallPropertysSetMethods;

        args.TCP_SEND_BUFFER_MAX = (UInt32)TCP_SEND_BUFFER_MAX;
        args.TCP_RECV_BUFFER_MAX = (UInt32)TCP_RECV_BUFFER_MAX;
        args.UDP_SEND_BUFFER_MAX = (UInt32)UDP_SEND_BUFFER_MAX;
        args.UDP_RECV_BUFFER_MAX = (UInt32)UDP_RECV_BUFFER_MAX;

        args.isMultiThreads = isMultiThreads;

        if (isMultiThreads)
        {
            gameapp = new KBEngineAppThread(args);
        }
        else
        {
            gameapp = new KBEngineApp(args);
        }
    }
Exemplo n.º 2
0
    public virtual void initKBEngine()
    {
        // 如果此处发生错误,请查看 Assets\Scripts\kbe_scripts\if_Entity_error_use______git_submodule_update_____kbengine_plugins_______open_this_file_and_I_will_tell_you.cs

        KBEngineArgs args = new KBEngineArgs();

        args.ip         = ip;
        args.port       = port;
        args.clientType = clientType;

        if (persistentDataPath == "Application.persistentDataPath")
        {
            args.persistentDataPath = Application.persistentDataPath;
        }
        else
        {
            args.persistentDataPath = persistentDataPath;
        }

        args.syncPlayer = syncPlayer;
        args.HZ_TICK    = HZ_TICK;

        args.SEND_BUFFER_MAX = (UInt32)SEND_BUFFER_MAX;
        args.RECV_BUFFER_MAX = (UInt32)RECV_BUFFER_MAX;

        if (isMultiThreads)
        {
            gameapp = new KBEngineAppThread(args);
        }
        else
        {
            gameapp = new KBEngineApp(args);
        }
    }
Exemplo n.º 3
0
 private void EngineEvents_OnConnectionState(bool success)
 {
     if (!success)
     {
         KBEngineArgs args = KBEngineApp.app.getInitArgs();
         Debug.LogErrorFormat("连接服务器({0}:{1}),发生错误", args.ip, args.port);
     }
     else
     {
         Debug.Log("连接服务器成功,登录中...");
     }
 }
Exemplo n.º 4
0
    public virtual void initKBEngine()
    {
        // 如果此处发生错误,请查看 Assets\Scripts\kbe_scripts\if_Entity_error_use______git_submodule_update_____kbengine_plugins_______open_this_file_and_I_will_tell_you.cs

        Dbg.debugLevel = debugLevel;

        KBEngineArgs args = new KBEngineArgs();

        args.ip         = ip;
        args.port       = port;
        args.clientType = clientType;

        if (persistentDataPath == "Application.persistentDataPath")
        {
            args.persistentDataPath = Application.persistentDataPath;
        }
        else
        {
            args.persistentDataPath = persistentDataPath;
        }

        args.syncPlayer       = syncPlayer;
        args.threadUpdateHZ   = threadUpdateHZ;
        args.useAliasEntityID = useAliasEntityID;
        args.isOnInitCallPropertysSetMethods = isOnInitCallPropertysSetMethods;

        args.SEND_BUFFER_MAX = (UInt32)SEND_BUFFER_MAX;
        args.RECV_BUFFER_MAX = (UInt32)RECV_BUFFER_MAX;

        args.isMultiThreads = isMultiThreads;

        if (isMultiThreads)
        {
            gameapp = new KBEngineAppThread(args);
        }
        else
        {
            gameapp = new KBEngineApp(args);
        }
    }