예제 #1
0
 public static function OnPlayerDisconnect(Player $player, $reasonid)
 {
     /* Remove from connected players list */
     unset(Players::$players[$player->id]);
     Players::$players_by_id[$player->id] = null;
     /* Remove from JQ list */
     Players::DelFromJQ($player);
     /* Remove from OOC list */
     Players::DelFromOOC($player);
     /* Send the quit info to players who requested it */
     $reason = Core::TranslateQuitReason($reasonid);
     if ($player->account && $player->account->Authed()) {
         foreach (Players::$players_jq as $p) {
             $p->Send(COLOR_GRAY, "[QUIT] {$player->name}({$player->id}) has quitted ({$reason})");
         }
     }
     if (Players::$upgrade_draws[$player->id] != null) {
         TextDrawDestroy(Players::$upgrade_draws[$player->id]);
         Players::$upgrade_draws[$player->id] = null;
     }
     if ($player->account) {
         $player->SetName($player->account->name);
     }
     Log::Append(LOG_JOINQUIT, "[{$player->id}] {$player->name}({$player->ip}) disconnected ({$reason})");
     $player->Destroy();
     return CALLBACK_OK;
 }