user_default/CCUserDefault(本地缓存 --通过读写xml文件)

本文介绍了Cocos2d-x引擎中CCUserDefault类的功能与用法,用于存储游戏通用的用户配置信息,并讨论了如何在使用此类时进行数据加密以保护用户隐私。通过示例展示了如何设置和获取各种类型的配置值,并提供了一个简单的加密方法来确保数据安全性。

#ifndef __SUPPORT_CCUSERDEFAULT_H__

#define __SUPPORT_CCUSERDEFAULT_H__


#include "platform/CCPlatformMacros.h"

#include <string>


NS_CC_BEGIN


/**

 * @addtogroup data_storage

 * @{

 */


/**

 * CCUserDefault acts as a tiny database. You can save and get base type values by it.

 * For example, setBoolForKey("played", true) will add a bool value true into the database.

 * Its key is "played". You can get the value of the key by getBoolForKey("played").

 * 

 * It supports the following base types:

 * bool, int, float, double, string

 */

class CC_DLL CCUserDefault

{

public:

    ~CCUserDefault();


    // get value methods


    /**

    @brief Get bool value by key, if the key doesn't exist, a default value will return.

     You can set the default value, or it is false.

    */

    bool    getBoolForKey(const char* pKey);

    bool    getBoolForKey(const char* pKey, bool defaultValue);

    /**

    @brief Get integer value by key, if the key doesn't exist, a default value will return.

     You can set the default value, or it is 0.

    */

    int     getIntegerForKey(const char* pKey);

    int     getIntegerForKey(const char* pKey, int defaultValue);

    /**

    @brief Get float value by key, if the key doesn't exist, a default value will return.

     You can set the default value, or it is 0.0f.

    */

    float    getFloatForKey(const char* pKey);

    float    getFloatForKey(const char* pKey, float defaultValue);

    /**

    @brief Get double value by key, if the key doesn't exist, a default value will return.

     You can set the default value, or it is 0.0.

    */

    double  getDoubleForKey(const char* pKey);

    double  getDoubleForKey(const char* pKey, double defaultValue);

    /**

    @brief Get string value by key, if the key doesn't exist, a default value will return.

    You can set the default value, or it is "".

    */

    std::string getStringForKey(const char* pKey);

    std::string getStringForKey(const char* pKey, const std::string & defaultValue);


    // set value methods


    /**

    @brief Set bool value by key.

    */

    void    setBoolForKey(const char* pKey, bool value);

    /**

    @brief Set integer value by key.

    */

    void    setIntegerForKey(const char* pKey, int value);

    /**

    @brief Set float value by key.

    */

    void    setFloatForKey(const char* pKey, float value);

    /**

    @brief Set double value by key.

    */

    void    setDoubleForKey(const char* pKey, double value);

    /**

    @brief Set string value by key.

    */

    void    setStringForKey(const char* pKey, const std::string & value);

    /**

     @brief Save content to xml file

     */

    void    flush();


    static CCUserDefault* sharedUserDefault();

    static void purgeSharedUserDefault();

    const static std::string& getXMLFilePath();

    static bool isXMLFileExist();


private:

    CCUserDefault();

    static bool createXMLFile();

    static void initXMLFilePath();

    

    static CCUserDefault* m_spUserDefault;

    static std::string m_sFilePath;

    static bool m_sbIsFilePathInitialized;

};


// end of data_storage group

/// @}


NS_CC_END


#endif // __SUPPORT_CCUSERDEFAULT_H__




CCUserDefault是Cocos2d-x引擎提供的持久化方案,其作用是存储所有游戏通用的用户配置信息,例如音乐和音效配置等。为了方便起见,有时我们也可以用CCUserDefault来存储金币数目这种简单的数据项。

 CCUserDefault可以看做一个永久存储的字典,本质是一个XML文件,将每个键及其对应的值以节点的形式存储到外存中。值只支持int和float等基本类型.

[cpp]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. CCUserDefault::sharedUserDefault()->setBoolForKey("exit"true);  
  2. pan style="color:#ff0000;">  CCUserDefault::sharedUserDefault()->flush();</span>//这行一定要加上,不然下次启动游戏的时候,该数据就没有保存。  
  3. bool bexit = CCUserDefault::sharedUserDefault()->getBoolForKey("exit");  

