From f7df8e133b66aafcf35f0590a0ac525a7d2f9278 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Mon, 31 Mar 2014 19:58:19 +0200 Subject: Documented msDifference --- MCServer/Plugins/APIDump/APIDesc.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 6f8a14421..532b4b665 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -230,22 +230,22 @@ g_APIDesc =

- + - + - + - + - + - +
area blockresultarea blockresult
this Src msOverwrite msFillAir msImprint this Src msOverwrite msFillAir msImprint msDifference
air air air air air air air air air air air
A air air A A A air air A A air
air B B B B air B B B B B
A B B A B A B B A B B
@@ -255,6 +255,8 @@ g_APIDesc =
  • msOverwrite completely overwrites all blocks with the Src's blocks
  • msFillAir overwrites only those blocks that were air
  • msImprint overwrites with only those blocks that are non-air
  • +
  • msSpongePrint Sponge overwrites nothing, everything else overwrites anything
  • +
  • msDifference changes all the blocks wich are the same to air. Otherwise the source block gets placed.
  • -- cgit v1.2.3 From a8bc27f8728a0c1f222871cbd3f5534646e59085 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Mon, 31 Mar 2014 20:05:48 +0200 Subject: Fixed typo --- MCServer/Plugins/APIDump/APIDesc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 532b4b665..1b020501c 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -256,7 +256,7 @@ g_APIDesc =
  • msFillAir overwrites only those blocks that were air
  • msImprint overwrites with only those blocks that are non-air
  • msSpongePrint Sponge overwrites nothing, everything else overwrites anything
  • -
  • msDifference changes all the blocks wich are the same to air. Otherwise the source block gets placed.
  • +
  • msDifference changes all the blocks which are the same to air. Otherwise the source block gets placed.
  • -- cgit v1.2.3 From b19022fc7ea4cb6bd1bc6f4b212478e65b5fa5a1 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Mon, 31 Mar 2014 20:13:08 +0200 Subject: Added extra table which should make it more clear what msDifference does. --- MCServer/Plugins/APIDump/APIDesc.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 1b020501c..657ac6aa6 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -247,6 +247,9 @@ g_APIDesc = A B B A B B + + A A A A B air +

    @@ -255,7 +258,6 @@ g_APIDesc =

  • msOverwrite completely overwrites all blocks with the Src's blocks
  • msFillAir overwrites only those blocks that were air
  • msImprint overwrites with only those blocks that are non-air
  • -
  • msSpongePrint Sponge overwrites nothing, everything else overwrites anything
  • msDifference changes all the blocks which are the same to air. Otherwise the source block gets placed.
  • -- cgit v1.2.3 From 1229795ff0fd82412e780fffc9f37a2d6eed5522 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 1 Apr 2014 20:50:10 +0200 Subject: cBlockArea: Added the msMask merge strategy. --- MCServer/Plugins/APIDump/APIDesc.lua | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 28e7744ed..9bcd6edde 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -200,6 +200,8 @@ g_APIDesc = msFillAir = { Notes = "Dst is overwritten by Src only where Src has air blocks" }, msImprint = { Notes = "Src overwrites Dst anywhere where Dst has non-air blocks" }, msLake = { Notes = "Special mode for merging lake images" }, + msSpongePrint = { Notes = "Similar to msImprint, sponge block doesn't overwrite anything, all other blocks overwrite everything"}, + msMask = { Notes = "The blocks that are exactly the same are kept in Dst, all differing blocks are replaced by air"}, }, ConstantGroups = { @@ -293,7 +295,6 @@ g_APIDesc = -

    msSpongePrint - used for most prefab-generators to merge the prefabs. Similar to msImprint, but uses the sponge block as the NOP block instead, so that the prefabs may carve out air @@ -306,10 +307,26 @@ g_APIDesc = A sponge A Sponge is the NOP block - * B B Everything else overwrites anything + * B B Everything else overwrites anything - ]], + +

    + msMask - the blocks that are the same in the other area are kept, all the + differing blocks are replaced with air. Meta is used in the comparison, too, two blocks of the + same type but different meta are considered different and thus replaced with air. +

    + + + + + + + + + +
    area block Notes
    this Src result
    A A A Same blocks are kept
    A non-A air Differing blocks are replaced with air
    +]], }, -- Merge strategies }, -- AdditionalInfo }, -- cBlockArea -- cgit v1.2.3 From 21e0607e49745f0a431fa045967cc45679ab22de Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Tue, 1 Apr 2014 21:12:48 +0200 Subject: APIDump: Gave msDifference it's own table. --- MCServer/Plugins/APIDump/APIDesc.lua | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 657ac6aa6..b01be6118 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -230,25 +230,25 @@ g_APIDesc =

    - + - + - + - + - + - + - +
    area blockresultarea blockresult
    this Src msOverwrite msFillAir msImprint msDifference this Src msOverwrite msFillAir msImprint
    air air air air air air air air air air air
    A air air A A air A air air A A
    air B B B B B air B B B B
    A B B A B B A B B A B
    A A A A B air A A A A A
    @@ -258,13 +258,25 @@ g_APIDesc =
  • msOverwrite completely overwrites all blocks with the Src's blocks
  • msFillAir overwrites only those blocks that were air
  • msImprint overwrites with only those blocks that are non-air
  • -
  • msDifference changes all the blocks which are the same to air. Otherwise the source block gets placed.
  • Special strategies

    For each strategy, evaluate the table rows from top downwards, the first match wins.

    - + +

    + msDifference - changes all the blocks which are the same to air. Otherwise the source block gets placed. +

    + + + + + + + +
    area block Notes
    * B B The blocks are different so we use block B
    B B Air The blocks are the same so we get air.
    + +

    msLake - used for merging areas with lava and water lakes, in the appropriate generator.

    -- cgit v1.2.3 From 67d7ad86896e90b799a0479a86a6e764c7fe36da Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 2 Apr 2014 11:58:19 +0200 Subject: Debuggers: Added a Base64 API roundtrip test. --- MCServer/Plugins/Debuggers/Debuggers.lua | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index 2619bd6c4..064d5d772 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -69,12 +69,13 @@ function Initialize(Plugin) LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion()) - -- TestBlockAreas(); - -- TestSQLiteBindings(); - -- TestExpatBindings(); - -- TestPluginCalls(); + -- TestBlockAreas() + -- TestSQLiteBindings() + -- TestExpatBindings() + -- TestPluginCalls() TestBlockAreasString() + TestStringBase64() --[[ -- Test cCompositeChat usage in console-logging: @@ -252,6 +253,24 @@ end +function TestStringBase64() + -- Create a binary string: + local s = "" + for i = 0, 255 do + s = s .. string.char(i) + end + + -- Roundtrip through Base64: + local Base64 = Base64Encode(s) + local UnBase64 = Base64Decode(Base64) + + assert(UnBase64 == s) +end + + + + + function TestSQLiteBindings() LOG("Testing SQLite bindings..."); -- cgit v1.2.3