Example #1
0
    //-------------------------------------------------------------------------
    public override void init()
    {
        EbLog.Note("ClientSampleNetwork.init()");

        EntityMgr.getDefaultEventPublisher().addHandler(Entity);

        DefaultRpcSession.defRpcMethod <int, string>(1, _onRpcMethod1);

        connectBase("192.168.0.10", 5882);
    }
Example #2
0
        //-------------------------------------------------------------------------
        public override void init()
        {
            EbLog.Note("ClientPlayerTrade.init()");

            DefaultRpcSession.defRpcMethod <PlayerTradeResponse>(
                (ushort)MethodType.s2cPlayerTradeResponse, s2cPlayerTradeResponse);
            DefaultRpcSession.defRpcMethod <PlayerTradeNotify>(
                (ushort)MethodType.s2cPlayerTradeNotify, s2cPlayerTradeNotify);

            Entity et_app = EntityMgr.findFirstEntityByType <EtApp>();

            CoApp    = et_app.getComponent <ClientApp <DefApp> >();
            CoPlayer = Entity.getComponent <ClientPlayer <DefPlayer> >();
        }
Example #3
0
        //-------------------------------------------------------------------------
        public override void init()
        {
            DefaultRpcSession.defRpcMethod <EquipResponse>(
                (ushort)MethodType.s2cEquipResponse, s2cEquipResponse);
            DefaultRpcSession.defRpcMethod <EquipNotify>(
                (ushort)MethodType.s2cEquipNotify, s2cEquipNotify);

            Entity et_app = EntityMgr.findFirstEntityByType <EtApp>();

            CoApp   = et_app.getComponent <ClientApp <DefApp> >();
            CoActor = Entity.getComponent <ClientActor <DefActor> >();

            // 请求初始化装备
            requestSetEquip();
        }
Example #4
0
        //-------------------------------------------------------------------------
        public override void init()
        {
            DefaultRpcSession.defRpcMethod <BagResponse>(
                (ushort)MethodType.s2cBagResponse, s2cBagResponse);
            DefaultRpcSession.defRpcMethod <BagNotify>(
                (ushort)MethodType.s2cBagNotify, s2cBagNotify);

            Entity et_app = EntityMgr.findFirstEntityByType <EtApp>();

            CoApp    = et_app.getComponent <ClientApp <DefApp> >();
            CoPlayer = Entity.getComponent <ClientPlayer <DefPlayer> >();

            // 请求初始化背包
            requestSetupBag();
        }
Example #5
0
        }                                                         // 本人消息发送记录

        //-------------------------------------------------------------------------
        public override void init()
        {
            DefaultRpcSession.defRpcMethod <PlayerChatResponse>(
                (ushort)MethodType.s2cPlayerChatResponse, s2cPlayerChatResponse);
            DefaultRpcSession.defRpcMethod <PlayerChatNotify>(
                (ushort)MethodType.s2cPlayerChatNotify, s2cPlayerChatNotify);

            Entity et_app = EntityMgr.findFirstEntityByType <EtApp>();

            CoApp = et_app.getComponent <ClientApp <DefApp> >();
            Entity et_player = EntityMgr.findFirstEntityByType <EtPlayer>();

            CoPlayer            = et_player.getComponent <ClientPlayer <DefPlayer> >();
            ListSendTextHistory = new List <ChatMsgSend>();
        }
Example #6
0
        //-------------------------------------------------------------------------
        public override void init()
        {
            EbLog.Note("ClientPlayerMailBox.init()");

            DefaultRpcSession.defRpcMethod <PlayerMailBoxResponse>(
                (ushort)MethodType.s2cPlayerMailBoxResponse, s2cPlayerMailBoxResponse);
            DefaultRpcSession.defRpcMethod <PlayerMailBoxNotify>(
                (ushort)MethodType.s2cPlayerMailBoxNotify, s2cPlayerMailBoxNotify);

            Entity et_app = EntityMgr.findFirstEntityByType <EtApp>();

            CoApp    = et_app.getComponent <ClientApp <DefApp> >();
            CoPlayer = Entity.getComponent <ClientPlayer <DefPlayer> >();
            //ListMailData = new List<MailData>();
            Init = false;

            requestMailBoxInitInfo();
        }
Example #7
0
        //-------------------------------------------------------------------------
        public override void init()
        {
            EbLog.Note("ClientNetMonitor.init()");

            DefaultRpcSession.defRpcMethod <AccountResponse>(
                (ushort)MethodType.s2cAccountResponse, s2cAccountResponse);
            DefaultRpcSession.defRpcMethod <AccountNotify>(
                (ushort)MethodType.s2cAccountNotify, s2cAccountNotify);

            Entity et_app = EntityMgr.findFirstEntityByType <EtApp>();

            CoApp = et_app.getComponent <ClientApp <DefApp> >();

            AccId    = "";
            Acc      = "";
            Token    = "";
            BaseIp   = "";
            BasePort = 5882;
        }
Example #8
0
        }                                                                        // 好友消息记录

        //-------------------------------------------------------------------------
        public override void init()
        {
            DefaultRpcSession.defRpcMethod <PlayerFriendResponse>(
                (ushort)MethodType.s2cPlayerFriendResponse, s2cPlayerFriendResponse);
            DefaultRpcSession.defRpcMethod <PlayerFriendNotify>(
                (ushort)MethodType.s2cPlayerFriendNotify, s2cPlayerFriendNotify);

            Entity et_app = EntityMgr.findFirstEntityByType <EtApp>();

            CoApp = et_app.getComponent <ClientApp <DefApp> >();
            Entity et_player = EntityMgr.findFirstEntityByType <EtPlayer>();

            CoPlayer = et_player.getComponent <ClientPlayer <DefPlayer> >();

            FriendListInDesktop = new List <PlayerInfo>();
            MapMsgRecord        = new Dictionary <string, List <ChatMsgRecord> >();

            // 请求获取好友列表
            //requestGetFriendList();
        }
