• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# KBEngine.Bundle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中KBEngine.Bundle的典型用法代码示例。如果您正苦于以下问题:C# Bundle类的具体用法?C# Bundle怎么用?C# Bundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Bundle类属于KBEngine命名空间,在下文中一共展示了Bundle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: postMail

		/*
			向服务端发送这个mail
		*/
		public void postMail(Bundle inbundle)
		{
			if(inbundle == null)
				inbundle = bundle;
			
			inbundle.send(networkInterface_);
			
			if(inbundle == bundle)
				bundle = null;
		}
开发者ID:hcy12321,项目名称:KBEngine-LearnNote,代码行数:13,代码来源:Mailbox.cs


示例2: newMail

		/*
			创建新的mail
		*/
		public Bundle newMail()
		{  
			if(bundle == null)
				bundle = new Bundle();
			
			if(type == Mailbox.MAILBOX_TYPE.MAILBOX_TYPE_CELL)
				bundle.newMessage(Message.messages["Baseapp_onRemoteCallCellMethodFromClient"]);
			else
				bundle.newMessage(Message.messages["Base_onRemoteMethodCall"]);
	
			bundle.writeInt32(this.id);
			
			return bundle;
		}
开发者ID:hcy12321,项目名称:KBEngine-LearnNote,代码行数:17,代码来源:Mailbox.cs


示例3: addToStream

		public override void addToStream(Bundle stream, object v)
		{
			stream.writeBlob(System.Text.Encoding.UTF8.GetBytes((string)v));
		}
开发者ID:kjdjpan,项目名称:kbengine_unity3d_plugins,代码行数:4,代码来源:DataTypes.cs


示例4: onLogin_loginapp

 private void onLogin_loginapp()
 {
     if(!loginappMessageImported_)
     {
         var bundle = new Bundle();
         bundle.newMessage(Message.messages["Loginapp_importClientMessages"]);
         bundle.send(_networkInterface);
         Dbg.DEBUG_MSG("KBEngine::onLogin_loginapp: send importClientMessages ...");
         Event.fireOut("Loginapp_importClientMessages", new object[]{});
     }
     else
     {
         onImportClientMessagesCompleted();
     }
 }
开发者ID:buckyu,项目名称:kbengine_unity3d_plugins,代码行数:15,代码来源:KBEngine.cs


示例5: updatePlayerToServer

        /*
            更新当前玩家的位置与朝向到服务端, 可以通过开关_syncPlayer关闭这个机制
        */
        public void updatePlayerToServer()
        {
            if(!_args.syncPlayer || spaceID == 0)
            {
                return;
            }

            TimeSpan span = DateTime.Now - _lastUpdateToServerTime;

            if(span.Milliseconds < 50)
                return;

            Entity playerEntity = player();
            if(playerEntity == null || playerEntity.inWorld == false)
                return;

            _lastUpdateToServerTime = System.DateTime.Now;

            Vector3 position = playerEntity.position;
            Vector3 direction = playerEntity.direction;

            bool posHasChanged = Vector3.Distance(_entityLastLocalPos, position) > 0.001f;
            bool dirHasChanged = Vector3.Distance(_entityLastLocalDir, direction) > 0.001f;

            if(posHasChanged || dirHasChanged)
            {
                _entityLastLocalPos = position;
                _entityLastLocalDir = direction;

                Bundle bundle = new Bundle();
                bundle.newMessage(Message.messages["Baseapp_onUpdateDataFromClient"]);
                bundle.writeFloat(position.x);
                bundle.writeFloat(position.y);
                bundle.writeFloat(position.z);

                bundle.writeFloat((float)((double)direction.x / 360 * 6.283185307179586));
                bundle.writeFloat((float)((double)direction.y / 360 * 6.283185307179586));
                bundle.writeFloat((float)((double)direction.z / 360 * 6.283185307179586));
                bundle.writeUint8((Byte)(playerEntity.isOnGround == true ? 1 : 0));
                bundle.writeUint32(spaceID);
                bundle.send(_networkInterface);
            }
        }
开发者ID:buckyu,项目名称:kbengine_unity3d_plugins,代码行数:46,代码来源:KBEngine.cs


