public override void OnOtherPlayerJoinRoom(ISFSObject sfsObject) { base.OnOtherPlayerJoinRoom(sfsObject); var userInfo = new RbwarUserInfo(); userInfo.Parse(sfsObject.GetSFSObject("user")); _gdata.AllUserInfos.Add(userInfo); }
protected override void InitGameData(ISFSObject gameInfo) { base.InitGameData(gameInfo); PlayerRecordNum = gameInfo.ContainsKey("playerRecordNum") ? gameInfo.GetInt("playerRecordNum") : -1; var rankData = new Rank(); rankData.SetRank(gameInfo); GoldRank = rankData.GoldRank; var luckRate = gameInfo.ContainsKey("luckRate") ? gameInfo.GetIntArray("luckRate") : null; if (luckRate != null) { LuckRate = new List <int>(luckRate); } var record = gameInfo.ContainsKey("record") ? gameInfo.GetSFSArray("record") : null; if (record != null) { for (int i = 0; i < record.Count; i++) { if (record.GetSFSObject(i) == null) { continue; } var recordValue = new RecordValue(); recordValue.SetRecord(record.GetSFSObject(i)); RecordSpot.Add(recordValue.Area); RecordCardType.Add(recordValue.CType); } } var user = gameInfo.ContainsKey("user") ? gameInfo.GetSFSObject("user") : null; if (user != null) { var userInfo = new RbwarUserInfo(); userInfo.Parse(user); GetPlayer <RbwarPlayer>().Info = userInfo; AllUserInfos.Add(userInfo); } var users = gameInfo.ContainsKey("users")?gameInfo.GetSFSArray("users"):null; if (users != null) { for (int i = 0; i < users.Count; i++) { var userInfo = new RbwarUserInfo(); userInfo.Parse(users.GetSFSObject(i)); AllUserInfos.Add(userInfo); } } }