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");
            }
        }
示例#2
0
        static int _m_Add(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    string _aKey = LuaAPI.lua_tostring(L, 2);
                    SimpleJSON.JSONNode _aItem = (SimpleJSON.JSONNode)translator.GetObject(L, 3, typeof(SimpleJSON.JSONNode));

                    gen_to_be_invoked.Add(_aKey, _aItem);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
示例#3
0
        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());
        }
示例#4
0
        public void getFriends()
        {
            string uuid = Context.Session["uuid"].ToString();

            LOG.Out("-----------------------------------> GetFriends : " + uuid + " <----------------------------------------: ");

            string json = XinManager.instance.AccountGetFriends(uuid);
            SimpleJSON.JSONArray friendArray = new SimpleJSON.JSONArray();
            SimpleJSON.JSONNode jn = SimpleJSON.JSON.Parse(json);
            SimpleJSON.JSONArray ja = jn["data"].AsArray;
            foreach (SimpleJSON.JSONData jd in ja)
            {
                string fuid = HuanXinIDToUID(jd);
                if (string.IsNullOrEmpty(fuid))
                    continue;
                string ainfo = XinManager.instance.AccountGet(fuid);
                if (!IsRegisted(ainfo))
                    continue;
                SimpleJSON.JSONNode ajn = SimpleJSON.JSON.Parse(ainfo);
                SimpleJSON.JSONClass ajc = JsonGen.UserInfo(
                   fuid,
                   ajn["entities"][0]["username"],
                   "userHandicon",
                   UIDToHuanXinID(fuid),
                   null,
                   SportMatchManager.instance.GetUserState(fuid),
                   SportMatchManager.instance.GetUserGroupID(fuid));
                friendArray.Add(ajc);
            }

            SimpleJSON.JSONClass result = new SimpleJSON.JSONClass();
            result.Add("status", JsonGen.Status(100));
            result.Add("friends", friendArray);
            Send(result);
        }