Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Network packets help

Comments in 'Plugin Development' started by laccolite, Jun 5, 2014.

  1. laccolite
    Offline

    laccolite New Member

    Joined:
    Mar 1, 2014
    Posts:
    22
    Hello everyone!

    I wanted to add a player to a server without a client and any plugins, so I wrote this:

    PHP:
    $sock socket_create(AF_INET,SOCK_DGRAM,SOL_UDP);
    $msg chr(0x05);
    $msg_size 35;
    $server '192.168.1.68';
    $port 19132;
    socket_sendto($sock,$msg$msg_size,,$server,$port);
    $msg chr(0x07);
    $msg_size 35;
    $server '192.168.1.68';
    $port 19132;
    socket_sendto($sock,$msg$msg_size,,$server,$port);
    Player connects, but then error happens:

    17:54:41 [ERROR] A E_WARNING error happened: "str_split(): The length of each segment must be greater than zero" in "C:\Users\Admin\Desktop\PM MP\PocketMine-MP 12\src\Player.php" at line 2326
    17:54:41 [ERROR] A E_WARNING error happened: "Invalid argument supplied for foreach()" in "C:\Users\Admin\Desktop\PM MP\PocketMine-MP 12\src\Player.php" at line 2331
    17:54:41 [INFO] [/192.168.1.68:53557] logged out due to timeout

    And player logs out due to timeout.

    Could anyone help me?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The packet contains too little data.
  3. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,710
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Easy way to spam up the console though :)
    PEMapModder likes this.

Share This Page

Advertisement