Ejemplo n.º 1
0
def buildPacket(writer, urlParam, actionResult):
    writer.PushIntoStack(MathUtils.ToNotNullString(actionResult.AchieveName))
    writer.PushShortIntoStack(MathUtils.ToShort(actionResult.AchieveType))
    writer.PushIntoStack(MathUtils.ToNotNullString(actionResult.HeadID))
    writer.PushIntoStack(MathUtils.ToNotNullString(actionResult.AchieveDesc))
    writer.PushShortIntoStack(MathUtils.ToShort(actionResult.IsComplete))
    writer.PushIntoStack(actionResult.CompleteNum)
    writer.PushIntoStack(actionResult.AchieveNum)

    return True
Ejemplo n.º 2
0
def buildPacket(writer, urlParam, actionResult):
    writer.PushIntoStack(actionResult.CompleteNum)
    writer.PushIntoStack(actionResult.AchieveNum)
    writer.PushIntoStack(actionResult.PageCount)
    writer.PushIntoStack(len(actionResult.AchieveList))
    for info in actionResult.AchieveList:
        isGain = AchieveTask.GetAchieveStatus(actionResult.userID, info.Id)
        dsItem = DataStruct()
        dsItem.PushIntoStack(info.Id)
        dsItem.PushIntoStack(MathUtils.ToNotNullString(info.Name))
        dsItem.PushIntoStack(MathUtils.ToNotNullString(info.HeadIcon))
        dsItem.PushShortIntoStack(MathUtils.ToShort(isGain))
        writer.PushIntoStack(dsItem)

    return True
Ejemplo n.º 3
0
def buildPacket(writer, urlParam, actionResult):
    writer.PushIntoStack(actionResult.PageCount)
    writer.PushIntoStack(len(actionResult.userItemList))
    for info in actionResult.userItemList:
        itemName = ''
        headID = ''
        shopInfo = ConfigCacheSet[ShopInfo]().FindKey(info.ItemID)
        if shopInfo:
            itemName = shopInfo.ShopName
            headID = shopInfo.HeadID
        dsItem = DataStruct()
        dsItem.PushIntoStack(MathUtils.ToNotNullString(info.UserItemID))
        dsItem.PushIntoStack(info.ItemID)
        dsItem.PushIntoStack(MathUtils.ToNotNullString(itemName))
        dsItem.PushShortIntoStack(MathUtils.ToShort(info.ShopType))
        dsItem.PushIntoStack(info.Num)
        dsItem.PushIntoStack(MathUtils.ToNotNullString(headID))
        writer.PushIntoStack(dsItem)
    return True
Ejemplo n.º 4
0
def buildPacket(writer, urlParam, actionResult):
    writer.PushIntoStack(actionResult.goldNum)
    writer.PushIntoStack(actionResult.gameCoin)
    writer.PushIntoStack(actionResult.freeNum)
    writer.PushIntoStack(actionResult.isSale)
    writer.PushIntoStack(actionResult.issTelegrams)
    writer.PushIntoStack(len(actionResult.grayCrystalArray))
    for info in actionResult.grayCrystalArray:
        crystalName = ''
        headID = ''
        crystalQuality = 0
        crystalInfo = ConfigCacheSet[CrystalInfo]().FindKey(info.CrystalID)
        if crystalInfo is not None:
            crystalName = crystalInfo.CrystalName
            headID = crystalInfo.HeadID
            crystalQuality = MathUtils.ToShort(crystalInfo.CrystalQuality)
        DsItem = DataStruct()
        DsItem.PushIntoStack(MathUtils.ToNotNullString(info.UserCrystalID))
        DsItem.PushIntoStack(info.CrystalID)
        DsItem.PushIntoStack(MathUtils.ToNotNullString(crystalName))
        DsItem.PushIntoStack(MathUtils.ToNotNullString(headID))
        DsItem.PushShortIntoStack(crystalQuality)
        writer.PushIntoStack(DsItem)

    writer.PushIntoStack(actionResult.userLightArray.Count)
    for info in actionResult.userLightArray:
        probabilityInfo = ConfigCacheSet[ProbabilityInfo]().FindKey(
            info.HuntingID)
        price = 0
        if probabilityInfo is not None:
            price = probabilityInfo.Price
        DsItem = DataStruct()
        DsItem.PushIntoStack(info.HuntingID)
        DsItem.PushIntoStack(price)
        DsItem.PushIntoStack(info.IsLight)
        writer.PushIntoStack(DsItem)

    writer.PushIntoStack(MathUtils.ToNotNullString(actionResult.prompt))

    return True
Ejemplo n.º 5
0
def buildPacket(writer, urlParam, actionResult):
    writer.PushIntoStack(actionResult.PageCount)
    writer.PushIntoStack(len(actionResult.TaskList))
    for info in actionResult.TaskList:
        CompleteNum = 0
        IsReceive = 1
        usertaskInfo = AchieveTask.GetUserTaskInfo(actionResult.userID,info.TaskID)
        if usertaskInfo:
            CompleteNum = usertaskInfo.TaskNum
            if CompleteNum>info.RestraintNum:
                CompleteNum =info.RestraintNum
            IsReceive = MathUtils.ToShort(usertaskInfo.TaskStatus)
        dsItem = DataStruct()
        dsItem.PushIntoStack(info.TaskID)
        dsItem.PushIntoStack(MathUtils.ToNotNullString(info.TaskName))
        dsItem.PushIntoStack(CompleteNum)
        dsItem.PushIntoStack(info.RestraintNum)
        dsItem.PushIntoStack(MathUtils.ToNotNullString(info.TaskDesc))
        dsItem.PushIntoStack(info.GameCoin)
        dsItem.PushShortIntoStack(IsReceive)
        writer.PushIntoStack(dsItem)
    return True
Ejemplo n.º 6
0
def takeAction(urlParam, parent):
    actionResult = ActionResult()
    userId = parent.Current.User.PersonalId;
    user = parent.Current.User

    achievement = ConfigCacheSet[AchievementInfo]().FindKey(urlParam.AchieveID)
    if achievement:
        actionResult.AchieveName = achievement.Name
        actionResult.AchieveType = achievement.Type
        actionResult.HeadID = achievement.HeadIcon
        actionResult.AchieveDesc = achievement.Description
        actionResult.AchieveNum = achievement.TargetNum
    cacheSet = GameDataCacheSet[UserAchieve]()
    achievePackage = cacheSet.FindKey(userId);
    if achievePackage:
        userAchievement = achievePackage.AchievePackage.Find(match = lambda s: s.AchieveID == urlParam.AchieveID)
        if userAchievement:
            actionResult.IsComplete = MathUtils.ToShort(userAchievement.TaskStatus)
            actionResult.CompleteNum = userAchievement.TaskNum

    #需要实现
    return actionResult