xy 3 주 전
부모
커밋
cf2bfa6e45
2개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 8 2
      src/GameClient.php
  2. 1 1
      src/main.php

+ 8 - 2
src/GameClient.php

@@ -136,8 +136,14 @@ class GameClient {
         $this->client->on(MsgID::RESFRIENDLIST, function($binaryData) {
             $response = new ResFriendList();
             $response->mergeFromString($binaryData);
-            echo "获取好友列表:".$response->getList();
-            echo "\n";
+            if($response->getSuccess()){
+                var_dump($response->getList());
+                echo "\n";
+            }else{
+                echo "获取好友列表失败";
+                echo "\n";
+            }
+         
         });
     }
 

+ 1 - 1
src/main.php

@@ -25,7 +25,7 @@ class ProgramMain {
          // 设置非阻塞标准输入
         stream_set_blocking(STDIN, false);
 
-        echo "游戏客户端交互模式(输入命令执行,如 login, outGame, exit)\n";
+        echo "游戏客户端交互模式(输入命令执行,如 login, outGame, exit,getFriens)\n";
         
         while (true) {
             $input = readline("> ");