コード例 #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

        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
ファイル: clientapp.cs プロジェクト: life02/kbengine-cocos2dx
    // 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;
 }