コード例 #1
0
        public PartyGetStatusResult PartyGetStatus(PartyGetStatusRequest request)
        {
            PartyMember partyMember;
            Party party;
            IEnumerable<PartyMember> partyMembers;
            if (TryGetUserPartyMember(out partyMember) &&
                TryGetParty(partyMember.PartyId, out party))
            {
                partyMembers = _partyMemberRepository.FindByPartyId(party.Id).Result;
            }
            else
            {
                party = new Party
                {
                    Id = "",
                    MatchmakeState = 0,
                    GameData = new byte[0]
                };
                partyMembers = new PartyMember[0];
            }
            var partyStatus = GetPartyStatus(party, partyMembers);

            return new PartyGetStatusResult
            {
                Result = new ServiceResult<PartyStatus>
                {
                    Data = partyStatus
                }
            };
        }
コード例 #2
0
        public PartyGetStatusResult PartyGetStatus(PartyGetStatusRequest request)
        {
            byte[] gameData = new byte[100];

            gameData = Enumerable.Repeat((byte) 0xAB, 100).ToArray();

            gameData[0] = 0x34;
            gameData[1] = 0x56;
            gameData[2] = 0x91;
            gameData[3] = 0x66;
            return new PartyGetStatusResult
            {
                Result = new ServiceResult<PartyStatus>
                {
                    Data = new PartyStatus
                    {
                        Party = new PartyId
                        {
                            Id = "1"
                        },
                        SessionMembers = new List<SessionMember>
                        {
                            new SessionMember
                            {
                                User = new UserId
                                {
                                    Id = 1
                                }
                            },
                            new SessionMember
                            {
                                User = new UserId
                                {
                                    Id = 2
                                }
                            }
                        },
                        MatchmakeState = 0,
                        GameData = gameData
                    }
                }
            };
        }