/** * Execute the job. * * @param \Illuminate\Http\Request $request * @return \Apolune\Contracts\Account\Player|null */ public function handle(Request $request) { $player = app('player'); $player->name = ucwords(strtolower($request->get('player'))); $player->account_id = $this->account->id(); $player->vocation = $request->get('vocation', vocations(true)->first()->id()); $player->town_id = $request->get('town', towns(true)->first()->id()); $player->world_id = $request->get('world', worlds()->first()->id()); $player->sex = $request->get('sex', genders()->first()->id()); $player->conditions = ''; $player->save(); event(new Created($player, $this->account)); return $player; }
} $controlrow = getcontrol(); if (isset($_GET["do"])) { $do = explode(":", $_GET["do"]); if ($do[0] == "main") { main(); } elseif ($do[0] == "items") { items(); } elseif ($do[0] == "edititem") { edititem($do[1]); } elseif ($do[0] == "drops") { drops(); } elseif ($do[0] == "editdrop") { editdrop($do[1]); } elseif ($do[0] == "towns") { towns(); } elseif ($do[0] == "edittown") { edittown($do[1]); } elseif ($do[0] == "monsters") { monsters(); } elseif ($do[0] == "editmonster") { editmonster($do[1]); } elseif ($do[0] == "levels") { levels(); } elseif ($do[0] == "editlevel") { editlevel(); } elseif ($do[0] == "spells") { spells(); } elseif ($do[0] == "editspell") { editspell($do[1]); } elseif ($do[0] == "users") {
/** * Get a specific town. * * @param integer $id * @param boolean $starter null * @return \Apolune\Contracts\Server\Town */ function town($id, $starter = null) { $towns = towns($starter); return head(array_where($towns, function ($key, $town) use($id) { return $town->id() === (int) $id; })); }