Example #9
0
        //-------------------------------------------------------------------------
        public override void init()
        {
            EbLog.Note("ClientPlayerDesktop.init()");

            DefaultRpcSession.defRpcMethod <DesktopResponse>(
                (ushort)MethodType.s2cPlayerDesktopResponse, s2cPlayerDesktopResponse);
            DefaultRpcSession.defRpcMethod <DesktopNotify>(
                (ushort)MethodType.s2cPlayerDesktopNotify, s2cPlayerDesktopNotify);

            Entity et_app = EntityMgr.findFirstEntityByType <EtApp>();

            CoApp = et_app.getComponent <ClientApp <DefApp> >();
            Entity et_player = EntityMgr.findFirstEntityByType <EtPlayer>();

            CoPlayer = et_player.getComponent <ClientPlayer <DefPlayer> >();

            DesktopConfigData      = new DesktopConfigData();
            MapEtActorMirrorByGuid = new Dictionary <string, Entity>();

            mMapAoIEvent[(byte)_eAoIEvent.SceneBroadcast] = onAoIEventSceneBroadcast;
        }
Example #10
0
        //-------------------------------------------------------------------------
        public override void init()
        {
            EbLog.Note("ClientPlayerTask.init()");

            DefaultRpcSession.defRpcMethod <PlayerTaskResponse>(
                (ushort)MethodType.s2cPlayerTaskResponse, s2cPlayerTaskResponse);
            DefaultRpcSession.defRpcMethod <PlayerTaskNotify>(
                (ushort)MethodType.s2cPlayerTaskNotify, s2cPlayerTaskNotify);

            Entity et_app = EntityMgr.findFirstEntityByType <EtApp>();

            CoApp    = et_app.getComponent <ClientApp <DefApp> >();
            CoPlayer = Entity.getComponent <ClientPlayer <DefPlayer> >();

            TaskMgr = new TaskMgr(Entity, true);
            TaskMgr.regTaskFactory(new TaskFactoryCollectItem());
            TaskMgr.regTaskFactory(new TaskFactoryDialogue());
            TaskMgr.regTaskFactory(new TaskFactoryKillMonster());
            TaskMgr.OnClientTaskStateChange = _onTaskStateChange;

            requestSetupTask();
        }
Example #11
0
        //_eRequestPlayerInfoReason mRequestPlayerInfoReason;

        //-------------------------------------------------------------------------
        public override void init()
        {
            EbLog.Note("ClientPlayer.init() EntityGuid=" + Entity.Guid);

            DefaultRpcSession.defRpcMethod <PlayerResponse>(
                (ushort)MethodType.s2cPlayerResponse, s2cPlayerResponse);
            DefaultRpcSession.defRpcMethod <PlayerNotify>(
                (ushort)MethodType.s2cPlayerNotify, s2cPlayerNotify);

            EntityMgr.getDefaultEventPublisher().addHandler(Entity);

            Entity et_app = EntityMgr.findFirstEntityByType <EtApp>();

            CoApp           = et_app.getComponent <ClientApp <DefApp> >();
            OnlinePlayerNum = 0;
            GetOnlinePlayerNumTimeElapsed = 0f;

            // 销毁EtLogin
            Entity et_login = EntityMgr.findFirstEntityByType <EtLogin>();

            EntityMgr.destroyEntity(et_login);

            // ClientActor组件
            CoActor = Entity.getComponent <ClientActor <DefActor> >();

            // ClientBag组件
            CoBag = Entity.getComponent <ClientBag <DefBag> >();

            // ClientStatus组件
            CoStatus = Entity.getComponent <ClientStatus <DefStatus> >();

            // ClientPlayerChat组件
            CoPlayerChat = Entity.getComponent <ClientPlayerChat <DefPlayerChat> >();

            // ClientPlayerFriend组件
            CoPlayerFriend = Entity.getComponent <ClientPlayerFriend <DefPlayerFriend> >();

            // ClientPlayerTask组件
            CoPlayerTask = Entity.getComponent <ClientPlayerTask <DefPlayerTask> >();

            // ClientPlayerDesktop组件
            CoPlayerDesktop = Entity.getComponent <ClientPlayerDesktop <DefPlayerDesktop> >();

            // ClientPlayerLobby组件
            CoPlayerLobby = Entity.getComponent <ClientPlayerLobby <DefPlayerLobby> >();

            // ClientPlayerMailBox组件
            CoPlayerMailBox = Entity.getComponent <ClientPlayerMailBox <DefPlayerMailBox> >();

            // ClientPlayerRanking组件
            CoPlayerRanking = Entity.getComponent <ClientPlayerRanking <DefPlayerRanking> >();

            // 显示主界面
            //UiMgr.Instance.CoPlayer = (ClientPlayer<DefPlayer>)(IComponent)this;
            //UiMgr.Instance.NeedChangeAtlas = CoActor.Def.mPropIsVIP.get();
            //UiMgr.Instance.destroyCurrentUi<UiMbLoading>();
            //createMainUi();
            var ui_main = UiMgr.Instance.createUi <UiMain>("Main", "Main");

            ui_main.init();

            // 请求获取在线玩家数量
            requestGetOnlinePlayerNum();
        }