Project Boolean [C# - R63A - OS - Free]

Page 5 of 6 FirstFirst 123456 LastLast
Results 61 to 75 of 79
  1. #61
    Proficient Member Squard is offline
    MemberRank
    Dec 2011 Join Date
    155Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    I created the difference:

    In Progress <>


    Finished <>

  2. #62
    Alpha Member Zak© is offline
    MemberRank
    Oct 2007 Join Date
    2,693Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    It nice to see you use Linq code.

  3. #63
    Retired maritnmine is offline
    MemberRank
    May 2007 Join Date
    North KoreaLocation
    1,103Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    Quote Originally Posted by Zak© View Post
    It nice to see you use Linq code.
    LINQ isn't always the best. I remember back years ago while I was doing coding on the Holo emu shit, we converted all the foreach statements to LINQ because LINQ was THE SHIT.
    And no, I would not have used that LINQ code in my server x]

    - Martin

  4. #64
    Proficient Member Squard is offline
    MemberRank
    Dec 2011 Join Date
    155Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    Achievement Progress:

    Code:
            public void GetResponse(OutMessage Message, Character Character)
            {
                var Achievements = StorageHandler.GetCharacterAchievements(Character.Id);
                var Details = StorageHandler.GetAchievementDetailsSorted(Id);
                var QueryA = (from item in Achievements where item.AchievementId == Id select item);
                var MaxLevel = Details.Count() > 0 ? Details.Count() : 1;
    
                var MyProgress = QueryA.Count() > 0 ? QueryA.First() : new CharacterAchievement(-1, Character.Id, Id, 0);
                var CurrentLevel = MyProgress.CurrentLevel;
                var NextLevel = (CurrentLevel + 1);
    
                if (NextLevel > MaxLevel)
                {
                    NextLevel= MaxLevel;
                }
    
                if (CurrentLevel >= MaxLevel)
                {
                    CurrentLevel = MaxLevel;
                }
    
                var QueryB = (from item in Details where item.Level == NextLevel select item);
    
                var NextRequired = QueryB.Count() > 0 ?  QueryB.First().RequiredAmmount : 1;
    
                Message.Append(Id);
                Message.Append(NextLevel);
                Message.Append(GetBadge(NextLevel));
                Message.Append(NextRequired);
                Message.Append(GetPixelReward(NextLevel));
                Message.Append(0); // TODO <> BadgeId
                Message.Append(0); // TODO <> GotAlready
                Message.Append(CurrentLevel == MaxLevel);
                Message.Append(AchievementHandler.GetCategory(ParentId).Caption.ToLower());
                Message.Append(MaxLevel);
            }
    Quote Originally Posted by maritnmine View Post
    LINQ isn't always the best. I remember back years ago while I was doing coding on the Holo emu shit, we converted all the foreach statements to LINQ because LINQ was THE SHIT.
    And no, I would not have used that LINQ code in my server x]

    - Martin
    Yes it not super else.

    Debug result: (Dictionary progressing <int,string> of 100 items)

    Code:
    00:00:00.0200000 Linq
    00:00:00 Loop

  5. #65
    Banned Divide is offline
    BannedRank
    Aug 2011 Join Date
    British CoderLocation
    1,013Posts
    Im liking acheivements Squard. GOOD JOB!

    Sent from my mobile via Tapatalk.

  6. #66
    Proficient Member Squard is offline
    MemberRank
    Dec 2011 Join Date
    155Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    Removed Linq lines. Replaced them with Loops.

    Its Faster I tested it.

    Special achievement-score calculator.

    Spares MySQL

    Code:
            public int GetAchievementScore()
            {
                var Result = 0;
    
                foreach (var AchievementProgress in StorageHandler.GetCharacterAchievements(Id))
                {
                    var Achievement = AchievementHandler.GetAchievement(AchievementProgress.Id);
    
                    Result += (AchievementProgress.CurrentLevel * Achievement.ScorePerLevel);
                }
    
                return Result;
            }

  7. #67
    Alpha Member Zak© is offline
    MemberRank
    Oct 2007 Join Date
    2,693Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    So i guess it's better to use loops i guess.

    Anyhow why not try out Lua style.

  8. #68
    Developer Quackster is online now
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,474Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    Why do you use the variable name 'var' for everything?

  9. #69
    Alpha Member Zak© is offline
    MemberRank
    Oct 2007 Join Date
    2,693Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    Quote Originally Posted by Quackster View Post
    Why do you use the variable name 'var' for everything?
    Code is shorter plus it define it automatically.

    It's nothing just a short-cut i'd say.

  10. #70
    Proficient Member Squard is offline
    MemberRank
    Dec 2011 Join Date
    155Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    Quote Originally Posted by Zak© View Post
    Code is shorter plus it define it automatically.

    It's nothing just a short-cut i'd say.
    Short-cut and cannot be null. ;D

    Stabilized Achievements and added:

    Code:
        class BadgePointLimitsComposer : IMessageComposer
        {
            public OutMessage Invoke(params object[] Parameters)
            {
                var Message = new OutMessage(627);
                Message.Append(AchievementHandler.Achievements.Count);
    
                foreach (var Achievement in AchievementHandler.Achievements.Values)
                {
                    var Items = StorageHandler.GetAchievementDetailsSorted(Achievement.Id);
    
                    Message.Append(Achievement.Badge);
                    Message.Append(Items.Count());
    
                    foreach (var Item in (from item in Items orderby item.Level ascending select item))
                    {
                        Message.Append(Item.Level);
                        Message.Append(Item.RequiredAmmount);
                    }
                }
    
                return Message;
            }
        }

  11. #71
    Lurking since '06 1ntel is offline
    MemberRank
    Jul 2006 Join Date
    401Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    Quote Originally Posted by Squard View Post
    Short-cut and cannot be null. ;D
    Yeah it can't be null when your coding it or the compiler complains, but it doesn't somewhere in the code which returns something can't set it to null.

    All the compiler does with "var" is when its compiled it turns that "var" into whichever class its defined with. aka var becomes Socket etc.

    So really it is just a short-cut, most coders are against it, usually when working in teams because scanning through code can be a pain when all you see is "var" everyone and not knowing what var is.

    Avoid using byte[] arrays where possible too, now I know that isn't possible in the Socket code but there is a way around it using the SocketAsyncEventArgs which you need to look into it and learn.

    Using byte[] causes heap fragmentation which can cause out of memory errors, .NET has a buffer pool for use (http://msdn.microsoft.com/en-us/libr...ermanager.aspx) but you can code your own

  12. #72
    Learning C# - Developer wy479 is offline
    MemberRank
    Nov 2010 Join Date
    :O You PERVERT!Location
    1,132Posts
    Quote Originally Posted by Davidaap View Post
    Lol.



    I already reported it :)
    :l who cares if you need to pay? None but you obviously gtfo if you can't talk about the dev itself btw nice dev!
    Posted via Mobile Device

    Quote Originally Posted by Davidaap View Post
    Lol.



    I already reported it :)
    :l who cares if you need to pay? None but you obviously gtfo if you can't talk about the dev itself btw nice dev!
    Posted via Mobile Device
    Posted via Mobile Device
    Posted via Mobile Device

  13. #73
    What about no. Davidaap is offline
    MemberRank
    Nov 2009 Join Date
    773Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    Quote Originally Posted by wy479 View Post
    :l who cares if you need to pay? None but you obviously gtfo if you can't talk about the dev itself btw nice dev!
    Posted via Mobile Device



    :l who cares if you need to pay? None but you obviously gtfo if you can't talk about the dev itself btw nice dev!
    Posted via Mobile Device
    Posted via Mobile Device
    Posted via Mobile Device
    I care lol paying for emulation software how stupid can you be

  14. #74
    What about no. Davidaap is offline
    MemberRank
    Nov 2009 Join Date
    773Posts

    Re: Project Boolean [C# - R63A - OS - Free]

    Dev stopped again?D

  15. #75
    Live Ocottish Sverlord Joopie is online now
    LegendRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,767Posts
    Quote Originally Posted by Davidaap View Post
    Dev stopped again?D
    Yep
    Posted via Mobile Device



Page 5 of 6 FirstFirst 123456 LastLast

Advertisement