コード例 #1
0
            protected override void Run(Session session, M2C_TeamGoBattleProgressAllDone message)
            {
                TestPlayerDataComponent testPlayerDataComponent = session.GetComponent <TestPlayerDataComponent>();
                BenchmarkComponent      benchmarkComponent      = Game.Scene.GetComponent <BenchmarkComponent>();

                if (benchmarkComponent.clients.TryGetValue(testPlayerDataComponent.testPlayerSetting.DeviceUniqueIdentifier, out var client))
                {
                    PartyBotModule partyBotModule = client.GetComponent <PartyBotModule>();
                    partyBotModule.state = State.Battle;
                    if (partyBotModule.isLeader)
                    {
                        benchmarkComponent.groupToRoomMap.Remove(client.index / 8);
                    }
                    //client.UserLog($"M2C_TeamGoBattleProgressAllDoneHandler");
                }
            }
コード例 #2
0
            protected void _Run(Session session, M2C_TeamModifyMember message)
            {
                TestPlayerDataComponent testPlayerDataComponent = session.GetComponent <TestPlayerDataComponent>();
                BenchmarkComponent      benchmarkComponent      = Game.Scene.GetComponent <BenchmarkComponent>();

                if (benchmarkComponent.clients.TryGetValue(testPlayerDataComponent.testPlayerSetting.DeviceUniqueIdentifier, out var client))
                {
                    PartyBotModule partyBotModule = client.GetComponent <PartyBotModule>();
                    if (partyBotModule.teams.TryGetValue(partyBotModule.roomId, out var team))
                    {
                        bool isAdd = true;

                        for (int i = 0; i < team.teamMemberDataList.Count; i++)
                        {
                            if (team.teamMemberDataList[i].Uid == message.Uid)
                            {
                                if (message.MemberData == null)
                                {
                                    //刪除
                                    isAdd = false;
                                    team.teamMemberDataList.RemoveAt(i);
                                    team.Info.NowMemberCount--;
                                    //client.UserLog($"RoomId:{partyBotModule.roomId}, NowMemberCount:{team.Info.NowMemberCount}");
                                }
                                else
                                {
                                    //更新
                                    isAdd = false;
                                    team.teamMemberDataList[i] = message.MemberData;
                                }
                                break;
                            }
                        }

                        if (isAdd)
                        {
                            team.teamMemberDataList.Add(message.MemberData);
                            team.Info.NowMemberCount++;
                            //client.UserLog($"RoomId:{partyBotModule.roomId}, NowMemberCount:{team.Info.NowMemberCount}");
                        }
                    }
                    //client.UserLog($"M2C_TeamModifyMemberHandler");
                }
            }
コード例 #3
0
            protected override void Run(Session session, M2C_TeamReadyModify message)
            {
                TestPlayerDataComponent testPlayerDataComponent = session.GetComponent <TestPlayerDataComponent>();
                BenchmarkComponent      benchmarkComponent      = Game.Scene.GetComponent <BenchmarkComponent>();

                if (benchmarkComponent.clients.TryGetValue(testPlayerDataComponent.testPlayerSetting.DeviceUniqueIdentifier, out var client))
                {
                    PartyBotModule partyBotModule = client.GetComponent <PartyBotModule>();
                    if (partyBotModule.teams.TryGetValue(partyBotModule.roomId, out var team))
                    {
                        for (int i = 0; i < team.teamMemberDataList.Count; i++)
                        {
                            if (team.teamMemberDataList[i].Uid == message.Uid)
                            {
                                team.teamMemberDataList[i].IsReady = message.IsReady;
                                break;
                            }
                        }
                    }
                    //client.UserLog($"M2C_TeamReadyModifyHandler");
                }
            }
コード例 #4
0
            protected override void Run(Session session, M2C_TeamGoBattle message)
            {
                TestPlayerDataComponent testPlayerDataComponent = session.GetComponent <TestPlayerDataComponent>();
                BenchmarkComponent      benchmarkComponent      = Game.Scene.GetComponent <BenchmarkComponent>();

                if (benchmarkComponent.clients.TryGetValue(testPlayerDataComponent.testPlayerSetting.DeviceUniqueIdentifier, out var client))
                {
                    PartyBotModule   partyBotModule   = client.GetComponent <PartyBotModule>();
                    MapUnitBotModule mapUnitBotModule = client.GetComponent <MapUnitBotModule>();
                    mapUnitBotModule.mapUnitId = message.MapUnitId;
                    for (int i = 0; i < message.MapUnitInfos.Count; i++)
                    {
                        var info = message.MapUnitInfos[i];
                        mapUnitBotModule.mapUnitInfos.TryAdd(info.MapUnitId, new MapUnitBotModule.MapUnitData
                        {
                            mapUnitInfo = info,
                        });
                    }
                    partyBotModule.state = State.GoBattle;
                    partyBotModule._inputAsyncTimePre = partyBotModule.timerComponent.time;
                    //client.UserLog($"M2C_TeamGoBattleHandler");
                }
            }