Fixed merge and some errors
This commit is contained in:
@@ -28,7 +28,7 @@ namespace Barotrauma.Networking
|
||||
MaximumConnections = NetConfig.MaxPlayers * 2,
|
||||
EnableUPnP = serverSettings.EnableUPnP,
|
||||
Port = serverSettings.Port,
|
||||
DualStack = GameSettings.CurrentConfig.UseDualModeSockets
|
||||
DualStack = GameSettings.CurrentConfig.UseDualModeSockets,
|
||||
LocalAddress = serverSettings.ListenIPAddress,
|
||||
};
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ defaultLib["ClientPacketHeader"] = CreateEnum("Barotrauma.Networking.ClientPacke
|
||||
defaultLib["ServerPacketHeader"] = CreateEnum("Barotrauma.Networking.ServerPacketHeader")
|
||||
defaultLib["RandSync"] = CreateEnum("Barotrauma.Rand+RandSync")
|
||||
defaultLib["DisconnectReason"] = CreateEnum("Barotrauma.Networking.DisconnectReason")
|
||||
defaultLib["TraitorMessageType"] = CreateEnum("Barotrauma.Networking.TraitorMessageType")
|
||||
defaultLib["CombatMode"] = CreateEnum("Barotrauma.AIObjectiveCombat+CombatMode")
|
||||
defaultLib["CauseOfDeathType"] = CreateEnum("Barotrauma.CauseOfDeathType")
|
||||
defaultLib["CharacterTeamType"] = CreateEnum("Barotrauma.CharacterTeamType")
|
||||
@@ -108,7 +107,6 @@ defaultLib["NetEntityEvent"] = CreateStatic("Barotrauma.Networking.NetEntityEven
|
||||
defaultLib["Screen"] = CreateStatic("Barotrauma.Screen")
|
||||
defaultLib["AttackResult"] = CreateStatic("Barotrauma.AttackResult", true)
|
||||
defaultLib["TempClient"] = CreateStatic("Barotrauma.Networking.TempClient", true)
|
||||
defaultLib["TraitorMissionResult"] = CreateStatic("Barotrauma.TraitorMissionResult", true)
|
||||
defaultLib["DecalManager"] = CreateStatic("Barotrauma.DecalManager", true)
|
||||
defaultLib["AutoItemPlacer"] = CreateStatic("Barotrauma.AutoItemPlacer")
|
||||
defaultLib["PropertyConditional"] = CreateStatic("Barotrauma.PropertyConditional", true)
|
||||
|
||||
@@ -123,6 +123,10 @@ RegisterBarotrauma("VideoPlayer")
|
||||
RegisterBarotrauma("CreditsPlayer")
|
||||
RegisterBarotrauma("SlideshowPlayer")
|
||||
RegisterBarotrauma("SerializableEntityEditor")
|
||||
RegisterBarotrauma("CircuitBoxWireRenderer")
|
||||
RegisterBarotrauma("CircuitBoxLabel")
|
||||
RegisterBarotrauma("CircuitBoxMouseDragSnapshotHandler")
|
||||
RegisterBarotrauma("CircuitBoxUI")
|
||||
|
||||
RegisterBarotrauma("SettingsMenu")
|
||||
RegisterBarotrauma("TabMenu")
|
||||
|
||||
@@ -18,6 +18,3 @@ RegisterBarotrauma("Networking.GameServer")
|
||||
|
||||
RegisterBarotrauma("Networking.ServerPeer")
|
||||
RegisterBarotrauma("Networking.ServerPeer+PendingClient")
|
||||
|
||||
RegisterBarotrauma("Traitor")
|
||||
RegisterBarotrauma("Traitor+TraitorMission")
|
||||
@@ -216,7 +216,6 @@ RegisterBarotrauma("SubmarineFile")
|
||||
RegisterBarotrauma("TalentsFile")
|
||||
RegisterBarotrauma("TalentTreesFile")
|
||||
RegisterBarotrauma("TextFile")
|
||||
RegisterBarotrauma("TraitorMissionsFile")
|
||||
RegisterBarotrauma("TutorialsFile")
|
||||
RegisterBarotrauma("UIStyleFile")
|
||||
RegisterBarotrauma("UpgradeModulesFile")
|
||||
@@ -240,8 +239,15 @@ RegisterBarotrauma("ItemInventory")
|
||||
RegisterBarotrauma("Inventory+ItemSlot")
|
||||
RegisterBarotrauma("FireSource")
|
||||
RegisterBarotrauma("AutoItemPlacer")
|
||||
RegisterBarotrauma("CircuitBoxConnection")
|
||||
RegisterBarotrauma("CircuitBoxComponent")
|
||||
RegisterBarotrauma("CircuitBoxNode")
|
||||
RegisterBarotrauma("CircuitBoxWire")
|
||||
RegisterBarotrauma("CircuitBoxInputOutputNode")
|
||||
RegisterBarotrauma("CircuitBoxSelectable")
|
||||
RegisterBarotrauma("CircuitBoxSizes")
|
||||
|
||||
local componentsToRegister = { "DockingPort", "Door", "GeneticMaterial", "Growable", "Holdable", "LevelResource", "ItemComponent", "ItemLabel", "LightComponent", "Controller", "Deconstructor", "Engine", "Fabricator", "OutpostTerminal", "Pump", "Reactor", "Steering", "PowerContainer", "Projectile", "Repairable", "Rope", "Scanner", "ButtonTerminal", "ConnectionPanel", "CustomInterface", "MemoryComponent", "Terminal", "WifiComponent", "Wire", "TriggerComponent", "ElectricalDischarger", "EntitySpawnerComponent", "ProducedItem", "VineTile", "GrowthSideExtension", "IdCard", "MeleeWeapon", "Pickable", "AbilityItemPickingTime", "Propulsion", "RangedWeapon", "AbilityRangedWeapon", "RepairTool", "Sprayer", "Throwable", "ItemContainer", "AbilityItemContainer", "Ladder", "LimbPos", "AbilityDeconstructedItem", "AbilityItemCreationMultiplier", "AbilityItemDeconstructedInventory", "MiniMap", "OxygenGenerator", "Sonar", "SonarTransducer", "Vent", "NameTag", "Planter", "Powered", "PowerTransfer", "Quality", "RemoteController", "AdderComponent", "AndComponent", "ArithmeticComponent", "ColorComponent", "ConcatComponent", "Connection", "DelayComponent", "DivideComponent", "EqualsComponent", "ExponentiationComponent", "FunctionComponent", "GreaterComponent", "ModuloComponent", "MotionSensor", "MultiplyComponent", "NotComponent", "OrComponent", "OscillatorComponent", "OxygenDetector", "RegExFindComponent", "RelayComponent", "SignalCheckComponent", "SmokeDetector", "StringComponent", "SubtractComponent", "TrigonometricFunctionComponent", "WaterDetector", "XorComponent", "StatusHUD", "Turret", "Wearable",
|
||||
local componentsToRegister = { "DockingPort", "Door", "GeneticMaterial", "Growable", "Holdable", "LevelResource", "ItemComponent", "ItemLabel", "LightComponent", "Controller", "Deconstructor", "Engine", "Fabricator", "OutpostTerminal", "Pump", "Reactor", "Steering", "PowerContainer", "Projectile", "Repairable", "Rope", "Scanner", "ButtonTerminal", "ConnectionPanel", "CustomInterface", "MemoryComponent", "Terminal", "WifiComponent", "Wire", "TriggerComponent", "ElectricalDischarger", "EntitySpawnerComponent", "ProducedItem", "VineTile", "GrowthSideExtension", "IdCard", "MeleeWeapon", "Pickable", "AbilityItemPickingTime", "Propulsion", "RangedWeapon", "AbilityRangedWeapon", "RepairTool", "Sprayer", "Throwable", "ItemContainer", "AbilityItemContainer", "Ladder", "LimbPos", "AbilityDeconstructedItem", "AbilityItemCreationMultiplier", "AbilityItemDeconstructedInventory", "MiniMap", "OxygenGenerator", "Sonar", "SonarTransducer", "Vent", "NameTag", "Planter", "Powered", "PowerTransfer", "Quality", "RemoteController", "AdderComponent", "AndComponent", "ArithmeticComponent", "ColorComponent", "ConcatComponent", "Connection", "CircuitBox", "DelayComponent", "DivideComponent", "EqualsComponent", "ExponentiationComponent", "FunctionComponent", "GreaterComponent", "ModuloComponent", "MotionSensor", "MultiplyComponent", "NotComponent", "OrComponent", "OscillatorComponent", "OxygenDetector", "RegExFindComponent", "RelayComponent", "SignalCheckComponent", "SmokeDetector", "StringComponent", "SubtractComponent", "TrigonometricFunctionComponent", "WaterDetector", "XorComponent", "StatusHUD", "Turret", "Wearable",
|
||||
"GridInfo", "PowerSourceGroup"
|
||||
}
|
||||
|
||||
@@ -381,8 +387,7 @@ RegisterBarotrauma("Skill")
|
||||
RegisterBarotrauma("SkillPrefab")
|
||||
RegisterBarotrauma("SkillSettings")
|
||||
|
||||
RegisterBarotrauma("TraitorMissionPrefab")
|
||||
RegisterBarotrauma("TraitorMissionResult")
|
||||
RegisterBarotrauma("TraitorManager")
|
||||
|
||||
Register("FarseerPhysics.Dynamics.Body")
|
||||
Register("FarseerPhysics.Dynamics.World")
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace Barotrauma
|
||||
var order = new Order(orderPrefab, autonomousObjective.Option, item ?? character.CurrentHull as Entity, orderPrefab.GetTargetItemComponent(item), orderGiver: character);
|
||||
if (order == null) { continue; }
|
||||
if ((order.IgnoreAtOutpost || autonomousObjective.IgnoreAtOutpost) &&
|
||||
Level.IsLoadedFriendlyOutpost && character.TeamID != CharacterTeamType.FriendlyNPC && !character.IsFriendlyNPCTurnedHostile)
|
||||
Level.IsLoadedFriendlyOutpost && character.TeamID != CharacterTeamType.FriendlyNPC)
|
||||
{
|
||||
if (Submarine.MainSub != null && Submarine.MainSub.DockedTo.None(s => s.TeamID != CharacterTeamType.FriendlyNPC && s.TeamID != character.TeamID))
|
||||
{
|
||||
|
||||
@@ -323,14 +323,15 @@ namespace Barotrauma.Items.Components
|
||||
wire.RegisterSignal(signal, source: this);
|
||||
#endif
|
||||
SendSignalIntoConnection(signal, recipient);
|
||||
GameMain.LuaCs.Hook.Call("signalReceived", signal, recipient);
|
||||
GameMain.LuaCs.Hook.Call("signalReceived." + recipient.item.Prefab.Identifier, signal, recipient);
|
||||
}
|
||||
|
||||
GameMain.LuaCs.Hook.Call("signalReceived", signal, connection);
|
||||
GameMain.LuaCs.Hook.Call("signalReceived." + recipient.item.Prefab.Identifier, signal, connection);
|
||||
|
||||
foreach (CircuitBoxConnection connection in CircuitBoxConnections)
|
||||
{
|
||||
connection.ReceiveSignal(signal);
|
||||
GameMain.LuaCs.Hook.Call("signalReceived", signal, connection.Connection);
|
||||
GameMain.LuaCs.Hook.Call("signalReceived." + connection.Connection.Item.Prefab.Identifier, signal, connection);
|
||||
}
|
||||
enumeratingWires = false;
|
||||
foreach (var removedWire in removedWires)
|
||||
@@ -428,4 +429,4 @@ namespace Barotrauma.Items.Components
|
||||
parentElement.Add(newElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2968,7 +2968,7 @@ namespace Barotrauma
|
||||
|
||||
if (condition <= 0.0f) { return; }
|
||||
|
||||
var should = GameMain.LuaCs.Hook.Call<bool?>("item.use", new object[] { this, character, targetLimb });
|
||||
var should = GameMain.LuaCs.Hook.Call<bool?>("item.use", new object[] { this, user, targetLimb, useTarget });
|
||||
|
||||
if (should != null && should.Value) { return; }
|
||||
|
||||
|
||||
@@ -489,9 +489,9 @@ namespace Barotrauma
|
||||
GameMain.Server.SendChatMessage(msg, messageType, sender, character);
|
||||
}
|
||||
|
||||
public static void SendTraitorMessage(Client client, string msg, Identifier missionid, TraitorMessageType type)
|
||||
public static void SendTraitorMessage(WriteOnlyMessage message, Client client)
|
||||
{
|
||||
GameMain.Server.SendTraitorMessage(client, msg, missionid, type);
|
||||
GameMain.Server.SendTraitorMessage(message, client);
|
||||
}
|
||||
|
||||
public static void SendDirectChatMessage(string sendername, string text, Character sender, ChatMessageType messageType = ChatMessageType.Private, Client client = null, string iconStyle = "")
|
||||
|
||||
@@ -28,6 +28,45 @@ namespace Barotrauma
|
||||
|
||||
}
|
||||
|
||||
private static void CopyFolder(string sourceDirName, string destDirName, bool copySubDirs, bool overwriteExisting = false)
|
||||
{
|
||||
// Get the subdirectories for the specified directory.
|
||||
DirectoryInfo dir = new DirectoryInfo(sourceDirName);
|
||||
|
||||
if (!dir.Exists)
|
||||
{
|
||||
throw new System.IO.DirectoryNotFoundException(
|
||||
"Source directory does not exist or could not be found: "
|
||||
+ sourceDirName);
|
||||
}
|
||||
|
||||
IEnumerable<DirectoryInfo> dirs = dir.GetDirectories();
|
||||
// If the destination directory doesn't exist, create it.
|
||||
if (!Directory.Exists(destDirName))
|
||||
{
|
||||
Directory.CreateDirectory(destDirName);
|
||||
}
|
||||
|
||||
// Get the files in the directory and copy them to the new location.
|
||||
IEnumerable<FileInfo> files = dir.GetFiles();
|
||||
foreach (FileInfo file in files)
|
||||
{
|
||||
string tempPath = Path.Combine(destDirName, file.Name);
|
||||
if (!overwriteExisting && File.Exists(tempPath)) { continue; }
|
||||
file.CopyTo(tempPath, true);
|
||||
}
|
||||
|
||||
// If copying subdirectories, copy them and their contents to new location.
|
||||
if (copySubDirs)
|
||||
{
|
||||
foreach (DirectoryInfo subdir in dirs)
|
||||
{
|
||||
string tempPath = Path.Combine(destDirName, subdir.Name);
|
||||
CopyFolder(subdir.FullName, tempPath, copySubDirs, overwriteExisting);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void DownloadWorkshopItemAsync(WorkshopItemDownload download, bool startDownload = false)
|
||||
{
|
||||
if (startDownload)
|
||||
@@ -45,7 +84,7 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
itemsBeingDownloaded.Remove(download);
|
||||
SaveUtil.CopyFolder(download.Item.Directory, download.Destination, true, true);
|
||||
CopyFolder(download.Item.Directory, download.Destination, true, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user