Пример #1
0
    private async void SendPickUpDropItem(ulong id)
    {
        //C2S_REQUEST_PERSONAL_DROP msg = new C2S_REQUEST_PERSONAL_DROP();
        //msg.protocolID = (ushort)KC2S_Protocol.c2s_request_personal_drop;
        //msg.id = id;
        //NetworkManager.Instance.SendToGameServer(msg);


        Debug.Log("------->>>>>发送拾取矿石信息" + id);
        c2s_RequestPersonalDrop msg = new c2s_RequestPersonalDrop();

        msg.Id = id;
        AskPersonalDropResponse askPersonalDropResponse = await AskPersonalDropRPC.AskPersonalDrop(msg);

        Debug.Log("------->>>>>收拾取矿石结果信息" + id);
        if (askPersonalDropResponse.Except != null)
        {
            Debug.LogError("------->>>>>拾取矿石失败");
        }
        else if (askPersonalDropResponse.Success != null)
        {
            s2c_NotifyPersonalDropResult result = askPersonalDropResponse.Success.Success_;
            Debug.Log("------->>>>>>收取拾取矿石成功_Result:" + result.Result);
            if (result.Result)
            {
                string key = result.MapId.ToString() + result.AreaUid.ToString() + result.NpcUid.ToString();
                NotifyDropResult(key);
            }
        }
    }
Пример #2
0
 private static void PersonalDropResultRun(GameSession.ToSyncDropResponse message)
 {
     GameSession.ToSyncDropResponse.Types.Success success = message.Success;
     if (success != null)
     {
         s2c_NotifyPersonalDropResult result = success.Success_.NotifyPersonalDrop;
         if (result != null)
         {
             if (result.Result)
             {
                 string key = result.MapId.ToString() + result.AreaUid.ToString() + result.NpcUid.ToString();
                 Debug.Log($"ToSyncDropResponse:PersonalDropResultRun key = {key}");
                 MineDropItemManager.Instance.NotifyDropResult(key);
             }
         }
     }
 }