mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-18 19:01:32 +12:00
Thread Safe more stuff.. hopefully
This is gonna break so much ..
This commit is contained in:
parent
80b1cdea19
commit
0cad1e0fac
24 changed files with 375 additions and 114 deletions
|
@ -42,9 +42,43 @@ namespace HISP.Game.Chat
|
||||||
}
|
}
|
||||||
public static string PrivateMessageSound;
|
public static string PrivateMessageSound;
|
||||||
|
|
||||||
public static List<Filter> FilteredWords = new List<Filter>();
|
private static List<Filter> filteredWords = new List<Filter>();
|
||||||
public static List<Correction> CorrectedWords = new List<Correction>();
|
private static List<Correction> correctedWords = new List<Correction>();
|
||||||
public static List<Reason> Reasons = new List<Reason>();
|
private static List<Reason> reasons = new List<Reason>();
|
||||||
|
|
||||||
|
public static void AddFilter(Filter filter)
|
||||||
|
{
|
||||||
|
filteredWords.Add(filter);
|
||||||
|
}
|
||||||
|
public static void AddCorrection(Correction correction)
|
||||||
|
{
|
||||||
|
correctedWords.Add(correction);
|
||||||
|
}
|
||||||
|
public static void AddReason(Reason reason)
|
||||||
|
{
|
||||||
|
reasons.Add(reason);
|
||||||
|
}
|
||||||
|
public static Filter[] FilteredWords
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return filteredWords.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static Correction[] CorrectedWords
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return correctedWords.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static Reason[] Reasons
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return reasons.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public static bool ProcessCommand(User user, string message)
|
public static bool ProcessCommand(User user, string message)
|
||||||
{
|
{
|
||||||
if (message.Length < 1)
|
if (message.Length < 1)
|
||||||
|
|
|
@ -6,13 +6,31 @@ namespace HISP.Game.Chat
|
||||||
{
|
{
|
||||||
public SocialType(string type)
|
public SocialType(string type)
|
||||||
{
|
{
|
||||||
Socials = new List<Social>();
|
socials = new List<Social>();
|
||||||
Type = type;
|
Type = type;
|
||||||
SocialTypes.Add(this);
|
socialTypes.Add(this);
|
||||||
}
|
}
|
||||||
public static List<SocialType> SocialTypes = new List<SocialType>();
|
private static List<SocialType> socialTypes = new List<SocialType>();
|
||||||
public string Type;
|
public string Type;
|
||||||
public List<Social> Socials;
|
private List<Social> socials;
|
||||||
|
public void AddSocial(Social social)
|
||||||
|
{
|
||||||
|
socials.Add(social);
|
||||||
|
}
|
||||||
|
public static SocialType[] SocialTypes
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return socialTypes.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public Social[] Socials
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return socials.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public class Social
|
public class Social
|
||||||
{
|
{
|
||||||
public SocialType BaseSocialType;
|
public SocialType BaseSocialType;
|
||||||
|
@ -47,13 +65,13 @@ namespace HISP.Game.Chat
|
||||||
if(stype.Type == type)
|
if(stype.Type == type)
|
||||||
{
|
{
|
||||||
social.BaseSocialType = stype;
|
social.BaseSocialType = stype;
|
||||||
stype.Socials.Add(social);
|
stype.AddSocial(social);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SocialType sType = new SocialType(type);
|
SocialType sType = new SocialType(type);
|
||||||
social.BaseSocialType = sType;
|
social.BaseSocialType = sType;
|
||||||
sType.Socials.Add(social);
|
sType.AddSocial(social);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,11 +13,22 @@ namespace HISP.Game.Events
|
||||||
public ThrowTracker(User thrower)
|
public ThrowTracker(User thrower)
|
||||||
{
|
{
|
||||||
Thrower = thrower;
|
Thrower = thrower;
|
||||||
ThrownAt = new List<User>();
|
thrownAt = new List<User>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddThrownAt(User user)
|
||||||
|
{
|
||||||
|
thrownAt.Add(user);
|
||||||
}
|
}
|
||||||
public User Thrower;
|
public User Thrower;
|
||||||
public List<User> ThrownAt;
|
private List<User> thrownAt;
|
||||||
|
public User[] ThrownAt
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return thrownAt.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Active = false;
|
public bool Active = false;
|
||||||
|
@ -139,7 +150,7 @@ namespace HISP.Game.Events
|
||||||
thrower.LoggedinClient.SendPacket(youEarned);
|
thrower.LoggedinClient.SendPacket(youEarned);
|
||||||
throwAt.LoggedinClient.SendPacket(otherEarned);
|
throwAt.LoggedinClient.SendPacket(otherEarned);
|
||||||
|
|
||||||
throwCounter.ThrownAt.Add(throwAt);
|
throwCounter.AddThrownAt(throwAt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace HISP.Game.Events
|
||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
int hrsIdx = GameServer.RandomNumberGenerator.Next(0, HorseInfo.Breeds.Count);
|
int hrsIdx = GameServer.RandomNumberGenerator.Next(0, HorseInfo.Breeds.Length);
|
||||||
HorseInfo.Breed breed = HorseInfo.Breeds[hrsIdx];
|
HorseInfo.Breed breed = HorseInfo.Breeds[hrsIdx];
|
||||||
if (breed.SpawnInArea == "none")
|
if (breed.SpawnInArea == "none")
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -12,12 +12,13 @@ namespace HISP.Game.Events
|
||||||
{
|
{
|
||||||
public WaterBalloonGame()
|
public WaterBalloonGame()
|
||||||
{
|
{
|
||||||
ThrownWaterBalloonMemory = new List<ThrownCounter>();
|
thrownWaterBalloonMemory = new List<ThrownCounter>();
|
||||||
Active = false;
|
Active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<ThrownCounter> ThrownWaterBalloonMemory;
|
private List<ThrownCounter> thrownWaterBalloonMemory;
|
||||||
|
public ThrownCounter[] ThrownWaterBalloonMemory;
|
||||||
public bool Active;
|
public bool Active;
|
||||||
private Timer gameTimeout;
|
private Timer gameTimeout;
|
||||||
private const int WATER_BALLOON_GAME_TIMEOUT = 5;
|
private const int WATER_BALLOON_GAME_TIMEOUT = 5;
|
||||||
|
@ -29,7 +30,7 @@ namespace HISP.Game.Events
|
||||||
NumThrown = numThrown;
|
NumThrown = numThrown;
|
||||||
baseGame = game;
|
baseGame = game;
|
||||||
|
|
||||||
game.ThrownWaterBalloonMemory.Add(this);
|
game.thrownWaterBalloonMemory.Add(this);
|
||||||
}
|
}
|
||||||
private WaterBalloonGame baseGame;
|
private WaterBalloonGame baseGame;
|
||||||
public User UserHit;
|
public User UserHit;
|
||||||
|
@ -89,17 +90,16 @@ namespace HISP.Game.Events
|
||||||
{
|
{
|
||||||
gameTimeout.Dispose();
|
gameTimeout.Dispose();
|
||||||
gameTimeout = null;
|
gameTimeout = null;
|
||||||
ThrownWaterBalloonMemory.Clear();
|
thrownWaterBalloonMemory.Clear();
|
||||||
Active = false;
|
Active = false;
|
||||||
}
|
}
|
||||||
private ThrownCounter[] getWinners()
|
private ThrownCounter[] getWinners()
|
||||||
{
|
{
|
||||||
int maxThrown = 0;
|
int maxThrown = 0;
|
||||||
ThrownCounter[] thrownWaterBalloonMemory = ThrownWaterBalloonMemory.ToArray();
|
|
||||||
List<ThrownCounter> winningCounter = new List<ThrownCounter>();
|
List<ThrownCounter> winningCounter = new List<ThrownCounter>();
|
||||||
|
|
||||||
// Find the highest throw count
|
// Find the highest throw count
|
||||||
foreach(ThrownCounter throwMemory in thrownWaterBalloonMemory)
|
foreach(ThrownCounter throwMemory in ThrownWaterBalloonMemory)
|
||||||
{
|
{
|
||||||
if(throwMemory.NumThrown >= maxThrown)
|
if(throwMemory.NumThrown >= maxThrown)
|
||||||
{
|
{
|
||||||
|
@ -121,16 +121,16 @@ namespace HISP.Game.Events
|
||||||
|
|
||||||
public void LeaveEvent(User userToLeave)
|
public void LeaveEvent(User userToLeave)
|
||||||
{
|
{
|
||||||
foreach (ThrownCounter thrownMemory in ThrownWaterBalloonMemory.ToArray())
|
foreach (ThrownCounter thrownMemory in ThrownWaterBalloonMemory)
|
||||||
{
|
{
|
||||||
if (thrownMemory.UserHit.Id == userToLeave.Id)
|
if (thrownMemory.UserHit.Id == userToLeave.Id)
|
||||||
ThrownWaterBalloonMemory.Remove(thrownMemory);
|
thrownWaterBalloonMemory.Remove(thrownMemory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ThrownCounter getThrownCounter(User userToGet)
|
private ThrownCounter getThrownCounter(User userToGet)
|
||||||
{
|
{
|
||||||
foreach(ThrownCounter thrownMemory in ThrownWaterBalloonMemory.ToArray())
|
foreach(ThrownCounter thrownMemory in ThrownWaterBalloonMemory)
|
||||||
{
|
{
|
||||||
if (thrownMemory.UserHit.Id == userToGet.Id)
|
if (thrownMemory.UserHit.Id == userToGet.Id)
|
||||||
return thrownMemory;
|
return thrownMemory;
|
||||||
|
|
|
@ -573,8 +573,33 @@ namespace HISP.Game.Horse
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string[] HorseNames;
|
public static string[] HorseNames;
|
||||||
public static List<Category> HorseCategories = new List<Category>();
|
private static List<Category> horseCategories = new List<Category>();
|
||||||
public static List<Breed> Breeds = new List<Breed>();
|
private static List<Breed> breeds = new List<Breed>();
|
||||||
|
|
||||||
|
public static void AddBreed(Breed breed)
|
||||||
|
{
|
||||||
|
breeds.Add(breed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddHorseCategory(Category category)
|
||||||
|
{
|
||||||
|
horseCategories.Add(category);
|
||||||
|
}
|
||||||
|
public static Category[] HorseCategories
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return horseCategories.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Breed[] Breeds
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return breeds.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static string GenerateHorseName()
|
public static string GenerateHorseName()
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,19 @@ namespace HISP.Game.Horse
|
||||||
{
|
{
|
||||||
public class Leaser
|
public class Leaser
|
||||||
{
|
{
|
||||||
public static List<Leaser> HorseLeasers = new List<Leaser>();
|
private static List<Leaser> horseLeasers = new List<Leaser>();
|
||||||
|
public static void AddHorseLeaser(Leaser leaser)
|
||||||
|
{
|
||||||
|
horseLeasers.Add(leaser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Leaser[] HorseLeasers
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return horseLeasers.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public Leaser(int breedId, int saddle, int saddlePad, int bridle)
|
public Leaser(int breedId, int saddle, int saddlePad, int bridle)
|
||||||
{
|
{
|
||||||
Breed = HorseInfo.GetBreedById(breedId);
|
Breed = HorseInfo.GetBreedById(breedId);
|
||||||
|
|
|
@ -195,7 +195,7 @@ namespace HISP.Game.Horse
|
||||||
Logger.InfoPrint("Generating horses.");
|
Logger.InfoPrint("Generating horses.");
|
||||||
while(wildHorses.Count < 40)
|
while(wildHorses.Count < 40)
|
||||||
{
|
{
|
||||||
HorseInfo.Breed horseBreed = HorseInfo.Breeds[GameServer.RandomNumberGenerator.Next(0, HorseInfo.Breeds.Count)];
|
HorseInfo.Breed horseBreed = HorseInfo.Breeds[GameServer.RandomNumberGenerator.Next(0, HorseInfo.Breeds.Length)];
|
||||||
if (horseBreed.Swf == "")
|
if (horseBreed.Swf == "")
|
||||||
continue;
|
continue;
|
||||||
if (horseBreed.SpawnInArea == "none") // no unipegs >_>
|
if (horseBreed.SpawnInArea == "none") // no unipegs >_>
|
||||||
|
|
|
@ -59,8 +59,31 @@ namespace HISP.Game.Items
|
||||||
public string HitYourselfMessage;
|
public string HitYourselfMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ItemInformation> Items = new List<ItemInformation>();
|
private static List<ItemInformation> items = new List<ItemInformation>();
|
||||||
public static List<ThrowableItem> ThrowableItems = new List<ThrowableItem>();
|
private static List<ThrowableItem> throwableItems = new List<ThrowableItem>();
|
||||||
|
public static void AddItemInfo(ItemInformation itm)
|
||||||
|
{
|
||||||
|
items.Add(itm);
|
||||||
|
}
|
||||||
|
public static void AddThrowableItem(ThrowableItem throwableItem)
|
||||||
|
{
|
||||||
|
throwableItems.Add(throwableItem);
|
||||||
|
}
|
||||||
|
public static ItemInformation[] Items
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return items.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static ThrowableItem[] ThrowableItems
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return throwableItems.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static int Present;
|
public static int Present;
|
||||||
public static int MailMessage;
|
public static int MailMessage;
|
||||||
|
|
|
@ -601,14 +601,14 @@ namespace HISP.Game
|
||||||
|
|
||||||
|
|
||||||
message += Messages.FormatTradeYourOffering(trade.OtherTrade.Trader.Username);
|
message += Messages.FormatTradeYourOffering(trade.OtherTrade.Trader.Username);
|
||||||
if (trade.MoneyOffered == 0 && trade.ItemsOffered.Count == 0 && trade.HorsesOffered.Count == 0)
|
if (trade.MoneyOffered == 0 && trade.ItemsOffered.Length == 0 && trade.HorsesOffered.Length == 0)
|
||||||
message += Messages.TradeOfferingNothing;
|
message += Messages.TradeOfferingNothing;
|
||||||
if (trade.MoneyOffered > 0)
|
if (trade.MoneyOffered > 0)
|
||||||
message += Messages.FormatTradeMoneyOffer(trade.MoneyOffered);
|
message += Messages.FormatTradeMoneyOffer(trade.MoneyOffered);
|
||||||
if(trade.HorsesOffered.Count > 0)
|
if(trade.HorsesOffered.Length > 0)
|
||||||
foreach(HorseInstance horse in trade.HorsesOffered)
|
foreach(HorseInstance horse in trade.HorsesOffered)
|
||||||
message += Messages.FormatTradeHorseOffer(horse.Name, horse.RandomId);
|
message += Messages.FormatTradeHorseOffer(horse.Name, horse.RandomId);
|
||||||
if(trade.ItemsOffered.Count > 0)
|
if(trade.ItemsOffered.Length > 0)
|
||||||
foreach(ItemInstance[] item in trade.ItemsOffered)
|
foreach(ItemInstance[] item in trade.ItemsOffered)
|
||||||
{
|
{
|
||||||
Item.ItemInformation itemInfo = item[0].GetItemInfo();
|
Item.ItemInformation itemInfo = item[0].GetItemInfo();
|
||||||
|
@ -623,14 +623,14 @@ namespace HISP.Game
|
||||||
message += Messages.TradeAddItems;
|
message += Messages.TradeAddItems;
|
||||||
|
|
||||||
message += Messages.FormatTradeOtherOffering(trade.OtherTrade.Trader.Username);
|
message += Messages.FormatTradeOtherOffering(trade.OtherTrade.Trader.Username);
|
||||||
if (trade.OtherTrade.MoneyOffered == 0 && trade.OtherTrade.ItemsOffered.Count == 0 && trade.OtherTrade.HorsesOffered.Count == 0)
|
if (trade.OtherTrade.MoneyOffered == 0 && trade.OtherTrade.ItemsOffered.Length == 0 && trade.OtherTrade.HorsesOffered.Length == 0)
|
||||||
message += Messages.TradeOfferingNothing;
|
message += Messages.TradeOfferingNothing;
|
||||||
if (trade.OtherTrade.MoneyOffered > 0)
|
if (trade.OtherTrade.MoneyOffered > 0)
|
||||||
message += Messages.FormatTradeMoneyOffer(trade.OtherTrade.MoneyOffered);
|
message += Messages.FormatTradeMoneyOffer(trade.OtherTrade.MoneyOffered);
|
||||||
if (trade.OtherTrade.HorsesOffered.Count > 0)
|
if (trade.OtherTrade.HorsesOffered.Length > 0)
|
||||||
foreach (HorseInstance horse in trade.OtherTrade.HorsesOffered)
|
foreach (HorseInstance horse in trade.OtherTrade.HorsesOffered)
|
||||||
message += Messages.FormatTradeHorseOffer(horse.Name, horse.RandomId);
|
message += Messages.FormatTradeHorseOffer(horse.Name, horse.RandomId);
|
||||||
if (trade.OtherTrade.ItemsOffered.Count > 0)
|
if (trade.OtherTrade.ItemsOffered.Length > 0)
|
||||||
foreach (ItemInstance[] item in trade.OtherTrade.ItemsOffered)
|
foreach (ItemInstance[] item in trade.OtherTrade.ItemsOffered)
|
||||||
{
|
{
|
||||||
Item.ItemInformation itemInfo = item[0].GetItemInfo();
|
Item.ItemInformation itemInfo = item[0].GetItemInfo();
|
||||||
|
|
|
@ -227,8 +227,18 @@ namespace HISP.Game
|
||||||
public NpcChat[] Chatpoints;
|
public NpcChat[] Chatpoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<NpcEntry> NpcList = new List<NpcEntry>();
|
private static List<NpcEntry> npcList = new List<NpcEntry>();
|
||||||
|
public static void AddNpc(NpcEntry npc)
|
||||||
|
{
|
||||||
|
npcList.Add(npc);
|
||||||
|
}
|
||||||
|
public static NpcEntry[] NpcList
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return npcList.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public static NpcReply GetNpcReply(NpcEntry npc, int id)
|
public static NpcReply GetNpcReply(NpcEntry npc, int id)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,18 @@ namespace HISP.Game
|
||||||
public bool Minigame;
|
public bool Minigame;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<QuestEntry> QuestList = new List<QuestEntry>();
|
private static List<QuestEntry> questList = new List<QuestEntry>();
|
||||||
|
public static void AddQuestEntry(QuestEntry quest)
|
||||||
|
{
|
||||||
|
questList.Add(quest);
|
||||||
|
}
|
||||||
|
private static QuestEntry[] QuestList
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return questList.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public static int GetTotalQuestPoints()
|
public static int GetTotalQuestPoints()
|
||||||
{
|
{
|
||||||
int totalQp = 0;
|
int totalQp = 0;
|
||||||
|
|
|
@ -6,14 +6,20 @@ namespace HISP.Game.Services
|
||||||
public class Groomer
|
public class Groomer
|
||||||
{
|
{
|
||||||
|
|
||||||
public static List<Groomer> Groomers = new List<Groomer>();
|
private static List<Groomer> groomers = new List<Groomer>();
|
||||||
|
public static Groomer[] Groomers
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return groomers.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public Groomer(int id, double price, int max)
|
public Groomer(int id, double price, int max)
|
||||||
{
|
{
|
||||||
Id = id;
|
Id = id;
|
||||||
PriceMultiplier = price;
|
PriceMultiplier = price;
|
||||||
Max = max;
|
Max = max;
|
||||||
Groomers.Add(this);
|
groomers.Add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Id;
|
public int Id;
|
||||||
|
|
|
@ -14,7 +14,18 @@ namespace HISP.Game.Services
|
||||||
BreedId = breedId;
|
BreedId = breedId;
|
||||||
BasePrice = basePrice;
|
BasePrice = basePrice;
|
||||||
}
|
}
|
||||||
public static List<Pawneer> PawneerPriceModels = new List<Pawneer>();
|
private static List<Pawneer> pawneerPriceModels = new List<Pawneer>();
|
||||||
|
private static Pawneer[] PawneerPriceModels
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return pawneerPriceModels.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void AddPawneerPriceModel(Pawneer pawneerPrice)
|
||||||
|
{
|
||||||
|
pawneerPriceModels.Add(pawneerPrice);
|
||||||
|
}
|
||||||
public int BreedId;
|
public int BreedId;
|
||||||
public int BasePrice;
|
public int BasePrice;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace HISP.Game.Services
|
||||||
{
|
{
|
||||||
public Workshop()
|
public Workshop()
|
||||||
{
|
{
|
||||||
CraftableItems = new List<CraftableItem>();
|
craftableItems = new List<CraftableItem>();
|
||||||
}
|
}
|
||||||
public class RequiredItem
|
public class RequiredItem
|
||||||
{
|
{
|
||||||
|
@ -21,19 +21,51 @@ namespace HISP.Game.Services
|
||||||
{
|
{
|
||||||
public CraftableItem()
|
public CraftableItem()
|
||||||
{
|
{
|
||||||
RequiredItems = new List<RequiredItem>();
|
requiredItems = new List<RequiredItem>();
|
||||||
}
|
}
|
||||||
public int Id;
|
public int Id;
|
||||||
public int GiveItemId;
|
public int GiveItemId;
|
||||||
public int MoneyCost;
|
public int MoneyCost;
|
||||||
public List<RequiredItem> RequiredItems;
|
private List<RequiredItem> requiredItems;
|
||||||
|
|
||||||
|
public void AddRequiredItem(RequiredItem item)
|
||||||
|
{
|
||||||
|
requiredItems.Add(item);
|
||||||
|
}
|
||||||
|
public RequiredItem[] RequiredItems
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return requiredItems.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public int X;
|
public int X;
|
||||||
public int Y;
|
public int Y;
|
||||||
public List<CraftableItem> CraftableItems;
|
private List<CraftableItem> craftableItems;
|
||||||
|
private static List<Workshop> workshops = new List<Workshop>();
|
||||||
public static List<Workshop> Workshops = new List<Workshop>();
|
public void AddCraftableItem(CraftableItem craftItem)
|
||||||
|
{
|
||||||
|
craftableItems.Add(craftItem);
|
||||||
|
}
|
||||||
|
public static void AddWorkshop(Workshop wkShop)
|
||||||
|
{
|
||||||
|
workshops.Add(wkShop);
|
||||||
|
}
|
||||||
|
public CraftableItem[] CraftableItems
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return craftableItems.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static Workshop[] Workshops
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return workshops.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public static Workshop GetWorkshopAt(int x, int y)
|
public static Workshop GetWorkshopAt(int x, int y)
|
||||||
{
|
{
|
||||||
foreach(Workshop wkShop in Workshops)
|
foreach(Workshop wkShop in Workshops)
|
||||||
|
|
|
@ -79,8 +79,19 @@ namespace HISP.Game.SwfModules
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<PoetryEntry> PoetList = new List<PoetryEntry>();
|
private static List<PoetryEntry> poetList = new List<PoetryEntry>();
|
||||||
private static List<PoetryPeice[]> poetryRooms = new List<PoetryPeice[]>();
|
private static List<PoetryPeice[]> poetryRooms = new List<PoetryPeice[]>();
|
||||||
|
public static void AddPoetEntry(PoetryEntry poetEntry)
|
||||||
|
{
|
||||||
|
poetList.Add(poetEntry);
|
||||||
|
}
|
||||||
|
public static PoetryEntry[] PoetList
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return poetList.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public static PoetryPeice[][] PoetryRooms
|
public static PoetryPeice[][] PoetryRooms
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -93,7 +104,7 @@ namespace HISP.Game.SwfModules
|
||||||
{
|
{
|
||||||
List<PoetryEntry> entries = new List<PoetryEntry>();
|
List<PoetryEntry> entries = new List<PoetryEntry>();
|
||||||
|
|
||||||
foreach(PoetryEntry poet in PoetList.ToArray())
|
foreach(PoetryEntry poet in PoetList)
|
||||||
{
|
{
|
||||||
if(poet.Room == roomId)
|
if(poet.Room == roomId)
|
||||||
{
|
{
|
||||||
|
@ -153,10 +164,5 @@ namespace HISP.Game.SwfModules
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +1,42 @@
|
||||||
using HISP.Server;
|
using HISP.Server;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace HISP.Game.SwfModules
|
namespace HISP.Game.SwfModules
|
||||||
{
|
{
|
||||||
public class Dressup
|
public class Dressup
|
||||||
{
|
{
|
||||||
|
|
||||||
public static List<DressupRoom> DressupRooms = new List<DressupRoom>();
|
private static List<DressupRoom> dressupRooms = new List<DressupRoom>();
|
||||||
|
public static DressupRoom[] DressupRooms
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return dressupRooms.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public class DressupRoom
|
public class DressupRoom
|
||||||
{
|
{
|
||||||
|
public int RoomId;
|
||||||
|
private List<DressupPeice> dressupPeices;
|
||||||
|
public DressupPeice[] DressupPeices
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return dressupPeices.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public DressupRoom(int roomId)
|
public DressupRoom(int roomId)
|
||||||
{
|
{
|
||||||
RoomId = roomId;
|
RoomId = roomId;
|
||||||
DressupPeices = new List<DressupPeice>();
|
dressupPeices = new List<DressupPeice>();
|
||||||
|
|
||||||
DressupPeice[] peices = Database.LoadDressupRoom(this);
|
DressupPeice[] peices = Database.LoadDressupRoom(this);
|
||||||
foreach (DressupPeice peice in peices)
|
foreach (DressupPeice peice in peices)
|
||||||
DressupPeices.Add(peice);
|
dressupPeices.Add(peice);
|
||||||
|
|
||||||
DressupRooms.Add(this);
|
dressupRooms.Add(this);
|
||||||
}
|
}
|
||||||
public int RoomId;
|
|
||||||
public List<DressupPeice> DressupPeices;
|
|
||||||
|
|
||||||
public DressupPeice GetDressupPeice(int peiceId)
|
public DressupPeice GetDressupPeice(int peiceId)
|
||||||
{
|
{
|
||||||
foreach(DressupPeice peice in DressupPeices)
|
foreach(DressupPeice peice in DressupPeices)
|
||||||
|
@ -36,7 +46,7 @@ namespace HISP.Game.SwfModules
|
||||||
}
|
}
|
||||||
// Else create peice
|
// Else create peice
|
||||||
DressupPeice dPeice = new DressupPeice(this, peiceId, 0, 0, false, true);
|
DressupPeice dPeice = new DressupPeice(this, peiceId, 0, 0, false, true);
|
||||||
DressupPeices.Add(dPeice);
|
dressupPeices.Add(dPeice);
|
||||||
return dPeice;
|
return dPeice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,17 @@ namespace HISP.Game
|
||||||
{
|
{
|
||||||
public class TwoPlayer
|
public class TwoPlayer
|
||||||
{
|
{
|
||||||
public static List<TwoPlayer> TwoPlayerGames = new List<TwoPlayer>();
|
private static List<TwoPlayer> twoPlayerGames = new List<TwoPlayer>();
|
||||||
|
public static TwoPlayer[] TwoPlayerGames
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return twoPlayerGames.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
public static void TwoPlayerRemove(User user)
|
public static void TwoPlayerRemove(User user)
|
||||||
{
|
{
|
||||||
foreach(TwoPlayer twoPlayerGame in TwoPlayerGames.ToArray())
|
foreach(TwoPlayer twoPlayerGame in TwoPlayerGames)
|
||||||
{
|
{
|
||||||
if((twoPlayerGame.Invitee.Id == user.Id))
|
if((twoPlayerGame.Invitee.Id == user.Id))
|
||||||
{
|
{
|
||||||
|
@ -21,7 +28,7 @@ namespace HISP.Game
|
||||||
}
|
}
|
||||||
public static bool IsPlayerInvitingPlayer(User sender, User checkInvites)
|
public static bool IsPlayerInvitingPlayer(User sender, User checkInvites)
|
||||||
{
|
{
|
||||||
foreach (TwoPlayer twoPlayerGame in TwoPlayerGames.ToArray())
|
foreach (TwoPlayer twoPlayerGame in TwoPlayerGames)
|
||||||
{
|
{
|
||||||
if ((twoPlayerGame.Invitee.Id == sender.Id && twoPlayerGame.Inviting.Id == checkInvites.Id) && !twoPlayerGame.Accepted)
|
if ((twoPlayerGame.Invitee.Id == sender.Id && twoPlayerGame.Inviting.Id == checkInvites.Id) && !twoPlayerGame.Accepted)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +39,7 @@ namespace HISP.Game
|
||||||
}
|
}
|
||||||
public static TwoPlayer GetGameInvitingPlayer(User sender, User checkInvites)
|
public static TwoPlayer GetGameInvitingPlayer(User sender, User checkInvites)
|
||||||
{
|
{
|
||||||
foreach (TwoPlayer twoPlayerGame in TwoPlayerGames.ToArray())
|
foreach (TwoPlayer twoPlayerGame in TwoPlayerGames)
|
||||||
{
|
{
|
||||||
if ((twoPlayerGame.Invitee.Id == sender.Id && twoPlayerGame.Inviting.Id == checkInvites.Id) && !twoPlayerGame.Accepted)
|
if ((twoPlayerGame.Invitee.Id == sender.Id && twoPlayerGame.Inviting.Id == checkInvites.Id) && !twoPlayerGame.Accepted)
|
||||||
{
|
{
|
||||||
|
@ -44,7 +51,7 @@ namespace HISP.Game
|
||||||
|
|
||||||
public static bool IsPlayerInGame(User user)
|
public static bool IsPlayerInGame(User user)
|
||||||
{
|
{
|
||||||
foreach (TwoPlayer twoPlayerGame in TwoPlayerGames.ToArray())
|
foreach (TwoPlayer twoPlayerGame in TwoPlayerGames)
|
||||||
{
|
{
|
||||||
if ((twoPlayerGame.Invitee.Id == user.Id || twoPlayerGame.Inviting.Id == user.Id) && twoPlayerGame.Accepted)
|
if ((twoPlayerGame.Invitee.Id == user.Id || twoPlayerGame.Inviting.Id == user.Id) && twoPlayerGame.Accepted)
|
||||||
{
|
{
|
||||||
|
@ -56,7 +63,7 @@ namespace HISP.Game
|
||||||
|
|
||||||
public static TwoPlayer GetTwoPlayerGameInProgress(User user)
|
public static TwoPlayer GetTwoPlayerGameInProgress(User user)
|
||||||
{
|
{
|
||||||
foreach (TwoPlayer twoPlayerGame in TwoPlayerGames.ToArray())
|
foreach (TwoPlayer twoPlayerGame in TwoPlayerGames)
|
||||||
{
|
{
|
||||||
if ((twoPlayerGame.Invitee.Id == user.Id || twoPlayerGame.Inviting.Id == user.Id) && twoPlayerGame.Accepted)
|
if ((twoPlayerGame.Invitee.Id == user.Id || twoPlayerGame.Inviting.Id == user.Id) && twoPlayerGame.Accepted)
|
||||||
{
|
{
|
||||||
|
@ -84,7 +91,7 @@ namespace HISP.Game
|
||||||
|
|
||||||
deleteTimer = new Timer(new TimerCallback(deleteTwoPlayer), null, 2 * 60 * 1000, 2 * 60 * 1000);
|
deleteTimer = new Timer(new TimerCallback(deleteTwoPlayer), null, 2 * 60 * 1000, 2 * 60 * 1000);
|
||||||
|
|
||||||
TwoPlayerGames.Add(this);
|
twoPlayerGames.Add(this);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
@ -105,7 +112,7 @@ namespace HISP.Game
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
|
||||||
TwoPlayerGames.Remove(this);
|
twoPlayerGames.Remove(this);
|
||||||
}
|
}
|
||||||
deleteTimer.Dispose();
|
deleteTimer.Dispose();
|
||||||
}
|
}
|
||||||
|
@ -219,7 +226,7 @@ namespace HISP.Game
|
||||||
else
|
else
|
||||||
updateOthers();
|
updateOthers();
|
||||||
|
|
||||||
TwoPlayerGames.Remove(this);
|
twoPlayerGames.Remove(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,25 +7,41 @@ namespace HISP.Player
|
||||||
public class Friends
|
public class Friends
|
||||||
{
|
{
|
||||||
private User baseUser;
|
private User baseUser;
|
||||||
public List<int> List;
|
private List<int> list;
|
||||||
|
public int[] List
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return list.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public int Count
|
public int Count
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return List.Count;
|
return List.Length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RemoveFromLocalList(int value)
|
||||||
|
{
|
||||||
|
list.Remove(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddToLocalList(int value)
|
||||||
|
{
|
||||||
|
list.Remove(value);
|
||||||
|
}
|
||||||
public Friends(User user)
|
public Friends(User user)
|
||||||
{
|
{
|
||||||
baseUser = user;
|
baseUser = user;
|
||||||
List = new List<int>();
|
list = new List<int>();
|
||||||
|
|
||||||
int[] friends = Database.GetBuddyList(user.Id);
|
int[] friends = Database.GetBuddyList(user.Id);
|
||||||
foreach(int friendId in friends)
|
foreach(int friendId in friends)
|
||||||
{
|
{
|
||||||
List.Add(friendId);
|
list.Add(friendId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -47,13 +63,13 @@ namespace HISP.Player
|
||||||
{
|
{
|
||||||
|
|
||||||
User removeFrom = GameServer.GetUserById(userid);
|
User removeFrom = GameServer.GetUserById(userid);
|
||||||
removeFrom.Friends.List.Remove(baseUser.Id);
|
removeFrom.Friends.RemoveFromLocalList(baseUser.Id);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (KeyNotFoundException) { /* User is offline, remove from database is sufficent */ };
|
catch (KeyNotFoundException) { /* User is offline, remove from database is sufficent */ };
|
||||||
|
|
||||||
|
|
||||||
baseUser.Friends.List.Remove(userid);
|
baseUser.Friends.RemoveFromLocalList(userid);
|
||||||
}
|
}
|
||||||
public void AddFriend(User userToFriend)
|
public void AddFriend(User userToFriend)
|
||||||
{
|
{
|
||||||
|
@ -79,8 +95,8 @@ namespace HISP.Player
|
||||||
if (userToFriend.PendingBuddyRequestTo == baseUser)
|
if (userToFriend.PendingBuddyRequestTo == baseUser)
|
||||||
{
|
{
|
||||||
Database.AddBuddy(baseUser.Id, userToFriend.Id);
|
Database.AddBuddy(baseUser.Id, userToFriend.Id);
|
||||||
List.Add(userToFriend.Id);
|
list.Add(userToFriend.Id);
|
||||||
userToFriend.Friends.List.Add(baseUser.Id);
|
userToFriend.Friends.AddToLocalList(baseUser.Id);
|
||||||
|
|
||||||
byte[] nowFriendsMsg = PacketBuilder.CreateChat(Messages.FormatAddBuddyConfirmed(userToFriend.Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
byte[] nowFriendsMsg = PacketBuilder.CreateChat(Messages.FormatAddBuddyConfirmed(userToFriend.Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||||
byte[] nowFriendsOther = PacketBuilder.CreateChat(Messages.FormatAddBuddyConfirmed(baseUser.Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
byte[] nowFriendsOther = PacketBuilder.CreateChat(Messages.FormatAddBuddyConfirmed(baseUser.Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||||
|
|
|
@ -27,9 +27,39 @@ namespace HISP.Player
|
||||||
public string Stage = "OPEN";
|
public string Stage = "OPEN";
|
||||||
|
|
||||||
public int MoneyOffered = 0;
|
public int MoneyOffered = 0;
|
||||||
public List<HorseInstance> HorsesOffered = new List<HorseInstance>();
|
private List<HorseInstance> horsesOffered = new List<HorseInstance>();
|
||||||
public List<ItemInstance[]> ItemsOffered = new List<ItemInstance[]>();
|
private List<ItemInstance[]> itemsOffered = new List<ItemInstance[]>();
|
||||||
|
public ItemInstance[][] ItemsOffered
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return itemsOffered.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public HorseInstance[] HorsesOffered
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return horsesOffered.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void RemoveOfferedHorse(HorseInstance horse)
|
||||||
|
{
|
||||||
|
horsesOffered.Remove(horse);
|
||||||
|
}
|
||||||
|
public void OfferHorse(HorseInstance horse)
|
||||||
|
{
|
||||||
|
horsesOffered.Add(horse);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OfferItems(ItemInstance[] items)
|
||||||
|
{
|
||||||
|
itemsOffered.Add(items);
|
||||||
|
}
|
||||||
|
public void RemoveOfferedItems(ItemInstance[] items)
|
||||||
|
{
|
||||||
|
itemsOffered.Remove(items);
|
||||||
|
}
|
||||||
private void endTrade()
|
private void endTrade()
|
||||||
{
|
{
|
||||||
Trader.PendingTradeTo = 0;
|
Trader.PendingTradeTo = 0;
|
||||||
|
@ -70,13 +100,13 @@ namespace HISP.Player
|
||||||
Trader.LoggedinClient.SendPacket(tradeNotAllowedWhileBidding);
|
Trader.LoggedinClient.SendPacket(tradeNotAllowedWhileBidding);
|
||||||
fail = true;
|
fail = true;
|
||||||
}
|
}
|
||||||
if (OtherTrade.Trader.HorseInventory.HorseList.Length + HorsesOffered.Count > OtherTrade.Trader.MaxHorses)
|
if (OtherTrade.Trader.HorseInventory.HorseList.Length + HorsesOffered.Length > OtherTrade.Trader.MaxHorses)
|
||||||
{
|
{
|
||||||
byte[] tradeYouHaveTooManyHorses = PacketBuilder.CreateChat(Messages.TradeYouCantHandleMoreHorses, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
byte[] tradeYouHaveTooManyHorses = PacketBuilder.CreateChat(Messages.TradeYouCantHandleMoreHorses, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||||
Trader.LoggedinClient.SendPacket(tradeYouHaveTooManyHorses);
|
Trader.LoggedinClient.SendPacket(tradeYouHaveTooManyHorses);
|
||||||
fail = true;
|
fail = true;
|
||||||
}
|
}
|
||||||
if (Trader.HorseInventory.HorseList.Length + OtherTrade.HorsesOffered.Count > Trader.MaxHorses)
|
if (Trader.HorseInventory.HorseList.Length + OtherTrade.HorsesOffered.Length > Trader.MaxHorses)
|
||||||
{
|
{
|
||||||
byte[] tradeYouHaveTooManyHorses = PacketBuilder.CreateChat(Messages.TradeYouCantHandleMoreHorses, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
byte[] tradeYouHaveTooManyHorses = PacketBuilder.CreateChat(Messages.TradeYouCantHandleMoreHorses, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||||
Trader.LoggedinClient.SendPacket(tradeYouHaveTooManyHorses);
|
Trader.LoggedinClient.SendPacket(tradeYouHaveTooManyHorses);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
98d0c4bb5e4c2b9300b97ac11b8ba65b05365645
|
80b1cdea1957c5471347f46cf8bb541e2abf1ca1
|
||||||
|
|
|
@ -4050,7 +4050,7 @@ namespace HISP.Server
|
||||||
sqlCommand.Dispose();
|
sqlCommand.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static List<ItemInstance> GetShopInventory(int shopId)
|
public static ItemInstance[] GetShopInventory(int shopId)
|
||||||
{
|
{
|
||||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||||
{
|
{
|
||||||
|
@ -4068,7 +4068,7 @@ namespace HISP.Server
|
||||||
instances.Add(new ItemInstance(reader.GetInt32(0), reader.GetInt32(1)));
|
instances.Add(new ItemInstance(reader.GetInt32(0), reader.GetInt32(1)));
|
||||||
}
|
}
|
||||||
sqlCommand.Dispose();
|
sqlCommand.Dispose();
|
||||||
return instances;
|
return instances.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4105,7 +4105,7 @@ namespace HISP.Server
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<ItemInstance> GetPlayerInventory(int playerId)
|
public static ItemInstance[] GetPlayerInventory(int playerId)
|
||||||
{
|
{
|
||||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||||
{
|
{
|
||||||
|
@ -4123,7 +4123,7 @@ namespace HISP.Server
|
||||||
instances.Add(new ItemInstance(reader.GetInt32(0), reader.GetInt32(1), reader.GetInt32(2)));
|
instances.Add(new ItemInstance(reader.GetInt32(0), reader.GetInt32(1), reader.GetInt32(2)));
|
||||||
}
|
}
|
||||||
sqlCommand.Dispose();
|
sqlCommand.Dispose();
|
||||||
return instances;
|
return instances.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static int[] GetModsAndAdmins()
|
public static int[] GetModsAndAdmins()
|
||||||
|
|
|
@ -136,7 +136,7 @@ namespace HISP.Server
|
||||||
Chat.Reason reason = new Chat.Reason();
|
Chat.Reason reason = new Chat.Reason();
|
||||||
reason.Name = gameData.messages.chat.reason_messages[i].name;
|
reason.Name = gameData.messages.chat.reason_messages[i].name;
|
||||||
reason.Message = gameData.messages.chat.reason_messages[i].message;
|
reason.Message = gameData.messages.chat.reason_messages[i].message;
|
||||||
Chat.Reasons.Add(reason);
|
Chat.AddReason(reason);
|
||||||
|
|
||||||
Logger.DebugPrint("Registered Chat Warning Reason: " + reason.Name + " (Message: " + reason.Message + ")");
|
Logger.DebugPrint("Registered Chat Warning Reason: " + reason.Name + " (Message: " + reason.Message + ")");
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ namespace HISP.Server
|
||||||
filter.FilteredWord = gameData.messages.chat.filter[i].word;
|
filter.FilteredWord = gameData.messages.chat.filter[i].word;
|
||||||
filter.MatchAll = gameData.messages.chat.filter[i].match_all;
|
filter.MatchAll = gameData.messages.chat.filter[i].match_all;
|
||||||
filter.Reason = Chat.GetReason((string)gameData.messages.chat.filter[i].reason_type);
|
filter.Reason = Chat.GetReason((string)gameData.messages.chat.filter[i].reason_type);
|
||||||
Chat.FilteredWords.Add(filter);
|
Chat.AddFilter(filter);
|
||||||
|
|
||||||
Logger.DebugPrint("Registered Filtered Word: " + filter.FilteredWord + " With reason: " + filter.Reason.Name + " (Matching all: " + filter.MatchAll + ")");
|
Logger.DebugPrint("Registered Filtered Word: " + filter.FilteredWord + " With reason: " + filter.Reason.Name + " (Matching all: " + filter.MatchAll + ")");
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ namespace HISP.Server
|
||||||
Chat.Correction correction = new Chat.Correction();
|
Chat.Correction correction = new Chat.Correction();
|
||||||
correction.FilteredWord = gameData.messages.chat.correct[i].word;
|
correction.FilteredWord = gameData.messages.chat.correct[i].word;
|
||||||
correction.ReplacedWord = gameData.messages.chat.correct[i].new_word;
|
correction.ReplacedWord = gameData.messages.chat.correct[i].new_word;
|
||||||
Chat.CorrectedWords.Add(correction);
|
Chat.AddCorrection(correction);
|
||||||
|
|
||||||
Logger.DebugPrint("Registered Word Correction: " + correction.FilteredWord + " to " + correction.ReplacedWord);
|
Logger.DebugPrint("Registered Word Correction: " + correction.FilteredWord + " to " + correction.ReplacedWord);
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ namespace HISP.Server
|
||||||
item.SpawnParamaters.SpawnNearSpecialTile = gameData.item.item_list[i].spawn_parameters.spawn_near_special_tile;
|
item.SpawnParamaters.SpawnNearSpecialTile = gameData.item.item_list[i].spawn_parameters.spawn_near_special_tile;
|
||||||
|
|
||||||
Logger.DebugPrint("Registered Item ID: " + item.Id + " Name: " + item.Name + " spawns on: " + item.SpawnParamaters.SpawnOnTileType);
|
Logger.DebugPrint("Registered Item ID: " + item.Id + " Name: " + item.Name + " spawns on: " + item.SpawnParamaters.SpawnOnTileType);
|
||||||
Item.Items.Add(item);
|
Item.AddItemInfo(item);
|
||||||
}
|
}
|
||||||
// Register Throwables
|
// Register Throwables
|
||||||
int totalThrowable = gameData.item.throwable.Count;
|
int totalThrowable = gameData.item.throwable.Count;
|
||||||
|
@ -241,7 +241,7 @@ namespace HISP.Server
|
||||||
throwableItem.HitMessage = gameData.item.throwable[i].message_hit;
|
throwableItem.HitMessage = gameData.item.throwable[i].message_hit;
|
||||||
throwableItem.ThrowMessage = gameData.item.throwable[i].message_throw;
|
throwableItem.ThrowMessage = gameData.item.throwable[i].message_throw;
|
||||||
throwableItem.HitYourselfMessage = gameData.item.throwable[i].message_hit_yourself;
|
throwableItem.HitYourselfMessage = gameData.item.throwable[i].message_hit_yourself;
|
||||||
Item.ThrowableItems.Add(throwableItem);
|
Item.AddThrowableItem(throwableItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register NPCs
|
// Register NPCs
|
||||||
|
@ -317,7 +317,7 @@ namespace HISP.Server
|
||||||
chats.Add(npcChat);
|
chats.Add(npcChat);
|
||||||
}
|
}
|
||||||
npcEntry.Chatpoints = chats.ToArray();
|
npcEntry.Chatpoints = chats.ToArray();
|
||||||
Npc.NpcList.Add(npcEntry);
|
Npc.AddNpc(npcEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register Quests
|
// Register Quests
|
||||||
|
@ -392,7 +392,7 @@ namespace HISP.Server
|
||||||
quest.ChainedQuestId = gameData.quest_list[i].chained_questid;
|
quest.ChainedQuestId = gameData.quest_list[i].chained_questid;
|
||||||
quest.Minigame = gameData.quest_list[i].minigame;
|
quest.Minigame = gameData.quest_list[i].minigame;
|
||||||
Logger.DebugPrint("Registered Quest: " + quest.Id + " - " + quest.Title);
|
Logger.DebugPrint("Registered Quest: " + quest.Id + " - " + quest.Title);
|
||||||
Quest.QuestList.Add(quest);
|
Quest.AddQuestEntry(quest);
|
||||||
}
|
}
|
||||||
|
|
||||||
int totalShops = gameData.shop_list.Count;
|
int totalShops = gameData.shop_list.Count;
|
||||||
|
@ -479,7 +479,7 @@ namespace HISP.Server
|
||||||
entry.Id = gameData.poetry[i].id;
|
entry.Id = gameData.poetry[i].id;
|
||||||
entry.Word = gameData.poetry[i].word;
|
entry.Word = gameData.poetry[i].word;
|
||||||
entry.Room = gameData.poetry[i].room_id;
|
entry.Room = gameData.poetry[i].room_id;
|
||||||
Brickpoet.PoetList.Add(entry);
|
Brickpoet.AddPoetEntry(entry);
|
||||||
|
|
||||||
Logger.DebugPrint("Registered poet: " + entry.Id.ToString() + " word: " + entry.Word + " in room " + entry.Room.ToString());
|
Logger.DebugPrint("Registered poet: " + entry.Id.ToString() + " word: " + entry.Word + " in room " + entry.Room.ToString());
|
||||||
}
|
}
|
||||||
|
@ -512,7 +512,7 @@ namespace HISP.Server
|
||||||
horseBreed.Swf = gameData.horses.breeds[i].swf;
|
horseBreed.Swf = gameData.horses.breeds[i].swf;
|
||||||
horseBreed.Type = gameData.horses.breeds[i].type;
|
horseBreed.Type = gameData.horses.breeds[i].type;
|
||||||
|
|
||||||
HorseInfo.Breeds.Add(horseBreed);
|
HorseInfo.AddBreed(horseBreed);
|
||||||
Logger.DebugPrint("Registered Horse Breed: #" + horseBreed.Id + ": " + horseBreed.Name);
|
Logger.DebugPrint("Registered Horse Breed: #" + horseBreed.Id + ": " + horseBreed.Name);
|
||||||
}
|
}
|
||||||
// Register Breed Prices @ Pawneer Order
|
// Register Breed Prices @ Pawneer Order
|
||||||
|
@ -522,7 +522,7 @@ namespace HISP.Server
|
||||||
int id = gameData.horses.pawneer_base_price[i].breed_id;
|
int id = gameData.horses.pawneer_base_price[i].breed_id;
|
||||||
int price = gameData.horses.pawneer_base_price[i].price;
|
int price = gameData.horses.pawneer_base_price[i].price;
|
||||||
Pawneer pawneerPricing = new Pawneer(id, price);
|
Pawneer pawneerPricing = new Pawneer(id, price);
|
||||||
Pawneer.PawneerPriceModels.Add(pawneerPricing);
|
Pawneer.AddPawneerPriceModel(pawneerPricing);
|
||||||
Logger.DebugPrint("Registered Pawneer Base Price " + pawneerPricing.BreedId + " for $" + pawneerPricing.BasePrice.ToString("N0", CultureInfo.InvariantCulture));
|
Logger.DebugPrint("Registered Pawneer Base Price " + pawneerPricing.BreedId + " for $" + pawneerPricing.BasePrice.ToString("N0", CultureInfo.InvariantCulture));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -533,7 +533,7 @@ namespace HISP.Server
|
||||||
category.Name = gameData.horses.categorys[i].name;
|
category.Name = gameData.horses.categorys[i].name;
|
||||||
category.MetaOthers = gameData.horses.categorys[i].message_others;
|
category.MetaOthers = gameData.horses.categorys[i].message_others;
|
||||||
category.Meta = gameData.horses.categorys[i].message;
|
category.Meta = gameData.horses.categorys[i].message;
|
||||||
HorseInfo.HorseCategories.Add(category);
|
HorseInfo.AddHorseCategory(category);
|
||||||
Logger.DebugPrint("Registered horse category type: " + category.Name);
|
Logger.DebugPrint("Registered horse category type: " + category.Name);
|
||||||
}
|
}
|
||||||
int totalTrackedItems = gameData.messages.meta.misc_stats.tracked_items.Count;
|
int totalTrackedItems = gameData.messages.meta.misc_stats.tracked_items.Count;
|
||||||
|
@ -626,12 +626,12 @@ namespace HISP.Server
|
||||||
Workshop.RequiredItem requiredItem = new Workshop.RequiredItem();
|
Workshop.RequiredItem requiredItem = new Workshop.RequiredItem();
|
||||||
requiredItem.RequiredItemId = gameData.workshop[i].craftable_items[ii].required_items[iii].req_item;
|
requiredItem.RequiredItemId = gameData.workshop[i].craftable_items[ii].required_items[iii].req_item;
|
||||||
requiredItem.RequiredItemCount = gameData.workshop[i].craftable_items[ii].required_items[iii].req_quantity;
|
requiredItem.RequiredItemCount = gameData.workshop[i].craftable_items[ii].required_items[iii].req_quantity;
|
||||||
craftableItem.RequiredItems.Add(requiredItem);
|
craftableItem.AddRequiredItem(requiredItem);
|
||||||
}
|
}
|
||||||
wkShop.CraftableItems.Add(craftableItem);
|
wkShop.AddCraftableItem(craftableItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
Workshop.Workshops.Add(wkShop);
|
Workshop.AddWorkshop(wkShop);
|
||||||
Logger.DebugPrint("Registered Workshop at X: " + wkShop.X + " Y: " + wkShop.Y);
|
Logger.DebugPrint("Registered Workshop at X: " + wkShop.X + " Y: " + wkShop.Y);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -793,7 +793,7 @@ namespace HISP.Server
|
||||||
leaser.Inteligence = gameData.leaser[i].horse.advanced_stats.inteligence;
|
leaser.Inteligence = gameData.leaser[i].horse.advanced_stats.inteligence;
|
||||||
leaser.Personality = gameData.leaser[i].horse.advanced_stats.personality;
|
leaser.Personality = gameData.leaser[i].horse.advanced_stats.personality;
|
||||||
|
|
||||||
Leaser.HorseLeasers.Add(leaser);
|
Leaser.AddHorseLeaser(leaser);
|
||||||
Logger.DebugPrint("Registered Leaser: " + leaser.LeaseId.ToString() + " For a " + leaser.HorseName);
|
Logger.DebugPrint("Registered Leaser: " + leaser.LeaseId.ToString() + " For a " + leaser.HorseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -484,7 +484,7 @@ namespace HISP.Server
|
||||||
|
|
||||||
HorseInstance horse = sender.LoggedinUser.HorseInventory.GetHorseById(horseRandomId);
|
HorseInstance horse = sender.LoggedinUser.HorseInventory.GetHorseById(horseRandomId);
|
||||||
if(!sender.LoggedinUser.TradingWith.HorsesOffered.Contains(horse))
|
if(!sender.LoggedinUser.TradingWith.HorsesOffered.Contains(horse))
|
||||||
sender.LoggedinUser.TradingWith.HorsesOffered.Add(horse);
|
sender.LoggedinUser.TradingWith.OfferHorse(horse);
|
||||||
|
|
||||||
UpdateArea(sender);
|
UpdateArea(sender);
|
||||||
|
|
||||||
|
@ -2380,7 +2380,7 @@ namespace HISP.Server
|
||||||
{
|
{
|
||||||
if(existingItems[0].ItemId == sender.LoggedinUser.AttemptingToOfferItem)
|
if(existingItems[0].ItemId == sender.LoggedinUser.AttemptingToOfferItem)
|
||||||
{
|
{
|
||||||
sender.LoggedinUser.TradingWith.ItemsOffered.Remove(existingItems);
|
sender.LoggedinUser.TradingWith.RemoveOfferedItems(existingItems);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2392,7 +2392,7 @@ namespace HISP.Server
|
||||||
{
|
{
|
||||||
items[i] = item.ItemInstances[i];
|
items[i] = item.ItemInstances[i];
|
||||||
}
|
}
|
||||||
sender.LoggedinUser.TradingWith.ItemsOffered.Add(items);
|
sender.LoggedinUser.TradingWith.OfferItems(items);
|
||||||
|
|
||||||
UpdateArea(sender);
|
UpdateArea(sender);
|
||||||
if (sender.LoggedinUser.TradingWith != null)
|
if (sender.LoggedinUser.TradingWith != null)
|
||||||
|
@ -4086,7 +4086,7 @@ namespace HISP.Server
|
||||||
int roomId = packet[3] - 40;
|
int roomId = packet[3] - 40;
|
||||||
Dressup.DressupRoom room = Dressup.GetDressupRoom(roomId);
|
Dressup.DressupRoom room = Dressup.GetDressupRoom(roomId);
|
||||||
|
|
||||||
if (room.DressupPeices.Count > 0)
|
if (room.DressupPeices.Length > 0)
|
||||||
{
|
{
|
||||||
byte[] allDressupsResponse = PacketBuilder.CreateDressupRoomPeiceResponse(room.DressupPeices.ToArray());
|
byte[] allDressupsResponse = PacketBuilder.CreateDressupRoomPeiceResponse(room.DressupPeices.ToArray());
|
||||||
sender.SendPacket(allDressupsResponse);
|
sender.SendPacket(allDressupsResponse);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue