Beispiel #1
0
    void _Packet(ScMatchInfo p)
    {
        Logger.LogInfo("Match info: isRobot: {5}, timeLimit: {4}, players: {0}, room: [{1}:{2}, {3}]", p.infoList.Length, p.room.host, p.room.port, p.room.room_key, p.timeLimit, p.isRobot);

        isMatchRobot = p.isRobot;
        timeLimit    = p.timeLimit;

        p.infoList.CopyTo(ref m_players);

        m_playerIndex = m_players.FindIndex(pi => pi.roleId == modulePlayer.id_);

        Logger.LogDetail("Player roomIndex: {0}", m_playerIndex);

        modulePVP.Connect(p.room);

        ScMatchInfo matchInfo = null;

        p.CopyTo(ref matchInfo);

        DispatchModuleEvent(EventMatchInfo, matchInfo);

        if (!isMatchRobot)
        {
            FightRecordManager.InstanceHandle <GameRecordDataPvp>();
            FightRecordManager.Set(p);
        }
    }
Beispiel #2
0
    private void ShowModels(ScMatchInfo rMatchInfo)
    {
        moduleHome.HideOthersBut(Module_Home.FIGHTING_PET_OBJECT_NAME, Module_Home.PLAYER_OBJECT_NAME, Module_Home.TEAM_OBJECT_NAME, Module_Home.TEAM_PET_OBJECT_NAME);

        moduleHome.DispatchEvent(Module_Home.EventSetMasterPosition, Event_.Pop(GetTransform(moduleFactionBattle.SelfFaction == Module_FactionBattle.Faction.Red ? 0 : 1)));
        var master = (Level.current as Level_Home)?.master;

        if (master)
        {
            master.direction = moduleFactionBattle.SelfFaction == Module_FactionBattle.Faction.Red
                ? CreatureDirection.FORWARD
                : CreatureDirection.BACK;
        }
        for (var i = 0; i < rMatchInfo.infoList.Length; i++)
        {
            if (rMatchInfo.infoList[i].roleId != modulePlayer.id_)
            {
                CreatEnemyCreature(rMatchInfo.infoList[i], moduleFactionBattle.SelfFaction == Module_FactionBattle.Faction.Red ? 1 : 0);
            }
        }
    }