Example #1
0
    public static WorldMap_RoleEnterReturnProto GetProto(byte[] buffer, bool isChild = false)
    {
        WorldMap_RoleEnterReturnProto proto = new WorldMap_RoleEnterReturnProto();

        MMO_MemoryStream ms = null;

        if (!isChild)
        {
            ms = GameEntry.Socket.SocketSendMS;
        }
        else
        {
            ms = GameEntry.Pool.DequeueClassObject <MMO_MemoryStream>();
        }
        ms.SetLength(0);
        ms.Write(buffer, 0, buffer.Length);
        ms.Position = 0;

        proto.IsSuccess = ms.ReadBool();
        if (!proto.IsSuccess)
        {
            proto.MsgCode = ms.ReadInt();
        }

        if (isChild)
        {
            GameEntry.Pool.EnqueueClassObject(ms);
        }
        return(proto);
    }
Example #2
0
    public static WorldMap_RoleEnterReturnProto GetProto(byte[] buffer)
    {
        WorldMap_RoleEnterReturnProto proto = new WorldMap_RoleEnterReturnProto();

        using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer))
        {
            proto.IsSuccess = ms.ReadBool();
            if (!proto.IsSuccess)
            {
                proto.MsgCode = ms.ReadInt();
            }
        }
        return(proto);
    }
Example #3
0
    public static WorldMap_RoleEnterReturnProto GetProto(MMO_MemoryStream ms, byte[] buffer)
    {
        WorldMap_RoleEnterReturnProto proto = new WorldMap_RoleEnterReturnProto();

        ms.SetLength(0);
        ms.Write(buffer, 0, buffer.Length);
        ms.Position = 0;

        proto.IsSuccess = ms.ReadBool();
        if (!proto.IsSuccess)
        {
            proto.MsgCode = ms.ReadInt();
        }

        return(proto);
    }
Example #4
0
    /// <summary>
    /// 服务器返回角色进入世界地图场景消息
    /// </summary>
    /// <param name="buffer"></param>
    private void OnWorldMapRoleEnterReturn(byte[] buffer)
    {
        WorldMap_RoleEnterReturnProto proto = WorldMap_RoleEnterReturnProto.GetProto(buffer);

        if (proto.IsSuccess)
        {
            m_CurrWorldMapId = m_WillToWorldMapId;

            CurrSceneType = SceneType.WorldMap;
            CurrPlayType  = PlayType.PVP;

            WorldMapEntity entity = WorldMapDBModel.Instance.Get(m_CurrWorldMapId);
            if (entity != null)
            {
                //不是主城 就可以战斗
                IsFightingScene = entity.IsCity == 0;
            }

            SceneManager.LoadScene("Scene_Loading");
        }
    }