示例6: resetpassword_loginapp

 /*
     重置密码, 通过loginapp
 */
 public void resetpassword_loginapp(bool noconnect)
 {
     if(noconnect)
     {
         reset();
         _networkInterface.connectTo(_args.ip, _args.port, onConnectTo_resetpassword_callback, null);
     }
     else
     {
         Bundle bundle = new Bundle();
         bundle.newMessage(Message.messages["Loginapp_reqAccountResetPassword"]);
         bundle.writeString(username);
         bundle.send(_networkInterface);
     }
 }
开发者ID:buckyu,项目名称:kbengine_unity3d_plugins,代码行数:18,代码来源:KBEngine.cs


示例7: onOpenLoginapp_resetpassword

        public void onOpenLoginapp_resetpassword()
        {
            Dbg.DEBUG_MSG("KBEngine::onOpenLoginapp_resetpassword: successfully!");
            currserver = "loginapp";
            currstate = "resetpassword";

            if(!loginappMessageImported_)
            {
                Bundle bundle = new Bundle();
                bundle.newMessage(Message.messages["Loginapp_importClientMessages"]);
                bundle.send(_networkInterface);
                Dbg.DEBUG_MSG("KBEngine::onOpenLoginapp_resetpassword: send importClientMessages ...");
            }
            else
            {
                onImportClientMessagesCompleted();
            }
        }
开发者ID:buckyu,项目名称:kbengine_unity3d_plugins,代码行数:18,代码来源:KBEngine.cs


示例8: login_loginapp

 /*
     登录到服务端(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=" + username);
         Bundle bundle = new Bundle();
         bundle.newMessage(Message.messages["Loginapp_login"]);
         bundle.writeInt8((sbyte)_args.clientType);
         bundle.writeBlob(KBEngineApp.app._clientdatas);
         bundle.writeString(username);
         bundle.writeString(password);
         bundle.send(_networkInterface);
     }
 }
开发者ID:buckyu,项目名称:kbengine_unity3d_plugins,代码行数:22,代码来源:KBEngine.cs


示例9: hello

        /*
            与服务端握手,与任何一个进程连接之后应该第一时间进行握手
        */
        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);
        }
开发者ID:buckyu,项目名称:kbengine_unity3d_plugins,代码行数:16,代码来源:KBEngine.cs


示例10: login_baseapp

        public bool login_baseapp(bool noconnect)
        {
            if(noconnect)
            {
                Event.fire("login_baseapp", new object[]{});
                if(!networkInterface_.connect(ip, port))
                {
                    Dbg.ERROR_MSG(string.Format("KBEngine::login_baseapp(): connect {0}:{1} is error!", ip, port));
                    return false;
                }

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

            return true;
        }
开发者ID:jsboys,项目名称:kbengine,代码行数:25,代码来源:KBEngine.cs


示例11: hello

 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_);
 }
开发者ID:jsboys,项目名称:kbengine,代码行数:11,代码来源:KBEngine.cs


示例12: bindEMail_baseapp

 public void bindEMail_baseapp()
 {
     Bundle bundle = new Bundle();
     bundle.newMessage(Message.messages["Baseapp_reqAccountBindEmail"]);
     bundle.writeInt32(entity_id);
     bundle.writeString(password);
     bundle.writeString("[email protected]");
     bundle.send(networkInterface_);
 }
开发者ID:jsboys,项目名称:kbengine,代码行数:9,代码来源:KBEngine.cs


示例13: createAccount_loginapp

 /*
     创建账号,通过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);
     }
 }
开发者ID:buckyu,项目名称:kbengine_unity3d_plugins,代码行数:20,代码来源:KBEngine.cs


示例14: login_loginapp

        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=" + username);

                Bundle bundle = new Bundle();
                bundle.newMessage(Message.messages["Loginapp_login"]);
                bundle.writeInt8(3); // clientType
                bundle.writeBlob(new byte[0]);
                bundle.writeString(username);
                bundle.writeString(password);
                bundle.send(networkInterface_);
            }

            return true;
        }
开发者ID:jsboys,项目名称:kbengine,代码行数:29,代码来源:KBEngine.cs


示例15: login_baseapp

        /*
            登录到服务端,登录到网关(baseapp)
        */
        public void login_baseapp(bool noconnect)
        {
            if(noconnect)
            {
                Event.fireOut("onLoginBaseapp", new object[]{});

                _networkInterface.reset();
                _networkInterface = new NetworkInterface();
                _networkInterface.connectTo(baseappIP, baseappPort, onConnectTo_baseapp_callback, null);
            }
            else
            {
                Bundle bundle = new Bundle();
                bundle.newMessage(Message.messages["Baseapp_loginBaseapp"]);
                bundle.writeString(username);
                bundle.writeString(password);
                bundle.send(_networkInterface);
            }
        }
