Commit 14e1e679 authored by Sylvain Renault's avatar Sylvain Renault
Browse files

Refacturing server, user.

Changed some folder, script names, namespace...
parent 8a3fc6a2
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -3,16 +3,20 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(WorldStorageServer))]
public class WorldStorageServerEditor : Editor
[CustomEditor(typeof(WorldStorageInfo))]
public class WorldStorageInfoEditor : Editor
{
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        EditorGUILayout.Space();
        WorldStorageServer srv = (WorldStorageServer)target;
        WorldStorageInfo srv = (WorldStorageInfo)target;

        string state = srv.GetServerState();
        EditorGUILayout.LabelField("Server State", state);

        string api = srv.GetAPIVersion();
        EditorGUILayout.LabelField("Server State", api);
        EditorGUILayout.LabelField("OpenAPI Version", api);
    }
}

Assets/Runtime.meta

0 → 100644
+8 −0
Original line number Diff line number Diff line
fileFormatVersion: 2
guid: 9f9d2ca3af2d00643b6a16d11277df9a
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData: 
  assetBundleName: 
  assetBundleVariant: 
+8 −0
Original line number Diff line number Diff line
fileFormatVersion: 2
guid: 2d42c05c2b33530478b6ec053f84a09d
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData: 
  assetBundleName: 
  assetBundleVariant: 
+57 −0
Original line number Diff line number Diff line
//
// ETSI (European Telecommunications Standards Institute, referred to as ETSI)
// ARF - ETSI ISG Augmented Reality Framework (ISG ARF)
// (C) 2022
//
// Development "World Storage", data management, authoring tools
//
// Authors:
// - Sylvain Renault (Fraunhofer HHI)
// 
// Date: May 2022
//

#define USING_OPENAPI_GENERATOR // alt. is Swagger

using System.IO;
using System.Collections.Generic;
using UnityEngine;

#if USING_OPENAPI_GENERATOR
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
#else
using IO.Swagger.Api;
using IO.Swagger.Model;
#endif

#if UNITY_EDITOR
namespace ETSI.ARF.WorldStorage.REST
{
    public class AdminRequest
    {
        static public string GetAdminInfo(WorldStorageServer ws)
        {
            DefaultApi api = new DefaultApi(ws.URI);
            string state = api.GetAdmin();
            Debug.Log("Server State: " + state);
            return state;
        }

        static public string GetVersion(WorldStorageServer ws)
        {
            DefaultApi api = new DefaultApi(ws.URI);
            string vers = api.GetVersion();
            Debug.Log("Using API Version: " + vers);
            return vers;
        }

        static public string Ping (WorldStorageServer ws)
        {
            DefaultApi api = new DefaultApi(ws.URI);
            api.GetPing();
            return "IsAlive";
        }
    }
}
#endif
 No newline at end of file
Loading