Created
March 15, 2020 13:22
-
-
Save PJZ9n/823bcb1de29c4df50bc81de090deab4e to your computer and use it in GitHub Desktop.
PMMP鯖側
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //とても単純な例で、そのまま使うことを前提としていません | |
| public function onJoin(PlayerJoinEvent $event): void { | |
| //プレイヤーが入ったときに、Web側に所持金データを送信する | |
| $ch = curl_init("http://aaa.com/money.php"); | |
| curl_setopt($ch, CURLOPT_POST, true); | |
| curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ | |
| "name" => $event->getPlayer()->getName(), | |
| "money" => /* 所持金を取得する処理 */, | |
| ])); | |
| curl_exec($ch); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment