mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-06 21:25:42 +12:00
update
This commit is contained in:
parent
d0b206f388
commit
30c0be0020
7 changed files with 129 additions and 17 deletions
|
@ -12,7 +12,10 @@
|
||||||
"location_format":" <I>You are%META% </I>",
|
"location_format":" <I>You are%META% </I>",
|
||||||
"tile_format":"<B>%TILENAME%</B>",
|
"tile_format":"<B>%TILENAME%</B>",
|
||||||
"nothing_message":"^LYou see nothing on the ground of interest.^R1",
|
"nothing_message":"^LYou see nothing on the ground of interest.^R1",
|
||||||
"seperator":"<BR>"
|
"seperator":"<BR>",
|
||||||
|
"areas":{
|
||||||
|
"bridge_text":"A bridge crosses over the water to another isle. That'll save you some travel costs!"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"chat":{
|
"chat":{
|
||||||
"for_others":{
|
"for_others":{
|
||||||
|
@ -43,9 +46,42 @@
|
||||||
0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
1,1,1,1,1,1],
|
1,1,1,1,1,1]
|
||||||
},
|
},
|
||||||
"overlay_tiles":{
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1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
|
||||||
|
],
|
||||||
|
|
||||||
"tile_depth":[3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,0,0,0,1,1,3,3,3,1,1,1,1,3,3,3,
|
"tile_depth":[3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,0,0,0,1,1,3,3,3,1,1,1,1,3,3,3,
|
||||||
3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,3,1,1,1,1,3,2,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
|
3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,3,1,1,1,1,3,2,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
|
||||||
3,2,2,2,2,1,1,1,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,3,2,2,2,2,2,
|
3,2,2,2,2,1,1,1,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,3,2,2,2,2,2,
|
||||||
|
|
37
Horse Isle Server/Horse Isle Server/Chat.cs
Normal file
37
Horse Isle Server/Horse Isle Server/Chat.cs
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Horse_Isle_Server
|
||||||
|
{
|
||||||
|
class Chat
|
||||||
|
{
|
||||||
|
public static bool isCommand(User user, string message)
|
||||||
|
{
|
||||||
|
if (message.Length < 1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (user.Administrator || user.Moderator)
|
||||||
|
if (message[0] == '%')
|
||||||
|
return true;
|
||||||
|
if (message[0] == '!')
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
public static bool isAppropriate(string message)
|
||||||
|
{
|
||||||
|
if (!ConfigReader.BadWords)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return true; // Fuck Censorship
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void HandleMessage(User user, byte channel, string message)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,13 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Horse_Isle_Server
|
namespace Horse_Isle_Server
|
||||||
{
|
{
|
||||||
class Client
|
class Client
|
||||||
|
@ -21,6 +16,7 @@ namespace Horse_Isle_Server
|
||||||
private Thread recvPackets;
|
private Thread recvPackets;
|
||||||
private Timer updateTimer;
|
private Timer updateTimer;
|
||||||
|
|
||||||
|
private int updateInterval = 60 * 1000;
|
||||||
private void updateTimerTick(object state)
|
private void updateTimerTick(object state)
|
||||||
{
|
{
|
||||||
Logger.DebugPrint("Sending update packet to "+ LoggedinUser.Username);
|
Logger.DebugPrint("Sending update packet to "+ LoggedinUser.Username);
|
||||||
|
@ -32,7 +28,8 @@ namespace Horse_Isle_Server
|
||||||
LoggedinUser = new User(id);
|
LoggedinUser = new User(id);
|
||||||
LoggedIn = true;
|
LoggedIn = true;
|
||||||
|
|
||||||
|
|
||||||
|
updateTimer = new Timer(new TimerCallback(updateTimerTick), null, updateInterval, updateInterval);
|
||||||
}
|
}
|
||||||
private void receivePackets()
|
private void receivePackets()
|
||||||
{
|
{
|
||||||
|
@ -82,8 +79,11 @@ namespace Horse_Isle_Server
|
||||||
{
|
{
|
||||||
Logger.ErrorPrint("Received an invalid packet (size: "+Packet.Length+")");
|
Logger.ErrorPrint("Received an invalid packet (size: "+Packet.Length+")");
|
||||||
}
|
}
|
||||||
|
|
||||||
byte identifier = Packet[0];
|
byte identifier = Packet[0];
|
||||||
|
|
||||||
|
if (updateTimer != null)
|
||||||
|
updateTimer.Change(updateInterval, updateInterval);
|
||||||
|
|
||||||
if (!LoggedIn) // Must be either login or policy-file-request
|
if (!LoggedIn) // Must be either login or policy-file-request
|
||||||
{
|
{
|
||||||
if (Encoding.UTF8.GetString(Packet).StartsWith("<policy-file-request/>")) // Policy File Request
|
if (Encoding.UTF8.GetString(Packet).StartsWith("<policy-file-request/>")) // Policy File Request
|
||||||
|
@ -151,7 +151,6 @@ namespace Horse_Isle_Server
|
||||||
RemoteIp = clientSocket.RemoteEndPoint.ToString();
|
RemoteIp = clientSocket.RemoteEndPoint.ToString();
|
||||||
|
|
||||||
Logger.DebugPrint("Client connected @ " + RemoteIp);
|
Logger.DebugPrint("Client connected @ " + RemoteIp);
|
||||||
updateTimer = new Timer(new TimerCallback(updateTimerTick), null, 60 * 1000, 60 * 1000);
|
|
||||||
|
|
||||||
recvPackets = new Thread(() =>
|
recvPackets = new Thread(() =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,6 +22,9 @@ namespace Horse_Isle_Server
|
||||||
public static string CrossDomainPolicyFile;
|
public static string CrossDomainPolicyFile;
|
||||||
public static bool Debug;
|
public static bool Debug;
|
||||||
|
|
||||||
|
public static bool BadWords;
|
||||||
|
public static bool ExpandSlang;
|
||||||
|
|
||||||
private static string ConfigurationFileName = "server.properties";
|
private static string ConfigurationFileName = "server.properties";
|
||||||
public static void OpenConfig()
|
public static void OpenConfig()
|
||||||
{
|
{
|
||||||
|
@ -87,6 +90,12 @@ namespace Horse_Isle_Server
|
||||||
case "crossdomain":
|
case "crossdomain":
|
||||||
CrossDomainPolicyFile = data;
|
CrossDomainPolicyFile = data;
|
||||||
break;
|
break;
|
||||||
|
case "filter_bad_words":
|
||||||
|
BadWords = data == "true";
|
||||||
|
break;
|
||||||
|
case "correct_slang":
|
||||||
|
ExpandSlang = data == "true";
|
||||||
|
break;
|
||||||
case "debug":
|
case "debug":
|
||||||
Debug = data == "true";
|
Debug = data == "true";
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -89,10 +89,9 @@ namespace Horse_Isle_Server
|
||||||
Messages.TileFormat = gameData.messages.meta.tile_format;
|
Messages.TileFormat = gameData.messages.meta.tile_format;
|
||||||
Messages.NothingMessage = gameData.messages.meta.nothing_message;
|
Messages.NothingMessage = gameData.messages.meta.nothing_message;
|
||||||
|
|
||||||
JArray overlayTileDepth = gameData.tile_paramaters.overlay_tiles.tile_depth;
|
Map.OverlayTileDepth = gameData.tile_paramaters.overlay_tiles.tile_depth.ToObject<int[]>();
|
||||||
JArray terrainTilePassibility = gameData.tile_paramaters.terrain_tiles.passibility;
|
Map.OverlayTilesetPassibility = gameData.tile_paramaters.overlay_tiles.passibility.ToObject<bool[][]>();
|
||||||
Map.OverlayTileDepth = overlayTileDepth.ToObject<int[]>();
|
Map.TerrainTilePassibility = gameData.tile_paramaters.terrain_tiles.passibility.ToObject<bool[]>();
|
||||||
Map.TerrainTilePassibility = terrainTilePassibility.ToObject<bool[]>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,9 @@ namespace Horse_Isle_Server
|
||||||
class Map
|
class Map
|
||||||
{
|
{
|
||||||
public static int[] OverlayTileDepth;
|
public static int[] OverlayTileDepth;
|
||||||
|
|
||||||
public static bool[] TerrainTilePassibility;
|
public static bool[] TerrainTilePassibility;
|
||||||
|
public static bool[][] OverlayTilesetPassibility;
|
||||||
|
|
||||||
public static Bitmap MapData;
|
public static Bitmap MapData;
|
||||||
|
|
||||||
|
@ -31,9 +33,29 @@ namespace Horse_Isle_Server
|
||||||
public static bool CheckPassable(int x, int y)
|
public static bool CheckPassable(int x, int y)
|
||||||
{
|
{
|
||||||
int tileId = GetTileId(x, y, false);
|
int tileId = GetTileId(x, y, false);
|
||||||
bool passable = TerrainTilePassibility[tileId-1];
|
int otileId = GetTileId(x, y, true);
|
||||||
Logger.DebugPrint("Checking tile passibility for tileid: " + tileId + " at " + x + "," + y+" passable: " +passable);
|
|
||||||
return passable;
|
bool terrainPassable = TerrainTilePassibility[tileId - 1];
|
||||||
|
int tileset = 0;
|
||||||
|
|
||||||
|
if (otileId > 190)
|
||||||
|
{
|
||||||
|
otileId -= 192;
|
||||||
|
if (World.InIsle(x, y))
|
||||||
|
tileset = World.GetIsle(x, y).Tileset+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool overlayPassable = OverlayTilesetPassibility[tileset][otileId - 1];
|
||||||
|
|
||||||
|
bool tilePassable = false;
|
||||||
|
if (terrainPassable || overlayPassable)
|
||||||
|
tilePassable = true;
|
||||||
|
if (!overlayPassable && otileId != 1)
|
||||||
|
tilePassable = false;
|
||||||
|
|
||||||
|
|
||||||
|
Logger.DebugPrint("Checking tile passibility for tileid: " + tileId + " and overlay tileid " + otileId + " on tileset " + tileset + " at " + x + "," + y);
|
||||||
|
return tilePassable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void OpenMap()
|
public static void OpenMap()
|
||||||
|
|
|
@ -24,5 +24,15 @@ crossdomain=CrossDomainPolicy.xml
|
||||||
# Red Text Stating "Todays Note:"
|
# Red Text Stating "Todays Note:"
|
||||||
motd=April 11, 2020. New breed, Camarillo White Horse. Two new quests.
|
motd=April 11, 2020. New breed, Camarillo White Horse. Two new quests.
|
||||||
|
|
||||||
|
# Chat Filter Settings
|
||||||
|
|
||||||
|
# Wether to block 'bad' words
|
||||||
|
# ex 'Fuck You!' gets blocked
|
||||||
|
filter_bad_words=true
|
||||||
|
|
||||||
|
# Wether to expand slang.
|
||||||
|
# ex 'lol' becomes '*laughing out loud!*'
|
||||||
|
correct_slang=true
|
||||||
|
|
||||||
# Should print debug logs
|
# Should print debug logs
|
||||||
debug=false
|
debug=false
|
Loading…
Add table
Reference in a new issue