BrickEmulator [C#] Pooling Sockets + From Scratch

Page 34 of 38 FirstFirst ... 2426272829303132333435363738 LastLast
Results 496 to 510 of 558
  1. #496
    this is title Shredinator is offline
    MemberRank
    May 2011 Join Date
    399Posts

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    love you both

  2. #497
    Old Habbo Developer AresCJ is offline
    MemberRank
    Jan 2009 Join Date
    USALocation
    1,183Posts

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Quote Originally Posted by joopie View Post
    Someone already tried to DoSs x]
    Isn't that like a simple few lines of code?

  3. #498
    Account Upgraded | Title Enabled! wichard is offline
    MemberRank
    Jul 2009 Join Date
    The NetherlandsLocation
    649Posts

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Quote Originally Posted by AresCJ View Post
    Isn't that like a simple few lines of code?
    Ye duh.

  4. #499
    Iron like a Lion in Zion! vLife is offline
    Super ModRank
    Apr 2009 Join Date
    The BahamasLocation
    3,788Posts

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Funny thing about the DoS, the person openly admitted it.

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

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    A DoS isn't going to test your server stability lol. You also can't block DDoS from within the program btw, you need proper firewall / mitigation service for big DDoS.

  6. #501
    Member Jaxite is offline
    MemberRank
    Sep 2011 Join Date
    EnglandLocation
    50Posts

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Quote Originally Posted by matty13 View Post
    A DoS isn't going to test your server stability lol. You also can't block DDoS from within the program btw, you need proper firewall / mitigation service for big DDoS.
    Finally someone who speaks the truth around here.

    This development seems good, and I expect it will be a well used server upon its release.

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

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    You really need to change your packet handler though Wichard. Initializing a handler per user is pointless and slow.

  8. #503
    Member Mikas17 is offline
    MemberRank
    Apr 2008 Join Date
    PortugalLocation
    83Posts

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Bug Report:



    Good luck with the project

  9. #504
    The Legend Returns vista4life is offline
    MemberRank
    Mar 2007 Join Date
    The NetherlandsLocation
    843Posts

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Quote Originally Posted by matty13 View Post
    You really need to change your packet handler though Wichard. Initializing a handler per user is pointless and slow.
    hmm true do you have any examples todo it ? i'm behind your idea your totaly right.

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

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Quote Originally Posted by vista4life View Post
    hmm true do you have any examples todo it ? i'm behind your idea your totaly right.
    Make a global message handler and message composer handler (if you want to do it that way) then initialize all handlers into a global handler which takes the parameters Session and Client Messages.

    Then route all users through the global handler when an incoming message comes in, don't use any locking as this will kill performance on anything globally accessed!!! and don't share any global variables inside the handler classes, this will cause race condition errors.

    I store all events on server bootup into a dictionary and access them by header packet ids.

    Code:
    public void HandleEvent(uint HeaderId, Session Session, ClientMessage Message)
            {
                IMessageEvent Event;
                if (_Events.TryGetValue(HeaderId, out Event))
                {
                    if (!Session.Authenticated && HeaderId != 206 & HeaderId != 415)
                    {
                        Console.Write("Un-authed packet received " + HeaderId);
                        return;
                    }
    
                    Event.Parse(Session, Message);
                }
                else
                {
                }
            }
    My code still needs finishing and cleaning up, but that is just a quick example.

    Anything inside the "Parse" function of Events is thread-safe as each Thread aka connected user/session creates its own stack, so it is thread-safe and extremely quick. Quick because events are accessed by index id's aka the header id's.

    So that is basically it :-)

  11. #506
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Why does everyone always use Public & Private when Internal is clearly better ^^

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

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Quote Originally Posted by Jupos View Post
    Why does everyone always use Public & Private when Internal is clearly better ^^
    because Internal is used for different means. Internal is visible in the same assembly, not namespace where as public is visible in the same namespace.

    They both have different means, same with protected vs private, there is no such thing as "clearly better", they just restrict visibility to certain things.

    I always forbid using public on any shared variable, I prefer to make everything private and access shared variables through a get set property. I use sometimes auto propertys which i use via "public ClassName aNameHere { get; private set; }" which can be quite useful, makes the compiler auto-generate a private variable which is accessed by a get set property.
    Last edited by 1ntel; 04-09-11 at 03:47 AM.

  13. #508
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Isn't internal stabler or something? I read about it somewhere...

  14. #509
    Account Upgraded | Title Enabled! wichard is offline
    MemberRank
    Jul 2009 Join Date
    The NetherlandsLocation
    649Posts

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Quote Originally Posted by matty13 View Post
    You really need to change your packet handler though Wichard. Initializing a handler per user is pointless and slow.
    NOOOES, i got 1 Packethandler global that interacts with an void.

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

    Re: BrickEmulator [C#] Pooling Sockets + From Scratch

    Quote Originally Posted by wichard View Post
    NOOOES, i got 1 Packethandler global that interacts with an void.
    Good man ;).

    ---------- Post added at 12:43 PM ---------- Previous post was at 12:42 PM ----------

    Quote Originally Posted by Jupos View Post
    Isn't internal stabler or something? I read about it somewhere...
    No they are just access modifiers, there is nothing more stable or faster about the word internal. If it was that magical I would of thought Microsoft would of done whatever 'magic' internal does to the word 'public'



Advertisement