mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-21 20:25:51 +12:00
Add BBCODE to Horse Descriptions, Player Descriptions and Ranch Descriptions.
This commit is contained in:
parent
bdebe4d84a
commit
72bc81d900
14 changed files with 142 additions and 40 deletions
|
@ -9,11 +9,6 @@ namespace HISP.Server
|
|||
private static int getHexVal(char hex)
|
||||
{
|
||||
int val = (int)hex;
|
||||
//For uppercase A-F letters:
|
||||
//return val - (val < 58 ? 48 : 55);
|
||||
//For lowercase a-f letters:
|
||||
//return val - (val < 58 ? 48 : 87);
|
||||
//Or the two combined, but a bit slower:
|
||||
return val - (val < 58 ? 48 : (val < 97 ? 55 : 87));
|
||||
}
|
||||
public static byte[] StringToByteArray(string hex)
|
||||
|
@ -31,6 +26,8 @@ namespace HISP.Server
|
|||
return arr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static Double PointsToDistance(int x1, int y1, int x2, int y2)
|
||||
{
|
||||
return Math.Sqrt(Math.Pow((x2 - x1), 2) + Math.Pow((y2 - y1), 2));
|
||||
|
|
|
@ -3753,7 +3753,7 @@ namespace HISP.Server
|
|||
|
||||
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE DroppedItems SET DespawnTimer=DespawnTimer-1";
|
||||
sqlCommand.CommandText = "UPDATE DroppedItems SET DespawnTimer=DespawnTimer-5";
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ using HISP.Game.SwfModules;
|
|||
using HISP.Game.Horse;
|
||||
using HISP.Game.Items;
|
||||
using System.Globalization;
|
||||
using HISP.Security;
|
||||
|
||||
namespace HISP.Server
|
||||
{
|
||||
|
@ -687,6 +688,16 @@ namespace HISP.Server
|
|||
|
||||
}
|
||||
|
||||
// Register BBCODE
|
||||
int totalBBocdes = gameData.bbcode.Count;
|
||||
for(int i = 0; i < totalBBocdes; i++)
|
||||
{
|
||||
string tag = gameData.bbcode[i].tag;
|
||||
string meta = gameData.bbcode[i].meta;
|
||||
BBCode code = new BBCode(tag, meta);
|
||||
Logger.DebugPrint("Registered BBCODE: " + code.Tag + " to " + code.MetaTranslation);
|
||||
}
|
||||
|
||||
HorseInfo.HorseNames = gameData.horses.names.ToObject<string[]>();
|
||||
|
||||
Item.Present = gameData.item.special.present;
|
||||
|
@ -769,7 +780,8 @@ namespace HISP.Server
|
|||
|
||||
Messages.RanchTrainAllAttempt = gameData.messages.meta.ranch.special.train_all;
|
||||
Messages.RanchTrainSuccessFormat = gameData.messages.meta.ranch.special.train_success;
|
||||
Messages.RanchTrainCantTrain = gameData.messages.meta.ranch.special.train_cant_train;
|
||||
Messages.RanchTrainCantTrainFormat = gameData.messages.meta.ranch.special.train_cant_train;
|
||||
Messages.RanchTrainBadMoodFormat = gameData.messages.meta.ranch.special.train_bad_mood;
|
||||
Messages.RanchHorsesFullyRested = gameData.messages.meta.ranch.special.fully_rested;
|
||||
Messages.RanchWagonDroppedYouOff = gameData.messages.meta.ranch.special.wagon_used;
|
||||
|
||||
|
|
|
@ -89,7 +89,14 @@ namespace HISP.Server
|
|||
|
||||
Treasure.AddValue();
|
||||
Database.IncPlayerTirednessForOfflineUsers();
|
||||
DroppedItems.Update();
|
||||
|
||||
|
||||
if (totalMinutesElapsed % 5 == 0)
|
||||
{
|
||||
DroppedItems.DespawnItems();
|
||||
DroppedItems.GenerateItems(false);
|
||||
}
|
||||
|
||||
WildHorse.Update();
|
||||
Npc.WanderNpcs();
|
||||
minuteTimer.Change(oneMinute, oneMinute);
|
||||
|
@ -2581,8 +2588,6 @@ namespace HISP.Server
|
|||
|
||||
string profilePage = packetStr.Split('|')[1];
|
||||
profilePage = profilePage.Substring(0, profilePage.Length - 2);
|
||||
profilePage = profilePage.Replace("[", "<");
|
||||
profilePage = profilePage.Replace("]", ">");
|
||||
sender.LoggedinUser.CharacterId = characterId;
|
||||
sender.LoggedinUser.ProfilePage = profilePage;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue