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.threadUpdateHZ = threadUpdateHZ;

        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);
    }
예제 #2
0
        public NetworkInterface(KBEngineApp app)
        {
            this.app_ = app;
            packets_  = new List <MemoryStream>();

            Message.bindFixedMessage();
        }
예제 #3
0
 public KBEngineApp(ClientApp c)
 {
     client = c;
     app    = this;
     //networkInterface_ = new NetworkInterface(this);
     kbethread = new KBEThread(this);
 }
예제 #4
0
    // Use this for initialization
    void Start()
    {
        MonoBehaviour.print("clientapp::start()");

        gameapp = new KBEngineApp();
        //gameapp.createAccount_loginapp(true);
        // gameapp.login_loginapp(true);

        gameapp.autoImportMessagesFromServer(true);
    }
예제 #5
0
        public KBEngineApp()
        {
            app = this;
            networkInterface_ = new NetworkInterface(this);
            kbethread = new KBEThread(this);
            t_ = new Thread(new ThreadStart(kbethread.run));
            t_.Start();

            // 注册事件
            installEvents();
        }
예제 #6
0
	// Use this for initialization
	void Start () 
	{
		MonoBehaviour.print("clientapp::start()");
			
		gameapp = new KBEngineApp();
		KBEngineApp.url = "http://127.0.0.1";
		KBEngineApp.app.clientType = 3;
		KBEngineApp.app.ip = "127.0.0.1";
		KBEngineApp.app.port = 20013;
		
		gameapp.autoImportMessagesFromServer(true);
	}
예제 #7
0
파일: KBEngine.cs 프로젝트: jsboys/kbengine
        public KBEngineApp()
        {
            app = this;

            loginappIP = ip;
            loginappPort = port;

            networkInterface_ = new NetworkInterface(this);
            kbethread_ = new KBEThread(this);
            t_ = new Thread(new ThreadStart(kbethread_.run));
            t_.Start();
        }
예제 #8
0
        public KBEngineApp(ClientApp c)
        {
            client = c;
            app    = this;


            networkInterface_ = new NetworkInterface(this);
            kbethread         = new KBEThread(this);
            t_ = new Thread(new ThreadStart(kbethread.run));
            t_.Start();

            //networkPeer = new NetworkPeer ();
            // 注册事件
        }
예제 #9
0
 public NetworkInterface(KBEngineApp app)
 {
     msgReader.mainLoop = KBEngine.KBEngineApp.app;
 }
예제 #10
0
 public KBEThread(KBEngineApp app)
 {
     this.app_ = app;
 }
예제 #11
0
        public virtual void destroy()
        {
            Dbg.WARNING_MSG("KBEngine::destroy()");

            reset();
            KBEngine.Event.deregisterIn(this);
            resetMessages();

            KBEngineApp.app = null;
        }
예제 #12
0
        public KBEngineApp(KBEngineArgs args)
        {
            if (app != null)
                throw new Exception("Only one instance of KBEngineApp!");

            app = this;

            initialize(args);
        }
예제 #13
0
 public NetworkInterface(KBEngineApp app)
 {
     this.app_          = app;
     packets_           = new List <MemoryStream>();
     msgReader.mainLoop = KBEngine.KBEngineApp.app;
 }
예제 #14
0
 public NetworkInterface(KBEngineApp app)
 {
     this.app_ = app;
     bindMessage();
     packets_ = new List<MemoryStream>();
 }
예제 #15
0
 public KBEThread(KBEngineApp app)
 {
     this.app_ = app;
 }