예제 #1
0
 public void UpdateAvatarLotSave(uint id, DbAvatar avatar)
 {
     avatar.avatar_id = id;
     Context.Connection.Query("UPDATE fso_avatars SET "
                              + "motive_data = @motive_data, "
                              + "skilllock = @skilllock, "
                              + "lock_mechanical = @lock_mechanical, "
                              + "lock_cooking = @lock_cooking, "
                              + "lock_charisma = @lock_charisma, "
                              + "lock_logic = @lock_logic, "
                              + "lock_body = @lock_body, "
                              + "lock_creativity = @lock_creativity, "
                              + "skill_mechanical = @skill_mechanical, "
                              + "skill_cooking = @skill_cooking, "
                              + "skill_charisma = @skill_charisma, "
                              + "skill_logic = @skill_logic, "
                              + "skill_body = @skill_body, "
                              + "skill_creativity = @skill_creativity, "
                              + "body = @body, "
                              + "body_swimwear = @body_swimwear, "
                              + "body_sleepwear = @body_sleepwear, "
                              + "body_current = @body_current, "
                              + "current_job = @current_job, "
                              + "is_ghost = @is_ghost, "
                              + "ticker_death = @ticker_death, "
                              + "ticker_gardener = @ticker_gardener, "
                              + "ticker_maid = @ticker_maid, "
                              + "ticker_repairman = @ticker_repairman WHERE avatar_id = @avatar_id", avatar);
 }
예제 #2
0
 public uint Create(DbAvatar avatar)
 {
     return((uint)Context.Connection.Query <int>("INSERT INTO fso_avatars (shard_id, user_id, name, " +
                                                 "gender, date, skin_tone, head, body, description, budget, moderation_level, " +
                                                 " body_swimwear, body_sleepwear) " +
                                                 " VALUES (@shard_id, @user_id, @name, @gender, @date, " +
                                                 " @skin_tone, @head, @body, @description, @budget, @moderation_level, " +
                                                 " @body_swimwear, @body_sleepwear); SELECT LAST_INSERT_ID();", new
     {
         shard_id = avatar.shard_id,
         user_id = avatar.user_id,
         name = avatar.name,
         gender = avatar.gender.ToString(),
         date = avatar.date,
         skin_tone = avatar.skin_tone,
         head = avatar.head,
         body = avatar.body,
         description = avatar.description,
         budget = avatar.budget,
         moderation_level = avatar.moderation_level,
         body_swimwear = avatar.body_swimwear,
         body_sleepwear = avatar.body_sleepwear
     }).First());
     //for now, everything else assumes default values.
 }