예제 #1
0
        /// <summary>
        /// Gets the operation response.
        /// </summary>
        /// <param name="errorCode">
        /// The error code.
        /// </param>
        /// <param name="debugMessage">
        /// The debug message.
        /// </param>
        /// <returns>
        /// A new operation response.
        /// </returns>
        public OperationResponse GetOperationResponse(short errorCode, string debugMessage)
        {
            var responseObjcet = new AuthenticateResponse();

            return new OperationResponse(this.OperationRequest.OperationCode, responseObjcet) { ReturnCode = errorCode, DebugMessage = debugMessage };
        }
예제 #2
0
        protected AuthenticateResponse GetAuthResponse(string username, string userId, string avatarName)
        {
            // Get the inventories
            Inventories inventories = DbManager.Instance.GetInventories(userId);

            // Get the equipments
            Equipments equipments = DbManager.Instance.FetchEquipments(userId);

            // Get the quest history journal
            int[] questJournal = DbManager.Instance.GetQuestJournal(userId);

            // Get the quest active history
            int[] questActive = DbManager.Instance.GetQuestActive(userId);
            byte[] eqBytes = Equipments.Serialize(equipments);

            AuthenticateResponse response = new AuthenticateResponse()
            {
                PlayerId = userId,
                PlayerUsername = username,
                AvatarName = avatarName,
                Inventories = Inventories.Serialize(inventories),
                Equipments = Equipments.Serialize(equipments),
                QuestJournal = questJournal,
                QuestActive = questActive
            };

            return response;
        }