mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-06 05:05:40 +12:00
Add items?
This commit is contained in:
parent
f72cd3e9cb
commit
39e0dbf612
17 changed files with 33603 additions and 32 deletions
File diff suppressed because it is too large
Load diff
|
@ -200,9 +200,9 @@ namespace Horse_Isle_Server
|
|||
{
|
||||
ClientSocket.Send(PacketData);
|
||||
}
|
||||
catch (SocketException e)
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.ErrorPrint("Socket exception occured: " + e.Message);
|
||||
Logger.ErrorPrint("Exception occured: " + e.Message);
|
||||
Disconnect();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Horse_Isle_Server
|
||||
{
|
||||
|
@ -35,7 +34,7 @@ namespace Horse_Isle_Server
|
|||
|
||||
Logger.DebugPrint("Registered Town: " + town.Name + " X " + town.StartX + "-" + town.EndX + " Y " + town.StartY + "-" + town.EndY);
|
||||
World.Towns.Add(town);
|
||||
}
|
||||
}
|
||||
|
||||
// Register Areas
|
||||
int totalAreas = gameData.places.towns.Count;
|
||||
|
@ -159,6 +158,43 @@ namespace Horse_Isle_Server
|
|||
}
|
||||
|
||||
|
||||
int totalItems = gameData.item.item_list.Count;
|
||||
for (int i = 0; i < totalItems; i++)
|
||||
{
|
||||
Item.ItemInformation item = new Item.ItemInformation();
|
||||
item.Id = gameData.item.item_list[i].id;
|
||||
item.Name = gameData.item.item_list[i].name;
|
||||
item.PluralName = gameData.item.item_list[i].plural_name;
|
||||
item.Description = gameData.item.item_list[i].description;
|
||||
item.IconId = gameData.item.item_list[i].icon_id;
|
||||
item.SortBy = gameData.item.item_list[i].sort_by;
|
||||
item.SellPrice = gameData.item.item_list[i].sell_price;
|
||||
item.EmbedSwf = gameData.item.item_list[i].embed_swf;
|
||||
item.WishingWell = gameData.item.item_list[i].wishing_well;
|
||||
item.Type = gameData.item.item_list[i].type;
|
||||
item.MiscFlags = gameData.item.item_list[i].misc_flags.ToObject<int[]>();
|
||||
int effectsCount = gameData.item.item_list[i].effects.Count;
|
||||
|
||||
Item.Effects[] effectsList = new Item.Effects[effectsCount];
|
||||
for(int ii = 0; ii < effectsCount; ii++)
|
||||
{
|
||||
effectsList[ii] = new Item.Effects();
|
||||
effectsList[ii].EffectsWhat = gameData.item.item_list[i].effects[ii].effect_what;
|
||||
effectsList[ii].EffectsWhat = gameData.item.item_list[i].effects[ii].effect_amount;
|
||||
}
|
||||
|
||||
item.Effects = effectsList;
|
||||
item.SpawnParamaters = new Item.SpawnRules();
|
||||
item.SpawnParamaters.SpawnCap = gameData.item.item_list[i].spawn_parameters.spawn_cap;
|
||||
item.SpawnParamaters.SpawnInArea = gameData.item.item_list[i].spawn_in_area;
|
||||
item.SpawnParamaters.SpawnOnTileType = gameData.item.item_list[i].spawn_on_tile_type;
|
||||
item.SpawnParamaters.SpawnOnSpecialTile = gameData.item.item_list[i].spawn_on_special_tile;
|
||||
item.SpawnParamaters.SpawnNearSpecialTile = gameData.item.item_list[i].spawn_near_special_tile;
|
||||
|
||||
Logger.DebugPrint("Registered Item ID: " + item.Id + " Name: " + item.Name);
|
||||
Item.Items.Add(item);
|
||||
}
|
||||
|
||||
|
||||
// New Users
|
||||
Messages.NewUserMessage = gameData.new_user.starting_message;
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.3.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
|
@ -84,7 +85,7 @@
|
|||
<Compile Include="Mailbox.cs" />
|
||||
<Compile Include="Map.cs" />
|
||||
<Compile Include="Messages.cs" />
|
||||
<Compile Include="ItemObject.cs" />
|
||||
<Compile Include="Item.cs" />
|
||||
<Compile Include="Meta.cs" />
|
||||
<Compile Include="PacketBuilder.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
|
|
48
Horse Isle Server/Horse Isle Server/Item.cs
Normal file
48
Horse Isle Server/Horse Isle Server/Item.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Horse_Isle_Server
|
||||
{
|
||||
class Item
|
||||
{
|
||||
public struct Effects
|
||||
{
|
||||
public string EffectsWhat;
|
||||
public int EffectAmount;
|
||||
}
|
||||
|
||||
public struct SpawnRules
|
||||
{
|
||||
public int SpawnCap;
|
||||
public string SpawnInArea;
|
||||
public string SpawnOnTileType;
|
||||
public string SpawnOnSpecialTile;
|
||||
public string SpawnNearSpecialTile;
|
||||
}
|
||||
public struct ItemInformation
|
||||
{
|
||||
public int Id;
|
||||
public string Name;
|
||||
public string PluralName;
|
||||
public string Description;
|
||||
|
||||
public int IconId;
|
||||
public int SortBy;
|
||||
public int SellPrice;
|
||||
|
||||
public string EmbedSwf;
|
||||
public bool WishingWell;
|
||||
public string Type;
|
||||
public int[] MiscFlags;
|
||||
public Effects[] Effects;
|
||||
|
||||
public SpawnRules SpawnParamaters;
|
||||
|
||||
}
|
||||
|
||||
public static List<ItemInformation> Items = new List<ItemInformation>();
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Horse_Isle_Server
|
||||
{
|
||||
class ItemObject
|
||||
{
|
||||
public int IconId;
|
||||
public int Price;
|
||||
public string ItemName;
|
||||
public string ItemDescription;
|
||||
public string ItemCategory;
|
||||
}
|
||||
}
|
|
@ -82,17 +82,17 @@ namespace Horse_Isle_Server
|
|||
// Meta
|
||||
public static string FormatTransportMessage(string method, string place, int cost, int id, int x, int y)
|
||||
{
|
||||
byte[] xy = new byte[4];
|
||||
xy[0] = (byte)(((x - 4) / 64) + 20);
|
||||
xy[1] = (byte)(((x - 4) % 64) + 20);
|
||||
string xy = "";
|
||||
xy += (char)(((x - 4) / 64) + 20);
|
||||
xy += (char)(((x - 4) % 64) + 20);
|
||||
|
||||
xy[2] = (byte)(((y - 1) / 64) + 20);
|
||||
xy[3] = (byte)(((y - 1) % 64) + 20);
|
||||
xy += (char)(((y - 1) / 64) + 20);
|
||||
xy += (char)(((y - 1) % 64) + 20);
|
||||
|
||||
int iconId = 253;
|
||||
if(method == "WAGON")
|
||||
iconId = 254;
|
||||
return TransportFormat.Replace("%METHOD%", method).Replace("%PLACE%", place).Replace("%COST%", cost.ToString()).Replace("%ID%", id.ToString()).Replace("%ICON%",iconId.ToString()).Replace(" % XY%",Encoding.UTF8.GetString(xy));
|
||||
return TransportFormat.Replace("%METHOD%", method).Replace("%PLACE%", place).Replace("%COST%", cost.ToString()).Replace("%ID%", id.ToString()).Replace("%ICON%",iconId.ToString()).Replace("%XY%", xy);
|
||||
}
|
||||
// For all
|
||||
public static string FormatGlobalChatMessage(string username, string message)
|
||||
|
|
|
@ -488,6 +488,8 @@ namespace Horse_Isle_Server
|
|||
|
||||
public static void OnDisconnect(Client sender)
|
||||
{
|
||||
connectedClients.Remove(sender);
|
||||
|
||||
if (sender.LoggedIn)
|
||||
{
|
||||
// Send disconnect message
|
||||
|
@ -505,7 +507,6 @@ namespace Horse_Isle_Server
|
|||
client.SendPacket(playerRemovePacket);
|
||||
}
|
||||
|
||||
connectedClients.Remove(sender);
|
||||
}
|
||||
|
||||
|
||||
|
|
BIN
WebInterface/game-site/mod/basketshoot.swf
Normal file
BIN
WebInterface/game-site/mod/basketshoot.swf
Normal file
Binary file not shown.
BIN
WebInterface/game-site/mod/checkers.swf
Normal file
BIN
WebInterface/game-site/mod/checkers.swf
Normal file
Binary file not shown.
BIN
WebInterface/game-site/mod/chess.swf
Normal file
BIN
WebInterface/game-site/mod/chess.swf
Normal file
Binary file not shown.
BIN
WebInterface/game-site/mod/marbles.swf
Normal file
BIN
WebInterface/game-site/mod/marbles.swf
Normal file
Binary file not shown.
BIN
WebInterface/game-site/mod/orbital.swf
Normal file
BIN
WebInterface/game-site/mod/orbital.swf
Normal file
Binary file not shown.
BIN
WebInterface/game-site/mod/snowballslingshot.swf
Normal file
BIN
WebInterface/game-site/mod/snowballslingshot.swf
Normal file
Binary file not shown.
BIN
WebInterface/game-site/mod/teamcave.swf
Normal file
BIN
WebInterface/game-site/mod/teamcave.swf
Normal file
Binary file not shown.
BIN
WebInterface/game-site/mod/teamjunglecave.swf
Normal file
BIN
WebInterface/game-site/mod/teamjunglecave.swf
Normal file
Binary file not shown.
BIN
WebInterface/game-site/mod/treasurehunter.swf
Normal file
BIN
WebInterface/game-site/mod/treasurehunter.swf
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue