Win BIG with HabboxStarz!
Show off your musical talent in our old skool singing competition! Big prizes to be won!
HxSS Awards winners and final standings!
It's all done! Click here to see the big big winners from this year's tournament, and the fan favourites for the awards!
Check out HabboxWiki!
The biggest and best archive of all things Habbo - could YOU be our next top editor?


Results 1 to 8 of 8

Thread: Packets!?

  1. #1
    Join Date
    Dec 2007
    Posts
    2,807
    Tokens
    0

    Latest Awards:

    Default Packets!?

    I'm really confused by the idea of packets. So lets say I have a client that sends my username "User=George" to the server and then it wants it to add it to User.txt and then recieve the list of Users in another packet. I know how to send and recieve packets I just don't get how to tell the server what to send back.

    Could anyone help me please?

  2. #2
    Join Date
    Nov 2005
    Posts
    4,486
    Tokens
    921

    Latest Awards:

    Default

    So say you send the server User=George, what was the packet that asked you to send that (from server) and what is the packet you receive after you have sent that (from server).
    "RETIRED" FROM HABBO(X)

    :¬:

    TOMSPIT / COWLY05


  3. #3
    Join Date
    Dec 2007
    Posts
    2,807
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by TomSpit View Post
    So say you send the server User=George, what was the packet that asked you to send that (from server) and what is the packet you receive after you have sent that (from server).
    Basically I have no idea atall how packets work and I can't find an easy explination. I also don't know how to handle them on the server. I make a connection with the server and then what?

  4. #4
    Join Date
    Feb 2006
    Location
    Ontario Canada
    Posts
    4,587
    Tokens
    0

    Latest Awards:

    Default

    say like client sends user=george enters room, the server gets that, and then sends it to every other open client. to tell the other client that george is in the room.

    .:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
    .:.: Stand up for what is right, even if you stand alone:.:.


  5. #5
    Join Date
    Mar 2008
    Posts
    5,107
    Tokens
    3,289

    Latest Awards:

    Default

    Because it's not just about doing "User=George". Try something like this..

    Client: @E|George| (@E being the enter packet, | being the start and end, and George being the username.).

    Server: UL|George,Bill,Hill,Chill|

    PHP Code:
    $packet $_GET["packet"]; // get the whole packet.

    $explode explode('|'$packet);
    $client_action $explode[0];   // get the @E or whatever

    $data $explode[1]; // gets whatever is after the | and before the |  so example: @E|Dentafrice| would get Dentafrice

    switch($client_action) {
        case 
    '@E':
            
    // do the user thing here.
            
    echo "UL|" $user->user_comma_list() . "|";
            break;

    Last edited by Dentafrice; 29-07-2009 at 11:27 PM.

  6. #6
    Join Date
    Dec 2007
    Posts
    2,807
    Tokens
    0

    Latest Awards:

    Default

    So if used PHP to "GET" the packet then does it automatically send the packets to everyone else connected to the server? How small are packets averagely aswell. So how large would a packet such as "Bob, zak, harry" be?

  7. #7
    Join Date
    Mar 2008
    Posts
    5,107
    Tokens
    3,289

    Latest Awards:

    Default

    Quote Originally Posted by FlyDuo View Post
    So if used PHP to "GET" the packet then does it automatically send the packets to everyone else connected to the server? How small are packets averagely aswell. So how large would a packet such as "Bob, zak, harry" be?
    No it doesn't automatically send it, I was just posting how the server could interpret it.

  8. #8
    Join Date
    Dec 2007
    Location
    :vi /bin/LINUXGURU.txt; :wq
    Posts
    513
    Tokens
    305

    Latest Awards:

    Default

    Packet = Transfers data from A to B (A = input | B = the output).
    @FlyDuo - You would want to encrypt packets so it all depends and if you could hint us what it will be for etc etc.
    Thanks,
    Nick
    ┌─┐
    ┴─┴
    ಠ_ರೃ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •