public static RetStr saveAnchorId(int roomId, String anchorId) { TTransport transport = null; RetStr result = null; try { transport = new TSocket(AR_CLOUD_ADDR, AR_CLOUD_PORT); transport.Open(); TProtocol protocol = new TBinaryProtocol(transport); ARCloud.Client client = new ARCloud.Client(protocol); result = client.saveAnchor(roomId, anchorId); } catch (TTransportException e) { Debug.LogError(e.Message); return(null); } finally { if (transport != null) { transport.Close(); } } return(result); }
public void ReaderFormCloud(RetStr pCloudAncContent) { mAncContent = pCloudAncContent.Value; if (mIsSetupCloudPoint || isInHostRoomIng) { return; } StopCoroutine(AsncResloveCloudAnc()); StartCoroutine(AsncResloveCloudAnc()); }
public void Read(TProtocol iprot) { iprot.IncrementRecursionDepth(); try { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 0: if (field.Type == TType.Struct) { Success = new RetStr(); Success.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); } finally { iprot.DecrementRecursionDepth(); } }
/// <summary> /// /// </summary> /// <param name="pAnchor"></param> public void LoadRoomCloudAnc(RoomCloudAncEvent pSuccessCall, RoomCloudAncEvent pFailureCall) { LoadRoomCloudAncSuccessEvent = pSuccessCall; LoadRoomCloudAncFailureEvent = pFailureCall; if (currRoomCloudAnc == null) { GameObject vAncObj = GameObject.Instantiate <GameObject>(prefabAncPrefab); currRoomCloudAnc = vAncObj.GetComponent <SenseAR_CloudAnchorProxy>(); } if (currRoomCloudAnc.isCanCreatFromClient()) { currRoomCloudAnc.ReBindSyncFromCloudSuccessEvent(LoadRoomCloudAncOver); currRoomCloudAnc.ReBindSyncFromCloudFailureEvent(LoadRoomCloudAncOver); RetStr vAncContentCloud = ARCloudClient.enterRoom(CloudRoomID); currRoomCloudAnc.ReaderFormCloud(vAncContentCloud); } else { NotifyLoadRoomCloudAncFailure(); } }
public string ToDirect() { string RetStr; double MaxDiff = 0; foreach (var cbm in ChildrenBeatmaps) { if (cbm.DifficultyRating > MaxDiff) { MaxDiff = cbm.DifficultyRating; } } MaxDiff *= 1.5; RetStr = $"{SetId}.osz|" + $"{Artist}|" + $"{Title}|" + $"{Creator}|" + $"{(int)RankedStatus}|" + $"{MaxDiff:0.00}|" + $"{LastUpdate}Z|" + $"{SetId}|" + $"{SetId}|" + "0|" + "1234|" + $"{Convert.ToInt32(HasVideo)}|" + $"{Convert.ToInt32(HasVideo) * 4321}|"; foreach (var cb in ChildrenBeatmaps) { RetStr += cb.ToDirect(); } return(RetStr.TrimEnd(',') + "|\r\n"); }