Esempio n. 1
0
    private string GetPlayerNames(MJGameIpInfo info)
    {
        if (info == null || info.seatId == null)
        {
            return("");
        }
        string      rolename = "";
        int         len      = info.seatId.Length;
        MJGameModel model    = MJGameModel.Inst;

        for (int i = 0; i < len; i++)
        {
            if (model.mRoomPlayers[info.seatId[i]] != null)
            {
                string n = model.mRoomPlayers[info.seatId[i]].nickName.Replace("\u0000", "");
                if (i == 0)
                {
                    rolename = n;
                }
                else
                {
                    rolename = rolename + "、" + n;
                }
            }
        }
        return(rolename);
    }
Esempio n. 2
0
    private MJGameBackController mBackController; //回放controller

    protected override void Awake()
    {
        base.Awake();
        mBackController = Global.Inst.GetController <MJGameBackController>();
        mModel          = MJGameModel.Inst;
        mBackModel      = MJGameBackModel.Inst;
        InitMJScene();
        mFourBtGameObject.gameObject.SetActive(true);
        mDeltaTime = 2f;
    }
Esempio n. 3
0
    private const string VOICE_INS_OTHER  = "LZMJ/Other/";         //其他操作声音

    public MJGameController() : base("GameUI", "Windows/Majiang/GameUI")
    {
        NetProcess.RegisterResponseCallBack(MJProtoMap.Cmd_GetGameStart, HandleStartGameData);    //麻将游戏开始 发牌
        NetProcess.RegisterResponseCallBack(MJProtoMap.Cmd_GetOnOptList, GetOnOptListACK);        //同步 玩家可以操作什么指令
        NetProcess.RegisterResponseCallBack(MJProtoMap.Cmd_GetOnWhoOptIns, GetInstructionsACK);   //同步谁操作了什么指令
        NetProcess.RegisterResponseCallBack(MJProtoMap.Cmd_GetSettlement, OnSettlement);          //同步小结算
        NetProcess.RegisterResponseCallBack(MJProtoMap.Cmd_GetBigSem, OnSettlementFinal);         //大结算
        NetProcess.RegisterResponseCallBack(MJProtoMap.CMD_PlayerJoinInRoom, OnPlayerJoinInRoom); //有玩家加入房间
        NetProcess.RegisterResponseCallBack(MJProtoMap.CMD_OnGetChat, NetOnGameTalk);             //同步游戏聊天
        NetProcess.RegisterResponseCallBack(MJProtoMap.CMD_ReadyCountDown, OnReadyCountDown);     //同步游戏准备倒计时

        //NetProcess.RegisterResponseCallBack(MJProtoMap.Cmd_GetErrorCode, (msg) =>
        //{
        //    ResponeErrorCode data = msg.Read<ResponeErrorCode>();
        //    GameUtils.ShowErrorTips(data.code);
        //});//错误列表


        SetModel <MJGameModel>();
        mModel = MJGameModel.Inst;
    }
Esempio n. 4
0
    public Queue <MJoptInfoData> msgQueue = new Queue <MJoptInfoData>();//操作  消息 队列

    public override void SetController(BaseController c)
    {
        base.SetController(c);
        Inst = this;
    }