public static void SetGroupPermissions(Group group)
		{
			DatabaseGroup g = database.groups.Where(x => group.Name == x.name).FirstOrDefault();
			if (g != null)
			{
				g.permissions = group.Permissions.Where(x => x.Value).Select(x => x.Key).ToArray();//group.ExportPermissions();
			}
			SaveSetting(jsonDatabaseFilename);
		}
		public static void AddGroup(ref Group group)
		{
			int newid = GetAvailableGroupID();
			DatabaseGroup newGroup = new DatabaseGroup() { name = group.Name, ID = newid };
			database.groups.Add(newGroup);

			group.ID = newid;
			SetGroupPermissions(group);
			SaveSetting(jsonDatabaseFilename);
		}
		public static void DeleteGroup(Group group)
		{
			DatabaseGroup databaseGroup = database.groups.Where(x => x.ID == group.ID).FirstOrDefault();
			if (databaseGroup != null)
			{
				foreach (var player in database.players)
				{
					if (player.group == databaseGroup.ID)
					{
						player.group = Network.DefaultGroup.ID;
					}
				}
				database.groups.Remove(databaseGroup);
			}
			SaveSetting(jsonDatabaseFilename);
		}