Пример #1
0
    //---------------------------------------------------------------------------------------------------------------------
    protected void onLoginClick(GameObject obj)
    {
        if (!mTestAccount)
        {
            CSLogin login = mSocketManager.createPacket <CSLogin>();
            login.setAccount(mAccountEdit.getText());
            login.setPassword(mPasswordEdit.getText());
            mSocketManager.sendMessage(login);
            // 发送登录消息后显示正在登录的提示框
            LT.ACTIVE_WINDOW(mTipMask);
            mCurTime = 0.0f;
        }
        else
        {
            // 创建玩家
            CommandCharacterManagerCreateCharacter cmdCreate = newCmd(out cmdCreate);
            cmdCreate.mCharacterType = CHARACTER_TYPE.CT_MYSELF;
            cmdCreate.mName          = "测试";
            cmdCreate.mID            = 0;
            pushCommand(cmdCreate, mCharacterManager);
            // 设置角色数据
            CharacterMyself myself = mCharacterManager.getMyself();
            CharacterData   data   = myself.getCharacterData();
            data.mMoney = 100;
            data.mHead  = 1;

            // 进入到主场景
            CommandGameSceneManagerEnter cmdEnterMain = newCmd(out cmdEnterMain, true, true);
            cmdEnterMain.mSceneType = GAME_SCENE_TYPE.GST_MAIN;
            pushDelayCommand(cmdEnterMain, mGameSceneManager);
        }
    }
Пример #2
0
    //---------------------------------------------------------------------------------------------------------------------
    protected void onLoginClick(GameObject obj)
    {
        CSLogin login = mSocketNetManager.createPacket(PACKET_TYPE.PT_CS_LOGIN) as CSLogin;

        login.setAccount(mAccountEdit.getText());
        login.setPassword(mPasswordEdit.getText());
        mSocketNetManager.sendMessage(login);
    }
Пример #3
0
    //---------------------------------------------------------------------------------------------------------------------
    protected void onLoginClick(GameObject obj)
    {
        CSLogin login = mSocketNetManager.createPacket <CSLogin>();

        login.setAccount(mAccountEdit.getText());
        login.setPassword(mPasswordEdit.getText());
        mSocketNetManager.sendMessage(login);
    }