这里要注意,    CCUserDefault中有个  flush()的函数,这个用来将数据写入xml文件中,也就是说当你使用setXX的一些函数后记得提交(调用一下flush函数)

XML的一个很严重的问题是明文存储,存储在外部的数据一旦被截获,就将直接暴露在攻击者面前,小则篡改用户数据,大则泄露用户隐私信息。因此,对存储在文件中的信息加密不可忽视。
 幸运的是,前面我们已经设计好了序列化和反序列化过程,只要在其中加入合适的加密和解密算法,即可保证我们的数据不会被轻易窃取。这里我们只使用一个简单的编码轮换来加密,相关代码如下:


[cpp]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. void encode(string &str)  
  2. {  
  3.     for(int i = 0; i < str.length(); i++) {  
  4.         int ch = str[i];  
  5.         ch = 0xff & (((ch & (1 << 7)) >> 7) & (ch << 1));  
  6.         str[i] = ch;  
  7.     }  
  8. }  
  9. void decode(string &str)  
  10. {  
  11.   
  12.     for(int i = 0; i < str.length(); i++) {  
  13.         int ch = str[i];  
  14.         ch = 0xff & (((ch & (1)) << 7) & (ch >> 1));  
  15.         str[i] = ch;  
  16.     }  
  17.   
  18. }  

