-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
54 changed files
with
588 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,34 @@ | ||
using Parsec; | ||
using Parsec.Shaiya.SData; | ||
using Parsec.Shaiya.Skill; | ||
using System; | ||
using Parsec; | ||
using Parsec.Shaiya.Svmap; | ||
|
||
namespace Sample.Files; | ||
|
||
internal static class Program | ||
{ | ||
private static void Main(string[] args) | ||
{ | ||
SData.DecryptFile("/home/matias/Desktop/DBSkillData.SData", "/home/matias/Desktop/DBSkillData.dec.SData"); | ||
// This sample shows how you can convert a shaiya file format (in this case svmap) into json to be able to | ||
// edit its properties as plain text, and then, convert it back to its original format | ||
|
||
var skillData = ParsecReader.FromFile<DBSkillData>("/home/matias/Desktop/DBSkillData.dec.SData"); | ||
// Step 1: Read a svmap from a file | ||
var svmap = ParsecReader.FromFile<Svmap>("2.svmap"); | ||
|
||
skillData.Write("/home/matias/Desktop/DBSkillData.dec.new.SData"); | ||
// You can go through and modify its properties here too | ||
foreach (var npc in svmap.Npcs) | ||
{ | ||
Console.WriteLine($"NpcId: {npc.NpcId}, Type: {npc.NpcType}"); | ||
} | ||
|
||
var newSkillData = ParsecReader.FromFile<DBSkillData>("/home/matias/Desktop/DBSkillData.dec.new.SData"); | ||
// Step 2: Export svmap as JSON | ||
svmap.WriteJson("2.svmap.json"); | ||
|
||
// Step 3: Modify the json file in any text editor | ||
|
||
// Step 4: Read svmap from the modified JSON file | ||
var svmapFromJson = ParsecReader.FromJsonFile<Svmap>("2.svmap.json"); | ||
|
||
// Step 5: Write the edited instance as .svmap | ||
svmapFromJson.Write("2.edited.svmap"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.