mirror of
https://github.com/islehorse/HISP.git
synced 2025-06-07 03:21:27 +12:00
Add Thread-Safe Lists, and make all list access thread-safe
This commit is contained in:
parent
900fe0d48a
commit
40c34ac030
24 changed files with 111 additions and 44 deletions
|
@ -41,7 +41,7 @@ namespace HISP.Player
|
|||
}
|
||||
|
||||
|
||||
private List<AwardEntry> awardsEarned;
|
||||
private ThreadSafeList<AwardEntry> awardsEarned;
|
||||
private User baseUser;
|
||||
public AwardEntry[] AwardsEarned
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ namespace HISP.Player
|
|||
{
|
||||
baseUser = user;
|
||||
int[] awards = Database.GetAwards(user.Id);
|
||||
awardsEarned = new List<AwardEntry>();
|
||||
awardsEarned = new ThreadSafeList<AwardEntry>();
|
||||
|
||||
foreach (int awardid in awards)
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace HISP.Player
|
|||
public class Friends
|
||||
{
|
||||
private User baseUser;
|
||||
private List<int> list;
|
||||
private ThreadSafeList<int> list;
|
||||
public int[] List
|
||||
{
|
||||
get
|
||||
|
@ -36,7 +36,7 @@ namespace HISP.Player
|
|||
public Friends(User user)
|
||||
{
|
||||
baseUser = user;
|
||||
list = new List<int>();
|
||||
list = new ThreadSafeList<int>();
|
||||
|
||||
int[] friends = Database.GetBuddyList(user.Id);
|
||||
foreach(int friendId in friends)
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace HISP.Player
|
|||
}
|
||||
|
||||
private User baseUser;
|
||||
private List<HighscoreTableEntry> highScoreList = new List<HighscoreTableEntry>();
|
||||
private ThreadSafeList<HighscoreTableEntry> highScoreList = new ThreadSafeList<HighscoreTableEntry>();
|
||||
|
||||
public Highscore(User user)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace HISP.Player
|
|||
public class Mailbox
|
||||
{
|
||||
private User baseUser;
|
||||
private List<Mail> mails = new List<Mail>();
|
||||
private ThreadSafeList<Mail> mails = new ThreadSafeList<Mail>();
|
||||
public int MailCount
|
||||
{
|
||||
get
|
||||
|
|
|
@ -6,10 +6,10 @@ namespace HISP.Player
|
|||
public class MutedPlayers
|
||||
{
|
||||
private User baseUser;
|
||||
private List<int> userIds;
|
||||
private ThreadSafeList<int> userIds;
|
||||
public MutedPlayers(User BaseUser)
|
||||
{
|
||||
userIds = new List<int>();
|
||||
userIds = new ThreadSafeList<int>();
|
||||
baseUser = BaseUser;
|
||||
int[] userids = Database.GetMutedPlayers(BaseUser.Id);
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace HISP.Player
|
|||
{
|
||||
public class PlayerQuests
|
||||
{
|
||||
private List<TrackedQuest> trackedQuests = new List<TrackedQuest>();
|
||||
private ThreadSafeList<TrackedQuest> trackedQuests = new ThreadSafeList<TrackedQuest>();
|
||||
public User BaseUser;
|
||||
public TrackedQuest[] QuestList
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue