mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-07 13:45:42 +12:00
Make nearby more accurate to public server.
This commit is contained in:
parent
9f592fb51b
commit
9f3ebaa256
8 changed files with 34 additions and 14 deletions
|
@ -149,7 +149,7 @@
|
|||
"you_could_purchase_this":"^T6You could purchase this ranch:^B6P^R1",
|
||||
"ranch_already_owned":"<B>You already own a ranch, however.</B>",
|
||||
"sub_only":"<B>Only Horse Isle subscribers may purchase a ranch however.</B>",
|
||||
"ranch_desc_others":"<BR>^H%DESCRIPTION%<BR>"
|
||||
"ranch_desc_others":"<BR>^H%DESCRIPTION%<BR>",
|
||||
|
||||
"unowned_ranch_click":"Unowned Ranch",
|
||||
"click_message":"%USERNAME%'s %TITLE%",
|
||||
|
|
|
@ -11,4 +11,5 @@ namespace HISP.Game
|
|||
// Drawingroom
|
||||
public class DrawingroomException : Exception { };
|
||||
public class DrawingroomFullException : DrawingroomException { };
|
||||
|
||||
}
|
||||
|
|
|
@ -129,6 +129,8 @@ namespace HISP.Game.Horse
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int TackOffset
|
||||
{
|
||||
get
|
||||
|
|
|
@ -51,24 +51,36 @@ namespace HISP.Game
|
|||
string usersNorth = "";
|
||||
string usersEast = "";
|
||||
string usersSouth = "";
|
||||
|
||||
foreach (User nearbyUser in nearbyUsers)
|
||||
{
|
||||
if (nearbyUser.X < x)
|
||||
if (nearbyUser.X == x && nearbyUser.Y == y) // not yourself
|
||||
continue;
|
||||
|
||||
int xDiff = x - nearbyUser.X;
|
||||
int yDiff = y - nearbyUser.Y;
|
||||
double angle = (Math.Atan2(yDiff, xDiff) * 180.0 / Math.PI);
|
||||
angle -= 45;
|
||||
angle = (angle % 360 + 360) % 360;
|
||||
|
||||
if (angle >= 270 && angle <= 360 )
|
||||
{
|
||||
usersWest += " " + nearbyUser.Username + " ";
|
||||
}
|
||||
else if (nearbyUser.X > x)
|
||||
else if (angle >= 90 && angle <= 180)
|
||||
{
|
||||
usersEast += " " + nearbyUser.Username + " ";
|
||||
}
|
||||
else if (nearbyUser.Y > y)
|
||||
else if (angle >= 180 && angle <= 270)
|
||||
{
|
||||
usersSouth += " " + nearbyUser.Username + " ";
|
||||
}
|
||||
else if (nearbyUser.Y < y)
|
||||
else if (angle >= 0 && angle <= 90)
|
||||
{
|
||||
usersNorth += " " + nearbyUser.Username + " ";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (usersEast != "")
|
||||
|
|
|
@ -198,7 +198,7 @@ namespace HISP.Game
|
|||
Database.SetServerTime(ServerTime.Minutes, ServerTime.Days, ServerTime.Years);
|
||||
|
||||
// Ranch Windmill Payments
|
||||
if(hours % 12 == 0)
|
||||
if(ServerTime.Minutes % 720 == 0) // every 12 hours
|
||||
{
|
||||
Logger.DebugPrint("Paying windmill owners . . . ");
|
||||
foreach (Ranch ranch in Ranch.Ranches)
|
||||
|
@ -220,7 +220,7 @@ namespace HISP.Game
|
|||
{
|
||||
ServerTime.Days += 1;
|
||||
ServerTime.Minutes = 0;
|
||||
|
||||
|
||||
Database.DoIntrestPayments(ConfigReader.IntrestRate);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace HISP.Server
|
||||
{
|
||||
|
@ -34,6 +31,11 @@ namespace HISP.Server
|
|||
return arr;
|
||||
}
|
||||
|
||||
public static Double PointsToDistance(int x1, int y1, int x2, int y2)
|
||||
{
|
||||
return Math.Sqrt(Math.Pow(x1 - (-y1), 2) + Math.Pow(x2 - (-y2), 2));
|
||||
}
|
||||
|
||||
public static DateTime UnixTimeStampToDateTime(double unixTimeStamp)
|
||||
{
|
||||
// Unix timestamp is seconds past epoch
|
||||
|
|
|
@ -671,7 +671,7 @@ namespace HISP.Server
|
|||
Messages.RanchYouCouldPurchaseThisRanch = gameData.messages.meta.ranch.you_could_purchase_this;
|
||||
Messages.RanchYouAllreadyOwnARanch = gameData.messages.meta.ranch.ranch_already_owned;
|
||||
Messages.RanchSubscribersOnly = gameData.messages.meta.ranch.sub_only;
|
||||
Messages.RanchDescriptionOthersFormat = gameData.meta.ranch.ranch_desc_others;
|
||||
Messages.RanchDescriptionOthersFormat = gameData.messages.meta.ranch.ranch_desc_others;
|
||||
Messages.RanchUnownedRanchClicked = gameData.messages.meta.ranch.unowned_ranch_click;
|
||||
Messages.RanchClickMessageFormat = gameData.messages.meta.ranch.click_message;
|
||||
|
||||
|
|
|
@ -61,8 +61,6 @@ namespace HISP.Server
|
|||
Database.IncAllUsersFreeTime(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (totalMinutesElapsed % 25 == 0)
|
||||
{
|
||||
|
||||
|
@ -84,6 +82,11 @@ namespace HISP.Server
|
|||
}
|
||||
}
|
||||
|
||||
foreach(GameClient client in ConnectedClients)
|
||||
if (client.LoggedIn)
|
||||
if (!client.LoggedinUser.MetaPriority)
|
||||
UpdateArea(client);
|
||||
|
||||
Treasure.AddValue();
|
||||
Database.IncPlayerTirednessForOfflineUsers();
|
||||
DroppedItems.Update();
|
||||
|
|
Loading…
Add table
Reference in a new issue