diff --git a/www/control_panel_edit_character.php b/www/control_panel_edit_character.php index 2af1ddbf..721fc439 100644 --- a/www/control_panel_edit_character.php +++ b/www/control_panel_edit_character.php @@ -61,12 +61,12 @@ $g_htmlToDbFieldMapping = array( "characterSkinColor" => "skinColor", "characterHairStyle" => "hairStyle", "characterHairColor" => "hairColor", - "characterHairOption" => "hairOption", + "characterHairOption" => "hairVariation", "characterEyeColor" => "eyeColor", "characterFaceType" => "faceType", - "characterFaceBrow" => "faceBrow", - "characterFaceEye" => "faceEye", - "characterFaceIris" => "faceIris", + "characterFaceBrow" => "faceEyebrows", + "characterFaceEye" => "faceEyeShape", + "characterFaceIris" => "faceIrisSize", "characterFaceNose" => "faceNose", "characterFaceMouth" => "faceMouth", "characterFaceJaw" => "faceJaw", @@ -76,7 +76,7 @@ $g_htmlToDbFieldMapping = array( "characterGuardian" => "guardian", "characterBirthMonth" => "birthMonth", "characterBirthDay" => "birthDay", - "characterAllegiance" => "allegiance", + "characterAllegiance" => "initialTown", "characterWeapon1" => "weapon1", "characterWeapon2" => "weapon2", "characterHeadGear" => "headGear", @@ -91,6 +91,58 @@ $g_htmlToDbFieldMapping = array( "characterLeftFingerGear" => "leftFingerGear" ); +$g_profileMapping = array( + "characterName" => "name", +/* + "characterIsLegacy" => "islegacy", + "characterPlayTime" => "playTime", + "characterPositionX" => "positionX", + "characterPositionY" => "positionY", + "characterPositionZ" => "positionZ", + "characterPositionR" => "rotation", + "characterCurrentZoneId" => "currentZoneId", +*/ + "characterGuardian" => "guardian", + "characterBirthDay" => "birthDay", + "characterBirthMonth" => "birthMonth", + "characterAllegiance" => "initialTown", + "characterTribe" => "tribe" +/* + "characterGcCurrent" => "gcCurrent", + "characterGcLimsaRank" => "gcLimsaRank", + "characterGcGridaniaRank" => "gcGridaniaRank", + "characterGcUldahRank" => "gcUldahRank", + "characterCurrentTitle" => "currentTitle", + "characterRestBonus" => "restBonus", + "characterAchievementPoints" => "achievementPoints", +*/ +); + +$g_appearanceMapping = array( +/* + "characterBaseId" => "baseId", +*/ + "characterSize" => "size", + "characterVoice" => "voice", + "characterSkinColor" => "skinColor", + "characterHairStyle" => "hairStyle", + "characterHairColor" => "hairColor", +/* "characterHairHighlightColor" => "hairHighlightColor", */ + "characterHairOption" => "hairVariation", + "characterEyeColor" => "eyeColor", + "characterFaceType" => "faceType", + "characterFaceBrow" => "faceEyebrows", + "characterFaceEye" => "faceEyeShape", + "characterFaceIris" => "faceIrisSize", + "characterFaceNose" => "faceNose", + "characterFaceMouth" => "faceMouth", + "characterFaceJaw" => "faceFeatures", + "characterFaceCheek" => "ears", + "characterFaceOption1" => "characteristics", + "characterFaceOption2" => "characteristicsColor" +); + + function SaveCharacter($databaseConnection, $htmlFieldMapping, $characterId) { $characterInfo = array(); @@ -140,6 +192,7 @@ if(isset($_POST["save"])) try { $g_characterInfo = GetCharacterInfo($g_databaseConnection, $g_userId, $g_characterId); + $g_characterAppearance = GetCharacterAppearance($g_databaseConnection, $g_userId, $g_characterId); } catch(Exception $e) { @@ -364,7 +417,7 @@ catch(Exception $e) Name: - + Guardian: @@ -373,10 +426,10 @@ catch(Exception $e) Allegiance: - - - - + + + +
@@ -389,7 +442,7 @@ catch(Exception $e) Tribe: - + Size: @@ -398,10 +451,10 @@ catch(Exception $e) Hair Style: - - - - + + + + Hair Color: @@ -410,10 +463,10 @@ catch(Exception $e) Face Type: - - - - + + + + Face Brow: @@ -422,10 +475,10 @@ catch(Exception $e) Face Nose: - - - - + + + + Face Mouth: @@ -434,10 +487,10 @@ catch(Exception $e) Face Option 1: - - - - + + + + Face Option 2: @@ -446,9 +499,10 @@ catch(Exception $e) - + +

+ +
diff --git a/www/database.php b/www/database.php index 79aabc0b..b20b52f8 100644 --- a/www/database.php +++ b/www/database.php @@ -341,6 +341,25 @@ function GetCharacterInfo($dataConnection, $userId, $characterId) return $row; } +function GetCharacterAppearance($dataConnection, $userId, $characterId) +{ + $query = sprintf("SELECT * FROM characters_appearance INNER JOIN characters ON characters_appearance.characterId = characters.id WHERE characters.userId = '%d' AND characters.Id='%d'", + $userId, $characterId); + $result = $dataConnection->query($query); + if(!$result) + { + throw new Exception(__FUNCTION__ . " failed: " . $dataConnection->error); + } + + $row = $result->fetch_assoc(); + if(!$row) + { + throw new Exception(__FUNCTION__ . " failed: " . $dataConnection->error); + } + + return $row; +} + function UpdateCharacterInfo($dataConnection, $characterId, $characterInfo) { $statement = $dataConnection->prepare("UPDATE ffxiv_characters SET