开发者ID:buckyu,项目名称:kbengine_unity3d_plugins,代码行数:22,代码来源:KBEngine.cs


示例16: onOpenLoginapp_createAccount

        public void onOpenLoginapp_createAccount()
        {
            Dbg.DEBUG_MSG("KBEngine::onOpenLoginapp_createAccount: successfully!");
            currserver_ = "loginapp";
            currstate_ = "createAccount";

            if(!loginappMessageImported_)
            {
                Bundle bundle = new Bundle();
                bundle.newMessage(Message.messages["Loginapp_importClientMessages"]);
                bundle.send(networkInterface_);
                Dbg.DEBUG_MSG("KBEngine::onOpenLoginapp_createAccount: start importClientMessages ...");
            }
            else
            {
                onImportClientMessagesCompleted();
            }
        }
开发者ID:jsboys,项目名称:kbengine,代码行数:18,代码来源:KBEngine.cs


示例17: newPassword

 /*
     设置新密码,通过baseapp, 必须玩家登录在线操作所以是baseapp。
 */
 public void newPassword(string old_password, string new_password)
 {
     Bundle bundle = new Bundle();
     bundle.newMessage(Message.messages["Baseapp_reqAccountNewPassword"]);
     bundle.writeInt32(entity_id);
     bundle.writeString(old_password);
     bundle.writeString(new_password);
     bundle.send(_networkInterface);
 }
开发者ID:buckyu,项目名称:kbengine_unity3d_plugins,代码行数:12,代码来源:KBEngine.cs


示例18: resetpassword_loginapp

        public bool resetpassword_loginapp(bool noconnect)
        {
            if(noconnect)
            {
                reset();
                if(!networkInterface_.connect(ip, port))
                {
                    Dbg.ERROR_MSG(string.Format("KBEngine::resetpassword_loginapp(): connect {0}:{1} is error!", ip, port));
                    return false;
                }

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

            return true;
        }
开发者ID:jsboys,项目名称:kbengine,代码行数:24,代码来源:KBEngine.cs


示例19: bindAccountEmail

 /*
     绑定Email,通过baseapp
 */
 public void bindAccountEmail(string emailAddress)
 {
     Bundle bundle = new Bundle();
     bundle.newMessage(Message.messages["Baseapp_reqAccountBindEmail"]);
     bundle.writeInt32(entity_id);
     bundle.writeString(password);
     bundle.writeString(emailAddress);
     bundle.send(_networkInterface);
 }
开发者ID:buckyu,项目名称:kbengine_unity3d_plugins,代码行数:12,代码来源:KBEngine.cs


示例20: sendTick

        public void sendTick()
        {
            if(!networkInterface_.valid())
                return;

            TimeSpan span = DateTime.Now - lastticktime_;

            updatePlayerToServer();

            if(span.Seconds > 15)
            {
                if(Message.messages["Loginapp_onClientActiveTick"] != null || Message.messages["Baseapp_onClientActiveTick"] != null)
                {
                    Bundle bundle = new Bundle();
                    if(currserver_ == "loginapp")
                    {
                        bundle.newMessage(Message.messages["Loginapp_onClientActiveTick"]);
                    }
                    else
                    {
                        bundle.newMessage(Message.messages["Baseapp_onClientActiveTick"]);
                    }

                    bundle.send(networkInterface_);
                }

                lastticktime_ = System.DateTime.Now;
            }
        }
开发者ID:jsboys,项目名称:kbengine,代码行数:29,代码来源:KBEngine.cs



注:本文中的KBEngine.Bundle类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# KBEngine.MemoryStream类代码示例发布时间:2022-05-26
下一篇:
C# Library.ObjectInstance类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap