mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-22 20:55:52 +12:00
Fix Arena TOCTOU
This commit is contained in:
parent
ab05db6cbf
commit
51223172c4
4 changed files with 35 additions and 11 deletions
|
@ -69,6 +69,8 @@ namespace HISP.Game.Chat
|
|||
return Command.UnBan(message, args, user);
|
||||
if (message.ToUpper().StartsWith("%ESCAPE"))
|
||||
return Command.Escape(message, args, user);
|
||||
if (message.ToUpper().StartsWith("%CALL HORSE"))
|
||||
return Command.CallHorse(message, args, user);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ using HISP.Game.Items;
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HISP.Game.Events;
|
||||
using HISP.Game.Horse;
|
||||
|
||||
namespace HISP.Game.Chat
|
||||
{
|
||||
|
@ -354,6 +355,23 @@ namespace HISP.Game.Chat
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool CallHorse(string message, string[] args, User user)
|
||||
{
|
||||
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message.Substring(1));
|
||||
|
||||
WildHorse horse = WildHorse.WildHorses[GameServer.RandomNumberGenerator.Next(0, WildHorse.WildHorses.Length)];
|
||||
horse.X = user.X;
|
||||
horse.Y = user.Y;
|
||||
|
||||
GameServer.UpdateAreaForAll(user.X, user.Y);
|
||||
|
||||
byte[] chatPacket = PacketBuilder.CreateChat(formattedmessage, PacketBuilder.CHAT_BOTTOM_LEFT);
|
||||
user.LoggedinClient.SendPacket(chatPacket);
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public static bool Dance(string message, string[] args, User user)
|
||||
{
|
||||
string moves = string.Join(" ", args).ToLower();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue