private void DoSaveFriend(string f1, string f2, string requester = "")
 {
     ADatabaseConfigsManager.avatarDB.UpdateOneData(TableName
                                                    , (ADBAccessor.filter_eq(InfoNameDefs.Friend1, f1) & ADBAccessor.filter_eq(InfoNameDefs.Friend2, f2))
                                                    | (ADBAccessor.filter_eq(InfoNameDefs.Friend1, f2) & ADBAccessor.filter_eq(InfoNameDefs.Friend2, f1))
                                                    , ADBAccessor.updates_build(ADBAccessor.update(InfoNameDefs.Friend1, f1)
                                                                                , ADBAccessor.update(InfoNameDefs.Friend2, f2)
                                                                                , (string.IsNullOrEmpty(requester)
                 ? ADBAccessor.update_unset(InfoNameDefs.FriendRequester)
                 : ADBAccessor.update(InfoNameDefs.FriendRequester, requester))), true);
 }
        public HttpResponseMessage Logout(string username, string token)
        {
            var eCheck = ATokenManager.Instance.OnCheckToken(username, token);

            if (!eCheck)
            {
                return(ResultToJson.GetErrorJsonResponse("Invalid token."));
            }

            ATokenManager.Instance.OnRemoveToken(username);
            ADatabaseConfigsManager.userDB.UpdateOneData(ADatabaseConfigsManager.tUserData, ADBAccessor.filter_eq(InfoNameDefs.Username, username), ADBAccessor.update_unset(InfoNameDefs.UserToken));
            return(ResultToJson.GetErrorJsonResponse());
        }
    public override void OnAddItem(int itemID, int count)
    {
        base.OnAddItem(itemID, count);

        if (dItems.ContainsKey(itemID))
        {
            ADBManager.Get(InitValueDefs.dbconnect, InitValueDefs.dbname).UpdateOneData(tableName, ADBAccessor.filter_eq(ParamNameDefs.CollectionID, ownerServer.objectId),
                                                                                        ADBAccessor.updates_build(ADBAccessor.update(ParamNameDefs.BagSlotPre + itemID, dItems[itemID])), true);
        }
        else
        {
            ADBManager.Get(InitValueDefs.dbconnect, InitValueDefs.dbname).UpdateOneData(tableName, ADBAccessor.filter_eq(ParamNameDefs.CollectionID, ownerServer.objectId),
                                                                                        ADBAccessor.updates_build(ADBAccessor.update_unset(ParamNameDefs.BagSlotPre + itemID)));
        }
    }