Reload is actually called now.
Most stuff in regions is starting to come together.
This commit is contained in:
parent
f4b4d041d9
commit
b9fb8cee55
1 changed files with 9 additions and 0 deletions
|
|
@ -54,6 +54,7 @@ namespace TShockAPI.DB
|
||||||
|
|
||||||
com.ExecuteNonQuery();
|
com.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
|
ReloadAllRegions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReloadAllRegions()
|
public void ReloadAllRegions()
|
||||||
|
|
@ -82,6 +83,7 @@ namespace TShockAPI.DB
|
||||||
string[] SplitIDs = MergedIDs.Split(',');
|
string[] SplitIDs = MergedIDs.Split(',');
|
||||||
|
|
||||||
Region r = new Region(new Rectangle(X1, Y1, width, height), name, Protected, Main.worldID.ToString());
|
Region r = new Region(new Rectangle(X1, Y1, width, height), name, Protected, Main.worldID.ToString());
|
||||||
|
r.RegionAllowedIDs = SplitIDs;
|
||||||
RegionArray[iterationCounter] = r;
|
RegionArray[iterationCounter] = r;
|
||||||
iterationCounter++;
|
iterationCounter++;
|
||||||
}
|
}
|
||||||
|
|
@ -112,7 +114,11 @@ namespace TShockAPI.DB
|
||||||
com.AddParameter("@userids", "");
|
com.AddParameter("@userids", "");
|
||||||
com.AddParameter("@protected", 1);
|
com.AddParameter("@protected", 1);
|
||||||
if (com.ExecuteNonQuery() > 0)
|
if (com.ExecuteNonQuery() > 0)
|
||||||
|
{
|
||||||
|
ReloadAllRegions();
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
@ -132,6 +138,7 @@ namespace TShockAPI.DB
|
||||||
com.AddParameter("@name", name.ToLower());
|
com.AddParameter("@name", name.ToLower());
|
||||||
com.AddParameter("@worldid", Main.worldID.ToString());
|
com.AddParameter("@worldid", Main.worldID.ToString());
|
||||||
com.ExecuteNonQuery();
|
com.ExecuteNonQuery();
|
||||||
|
ReloadAllRegions();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -155,6 +162,7 @@ namespace TShockAPI.DB
|
||||||
else
|
else
|
||||||
com.AddParameter("@bool", 0);
|
com.AddParameter("@bool", 0);
|
||||||
com.AddParameter("@worldid", Main.worldID.ToString());
|
com.AddParameter("@worldid", Main.worldID.ToString());
|
||||||
|
ReloadAllRegions();
|
||||||
if (com.ExecuteNonQuery() > 0)
|
if (com.ExecuteNonQuery() > 0)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
|
|
@ -278,6 +286,7 @@ namespace TShockAPI.DB
|
||||||
|
|
||||||
com.CommandText = "UPDATE Regions SET UserIds=@ids";
|
com.CommandText = "UPDATE Regions SET UserIds=@ids";
|
||||||
com.AddParameter("@ids", MergedIDs);
|
com.AddParameter("@ids", MergedIDs);
|
||||||
|
ReloadAllRegions();
|
||||||
return (com.ExecuteNonQuery() > 0);
|
return (com.ExecuteNonQuery() > 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue