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("> ");