Esempio n. 1
0
        // Room服务器创建场景成功的回复;
        void OnCreateScnSuccess(JsonData json)
        {
            int roomID = json["scnID"].AsInt;
            NotifySceneReady roomReady = new NotifySceneReady();

            roomReady.SceneID = roomID;
            for (int i = 0; i < mPlayers.Count; ++i)
            {
                Player player = mPlayers[i];
                NetWork.NotifyMessage <NotifySceneReady>(player.mUserID, STC.STC_SceneReady, roomReady);
            }
        }
Esempio n. 2
0
    void NotifyScnReady(byte[] data)
    {
        NotifySceneReady roomReady = ProtoBufUtils.Deserialize <NotifySceneReady>(data);

        GameController.mScnUID = roomReady.SceneID;
        NetWork.SetUrl(ServerManager.RoomServerUrl);
        SceneSystem.Instance.ChangeScene(SceneSystem.roomScnID);

        ReqEnterScene reqEnterScn = GetReqEnterScn();

        reqEnterScn.UserID   = GameController.mUserInfo.uid;
        reqEnterScn.NickName = GameController.mUserInfo.nickName;
        reqEnterScn.ClassID  = 1;
        NetWork.SendPacket <ReqEnterScene>(CTS.CTS_EnterScn, reqEnterScn, null);
    }