Exemple #1
0
 public static CountMgr getInstance()
 {
     if (s_mgr == null)
     {
         s_mgr = new CountMgr();
         s_mgr.init();
     }
     return(s_mgr);
 }
    // 函数自拼接所需要的参数
    public void addLog(int op_type, OpParam op_param, GMUser user)
    {
        m_id = CountMgr.getInstance().getCurId(CountMgr.OP_LOG_COUNT_KEY);
        Dictionary <string, object> data = new Dictionary <string, object>();

        data["id"]        = m_id;
        data["OpDbIP"]    = user.m_dbIP;
        data["account"]   = user.m_user;
        data["accountIP"] = user.m_ip;
        data["OpType"]    = op_type;
        data["OpTime"]    = DateTime.Now;
        data["OpParam"]   = op_param.getString();

        // 操作日志存于0号服务器
        bool res = DBMgr.getInstance().save(TableName.OPLOG, data, "id", m_id, 0, DbName.DB_ACCOUNT);
    }