Merge remote-tracking branch 'refs/remotes/barotrauma/master'

Conflicts:
	Subsurface/Source/Networking/FileStreamReceiver.cs
	Subsurface/Source/Networking/FileStreamSender.cs
	Subsurface/Source/Networking/GameClient.cs
	Subsurface/Source/Networking/GameServer.cs
	Subsurface/Source/Networking/GameServerLogin.cs
	Subsurface/Source/Networking/NetworkEvent.cs
	Subsurface/Source/Screens/NetLobbyScreen.cs
This commit is contained in:
juanjp600
2016-09-24 21:28:37 -03:00
45 changed files with 97 additions and 97 deletions
+2 -2
View File
@@ -273,7 +273,7 @@ namespace Launcher2
string exePath = Directory.GetCurrentDirectory() + "//" + executables[0]; string exePath = Directory.GetCurrentDirectory() + "//" + executables[0];
if (!File.Exists(exePath)) if (!File.Exists(exePath))
{ {
ShowError("Error", "Couldn't find the executable ''" + exePath + "''!"); ShowError("Error", "Couldn't find the executable \"" + exePath + "\"!");
return false; return false;
} }
@@ -283,7 +283,7 @@ namespace Launcher2
} }
catch (Exception exception) catch (Exception exception)
{ {
ShowError("Error while opening executable ''" + exePath + "''", exception.Message); ShowError("Error while opening executable \"" + exePath + "\"", exception.Message);
return false; return false;
} }
@@ -252,7 +252,7 @@ namespace Barotrauma
refLimb = GetLimb(LimbType.Torso); refLimb = GetLimb(LimbType.Torso);
if (refLimb == null) refLimb = GetLimb(LimbType.Head); if (refLimb == null) refLimb = GetLimb(LimbType.Head);
if (refLimb == null) DebugConsole.ThrowError("Character ''" + character + "'' doesn't have a head or torso!"); if (refLimb == null) DebugConsole.ThrowError("Character \"" + character + "\" doesn't have a head or torso!");
UpdateCollisionCategories(); UpdateCollisionCategories();
@@ -960,7 +960,7 @@ namespace Barotrauma
//clamp the magnitude of the correction movement between 0.5f - 5.0f //clamp the magnitude of the correction movement between 0.5f - 5.0f
Vector2 newCorrectionMovement = Vector2.Normalize(diff) * MathHelper.Clamp(dist * 2.0f, 0.5f, 5.0f); Vector2 newCorrectionMovement = Vector2.Normalize(diff) * MathHelper.Clamp(dist * 2.0f, 0.5f, 5.0f);
//heading in the right direction -> use the ''normal'' movement if it's faster than correctionMovement //heading in the right direction -> use the \"normal\" movement if it's faster than correctionMovement
//i.e. the character is close to the targetposition but the character is still running //i.e. the character is close to the targetposition but the character is still running
if (Math.Sign(targetMovement.X) == Math.Sign(newCorrectionMovement.X)) if (Math.Sign(targetMovement.X) == Math.Sign(newCorrectionMovement.X))
{ {
+3 -3
View File
@@ -457,14 +457,14 @@ namespace Barotrauma
if (!System.IO.File.Exists(file)) if (!System.IO.File.Exists(file))
{ {
DebugConsole.ThrowError("Spawning a character failed - file ''"+file+"'' not found!"); DebugConsole.ThrowError("Spawning a character failed - file \""+file+"\" not found!");
return null; return null;
} }
} }
#else #else
if (!System.IO.File.Exists(file)) if (!System.IO.File.Exists(file))
{ {
DebugConsole.ThrowError("Spawning a character failed - file ''"+file+"'' not found!"); DebugConsole.ThrowError("Spawning a character failed - file \""+file+"\" not found!");
return null; return null;
} }
#endif #endif
@@ -632,7 +632,7 @@ namespace Barotrauma
if (humanConfigFile == null) if (humanConfigFile == null)
{ {
DebugConsole.ThrowError("Couldn't find a config file for humans from the selected content package!"); DebugConsole.ThrowError("Couldn't find a config file for humans from the selected content package!");
DebugConsole.ThrowError("(The config file must end with ''human.xml'')"); DebugConsole.ThrowError("(The config file must end with \"human.xml\")");
return ""; return "";
} }
} }
+1 -1
View File
@@ -101,7 +101,7 @@ namespace Barotrauma
ItemPrefab itemPrefab = ItemPrefab.list.Find(ip => ip.Name == itemName) as ItemPrefab; ItemPrefab itemPrefab = ItemPrefab.list.Find(ip => ip.Name == itemName) as ItemPrefab;
if (itemPrefab == null) if (itemPrefab == null)
{ {
DebugConsole.ThrowError("Tried to spawn ''" + Name + "'' with the item ''" + itemName + "''. Matching item prefab not found."); DebugConsole.ThrowError("Tried to spawn \"" + Name + "\" with the item \"" + itemName + "\". Matching item prefab not found.");
return; return;
} }
+1 -1
View File
@@ -236,7 +236,7 @@ namespace Barotrauma
catch catch
{ {
type = LimbType.None; type = LimbType.None;
DebugConsole.ThrowError("Error in "+element+"! ''"+element.Attribute("type").Value+"'' is not a valid limb type"); DebugConsole.ThrowError("Error in "+element+"! \""+element.Attribute("type").Value+"\" is not a valid limb type");
} }
+1 -1
View File
@@ -316,7 +316,7 @@ namespace Barotrauma
} }
else else
{ {
DebugConsole.ThrowError("Couldn't apply value "+value.ToString()+" ("+type+") to property ''"+property.Name+"'' ("+property.GetValue().GetType()+")! " DebugConsole.ThrowError("Couldn't apply value "+value.ToString()+" ("+type+") to property \""+property.Name+"\" ("+property.GetValue().GetType()+")! "
+"Make sure the type of the value set in the config files matches the type of the property."); +"Make sure the type of the value set in the config files matches the type of the property.");
} }
} }
+1 -1
View File
@@ -61,7 +61,7 @@ namespace Barotrauma
if (doc==null) if (doc==null)
{ {
DebugConsole.ThrowError("Couldn't load content package ''"+filePath+"''!"); DebugConsole.ThrowError("Couldn't load content package \""+filePath+"\"!");
return; return;
} }
+1 -1
View File
@@ -75,7 +75,7 @@ namespace Barotrauma
return true; return true;
case CoroutineStatus.Failure: case CoroutineStatus.Failure:
DebugConsole.ThrowError("Coroutine ''" + handle.Name + "'' has failed"); DebugConsole.ThrowError("Coroutine \"" + handle.Name + "\" has failed");
return true; return true;
} }
} }
+5 -5
View File
@@ -65,7 +65,7 @@ namespace Barotrauma
textBox.Color = Color.Black * 0.7f; textBox.Color = Color.Black * 0.7f;
NewMessage("Press F3 to open/close the debug console", Color.Cyan); NewMessage("Press F3 to open/close the debug console", Color.Cyan);
NewMessage("Enter ''help'' for a list of available console commands", Color.Cyan); NewMessage("Enter \"help\" for a list of available console commands", Color.Cyan);
} }
@@ -163,7 +163,7 @@ namespace Barotrauma
#if !DEBUG #if !DEBUG
if (GameMain.Client != null && !IsCommandPermitted(commands[0].ToLowerInvariant(), GameMain.Client)) if (GameMain.Client != null && !IsCommandPermitted(commands[0].ToLowerInvariant(), GameMain.Client))
{ {
ThrowError("You're not permitted to use the command ''" + commands[0].ToLowerInvariant()+"''!"); ThrowError("You're not permitted to use the command \"" + commands[0].ToLowerInvariant()+"\"!");
return; return;
} }
#endif #endif
@@ -172,7 +172,7 @@ namespace Barotrauma
{ {
case "help": case "help":
NewMessage("menu: go to main menu", Color.Cyan); NewMessage("menu: go to main menu", Color.Cyan);
NewMessage("game: enter the ''game screen''", Color.Cyan); NewMessage("game: enter the \"game screen\"", Color.Cyan);
NewMessage("edit: switch to submarine editor", Color.Cyan); NewMessage("edit: switch to submarine editor", Color.Cyan);
NewMessage("edit [submarine name]: load a submarine and switch to submarine editor", Color.Cyan); NewMessage("edit [submarine name]: load a submarine and switch to submarine editor", Color.Cyan);
NewMessage("load [submarine name]: load a submarine", Color.Cyan); NewMessage("load [submarine name]: load a submarine", Color.Cyan);
@@ -212,7 +212,7 @@ namespace Barotrauma
NewMessage("kick [name]: kick a player out from the server", Color.Cyan); NewMessage("kick [name]: kick a player out from the server", Color.Cyan);
NewMessage("ban [name]: kick and ban the player from the server", Color.Cyan); NewMessage("ban [name]: kick and ban the player from the server", Color.Cyan);
NewMessage("banip [IP address]: ban the IP address from the server", Color.Cyan); NewMessage("banip [IP address]: ban the IP address from the server", Color.Cyan);
NewMessage("debugdraw: toggles the ''debug draw mode''", Color.Cyan); NewMessage("debugdraw: toggles the \"debug draw mode\"", Color.Cyan);
NewMessage("netstats: toggles the visibility of the network statistics panel", Color.Cyan); NewMessage("netstats: toggles the visibility of the network statistics panel", Color.Cyan);
break; break;
@@ -661,7 +661,7 @@ namespace Barotrauma
if (GameMain.Config.MasterServerUrl != "http://www.undertowgames.com/baromaster") if (GameMain.Config.MasterServerUrl != "http://www.undertowgames.com/baromaster")
{ {
DebugConsole.ThrowError("MasterServerUrl ''"+GameMain.Config.MasterServerUrl+"''!"); DebugConsole.ThrowError("MasterServerUrl \""+GameMain.Config.MasterServerUrl+"\"!");
} }
GameMain.Config.Save("config.xml"); GameMain.Config.Save("config.xml");
@@ -50,7 +50,7 @@ namespace Barotrauma
ItemPrefab itemPrefab = ItemPrefab.list.Find(ip => ip.Name == itemName) as ItemPrefab; ItemPrefab itemPrefab = ItemPrefab.list.Find(ip => ip.Name == itemName) as ItemPrefab;
if (itemPrefab==null) if (itemPrefab==null)
{ {
DebugConsole.ThrowError("Couldn't spawn item for cargo mission: item prefab ''"+element.Name.ToString()+"'' not found"); DebugConsole.ThrowError("Couldn't spawn item for cargo mission: item prefab \""+element.Name.ToString()+"\" not found");
return; return;
} }
+2 -2
View File
@@ -173,13 +173,13 @@ namespace Barotrauma
t = Type.GetType("Barotrauma." + type, true, true); t = Type.GetType("Barotrauma." + type, true, true);
if (t == null) if (t == null)
{ {
DebugConsole.ThrowError("Error in " + configFile + "! Could not find a mission class of the type ''" + type + "''."); DebugConsole.ThrowError("Error in " + configFile + "! Could not find a mission class of the type \"" + type + "\".");
continue; continue;
} }
} }
catch catch
{ {
DebugConsole.ThrowError("Error in " + configFile + "! Could not find a mission class of the type ''" + type + "''."); DebugConsole.ThrowError("Error in " + configFile + "! Could not find a mission class of the type \"" + type + "\".");
continue; continue;
} }
+2 -2
View File
@@ -152,13 +152,13 @@ namespace Barotrauma
t = Type.GetType("Barotrauma." + type, true, true); t = Type.GetType("Barotrauma." + type, true, true);
if (t == null) if (t == null)
{ {
DebugConsole.ThrowError("Error in " + configFile + "! Could not find an event class of the type ''" + type + "''."); DebugConsole.ThrowError("Error in " + configFile + "! Could not find an event class of the type \"" + type + "\".");
continue; continue;
} }
} }
catch catch
{ {
DebugConsole.ThrowError("Error in " + configFile + "! Could not find an event class of the type ''" + type + "''."); DebugConsole.ThrowError("Error in " + configFile + "! Could not find an event class of the type \"" + type + "\".");
continue; continue;
} }
+1 -1
View File
@@ -17,7 +17,7 @@ namespace Barotrauma
try { doc = XDocument.Load(file); } try { doc = XDocument.Load(file); }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Loading style ''" + file + "'' failed", e); DebugConsole.ThrowError("Loading style \"" + file + "\" failed", e);
return; return;
} }
+1 -1
View File
@@ -203,7 +203,7 @@ namespace Barotrauma
GUIComponent.Init(Window); GUIComponent.Init(Window);
DebugConsole.Init(Window); DebugConsole.Init(Window);
DebugConsole.Log(SelectedPackage == null ? "No content package selected" : "Content package ''" + SelectedPackage.Name + "'' selected"); DebugConsole.Log(SelectedPackage == null ? "No content package selected" : "Content package \"" + SelectedPackage.Name + "\" selected");
yield return CoroutineStatus.Running; yield return CoroutineStatus.Running;
LightManager = new Lights.LightManager(GraphicsDevice); LightManager = new Lights.LightManager(GraphicsDevice);
@@ -109,7 +109,7 @@ namespace Barotrauma.Tutorials
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
infoBox = CreateInfoFrame("The reactor core has started generating heat, which in turn generates power for the submarine. The power generation is very low at the moment," infoBox = CreateInfoFrame("The reactor core has started generating heat, which in turn generates power for the submarine. The power generation is very low at the moment,"
+ " because the reactor is set to shut itself down when the temperature rises above 500 degrees Celsius. You can adjust the temperature limit by changing the ''Shutdown Temperature'' in the control panel.", true); + " because the reactor is set to shut itself down when the temperature rises above 500 degrees Celsius. You can adjust the temperature limit by changing the \"Shutdown Temperature\" in the control panel.", true);
while (infoBox != null) while (infoBox != null)
{ {
@@ -130,7 +130,7 @@ namespace Barotrauma.Tutorials
} }
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
infoBox = CreateInfoFrame("Looks like we're up and running! Now you should turn on the ''Automatic temperature control'', which will make the reactor " infoBox = CreateInfoFrame("Looks like we're up and running! Now you should turn on the \"Automatic temperature control\", which will make the reactor "
+ "automatically adjust the temperature to a suitable level. Even though it's an easy way to keep the reactor up and running most of the time, " + "automatically adjust the temperature to a suitable level. Even though it's an easy way to keep the reactor up and running most of the time, "
+ "you should keep in mind that it changes the temperature very slowly and carefully, which may cause issues if there are sudden changes in grid load."); + "you should keep in mind that it changes the temperature very slowly and carefully, which may cause issues if there are sudden changes in grid load.");
@@ -256,7 +256,7 @@ namespace Barotrauma.Tutorials
yield return CoroutineStatus.Running; yield return CoroutineStatus.Running;
} }
infoBox = CreateInfoFrame("You can take a look at the area around the sub by selecting the ''Sonar'' checkbox."); infoBox = CreateInfoFrame("You can take a look at the area around the sub by selecting the \"Sonar\" checkbox.");
while (!radar.IsActive) while (!radar.IsActive)
{ {
@@ -555,7 +555,7 @@ namespace Barotrauma.Tutorials
brokenBox = Character.Controlled.SelectedConstruction; brokenBox = Character.Controlled.SelectedConstruction;
infoBox = CreateInfoFrame("Here's our problem: this junction box is broken. Luckily engineers are adept at fixing electrical devices - " infoBox = CreateInfoFrame("Here's our problem: this junction box is broken. Luckily engineers are adept at fixing electrical devices - "
+"you just need to find a spare wire and click the ''Fix''-button to repair the box."); +"you just need to find a spare wire and click the \"Fix\"-button to repair the box.");
break; break;
} }
@@ -18,14 +18,14 @@ namespace Barotrauma.Tutorials
yield return CoroutineStatus.Running; yield return CoroutineStatus.Running;
} }
infoBox = CreateInfoFrame("Press ''Structure'' at the left side of the screen to start placing some walls."); infoBox = CreateInfoFrame("Press \"Structure\" at the left side of the screen to start placing some walls.");
while (GameMain.EditMapScreen.SelectedTab != (int)MapEntityCategory.Structure) while (GameMain.EditMapScreen.SelectedTab != (int)MapEntityCategory.Structure)
{ {
yield return CoroutineStatus.Running; yield return CoroutineStatus.Running;
} }
infoBox = CreateInfoFrame("Select ''topwall'' from the list.", true); infoBox = CreateInfoFrame("Select \"topwall\" from the list.", true);
while (MapEntityPrefab.Selected == null || MapEntityPrefab.Selected.Name != "topwall") while (MapEntityPrefab.Selected == null || MapEntityPrefab.Selected.Name != "topwall")
{ {
@@ -52,7 +52,7 @@ namespace Barotrauma.Tutorials
WayPoint wayPoint = WayPoint.GetRandom(SpawnType.Cargo, null); WayPoint wayPoint = WayPoint.GetRandom(SpawnType.Cargo, null);
if (wayPoint == null) if (wayPoint == null)
{ {
DebugConsole.ThrowError("A waypoint with the spawntype ''cargo'' is required for the tutorial event"); DebugConsole.ThrowError("A waypoint with the spawntype \"cargo\" is required for the tutorial event");
return; return;
} }
@@ -65,7 +65,7 @@ namespace Barotrauma.Tutorials
var idCard = character.Inventory.FindItem("ID Card"); var idCard = character.Inventory.FindItem("ID Card");
if (idCard == null) if (idCard == null)
{ {
DebugConsole.ThrowError("Item prefab ''ID Card'' not found!"); DebugConsole.ThrowError("Item prefab \"ID Card\" not found!");
return; return;
} }
idCard.AddTag("com"); idCard.AddTag("com");
+1 -1
View File
@@ -336,7 +336,7 @@ namespace Barotrauma
} }
catch catch
{ {
DebugConsole.ThrowError("Saving gamesession to ''" + filePath + "'' failed!"); DebugConsole.ThrowError("Saving gamesession to \"" + filePath + "\" failed!");
} }
} }
} }
@@ -44,7 +44,7 @@ namespace Barotrauma
if (!infoTexts.TryGetValue(infoName.ToLowerInvariant(), out infoList) || !infoList.Any()) if (!infoTexts.TryGetValue(infoName.ToLowerInvariant(), out infoList) || !infoList.Any())
{ {
#if DEBUG #if DEBUG
return "Info text ''" + infoName + "'' not found"; return "Info text \"" + infoName + "\" not found";
#else #else
return ""; return "";
#endif #endif
+1 -1
View File
@@ -210,7 +210,7 @@ namespace Barotrauma
{ {
if (keyMapping[(int)inputType]==null) if (keyMapping[(int)inputType]==null)
{ {
DebugConsole.ThrowError("Key binding for the input type ''" + inputType + " not set!"); DebugConsole.ThrowError("Key binding for the input type \"" + inputType + " not set!");
keyMapping[(int)inputType] = new KeyOrMouse(Keys.D1); keyMapping[(int)inputType] = new KeyOrMouse(Keys.D1);
} }
} }
@@ -304,7 +304,7 @@ namespace Barotrauma.Items.Components
} }
catch catch
{ {
DebugConsole.ThrowError("Error in " + element + "! ''" + element.Attribute("type").Value + "'' is not a valid alignment"); DebugConsole.ThrowError("Error in " + element + "! \"" + element.Attribute("type").Value + "\" is not a valid alignment");
} }
guiFrame = new GUIFrame( guiFrame = new GUIFrame(
@@ -320,7 +320,7 @@ namespace Barotrauma.Items.Components
if (filePath == "") if (filePath == "")
{ {
DebugConsole.ThrowError("Error when instantiating item ''"+item.Name+"'' - sound with no file path set"); DebugConsole.ThrowError("Error when instantiating item \""+item.Name+"\" - sound with no file path set");
continue; continue;
} }
@@ -732,13 +732,13 @@ namespace Barotrauma.Items.Components
t = Type.GetType("Barotrauma.Items.Components." + type + "", false, true); t = Type.GetType("Barotrauma.Items.Components." + type + "", false, true);
if (t == null) if (t == null)
{ {
if (errorMessages) DebugConsole.ThrowError("Could not find the component ''" + type + "'' (" + file + ")"); if (errorMessages) DebugConsole.ThrowError("Could not find the component \"" + type + "\" (" + file + ")");
return null; return null;
} }
} }
catch (Exception e) catch (Exception e)
{ {
if (errorMessages) DebugConsole.ThrowError("Could not find the component ''" + type + "'' (" + file + ")", e); if (errorMessages) DebugConsole.ThrowError("Could not find the component \"" + type + "\" (" + file + ")", e);
return null; return null;
} }
@@ -749,13 +749,13 @@ namespace Barotrauma.Items.Components
constructor = t.GetConstructor(new Type[] { typeof(Item), typeof(XElement) }); constructor = t.GetConstructor(new Type[] { typeof(Item), typeof(XElement) });
if (constructor == null) if (constructor == null)
{ {
DebugConsole.ThrowError("Could not find the constructor of the component ''" + type + "'' (" + file + ")"); DebugConsole.ThrowError("Could not find the constructor of the component \"" + type + "\" (" + file + ")");
return null; return null;
} }
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Could not find the constructor of the component ''" + type + "'' (" + file + ")", e); DebugConsole.ThrowError("Could not find the constructor of the component \"" + type + "\" (" + file + ")", e);
return null; return null;
} }
@@ -65,7 +65,7 @@ namespace Barotrauma.Items.Components
var itemPrefab = ItemPrefab.list.FirstOrDefault(ip => ip.Name.ToLowerInvariant() == deconstructProduct.ItemPrefabName.ToLowerInvariant()) as ItemPrefab; var itemPrefab = ItemPrefab.list.FirstOrDefault(ip => ip.Name.ToLowerInvariant() == deconstructProduct.ItemPrefabName.ToLowerInvariant()) as ItemPrefab;
if (itemPrefab==null) if (itemPrefab==null)
{ {
DebugConsole.ThrowError("Tried to deconstruct item ''"+targetItem.Name+"'' but couldn't find item prefab ''"+deconstructProduct+"''!"); DebugConsole.ThrowError("Tried to deconstruct item \""+targetItem.Name+"\" but couldn't find item prefab \""+deconstructProduct+"\"!");
continue; continue;
} }
Item.Spawner.QueueItem(itemPrefab, containers[1].Inventory); Item.Spawner.QueueItem(itemPrefab, containers[1].Inventory);
@@ -25,7 +25,7 @@ namespace Barotrauma.Items.Components
TargetItem = ItemPrefab.list.Find(ip => ip.Name.ToLowerInvariant() == name.ToLowerInvariant()) as ItemPrefab; TargetItem = ItemPrefab.list.Find(ip => ip.Name.ToLowerInvariant() == name.ToLowerInvariant()) as ItemPrefab;
if (TargetItem == null) if (TargetItem == null)
{ {
DebugConsole.ThrowError("Error in fabricable item "+name+"! Item ''" + element.Name + "'' not found."); DebugConsole.ThrowError("Error in fabricable item "+name+"! Item \"" + element.Name + "\" not found.");
return; return;
} }
@@ -43,7 +43,7 @@ namespace Barotrauma.Items.Components
ItemPrefab requiredItem = ItemPrefab.list.Find(ip => ip.Name.ToLowerInvariant() == requiredItemName.Trim().ToLowerInvariant()) as ItemPrefab; ItemPrefab requiredItem = ItemPrefab.list.Find(ip => ip.Name.ToLowerInvariant() == requiredItemName.Trim().ToLowerInvariant()) as ItemPrefab;
if (requiredItem == null) if (requiredItem == null)
{ {
DebugConsole.ThrowError("Error in fabricable item " + name + "! Required item ''" + requiredItemName + "'' not found."); DebugConsole.ThrowError("Error in fabricable item " + name + "! Required item \"" + requiredItemName + "\" not found.");
continue; continue;
} }
@@ -80,7 +80,7 @@ namespace Barotrauma.Items.Components
if (subElement.Attribute("texture") == null) if (subElement.Attribute("texture") == null)
{ {
DebugConsole.ThrowError("Item ''" + item.Name + "'' doesn't have a texture specified!"); DebugConsole.ThrowError("Item \"" + item.Name + "\" doesn't have a texture specified!");
return; return;
} }
@@ -34,21 +34,21 @@ namespace Barotrauma.RuinGeneration
if (Prefab == null) if (Prefab == null)
{ {
DebugConsole.ThrowError("Loading ruin structure failed - structure prefab ''"+prefab+" not found"); DebugConsole.ThrowError("Loading ruin structure failed - structure prefab \""+prefab+" not found");
return; return;
} }
string alignmentStr = ToolBox.GetAttributeString(element,"alignment","Bottom"); string alignmentStr = ToolBox.GetAttributeString(element,"alignment","Bottom");
if (!Enum.TryParse<Alignment>(alignmentStr, true, out Alignment)) if (!Enum.TryParse<Alignment>(alignmentStr, true, out Alignment))
{ {
DebugConsole.ThrowError("Error in ruin structure ''"+prefab+"'' - "+alignmentStr+" is not a valid alignment"); DebugConsole.ThrowError("Error in ruin structure \""+prefab+"\" - "+alignmentStr+" is not a valid alignment");
} }
string typeStr = ToolBox.GetAttributeString(element,"type",""); string typeStr = ToolBox.GetAttributeString(element,"type","");
if (!Enum.TryParse<RuinStructureType>(typeStr,true, out Type)) if (!Enum.TryParse<RuinStructureType>(typeStr,true, out Type))
{ {
DebugConsole.ThrowError("Error in ruin structure ''" + prefab + "'' - " + typeStr + " is not a valid type"); DebugConsole.ThrowError("Error in ruin structure \"" + prefab + "\" - " + typeStr + " is not a valid type");
return; return;
} }
@@ -20,7 +20,7 @@
of conditions and the following disclaimer in the documentation and/or other materials of conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution. provided with the distribution.
THIS SOFTWARE IS PROVIDED BY James Humphreys ``AS IS'' AND ANY EXPRESS OR IMPLIED THIS SOFTWARE IS PROVIDED BY James Humphreys ``AS IS\" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+1 -1
View File
@@ -212,7 +212,7 @@ namespace Barotrauma
if (!File.Exists(pathBox.Text)) if (!File.Exists(pathBox.Text))
{ {
new GUIMessageBox("Error", "Submarine file ''" + pathBox.Text + "'' not found!"); new GUIMessageBox("Error", "Submarine file \"" + pathBox.Text + "\" not found!");
pathBox.Flash(Color.Red); pathBox.Flash(Color.Red);
pathBox.Text = filePath; pathBox.Text = filePath;
return false; return false;
+1 -1
View File
@@ -91,7 +91,7 @@ namespace Barotrauma
{ {
MapEntityPrefab ep = new MapEntityPrefab(); MapEntityPrefab ep = new MapEntityPrefab();
ep.name = "Hull"; ep.name = "Hull";
ep.Description = "Hulls determine which parts are considered to be ''inside the sub''. Generally every room should be enclosed by a hull."; ep.Description = "Hulls determine which parts are considered to be \"inside the sub\". Generally every room should be enclosed by a hull.";
ep.constructor = typeof(Hull).GetConstructor(new Type[] { typeof(MapEntityPrefab), typeof(Rectangle) }); ep.constructor = typeof(Hull).GetConstructor(new Type[] { typeof(MapEntityPrefab), typeof(Rectangle) });
ep.resizeHorizontal = true; ep.resizeHorizontal = true;
ep.resizeVertical = true; ep.resizeVertical = true;
+13 -13
View File
@@ -569,7 +569,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Saving submarine ''" + filePath + "'' failed!", e); DebugConsole.ThrowError("Saving submarine \"" + filePath + "\" failed!", e);
return false; return false;
} }
@@ -607,7 +607,7 @@ namespace Barotrauma
{ {
if (!Hull.hullList.Any()) if (!Hull.hullList.Any())
{ {
DebugConsole.ThrowError("No hulls found in the submarine. Hulls determine the ''borders'' of an individual room and are required for water and air distribution to work correctly."); DebugConsole.ThrowError("No hulls found in the submarine. Hulls determine the \"borders\" of an individual room and are required for water and air distribution to work correctly.");
} }
foreach (Item item in Item.ItemList) foreach (Item item in Item.ItemList)
@@ -628,7 +628,7 @@ namespace Barotrauma
if (WayPoint.WayPointList.Find(wp => wp.SpawnType == SpawnType.Cargo) == null) if (WayPoint.WayPointList.Find(wp => wp.SpawnType == SpawnType.Cargo) == null)
{ {
DebugConsole.ThrowError("The submarine doesn't have spawnpoints for cargo (which are used for determining where to place bought items). " DebugConsole.ThrowError("The submarine doesn't have spawnpoints for cargo (which are used for determining where to place bought items). "
+"To fix this, create a new spawnpoint and change its ''spawn type'' parameter to ''cargo''."); +"To fix this, create a new spawnpoint and change its \"spawn type\" parameter to \"cargo\".");
} }
} }
@@ -647,7 +647,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Directory ''" + SavePath + "'' not found and creating the directory failed.", e); DebugConsole.ThrowError("Directory \"" + SavePath + "\" not found and creating the directory failed.", e);
return; return;
} }
} }
@@ -662,7 +662,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Couldn't open directory ''" + SavePath + "''!", e); DebugConsole.ThrowError("Couldn't open directory \"" + SavePath + "\"!", e);
return; return;
} }
@@ -674,7 +674,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Couldn't open subdirectory ''" + subDirectory + "''!", e); DebugConsole.ThrowError("Couldn't open subdirectory \"" + subDirectory + "\"!", e);
return; return;
} }
} }
@@ -717,7 +717,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Loading submarine ''" + file + "'' failed!", e); DebugConsole.ThrowError("Loading submarine \"" + file + "\" failed!", e);
return null; return null;
} }
@@ -731,7 +731,7 @@ namespace Barotrauma
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Loading submarine ''" + file + "'' failed! ("+e.Message+")"); DebugConsole.ThrowError("Loading submarine \"" + file + "\" failed! ("+e.Message+")");
return null; return null;
} }
} }
@@ -744,13 +744,13 @@ namespace Barotrauma
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Loading submarine ''" + file + "'' failed! (" + e.Message + ")"); DebugConsole.ThrowError("Loading submarine \"" + file + "\" failed! (" + e.Message + ")");
return null; return null;
} }
} }
else else
{ {
DebugConsole.ThrowError("Couldn't load submarine ''" + file + "! (Unrecognized file extension)"); DebugConsole.ThrowError("Couldn't load submarine \"" + file + "! (Unrecognized file extension)");
return null; return null;
} }
@@ -796,13 +796,13 @@ namespace Barotrauma
t = Type.GetType("Barotrauma." + typeName, true, true); t = Type.GetType("Barotrauma." + typeName, true, true);
if (t == null) if (t == null)
{ {
DebugConsole.ThrowError("Error in " + filePath + "! Could not find a entity of the type ''" + typeName + "''."); DebugConsole.ThrowError("Error in " + filePath + "! Could not find a entity of the type \"" + typeName + "\".");
continue; continue;
} }
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Error in " + filePath + "! Could not find a entity of the type ''" + typeName + "''.", e); DebugConsole.ThrowError("Error in " + filePath + "! Could not find a entity of the type \"" + typeName + "\".", e);
continue; continue;
} }
@@ -813,7 +813,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Could not find the method ''Load'' in " + t + ".", e); DebugConsole.ThrowError("Could not find the method \"Load\" in " + t + ".", e);
} }
} }
+1 -1
View File
@@ -309,7 +309,7 @@ namespace Barotrauma
//should never be null when casting a line out from inside the bounding box //should never be null when casting a line out from inside the bounding box
Debug.Assert(intersection != null); Debug.Assert(intersection != null);
//''+ translatedir'' in order to move the character slightly away from the wall //\"+ translatedir\" in order to move the character slightly away from the wall
c.AnimController.SetPosition(ConvertUnits.ToSimUnits(c.WorldPosition + ((Vector2)intersection - limb.WorldPosition)) + translateDir); c.AnimController.SetPosition(ConvertUnits.ToSimUnits(c.WorldPosition + ((Vector2)intersection - limb.WorldPosition)) + translateDir);
return; return;
+2 -2
View File
@@ -131,7 +131,7 @@ namespace Barotrauma.Networking
} }
catch catch
{ {
new GUIMessageBox("Could not connect to server", "Failed to resolve address ''"+serverIP+":"+Port+"''. Please make sure you have entered a valid IP address."); new GUIMessageBox("Could not connect to server", "Failed to resolve address \""+serverIP+":"+Port+"\". Please make sure you have entered a valid IP address.");
return; return;
} }
@@ -574,7 +574,7 @@ namespace Barotrauma.Networking
if (gameMode == null) if (gameMode == null)
{ {
DebugConsole.ThrowError("Game mode ''" + modeName + "'' not found!"); DebugConsole.ThrowError("Game mode \"" + modeName + "\" not found!");
yield return CoroutineStatus.Success; yield return CoroutineStatus.Success;
} }
@@ -58,7 +58,7 @@ namespace Barotrauma.Particles
if (prefab == null) if (prefab == null)
{ {
DebugConsole.ThrowError("Particle prefab ''" + prefabName+"'' not found!"); DebugConsole.ThrowError("Particle prefab \"" + prefabName+"\" not found!");
return null; return null;
} }
+1 -1
View File
@@ -97,7 +97,7 @@ namespace Barotrauma
sw.WriteLine(sb.ToString()); sw.WriteLine(sb.ToString());
sw.Close(); sw.Close();
CrashMessageBox( "A crash report (''crashreport.txt'') was saved in the root folder of the game."+ CrashMessageBox( "A crash report (\"crashreport.txt\") was saved in the root folder of the game."+
" If you'd like to help fix this bug, please post the report on the Undertow Games forums."); " If you'd like to help fix this bug, please post the report on the Undertow Games forums.");
} }
} }
+2 -2
View File
@@ -94,7 +94,7 @@ namespace Barotrauma
} }
else else
{ {
DebugConsole.ThrowError("Failed to set the value of the property ''" + Name + "'' of ''" + obj + "'' to " + value); DebugConsole.ThrowError("Failed to set the value of the property \"" + Name + "\" of \"" + obj + "\" to " + value);
DebugConsole.ThrowError("(Type not implemented)"); DebugConsole.ThrowError("(Type not implemented)");
return false; return false;
@@ -109,7 +109,7 @@ namespace Barotrauma
if (property.PropertyType!= value.GetType()) if (property.PropertyType!= value.GetType())
{ {
DebugConsole.ThrowError("Failed to set the value of the property ''"+Name+"'' of ''"+obj.ToString()+"'' to "+value.ToString()); DebugConsole.ThrowError("Failed to set the value of the property \""+Name+"\" of \""+obj.ToString()+"\" to "+value.ToString());
DebugConsole.ThrowError("(Non-matching type, should be "+property.PropertyType+" instead of " +value.GetType()+")"); DebugConsole.ThrowError("(Non-matching type, should be "+property.PropertyType+" instead of " +value.GetType()+")");
return false; return false;
+1 -1
View File
@@ -485,7 +485,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Couldn't delete file ''"+sub.FilePath+"''!", e); DebugConsole.ThrowError("Couldn't delete file \""+sub.FilePath+"\"!", e);
} }
} }
+3 -3
View File
@@ -192,7 +192,7 @@ namespace Barotrauma
passwordBox = new GUITextBox(new Rectangle(160, 150, 200, 30), null, null, Alignment.TopLeft, Alignment.Left, GUI.Style, menuTabs[(int)Tab.HostServer]); passwordBox = new GUITextBox(new Rectangle(160, 150, 200, 30), null, null, Alignment.TopLeft, Alignment.Left, GUI.Style, menuTabs[(int)Tab.HostServer]);
isPublicBox = new GUITickBox(new Rectangle(10, 200, 20, 20), "Public server", Alignment.TopLeft, menuTabs[(int)Tab.HostServer]); isPublicBox = new GUITickBox(new Rectangle(10, 200, 20, 20), "Public server", Alignment.TopLeft, menuTabs[(int)Tab.HostServer]);
isPublicBox.ToolTip = "Public servers are shown in the list of available servers in the ''Join Server'' -tab"; isPublicBox.ToolTip = "Public servers are shown in the list of available servers in the \"Join Server\" -tab";
useUpnpBox = new GUITickBox(new Rectangle(10, 250, 20, 20), "Attempt UPnP port forwarding", Alignment.TopLeft, menuTabs[(int)Tab.HostServer]); useUpnpBox = new GUITickBox(new Rectangle(10, 250, 20, 20), "Attempt UPnP port forwarding", Alignment.TopLeft, menuTabs[(int)Tab.HostServer]);
@@ -407,7 +407,7 @@ namespace Barotrauma
if (doc==null) if (doc==null)
{ {
DebugConsole.ThrowError("Error loading save file ''"+fileName+"''. The file may be corrupted."); DebugConsole.ThrowError("Error loading save file \""+fileName+"\". The file may be corrupted.");
return false; return false;
} }
@@ -573,7 +573,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Loading save ''"+saveFile+"'' failed", e); DebugConsole.ThrowError("Loading save \""+saveFile+"\" failed", e);
return false; return false;
} }
+3 -3
View File
@@ -1174,17 +1174,17 @@ namespace Barotrauma
string errorMsg = ""; string errorMsg = "";
if (sub == null) if (sub == null)
{ {
errorMsg = "Submarine ''" + subName + "'' was selected by the server. Matching file not found in your submarine folder. "; errorMsg = "Submarine \"" + subName + "\" was selected by the server. Matching file not found in your submarine folder. ";
} }
else if (sub.MD5Hash.Hash == null) else if (sub.MD5Hash.Hash == null)
{ {
errorMsg = "Couldn't load submarine ''" + subName + "''. The file may be corrupted. "; errorMsg = "Couldn't load submarine \"" + subName + "\". The file may be corrupted. ";
if (matchingListSub != null) matchingListSub.TextColor = Color.Red; if (matchingListSub != null) matchingListSub.TextColor = Color.Red;
} }
else else
{ {
errorMsg = "Your version of the submarine file ''" + sub.Name + "'' doesn't match the server's version! " errorMsg = "Your version of the submarine file \"" + sub.Name + "\" doesn't match the server's version! "
+ "Your MD5 hash: " + sub.MD5Hash.Hash + " \n" + "Your MD5 hash: " + sub.MD5Hash.Hash + " \n"
+ "Server's MD5 hash: " + md5Hash + ". "; + "Server's MD5 hash: " + md5Hash + ". ";
} }
+1 -1
View File
@@ -68,7 +68,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Failed to cast vote type ''"+voteTypeByte+"''", e); DebugConsole.ThrowError("Failed to cast vote type \""+voteTypeByte+"\"", e);
return; return;
} }
@@ -255,7 +255,7 @@ namespace Barotrauma
switch (response.StatusCode) switch (response.StatusCode)
{ {
case System.Net.HttpStatusCode.NotFound: case System.Net.HttpStatusCode.NotFound:
DebugConsole.ThrowError("Error while connecting to master server (404 - ''" + NetConfig.MasterServerUrl + "'' not found)"); DebugConsole.ThrowError("Error while connecting to master server (404 - \"" + NetConfig.MasterServerUrl + "\" not found)");
break; break;
case System.Net.HttpStatusCode.ServiceUnavailable: case System.Net.HttpStatusCode.ServiceUnavailable:
DebugConsole.ThrowError("Error while connecting to master server (505 - Service Unavailable)"); DebugConsole.ThrowError("Error while connecting to master server (505 - Service Unavailable)");
+1 -1
View File
@@ -78,7 +78,7 @@ namespace Barotrauma
{ {
if (!File.Exists(file)) if (!File.Exists(file))
{ {
DebugConsole.ThrowError("File ''" + file + "'' not found!"); DebugConsole.ThrowError("File \"" + file + "\" not found!");
return null; return null;
} }
+1 -1
View File
@@ -181,7 +181,7 @@ namespace Barotrauma
} }
else else
{ {
DebugConsole.ThrowError("Sprite ''"+file+"'' not found!"); DebugConsole.ThrowError("Sprite \""+file+"\" not found!");
} }
return null; return null;
+5 -5
View File
@@ -110,7 +110,7 @@ namespace Barotrauma
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("ERROR: deleting save file ''"+fileName+" failed.", e); DebugConsole.ThrowError("ERROR: deleting save file \""+fileName+" failed.", e);
} }
} }
@@ -119,14 +119,14 @@ namespace Barotrauma
{ {
if (!Directory.Exists(SaveFolder)) if (!Directory.Exists(SaveFolder))
{ {
DebugConsole.ThrowError("Save folder ''" + SaveFolder + " not found! Attempting to create a new folder"); DebugConsole.ThrowError("Save folder \"" + SaveFolder + " not found! Attempting to create a new folder");
try try
{ {
Directory.CreateDirectory(SaveFolder); Directory.CreateDirectory(SaveFolder);
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Failed to create the folder ''" + SaveFolder + "''!", e); DebugConsole.ThrowError("Failed to create the folder \"" + SaveFolder + "\"!", e);
} }
} }
@@ -144,7 +144,7 @@ namespace Barotrauma
{ {
if (!Directory.Exists(SaveFolder)) if (!Directory.Exists(SaveFolder))
{ {
DebugConsole.ThrowError("Save folder ''"+SaveFolder+"'' not found. Created new folder"); DebugConsole.ThrowError("Save folder \""+SaveFolder+"\" not found. Created new folder");
Directory.CreateDirectory(SaveFolder); Directory.CreateDirectory(SaveFolder);
} }
@@ -189,7 +189,7 @@ namespace Barotrauma
{ {
if (!File.Exists(fileName)) if (!File.Exists(fileName))
{ {
DebugConsole.ThrowError("File ''"+fileName+" doesn't exist!"); DebugConsole.ThrowError("File \""+fileName+" doesn't exist!");
return null; return null;
} }
+1 -1
View File
@@ -54,7 +54,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Loading texture ''"+path+"'' failed!", e); DebugConsole.ThrowError("Loading texture \""+path+"\" failed!", e);
return null; return null;
} }
+7 -7
View File
@@ -36,7 +36,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Couldn't load xml document ''"+filePath+"''!", e); DebugConsole.ThrowError("Couldn't load xml document \""+filePath+"\"!", e);
return null; return null;
} }
@@ -54,7 +54,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Loading font ''"+file+"'' failed", e); DebugConsole.ThrowError("Loading font \""+file+"\" failed", e);
} }
return font; return font;
@@ -197,7 +197,7 @@ namespace Barotrauma
} }
else else
{ {
DebugConsole.ThrowError("Error in " + attribute.Value.ToString() + "! ''" + val + "'' is not a valid boolean value"); DebugConsole.ThrowError("Error in " + attribute.Value.ToString() + "! \"" + val + "\" is not a valid boolean value");
return false; return false;
} }
} }
@@ -244,7 +244,7 @@ namespace Barotrauma
if (components.Length!=2) if (components.Length!=2)
{ {
if (!errorMessages) return vector; if (!errorMessages) return vector;
DebugConsole.ThrowError("Failed to parse the string ''"+stringVector2+"'' to Vector2"); DebugConsole.ThrowError("Failed to parse the string \""+stringVector2+"\" to Vector2");
return vector; return vector;
} }
@@ -267,7 +267,7 @@ namespace Barotrauma
if (components.Length < 3) if (components.Length < 3)
{ {
if (errorMessages) DebugConsole.ThrowError("Failed to parse the string ''" + stringVector4 + "'' to Vector4"); if (errorMessages) DebugConsole.ThrowError("Failed to parse the string \"" + stringVector4 + "\" to Vector4");
return vector; return vector;
} }
@@ -488,7 +488,7 @@ namespace Barotrauma
if (lineCount == 0) if (lineCount == 0)
{ {
DebugConsole.ThrowError("File ''" + filePath + "'' is empty!"); DebugConsole.ThrowError("File \"" + filePath + "\" is empty!");
file.Close(); file.Close();
return ""; return "";
} }
@@ -513,7 +513,7 @@ namespace Barotrauma
} }
catch (Exception e) catch (Exception e)
{ {
DebugConsole.ThrowError("Couldn't open file ''" + filePath + "''!", e); DebugConsole.ThrowError("Couldn't open file \"" + filePath + "\"!", e);
return ""; return "";
} }
+2 -2
View File
@@ -189,7 +189,7 @@ namespace Barotrauma
catch (Exception e) catch (Exception e)
{ {
System.Diagnostics.Debug.WriteLine("Could not delete file ''" + file + "'' (" + e.Message + ")"); System.Diagnostics.Debug.WriteLine("Could not delete file \"" + file + "\" (" + e.Message + ")");
continue; continue;
} }
} }
@@ -215,7 +215,7 @@ namespace Barotrauma
catch (Exception e) catch (Exception e)
{ {
System.Diagnostics.Debug.WriteLine("Could not delete file ''" + file + "'' (" + e.Message + ")"); System.Diagnostics.Debug.WriteLine("Could not delete file \"" + file + "\" (" + e.Message + ")");
continue; continue;
} }
} }