public static void ClientDisconnected(Client client)
		{
			DatabaseLock.WaitOne();
			ConnectedClients.Remove(client);
			DatabaseLock.ReleaseMutex();
			EnqueuAction(() => { });
		}
Esempio n. 2
0
 internal static void ClientDisconnected(Client client)
 {
     ClientLock.WaitOne();
     ConnectedClients.Remove(client);
     client.Player.GetProperty<Account>("account").LoggedInCharacter = null;
     Core.RemovePlayer(client.Player);
     ClientLock.ReleaseMutex();
 }
        public static void ClientConnected(Client client)
        {
			client.Player = new Actor();
			client.Player.ConnectedClient = client;
			client.CommandHandler = LoginCommandHandler;

			var settings = GetObject("settings") as Settings;
			client.Send(settings.Banner);
			client.Send(settings.MessageOfTheDay);

			DatabaseLock.WaitOne();
            ConnectedClients.Add(client);
			DatabaseLock.ReleaseMutex();
        }
		public void HandleCommand(Client Client, String Command)
		{
            try
			{
				var matchedCommand = Parser.ParseCommand(Command, Client.Player);
				if (matchedCommand != null)
					matchedCommand.Command.Processor.Perform(matchedCommand.Match, Client.Player);
				else
					Client.Send("I do not understand.");
			}
			catch (Exception e)
			{
				Mud.ClearPendingMessages();
				Client.Send(e.Message);
			}
		}
Esempio n. 5
0
 public static void TiePlayerToClient(Client Client, Actor Actor)
 {
     Client.Player = Actor;
     Actor.ConnectedClient = Client;
 }
        internal static void EnqueuClientCommand(Client Client, String RawCommand)
        {
			EnqueuAction(() => { Client.CommandHandler.HandleCommand(Client, RawCommand); });
        }
			public RawPendingMessage(Client Destination, String Message)
			{
				this.Destination = Destination;
				this.Message = Message;
			}
Esempio n. 8
0
        public static void SendMessage(Client Client, String Message, params Object[] MentionedObjects)
        {
            if (String.IsNullOrEmpty(Message)) return;
            if (Core.SilentFlag) return;
            Core.OutputQueryTriggered = true;

            Core.PendingMessages.Add(new PendingMessage(Client, Core.FormatMessage(Client.Player, Message, MentionedObjects)));
        }