mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-07 13:45:42 +12:00
block socials when target player leaves the same spot
This commit is contained in:
parent
a116a27f0a
commit
6d1d0165c1
4 changed files with 16 additions and 3 deletions
|
@ -237,7 +237,8 @@
|
|||
"socials":{
|
||||
"socials_button":"^B5%ID%%SOCIALNAME%",
|
||||
"socials_message":"<FONT COLOR='#BA0042'>* %SOCIALMSG% *</FONT>",
|
||||
"socials_menu_type":"^L%TYPE%:^R1"
|
||||
"socials_menu_type":"^L%TYPE%:^R1",
|
||||
"no_longer_nearby":"Player is no longer nearby!",
|
||||
},
|
||||
"trade":{
|
||||
"trading_with":"^ATTrading with %PLAYERNAME%",
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace HISP.Game
|
|||
public static string SocialButton;
|
||||
public static string SocialMessageFormat;
|
||||
public static string SocialTypeFormat;
|
||||
public static string SocialPlayerNoLongerNearby;
|
||||
|
||||
// Trading
|
||||
public static string TradeWithPlayerFormat;
|
||||
|
|
|
@ -862,6 +862,7 @@ namespace HISP.Server
|
|||
Messages.SocialButton = gameData.messages.meta.player_interaction.socials.socials_button;
|
||||
Messages.SocialMessageFormat = gameData.messages.meta.player_interaction.socials.socials_message;
|
||||
Messages.SocialTypeFormat = gameData.messages.meta.player_interaction.socials.socials_menu_type;
|
||||
Messages.SocialPlayerNoLongerNearby = gameData.messages.meta.player_interaction.socials.no_longer_nearby;
|
||||
|
||||
// Trade
|
||||
|
||||
|
|
|
@ -480,9 +480,19 @@ namespace HISP.Server
|
|||
break;
|
||||
case PacketBuilder.SOCIALS_USE:
|
||||
int socialId = Convert.ToInt32(packet[2] - (byte)0x21);
|
||||
SocialType.Social social = SocialType.GetSocial(socialId);
|
||||
SocialType.Social social = SocialType.GetSocial(socialId);
|
||||
|
||||
foreach(User user in GetUsersAt(sender.LoggedinUser.X, sender.LoggedinUser.Y, true, true))
|
||||
if(sender.LoggedinUser.SocializingWith != null)
|
||||
{
|
||||
if(sender.LoggedinUser.SocializingWith.X == sender.LoggedinUser.X && sender.LoggedinUser.SocializingWith.Y == sender.LoggedinUser.Y)
|
||||
{
|
||||
byte[] playerNotNearby = PacketBuilder.CreateChat(Messages.SocialPlayerNoLongerNearby, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.SendPacket(playerNotNearby);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach (User user in GetUsersAt(sender.LoggedinUser.X, sender.LoggedinUser.Y, true, true))
|
||||
{
|
||||
if (social.BaseSocialType.Type != "GROUP")
|
||||
if (user.Id == sender.LoggedinUser.SocializingWith.Id)
|
||||
|
|
Loading…
Add table
Reference in a new issue