Example #1
0
    public bool PrevGameMessage(byte[] BinaryUserData)
    {
        Protocol.Message msg = DataParser.ReadJsonData <Protocol.Message>(BinaryUserData);
        if (msg == null)
        {
            return(false);
        }

        // 게임 설정 사전 작업 패킷 검사
        switch (msg.type)
        {
        case Protocol.Type.AIPlayerInfo:
            Protocol.AIPlayerInfo aiPlayerInfo = DataParser.ReadJsonData <Protocol.AIPlayerInfo>(BinaryUserData);
            ProcessAIDate(aiPlayerInfo);
            return(true);

        case Protocol.Type.LoadRoomScene:
            if (isHost)
            {
                Debug.Log("2.5초 후 게임 씬 전환 메시지 송신");
                Invoke("SendChangeGameScene", 2.5f);
            }
            return(true);

        case Protocol.Type.LoadGameScene:
            GameManager.instance.ChangeState(GameManager.GameState.GameStart);
            return(true);
        }
        return(false);
    }
Example #2
0
    private void ProcessAIDate(Protocol.AIPlayerInfo aIPlayerInfo)
    {
        MatchInGameSessionEventArgs args = new MatchInGameSessionEventArgs();

        args.GameRecord = aIPlayerInfo.GetMatchRecord();

        ProcessMatchInGameAccess(args);
    }