コード例 #1
0
        public string ToJSON()
        {
            SimpleJSON.JSONClass js = new SimpleJSON.JSONClass();
            js["name"]          = NAME;
            js["author"]        = AUTHOR;
            js["description"]   = DESCRIPTION;
            js["update_method"] = Enum.GetName(typeof(UPDATER_TYPE), UPDATE_METHOD.METHOD);
            js["url"]           = UPDATE_METHOD.URL;

            return(String.Concat("\"", NAME, ".", AUTHOR, "\"", ": ", js.ToString(), ",\n"));
        }
コード例 #2
0
ファイル: HttpResult.cs プロジェクト: johnson2heng/GeekServer
        public override string ToString()
        {
            var json = new SimpleJSON.JSONClass();

            json["code"].AsInt = code;
            json["msg"]        = msg;
            foreach (var kv in extraMap)
            {
                json[kv.Key] = kv.Value;
            }
            return(json.ToString());
        }
コード例 #3
0
        static int _m_ToString(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                SimpleJSON.JSONClass gen_to_be_invoked = (SimpleJSON.JSONClass)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 1)
                {
                    string gen_ret = gen_to_be_invoked.ToString(  );
                    LuaAPI.lua_pushstring(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string _aPrefix = LuaAPI.lua_tostring(L, 2);

                    string gen_ret = gen_to_be_invoked.ToString(_aPrefix);
                    LuaAPI.lua_pushstring(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to SimpleJSON.JSONClass.ToString!"));
        }
        private void LoadTrackerSettings()
        {
            //Load tracker data
            SimpleJSON.JSONNode hostfile = new SimpleJSON.JSONClass();
            bool loaded = false;

            if (!Application.isMobilePlatform && Application.platform != RuntimePlatform.WebGLPlayer /*&& useSystemIO*/)
            {
                if (!System.IO.File.Exists("host.cfg"))
                {
                    hostfile.Add("host", new SimpleJSON.JSONData("http://192.168.175.117:3000/api/proxy/gleaner/collector/"));
                    hostfile.Add("trackingCode", new SimpleJSON.JSONData("57d81d5585b094006eab04d6ndecvjlvjss8aor"));
                    System.IO.File.WriteAllText("host.cfg", hostfile.ToString());
                }
                else
                {
                    hostfile = SimpleJSON.JSON.Parse(System.IO.File.ReadAllText("host.cfg"));
                }
                loaded = true;
            }

            try
            {
                if (loaded)
                {
                    var settings = TrackerAsset.Instance.Settings as TrackerAssetSettings;
                    settings.Host         = hostfile["host"];
                    settings.TrackingCode = hostfile["trackingCode"];
                    //End tracker data loading
                }
            }
            catch
            {
                Debug.Log("Error loading the tracker settings");
            }
        }
コード例 #5
0
ファイル: Game.cs プロジェクト: Victorma/Compluaventuras
        void Awake()
        {
            Game.instance = this;
            //Load tracker data
            SimpleJSON.JSONNode hostfile = new SimpleJSON.JSONClass();
            bool loaded = false;

#if UNITY_WEBPLAYER || UNITY_WEBGL
#elif UNITY_ANDROID || UNITY_IPHONE
#else
            if (useSystemIO)
            {
                if (!System.IO.File.Exists("host.cfg"))
                {
                    hostfile.Add("host", new SimpleJSON.JSONData("http://192.168.175.117:3000/api/proxy/gleaner/collector/"));
                    hostfile.Add("trackingCode", new SimpleJSON.JSONData("57d81d5585b094006eab04d6ndecvjlvjss8aor"));
                    System.IO.File.WriteAllText("host.cfg", hostfile.ToString());
                }
                else
                {
                    hostfile = SimpleJSON.JSON.Parse(System.IO.File.ReadAllText("host.cfg"));
                }
                loaded = true;
            }
#endif
            try
            {
                if (loaded)
                {
                    Tracker.T.host         = hostfile["host"];
                    Tracker.T.trackingCode = hostfile["trackingCode"];
                    //End tracker data loading
                }
            }
            catch { }

            style       = Resources.Load("basic") as GUISkin;
            optionlabel = new GUIStyle(style.label);

            if (Game.GameToLoad != "")
            {
                gameName    = Game.GameToLoad;
                gamePath    = ResourceManager.Instance.getCurrentDirectory() + System.IO.Path.DirectorySeparatorChar + "Games" + System.IO.Path.DirectorySeparatorChar;
                useSystemIO = true;
            }

            if (editor_mode)
            {
                gameName = "CurrentGame";
            }

            selected_path = gamePath + gameName;
            selected_game = selected_path + "/";

            // TODO incidences are unused, why?
            //List<Incidence> incidences = new List<Incidence>();

            AdventureData     data      = new AdventureData();
            AdventureHandler_ adventure = new AdventureHandler_(data);
            switch (getLoadingType())
            {
            case ResourceManager.LoadingType.RESOURCES_LOAD:
                adventure.Parse(gameName + "/descriptor");
                ResourceManager.Instance.Path = gameName;
                break;

            case ResourceManager.LoadingType.SYSTEM_IO:
                adventure.Parse(selected_game + "descriptor.xml");
                ResourceManager.Instance.Path = selected_game;
                break;
            }

            game_state = new GameState(data);
            CompletableController.Instance.setCompletables(GameState.getCompletables());
        }