Added the option to disable karma
This commit is contained in:
@@ -408,6 +408,12 @@ namespace Barotrauma
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
commands.Add(new Command("togglekarma", "togglekarma: Toggles the karma system.", (string[] args) =>
|
||||||
|
{
|
||||||
|
if (GameMain.Server == null) return;
|
||||||
|
GameMain.Server.KarmaEnabled = !GameMain.Server.KarmaEnabled;
|
||||||
|
}));
|
||||||
|
|
||||||
commands.Add(new Command("kick", "kick [name]: Kick a player out of the server.", (string[] args) =>
|
commands.Add(new Command("kick", "kick [name]: Kick a player out of the server.", (string[] args) =>
|
||||||
{
|
{
|
||||||
if (GameMain.NetworkMember == null || args.Length == 0) return;
|
if (GameMain.NetworkMember == null || args.Length == 0) return;
|
||||||
|
|||||||
@@ -32,8 +32,18 @@ namespace Barotrauma.Networking
|
|||||||
private float karma = 1.0f;
|
private float karma = 1.0f;
|
||||||
public float Karma
|
public float Karma
|
||||||
{
|
{
|
||||||
get { return karma; }
|
get
|
||||||
set { karma = Math.Min(Math.Max(value,0.0f),1.0f); DebugConsole.NewMessage(Name+"'s karma set to "+karma,Microsoft.Xna.Framework.Color.Yellow); }
|
{
|
||||||
|
if (GameMain.Server == null) return 1.0f;
|
||||||
|
if (!GameMain.Server.KarmaEnabled) return 1.0f;
|
||||||
|
return karma;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (GameMain.Server == null) return;
|
||||||
|
if (!GameMain.Server.KarmaEnabled) return;
|
||||||
|
karma = Math.Min(Math.Max(value,0.0f),1.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte TeamID = 0;
|
public byte TeamID = 0;
|
||||||
|
|||||||
@@ -210,6 +210,13 @@ namespace Barotrauma.Networking
|
|||||||
private set;
|
private set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Serialize(false,true)]
|
||||||
|
public bool KarmaEnabled
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
}
|
||||||
|
|
||||||
private void SaveSettings()
|
private void SaveSettings()
|
||||||
{
|
{
|
||||||
XDocument doc = new XDocument(new XElement("serversettings"));
|
XDocument doc = new XDocument(new XElement("serversettings"));
|
||||||
|
|||||||
Reference in New Issue
Block a user