コード例 #1
0
        public static String getPersonaInfo()
        {
            ProfileData profileData = new ProfileData();
            Persona activePersona = Access.CurrentSession.ActivePersona;
            profileData.boost = activePersona.Boost;
            profileData.cash = activePersona.Cash;
            profileData.iconIndex = activePersona.IconIndex;
            profileData.level = activePersona.Level;
            profileData.motto = activePersona.Motto;
            profileData.name = activePersona.Name;
            profileData.percentToLevel = activePersona.PercentageOfLevelCompletion;
            profileData.personaId = activePersona.Id;
            profileData.rating = activePersona.rating;
            profileData.rep = activePersona.ReputationInTotal;
            profileData.repAtCurrentLevel = activePersona.ReputationInLevel;
            profileData.score = activePersona.score;

            return profileData.SerializeObject();
        }
コード例 #2
0
ファイル: User.cs プロジェクト: berkay2578/nfsw-server
        public static String getPermanentSession()
        {
            UserInfo userInfo = new UserInfo();
            foreach(Persona persona in Access.CurrentSession.PersonaList)
            {
                ProfileData profileData = new ProfileData();
                profileData.boost = persona.Boost;
                profileData.cash = persona.Cash;
                profileData.iconIndex = persona.IconIndex;
                profileData.level = persona.Level;
                profileData.motto = persona.Motto;
                profileData.name = persona.Name;
                profileData.percentToLevel = persona.PercentageOfLevelCompletion;
                profileData.personaId = persona.Id;
                profileData.rating = persona.rating;
                profileData.rep = persona.ReputationInTotal;
                profileData.repAtCurrentLevel = persona.ReputationInLevel;
                profileData.score = persona.score;
                userInfo.personas.Add(profileData);
            }

            userInfo.defaultPersonaIdx = Engine.getDefaultPersonaIdx();
            return userInfo.SerializeObject();
        }