1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

how to check if players is signed in xbox or not ?

Discussion in 'Facepalm' started by r7vmc, Aug 10, 2017.

  1. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    as in the title
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    facepalm
    Do some research. Don't ask generic questions in the development section. Provide code to allow us to help you in the development section. Don't post plugin requests in the development section. I can go on and on...
     
  3. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    i tried to use this code to check but it dosent work
    PHP:
     public function onPacketReceived(DataPacketReceiveEvent $event){
            
    $packet $event->getPacket();
             if (
    $packet instanceof LoginPacket) {
             if (!
    $packet->identityPublicKey === null) {
                    
    $player->kick("§l§cﺶﺨﺗ ﻥﺎﺸﻋ xbox ﻲﻓ ﻞﺠﺴﻣ ﻥﻮﻜﺗ ﻡﺯﻻ"false);
                  }
           }
    }
    i tried to use close instead of kick as well but no luck
    and i did researches in the old and new fourms but i didnt understand anything
     
    Last edited: Aug 11, 2017
    jasonwynn10 and Levi like this.
  4. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    You must wait until is fully logged, store somewhere if player is logged to xbox or not and then kick in PlayerLoginEvent or close the event
     
    Last edited: Aug 11, 2017
    r7vmc likes this.
  5. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    i tried these two but it dosent work
    PHP:
    if ($player->isConnected() && $packet->identityPublicKey === null) { //xbox auth
        
    $player->kick("§l§cﺶﺨﺗ ﻥﺎﺸﻋ xbox ﻲﻓ ﻞﺠﺴﻣ ﻥﻮﻜﺗ ﻡﺯﻻ"false);
    }
    and
    PHP:
    if ($player->loggedIn && $packet->identityPublicKey === null) { //xbox auth
        
    $player->kick("§l§cﺶﺨﺗ ﻥﺎﺸﻋ xbox ﻲﻓ ﻞﺠﺴﻣ ﻥﻮﻜﺗ ﻡﺯﻻ"false);
    }
    and tried to change to close instead of kick
     
  6. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    is there any other way to check if he's fully logged in ?
     
  7. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    PHP:
    public function onPacketReceived(DataPacketReceiveEvent $event){
        
    $packet $event->getPacket();
        if(
    $packet instanceof LoginPacket){
            if(!isset(
    $packet->chainData["chain"][2])){
                
    $player->kick("§l§cﺶﺨﺗ ﻥﺎﺸﻋ xbox ﻲﻓ ﻞﺠﺴﻣ ﻥﻮﻜﺗ ﻡﺯﻻ"false);
            }
        }
    }
     
    r7vmc likes this.
  8. r7vmc

    r7vmc Baby Zombie

    Messages:
    112
    GitHub:
    r7vmc
    thx that worked
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.