[Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

Page 1 of 18 12345678911 ... LastLast
Results 1 to 15 of 265
  1. #1
    Member AlexDj94 is offline
    MemberRank
    Sep 2009 Join Date
    Rome, ItalyLocation
    69Posts

    [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]


    for client RELEASE63-201203232304-318407343

    Code:
    Project habSock3t
    Copyright (C) AlexDj94 2012
    alessio.dionisi94@gmail.com
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.
    Sorry i dont have free time to continue this project, download the last sources and play/edit it...

    Features
    • SocketAsyncEventArgs (10.000+ Connections)
    • MySql Query Pooling
    • Packets Manager


    Downloads
    Project habSock3t - (0.981 Sources + Compiled + Database) - 04/04/2012
    Project habSock3t - (0.979 Sources + Compiled + Database) - 24/03/2012
    OLD Server with some extra packets: SnowStorm, Firends and other (Only for packet structure)

    How to use
    1. Add this to your hosts file: {IP or 127.0.0.1} localhost.habbo.com
    2. Import the database
    3. Edit config.habdata
    4. Edit habbo.com client with localhost.habbo.com
    5. Open the server
    6. Change the IP on the users table
    7. Open the client and PLAY! :D


    Screens





    Last edited by AlexDj94; 05-04-12 at 12:34 AM.


  2. #2
    Account Upgraded | Title Enabled! George2000 is offline
    MemberRank
    Jul 2011 Join Date
    The NetherlandsLocation
    1,150Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    Nice, hope this will be released :)

  3. #3
    Account Upgraded | Title Enabled! W00dL3cs is offline
    MemberRank
    Mar 2012 Join Date
    202Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    How are you handling client disconnect with socketasynceventargs?

    I mean, how does your server understand when an user refreshes the client page?

  4. #4
    Member AlexDj94 is offline
    MemberRank
    Sep 2009 Join Date
    Rome, ItalyLocation
    69Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    Quote Originally Posted by W00dL3cs View Post
    How are you handling client disconnect with socketasynceventargs?

    I mean, how does your server understand when an user refreshes the client page?
    Code:
    public void CloseClientSocket(SocketAsyncEventArgs e)
            {
                var Token = e.UserToken as GameServerToken;
                var Session = GetSession(Token.Socket);
                int ID = Session.ID;
                Logs.WriteLine("Free client connection [" + ID + "].");
    
                try
                {
                    AllSessions.Remove(Session);
                    IDs.Remove(ID);
                    Users.RemoveByConnectionID(ID);
                }
                catch { }
    
                try
                {
                    Token.Socket.Shutdown(SocketShutdown.Both);
                }
                catch (Exception) { }
    
                Token.Socket.Close();
                Interlocked.Decrement(ref TotalConnections);
                Semaphore.Release();
                ReadWritePool.Push(e);
            }
    
    private void HandleSend(SocketAsyncEventArgs e)
            {
                if (e.SocketError != SocketError.Success)
                {
                    CloseClientSocket(e);
                }
            }
    
    private void HandleReceive(SocketAsyncEventArgs e)
            {
                var Token = e.UserToken as GameServerToken;
                try
                {
                    if (e.BytesTransferred > 0 && e.SocketError == SocketError.Success)
                    {
                        var Received = new byte[e.BytesTransferred];
                        Array.Copy(BufferManager.Buffer, e.Offset, Received, 0, e.BytesTransferred);
                        string Data = System.Text.Encoding.Default.GetString(Received);
                        Messages.Handle(GetSession(Token.Socket), Data);
                    }
                    else
                    {
                        CloseClientSocket(e);
                    }
                }
                catch { CloseClientSocket(e); }
                finally { try { Token.Socket.ReceiveAsync(e); } catch { } }
            }
    Last edited by AlexDj94; 20-03-12 at 08:17 PM.

  5. #5
    Account Upgraded | Title Enabled! W00dL3cs is offline
    MemberRank
    Mar 2012 Join Date
    202Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    Quote Originally Posted by AlexDj94 View Post
    Code:
    public void CloseClientSocket(SocketAsyncEventArgs e)
            {
                var Token = e.UserToken as GameServerToken;
                var Session = GetSession(Token.Socket);
                int ID = Session.ID;
                Logs.WriteLine("Free client connection [" + ID + "].");
    
                try
                {
                    AllSessions.Remove(Session);
                    IDs.Remove(ID);
                    Users.RemoveByConnectionID(ID);
                }
                catch { }
    
                try
                {
                    Token.Socket.Shutdown(SocketShutdown.Both);
                }
                catch (Exception) { }
    
                Token.Socket.Close();
                Interlocked.Decrement(ref TotalConnections);
                Semaphore.Release();
                ReadWritePool.Push(e);
            }
    
    private void HandleSend(SocketAsyncEventArgs e)
            {
                if (e.SocketError != SocketError.Success)
                {
                    CloseClientSocket(e);
                }
            }
    
    private void HandleReceive(SocketAsyncEventArgs e)
            {
                var Token = e.UserToken as GameServerToken;
                try
                {
                    if (e.BytesTransferred > 0 && e.SocketError == SocketError.Success)
                    {
                        var Received = new byte[e.BytesTransferred];
                        Array.Copy(BufferManager.Buffer, e.Offset, Received, 0, e.BytesTransferred);
                        string Data = System.Text.Encoding.Default.GetString(Received);
                        Messages.Handle(GetSession(Token.Socket), Data);
                    }
                    else
                    {
                        CloseClientSocket(e);
                    }
                }
                catch { CloseClientSocket(e); }
                finally { try { Token.Socket.ReceiveAsync(e); } catch { } }
            }
    This won't probably catch a client refresh...

    In fact, in that case, there is no message sent, while you are disconnecting a session when message is empty...

  6. #6
    Member AlexDj94 is offline
    MemberRank
    Sep 2009 Join Date
    Rome, ItalyLocation
    69Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    Vector2 is for X,Y and Vector3 is for X,Y,Z

  7. #7
    [title][/title] Phosfor is offline
    MemberRank
    Jul 2010 Join Date
    FranceLocation
    286Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    lolwut, you use Win8 ? =D

    Did you use the "SuperSocket" for the 10k online users ?

  8. #8
    Member AlexDj94 is offline
    MemberRank
    Sep 2009 Join Date
    Rome, ItalyLocation
    69Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    Quote Originally Posted by Phosfor View Post
    lolwut, you use Win8 ? =D

    Did you use the "SuperSocket" for the 10k online users ?
    Win8 Consumer Preview :D
    I use SocketAsyncEventArgs, SocketAsyncEventArgsPool and BufferManager to get the best performances (Sorry for bad english)




    Added login by IP, Private Rooms, Navigator and Simple pathfinder :)
    Last edited by AlexDj94; 20-03-12 at 11:01 PM.

  9. #9
    <insert title here> Shorty is offline
    MemberRank
    Feb 2007 Join Date
    United KingdomLocation
    1,861Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    Good luck, looks interesting. ^^

  10. #10
    Member AlexDj94 is offline
    MemberRank
    Sep 2009 Join Date
    Rome, ItalyLocation
    69Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    Updated to RELEASE63-201203200950-912601693 :D

  11. #11
    swagggggg Livar is offline
    MemberRank
    Oct 2008 Join Date
    United KingdomLocation
    2,272Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    good luck with this.
    Posted via Mobile Device

  12. #12
    Account Upgraded | Title Enabled! DoctorCooper is offline
    MemberRank
    Oct 2011 Join Date
    R:\aGEZONELocation
    317Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    Good luck with this looks good.

  13. #13
    Member AlexDj94 is offline
    MemberRank
    Sep 2009 Join Date
    Rome, ItalyLocation
    69Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    You can help me with this tool and post the packets in this thread :) [Sorry for bad english]

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

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    Quote Originally Posted by AlexDj94 View Post
    You can help me with this tool and post the packets in this thread :) [Sorry for bad english]
    Where's policy check in your Sockets?

  15. #15
    Member AlexDj94 is offline
    MemberRank
    Sep 2009 Join Date
    Rome, ItalyLocation
    69Posts

    Re: [Open Source] [C#] [MySQL] Project habSock3t [R63B] [From Scratch]

    Is on messages.cs
    Posted via Mobile Device



Page 1 of 18 12345678911 ... LastLast

Advertisement