C:\Users\c>mvn install:install-file -Dfile=spring-test-5.1.8.RELEASE.jar -DgroupId=org.springframework -DartifactId=spring-test -Dversion=5.1.8.RELEASE -Dpackaging=jar [INFO] Scanning for projects... Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom (4 KB at 9.2 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom (13 KB at 132.6 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-parent/21/maven-parent-21.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-parent/21/maven-parent-21.pom (26 KB at 79.2 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/apache/10/apache-10.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/apache/10/apache-10.pom (15 KB at 73.0 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar (25 KB at 71.4 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom (7 KB at 20.9 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-plugins/23/maven-plugins-23.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-plugins/23/maven-plugins-23.pom (9 KB at 109.5 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-parent/22/maven-parent-22.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-parent/22/maven-parent-22.pom (30 KB at 330.1 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/apache/11/apache-11.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/apache/11/apache-11.pom (15 KB at 45.6 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.jar (27 KB at 333.2 KB/sec) [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom --- Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.pom (2 KB at 3.7 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven/2.0.6/maven-2.0.6.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven/2.0.6/maven-2.0.6.pom (9 KB at 71.8 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-parent/5/maven-parent-5.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-parent/5/maven-parent-5.pom (15 KB at 236.2 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/apache/3/apache-3.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/apache/3/apache-3.pom (4 KB at 38.5 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6.pom (3 KB at 37.3 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.pom (2 KB at 26.1 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.pom (3 KB at 49.6 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-utils/1.4.1/plexus-utils-1.4.1.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-utils/1.4.1/plexus-utils-1.4.1.pom (2 KB at 21.9 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom (9 KB at 116.8 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.pom (4 KB at 46.5 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-containers/1.0.3/plexus-containers-1.0.3.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-containers/1.0.3/plexus-containers-1.0.3.pom (492 B at 7.6 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom (6 KB at 96.6 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/junit/junit/3.8.1/junit-3.8.1.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/junit/junit/3.8.1/junit-3.8.1.pom (998 B at 14.3 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom (7 KB at 58.7 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.pom (4 KB at 51.8 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6.pom (2 KB at 23.6 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.pom (3 KB at 40.6 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6.pom (2 KB at 18.2 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6.pom (2 KB at 22.3 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6.pom (2 KB at 25.0 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-utils/3.0.5/plexus-utils-3.0.5.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-utils/3.0.5/plexus-utils-3.0.5.pom (3 KB at 30.3 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus/3.1/plexus-3.1.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus/3.1/plexus-3.1.pom (19 KB at 256.0 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/sonatype/spice/spice-parent/17/spice-parent-17.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/sonatype/spice/spice-parent/17/spice-parent-17.pom (7 KB at 91.7 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/sonatype/forge/forge-parent/10/forge-parent-10.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/sonatype/forge/forge-parent/10/forge-parent-10.pom (14 KB at 181.4 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-digest/1.0/plexus-digest-1.0.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-digest/1.0/plexus-digest-1.0.pom (2 KB at 11.1 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-components/1.1.7/plexus-components-1.1.7.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-components/1.1.7/plexus-components-1.1.7.pom (5 KB at 57.2 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus/1.0.8/plexus-1.0.8.pom (8 KB at 87.2 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.pom Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.pom (8 KB at 72.4 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.jar Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6.jar Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6.jar Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.jar Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.jar (13 KB at 115.2 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.jar (48 KB at 409.8 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/junit/junit/3.8.1/junit-3.8.1.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6.jar (29 KB at 241.4 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6.jar (35 KB at 294.1 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6.jar (114 KB at 766.6 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar (37 KB at 144.2 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.jar (85 KB at 320.8 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/junit/junit/3.8.1/junit-3.8.1.jar (119 KB at 434.7 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-utils/3.0.5/plexus-utils-3.0.5.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar (190 KB at 660.7 KB/sec) Downloading: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-digest/1.0/plexus-digest-1.0.jar Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.jar (56 KB at 184.6 KB/sec) Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6.jar (24 KB at 72.6 KB/sec) Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6.jar (86 KB at 248.0 KB/sec) Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-utils/3.0.5/plexus-utils-3.0.5.jar (226 KB at 601.7 KB/sec) Downloaded: http://maven.aliyun.com/nexus/content/repositories/central/org/codehaus/plexus/plexus-digest/1.0/plexus-digest-1.0.jar (12 KB at 30.2 KB/sec) [ERROR] The specified file 'C:\Users\c\spring-test-5.1.8.RELEASE.jar' not exists [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5.888 s [INFO] Finished at: 2025-07-29T10:57:44+08:00 [INFO] Final Memory: 10M/201M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project standalone-pom: The specified file 'C:\Users\c\spring-test-5.1.8.RELEASE.jar' not exists -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
07-30
[show_car_model-5] process has died [pid 53596, exit code 1, cmd /home/nvidia/radar/72/r7863_ros_sw/r7863_ros_sw/install/lib/car_model/show_car_model.py __name:=show_car_model __log:=/root/.ros/log/44fc5cac-84b2-11f0-a0af-a931dbf4ce1d/show_car_model-5.log]. log file: /root/.ros/log/44fc5cac-84b2-11f0-a0af-a931dbf4ce1d/show_car_model-5*.log [INFO] [1756456166.731344290]: using default calibration URL [INFO] [1756456166.733764507]: camera calibration URL: file:///root/.ros/camera_info/head_camera.yaml [INFO] [1756456166.734195360]: Unable to open camera calibration file [/root/.ros/camera_info/head_camera.yaml] [WARN] [1756456166.734502595]: Camera calibration file /root/.ros/camera_info/head_camera.yaml not found. [INFO] [1756456166.734806694]: Starting 'head_camera' (/dev/video0) at 640x480 via mmap (yuyv) at 30 FPS [ERROR] [1756456166.735197866]: Couldn't query v4l fps! error 25, Inappropriate ioctl for device [usb_cam0-2] process has died [pid 53591, exit code 1, cmd /opt/ros/noetic/lib/usb_cam/usb_cam_node __name:=usb_cam0 __log:=/root/.ros/log/44fc5cac-84b2-11f0-a0af-a931dbf4ce1d/usb_cam0-2.log]. log file: /root/.ros/log/44fc5cac-84b2-11f0-a0af-a931dbf4ce1d/usb_cam0-2*.log [INFO] [1756456167.367858202]: Stereo is NOT SUPPORTED [INFO] [1756456167.368498400]: OpenGL device: NVIDIA Tegra Orin (nvgpu)/integrated [INFO] [1756456167.368970629]: OpenGl version: 4.6 (GLSL 4.6). [ERROR] [1756456172.253603325]: Tried to advertise a service that is already advertised in this node [/r7863_show/compressed/set_parameters]
最新发布
08-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值