예제 #1
0
 public override void AddRecipes()
 {
     base.AddRecipes();
     if (Loaded)
     {
         return;
     }
     //_messageChecker = new MessageChecker();
     ShowTooltip       = "";
     _packetHandler    = new PacketHandler();
     _sscPacketHandler = new SSCPacketHandler();
     if (!Main.dedServ)
     {
         // 加载资源只有在非服务器端才会执行
         // MethodSwapper.SwapMethods();
         MainPlayerGroup       = new Group("default");
         ToolBarServiceManager = new ToolBarServiceManager();
         ResourceLoader.LoadAll();
         GuiManager        = new GUIManager(this);
         IsLoginClientSide = false;
         ClientUnion       = null;
         if (DEBUGMODE)
         {
             ClientUnion       = new Union("裙中世界");
             ClientUnion.Owner = "我不是裙子";
         }
     }
     else
     {
         // 生成玩家存档,这里用json文件存储玩家信息
         // 顺序一定不能错
         PlayerCollection = new PlayerCollection();
         PlayerDoc        = new PlayersDocument("players.json");
         PlayerDoc.ExtractPlayersData();
         GroupManager = new GroupManager();
         GroupManager.SetGroups();
         UnionManager  = new UnionManager();
         RegionManager = new RegionManager();
         MailManager   = new MailManager();
         // 服务器端生成RSA私钥
         RSACrypto.GenKey();
         ConfigLoader.Load();
         MarketManager  = new MarketManager();
         MatchingSystem = new MatchingSystem();
         AddUnionRegions();
     }
     Loaded = true;
     if (!Main.dedServ)
     {
         GuiManager.SetNPCDefaults();
     }
 }
예제 #2
0
        public IActionResult Unregister()
        {
            try
            {
                MatchingSystem.UnregisterUser(mSession);

                return(Ok());
            }
            catch (WebResponseException e)
            {
                mLogger.LogError(e.Message);

                return(e.HttpRequestResult());
            }
            catch (System.Exception e)
            {
                mLogger.LogError(e.Message);

                return(BadRequest());
            }
        }
예제 #3
0
        public IActionResult Register(Line myLine, Line partnerLine)
        {
            try
            {
                MatchingRole role = new MatchingRole(myLine, partnerLine);

                MatchingSystem.RegisterUser(mSession, role);

                return(Ok());
            }
            catch (WebResponseException e)
            {
                mLogger.LogError(e.Message);

                return(e.HttpRequestResult());
            }
            catch (System.Exception e)
            {
                mLogger.LogError(e.Message);

                return(BadRequest());
            }
        }
예제 #4
0
    /// <summary>
    /// 毎フレーム更新
    /// </summary>
    void Update()
    {
        switch (GameStatus)
        {
        //タイトル画面
        case GameState.Title:
            //エンターキーが押されたらステージをロードする
            if (isGameStart && WaiteFrame > 180)
            {
                GameStatus = GameState.Matching;
                StartCoroutine(LoadScene(GameState.Matching));
                isGameClear = false;
                WaiteFrame  = 0;
            }
            break;

        case GameState.Matching:

            if (SceneManager.GetActiveScene().name == "Matching")
            {
                m_MS        = GameObject.Find("MatchingManager").GetComponent <MatchingSystem>();
                PlayerNum   = m_MS.GetPlayerNum();
                isAdvanceOK = m_MS.GetGameStart();
            }

            if (isAdvanceOK && WaiteFrame > 180)
            {
                GameStatus = GameState.Stage;
                StartCoroutine(LoadScene(GameState.Stage));
                SoundManager.Instance.PlayBGM(SoundManager.BGMlist.StageNormalBGM);
                WaiteFrame = 0;
            }
            Debug.Log(WaiteFrame);
            break;

        //ステージシーン
        case GameState.Stage:
            if (isGameClear && WaiteFrame > 180)
            {
                GameStatus = GameState.Result;
                StartCoroutine(LoadScene(GameState.Result));
                WaiteFrame = 0;
                SoundManager.Instance.PlayBGM(SoundManager.BGMlist.GameClearBGM);
            }
            break;

        case GameState.Result:
            if (Input.anyKeyDown && WaiteFrame > 180)
            {
                GameStatus = GameState.Title;
                StartCoroutine(LoadScene(GameState.Title));
                SoundManager.Instance.PlayBGM(SoundManager.BGMlist.TitleBGM);
                Reset();
                WaiteFrame = 0;
            }
            break;

        default:
            break;
        }

        WaiteFrame++;
        // 終了処理
        if (Input.GetKey(KeyCode.Escape))
        {
            Application.Quit();
        }
    }