Exemplo n.º 1
0
        public override void MessageReceived(GameLaunchedMessage message)
        {
            var game       = _gamesService.GetOrCreate(message.Game);
            var gameLaunch = new GameLaunch
            {
                ArcadeId = message.ArcadeId,
                Game     = game,
                DateTime = DateTime.Now
            };

            _databaseContext.GameLaunches.Add(gameLaunch);
            _databaseContext.SaveChanges();
        }
Exemplo n.º 2
0
        static int _m_GetCurrentMachineLocalIP_xlua_st_(RealStatePtr L)
        {
            try {
                {
                    string gen_ret = GameLaunch.GetCurrentMachineLocalIP(  );
                    LuaAPI.lua_pushstring(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Exemplo n.º 3
0
    private void Awake()
    {
        Instance = this;
        InitLoading.gameObject.SetActive(true);
        LoadingScreen.gameObject.SetActive(true);

        //ProcessManager.StartService();

        UIAPIInitializer.Current.Initialize();

        GetComponent <RenderManager>().Hide();

        LaunchManagers();

        PreLoadingAssets();
    }
Exemplo n.º 4
0
    void Awake()
    {
        if (m_instance == null)
        {
            m_instance = this;
            DontDestroyOnLoad(this.gameObject);
#if DEBUG_MODE
            //GameObject debugSys = GameObject.Instantiate(Resources.Load(m_gameDebugPath)) as GameObject;
            //debugSys.transform.parent = this.gameObject.transform;
#endif
        }
        else
        {
            Destroy(this.gameObject);
        }
    }
Exemplo n.º 5
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    GameLaunch gen_ret = new GameLaunch();
                    translator.Push(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 GameLaunch constructor!"));
        }
Exemplo n.º 6
0
 void Awake()
 {
     GameLaunch.DontDestroyOnLoad(this.gameObject);
     UIManager.Instance.Init(Instantiate(Resources.Load <GameObject>(PathCollections.RootPath)).transform);
     RegisterUI();
 }
Exemplo n.º 7
0
        public IActionResult UploadJsonToDb(int index, int quantity)
        {
            var path  = _appEnvironment.WebRootPath + "\\jsons";
            var files = Directory.GetFiles(path).Where(f => f.Contains(".json")).ToList();

            for (int j = index; j < quantity + index; j++)
            {
                var text = string.Empty;

                if (files.Count > j)
                {
                    text = System.IO.File.ReadAllText(files[j]);
                }
                else
                {
                    break;
                }

                List <JsonFullObject> jsonModels = new List <JsonFullObject>();

                jsonModels = JsonConvert.DeserializeObject <List <JsonFullObject> >(text);

                for (int i = 0; i < jsonModels.Count; i++)
                {
                    switch (jsonModels[i].EventId)
                    {
                    case 1:
                        var gl = new GameLaunch
                        {
                            Date    = jsonModels[i].Date,
                            EventId = jsonModels[i].EventId
                        };

                        _db.GameLaunches.Add(gl);
                        break;

                    case 2:
                        var fgl = new FirstGameLaunch
                        {
                            Date    = jsonModels[i].Date,
                            Gender  = jsonModels[i].Parameters.Gender,
                            Age     = jsonModels[i].Parameters.Age,
                            Country = jsonModels[i].Parameters.Country,
                            EventId = jsonModels[i].EventId
                        };

                        _db.FirstGameLaunches.Add(fgl);
                        break;

                    case 3:
                        var ss = new StageStart
                        {
                            Date    = jsonModels[i].Date,
                            Stage   = jsonModels[i].Parameters.Stage,
                            EventId = jsonModels[i].EventId
                        };

                        _db.StageStarts.Add(ss);
                        break;

                    case 4:
                        var se = new StageEnd
                        {
                            Date    = jsonModels[i].Date,
                            Stage   = jsonModels[i].Parameters.Stage,
                            Win     = jsonModels[i].Parameters.Win,
                            Time    = jsonModels[i].Parameters.Time,
                            Income  = jsonModels[i].Parameters.Income,
                            EventId = jsonModels[i].EventId
                        };

                        _db.StageEnds.Add(se);
                        break;

                    case 5:
                        var ip = new IngamePurchase
                        {
                            Date    = jsonModels[i].Date,
                            Item    = jsonModels[i].Parameters.Item,
                            Price   = jsonModels[i].Parameters.Price,
                            EventId = jsonModels[i].EventId
                        };

                        _db.IngamePurchases.Add(ip);
                        break;

                    case 6:
                        var cp = new CurrencyPurchase
                        {
                            Date    = jsonModels[i].Date,
                            Name    = jsonModels[i].Parameters.Name,
                            Price   = jsonModels[i].Parameters.Price,
                            Income  = jsonModels[i].Parameters.Income,
                            EventId = jsonModels[i].EventId
                        };

                        _db.CurrencyPurchases.Add(cp);
                        break;
                    }
                }
            }

            _db.SaveChanges();

            return(RedirectToAction("Index"));
        }