move LuaPlayer and CreateVector to a separate compatibility lua file
This commit is contained in:
@@ -75,89 +75,5 @@ namespace Barotrauma
|
||||
|
||||
public void AssignOnClientRequestExecute(string names, object onExecute) => DebugConsole.AssignOnClientRequestExecute(names, (Client a, Vector2 b, string[] c) => { env.CallFunction(onExecute, new object[] { a, b, c }); });
|
||||
}
|
||||
|
||||
|
||||
// TODO: REMOVE
|
||||
partial class LuaPlayer
|
||||
{
|
||||
|
||||
public static List<Character> GetAllCharacters()
|
||||
{
|
||||
return Character.CharacterList;
|
||||
}
|
||||
|
||||
public static List<Client> GetAllClients()
|
||||
{
|
||||
return GameMain.Server.ConnectedClients;
|
||||
}
|
||||
|
||||
public static CharacterInfo CreateCharacterInfo(string speciesName, string name = "", JobPrefab jobPrefab = null, string ragdollFileName = null, int variant = 0, Rand.RandSync randSync = Rand.RandSync.Unsynced, string npcIdentifier = "")
|
||||
{
|
||||
return new CharacterInfo(speciesName, name, name, jobPrefab, ragdollFileName, variant, randSync, npcIdentifier);
|
||||
}
|
||||
|
||||
public static void SetClientCharacter(Client client, Character character)
|
||||
{
|
||||
GameMain.Server.SetClientCharacter(client, character);
|
||||
}
|
||||
|
||||
public static void SetCharacterTeam(Character character, int team)
|
||||
{
|
||||
character.TeamID = (CharacterTeamType)team;
|
||||
}
|
||||
|
||||
public static void SetClientTeam(Client character, int team)
|
||||
{
|
||||
character.TeamID = (CharacterTeamType)team;
|
||||
}
|
||||
|
||||
public static void Kick(Client client, string reason = "")
|
||||
{
|
||||
GameMain.Server.KickClient(client.Connection, reason);
|
||||
}
|
||||
|
||||
public static void Ban(Client client, string reason = "", bool range = false, float seconds = -1)
|
||||
{
|
||||
if (seconds == -1)
|
||||
{
|
||||
GameMain.Server.BanClient(client, reason, range, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameMain.Server.BanClient(client, reason, range, TimeSpan.FromSeconds(seconds));
|
||||
}
|
||||
}
|
||||
|
||||
public static void UnbanPlayer(string player, string endpoint)
|
||||
{
|
||||
GameMain.Server.UnbanPlayer(player, endpoint);
|
||||
|
||||
}
|
||||
|
||||
public static void SetSpectatorPos(Client client, Vector2 pos)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static void SetRadioRange(Character character, float range)
|
||||
{
|
||||
if (character.Inventory == null) { return; }
|
||||
|
||||
foreach (Item item in character.Inventory.AllItems)
|
||||
{
|
||||
if (item == null) { continue; }
|
||||
|
||||
if (item.Name == "Headset")
|
||||
{
|
||||
item.GetComponent<Items.Components.WifiComponent>().Range = range;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool CheckPermission(Client client, ClientPermissions permissions)
|
||||
{
|
||||
return client.Permissions.HasFlag(permissions);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user