public override void addToStream(Bundle stream, object v)
 {
     stream.writeBlob((byte[])v);
 }
 /*
     登录到服务端(loginapp), 登录成功后还必须登录到网关(baseapp)登录流程才算完毕
 */
 public void login_loginapp(bool noconnect)
 {
     if(noconnect)
     {
         reset();
         _networkInterface.connectTo(_args.ip, _args.port, onConnectTo_loginapp_callback, null);
     }
     else
     {
         Dbg.DEBUG_MSG("KBEngine::login_loginapp(): send login! username="******"Loginapp_login"]);
         bundle.writeInt8((sbyte)_args.clientType);
         bundle.writeBlob(KBEngineApp.app._clientdatas);
         bundle.writeString(username);
         bundle.writeString(password);
         bundle.send(_networkInterface);
     }
 }
 public override void addToStream(Bundle stream, object v)
 {
     stream.writeBlob(System.Text.Encoding.UTF8.GetBytes((string)v));
 }
 /*
     创建账号,通过loginapp
 */
 public void createAccount_loginapp(bool noconnect)
 {
     if(noconnect)
     {
         reset();
         _networkInterface.connectTo(_args.ip, _args.port, onConnectTo_createAccount_callback, null);
     }
     else
     {
         Bundle bundle = new Bundle();
         bundle.newMessage(Message.messages["Loginapp_reqCreateAccount"]);
         bundle.writeString(username);
         bundle.writeString(password);
         bundle.writeBlob(KBEngineApp.app._clientdatas);
         bundle.send(_networkInterface);
     }
 }
        /*
            与服务端握手,与任何一个进程连接之后应该第一时间进行握手
        */
        public void hello()
        {
            Bundle bundle = new Bundle();
            if(currserver == "loginapp")
                bundle.newMessage(Message.messages["Loginapp_hello"]);
            else
                bundle.newMessage(Message.messages["Baseapp_hello"]);

            bundle.writeString(clientVersion);
            bundle.writeString(clientScriptVersion);
            bundle.writeBlob(_encryptedKey);
            bundle.send(_networkInterface);
        }
Esempio n. 6
0
        public bool login_loginapp(bool noconnect)
        {
            if(noconnect)
            {
                reset();
                if(!networkInterface_.connect(loginappIP, loginappPort))
                {
                    Dbg.ERROR_MSG(string.Format("KBEngine::login_loginapp(): connect {0}:{1} is error!", loginappIP, loginappPort));
                    return false;
                }

                onLogin_loginapp();
                Dbg.DEBUG_MSG(string.Format("KBEngine::login_loginapp(): connect {0}:{1} is successfylly!", loginappIP, loginappPort));
            }
            else
            {
                Dbg.DEBUG_MSG("KBEngine::login_loginapp(): send login! username="******"Loginapp_login"]);
                bundle.writeInt8(3); // clientType
                bundle.writeBlob(new byte[0]);
                bundle.writeString(username);
                bundle.writeString(password);
                bundle.send(networkInterface_);
            }

            return true;
        }
Esempio n. 7
0
 public void addToStreamEx(Bundle stream, AVATAR_DATA v)
 {
     stream.writeInt8(v.param1);
     stream.writeBlob(v.param2);
 }
Esempio n. 8
0
 public void hello()
 {
     Bundle bundle = new Bundle();
     if(currserver_ == "loginapp")
         bundle.newMessage(Message.messages["Loginapp_hello"]);
     else
         bundle.newMessage(Message.messages["Baseapp_hello"]);
     bundle.writeString(clientVersion_);
     bundle.writeBlob(clientdatas_);
     bundle.send(networkInterface_);
 }
Esempio n. 9
0
        public bool createAccount_loginapp(bool noconnect)
        {
            if(noconnect)
            {
                reset();
                if(!networkInterface_.connect(ip, port))
                {
                    Dbg.ERROR_MSG(string.Format("KBEngine::createAccount_loginapp(): connect {0}:{1} is error!", ip, port));
                    return false;
                }

                onOpenLoginapp_createAccount();
                Dbg.DEBUG_MSG(string.Format("KBEngine::createAccount_loginapp(): connect {0}:{1} is successfylly!", ip, port));
            }
            else
            {
                Bundle bundle = new Bundle();
                bundle.newMessage(Message.messages["Loginapp_reqCreateAccount"]);
                bundle.writeString(username);
                bundle.writeString(password);
                bundle.writeBlob(new byte[0]);
                bundle.send(networkInterface_);
            }

            return true;
        }
		public override void addToStream(Bundle stream, object v)
		{
			stream.writeBlob((byte[])v);
		}
		public override void addToStream(Bundle stream, object v)
		{
			stream.writeBlob(System.Text.Encoding.UTF8.GetBytes((string)v));
		}
Esempio n. 12
0
 public void addToStreamEx(Bundle stream, FS_ENTITY_DATA v)
 {
     stream.writeInt32(v.entityid);
     stream.writeUint8(v.cmd_type);
     stream.writeBlob(v.datas);
 }