public override void OnCommand(OrbClientInfo clientInfo, OrbCommandArgs cmdArgs)
        {
            if (cmdArgs == null || !(cmdArgs is DeleteCommandArgs))
            {
                return;
            }

            DeleteCommandArgs args = (DeleteCommandArgs)cmdArgs;

            if (args.Count > 0)
            {
                int[] serials = args.ItemSerials;

                for (int i = 0; i < serials.Length; ++i)
                {
                    Item item = World.FindItem(serials[i]);

                    if (item == null || item.Deleted)
                    {
                        continue;
                    }

                    item.Delete();
                }
            }
        }
		public override void OnCommand(OrbClientInfo client, OrbCommandArgs cmdArgs)
		{
			if(cmdArgs == null || !(cmdArgs is MoveItemsArgs) )
				return;

			MoveItemsArgs args = (MoveItemsArgs)cmdArgs;

			if(args.Count > 0)
			{
				int xoffset = args.Xoffset;
				int yoffset = args.Yoffset;
				int zoffset = args.Zoffset;

				int[] serials = args.ItemSerials;

				for(int i=0; i < serials.Length; ++i)
				{
					Item item = World.FindItem(serials[i]);

					if(item == null)
						continue;

					int newX = item.X + xoffset;
					int newY = item.Y + yoffset;
					int newZ = item.Z + zoffset;

					item.Location = new Point3D(newX, newY, newZ);
				}
			}
		}
Beispiel #3
0
        public static void SendCommand(string alias, OrbCommandArgs args)
        {
            bool   success = true;
            string reason  = null;

            if (!IsConnected)
            {
                reason  = "A connection is required before this command can be sent to the server.";
                success = false;
            }

            try
            {
                m_Connection.SendCommand(alias, new OrbClientInfo(m_ClientID, m_UserName), args);
                success = true;
            }
            catch (Exception e)
            {
                reason  = "Connection to the server was lost.\nException: " + e.Message;
                success = false;
            }

            if (!success)
            {
                MessageBox.Show(reason, "Command Failed");
            }
        }
Beispiel #4
0
        public override void OnCommand(OrbClientInfo client, OrbCommandArgs cmdArgs)
        {
            if (cmdArgs == null || !(cmdArgs is MoveItemsArgs))
            {
                return;
            }

            MoveItemsArgs args = (MoveItemsArgs)cmdArgs;

            if (args.Count > 0)
            {
                int xoffset = args.Xoffset;
                int yoffset = args.Yoffset;
                int zoffset = args.Zoffset;

                int[] serials = args.ItemSerials;

                for (int i = 0; i < serials.Length; ++i)
                {
                    Item item = World.FindItem(serials[i]);

                    if (item == null)
                    {
                        continue;
                    }

                    int newX = item.X + xoffset;
                    int newY = item.Y + yoffset;
                    int newZ = item.Z + zoffset;

                    item.Location = new Point3D(newX, newY, newZ);
                }
            }
        }
Beispiel #5
0
 public void SendCommand(string alias, OrbClientInfo client, OrbCommandArgs args)
 {
     if (OnExecuteCommand != null)
     {
         OnExecuteCommand(alias, client, args);
     }
 }
Beispiel #6
0
        // override the abstract OnCommand method. This method is called by the scripted OrbServer class
        public override void OnCommand(OrbClientInfo clientInfo, OrbCommandArgs args)
        {
            // cast the clientInfo into the OrbClientState subclass that contains addition info
            // such as the OrbClientID, Account, and logged in char if online.
            OrbClientState client = (OrbClientState)clientInfo;

            // cast the args to the appropriate subclass
            SendMessageArgs msgArgs = (SendMessageArgs)args;

            if (client.OnlineMobile != null)
            {
                // send the message to the logged in character
                client.OnlineMobile.SendMessage(msgArgs.Message);
            }
        }
Beispiel #7
0
        private static void OnExecuteCommand(string alias, OrbClientInfo clientInfo, OrbCommandArgs args)
        {
            OrbClientState client = GetClientState(clientInfo);

            if (client == null)
            {
                return;
            }

            OrbCommand command = GetCommand(alias, client);

            if (command != null)
            {
                new CommandSyncTimer(client, command, args).Start();
            }
        }
Beispiel #8
0
		private static void OnExecuteCommand(string alias, OrbClientInfo clientInfo, OrbCommandArgs args)
		{
			OrbClientState client = GetClientState(clientInfo);

			if(client == null)
				return;

			try
			{
				OrbCommand command = GetCommand(alias, client);

				if(command != null)
				{
					new CommandSyncTimer(client, command, args).Start();
				}
			}
			catch(Exception e)
			{
				Console.WriteLine("Exception occurred for OrbServer command {0}\nMessage: {1}", alias, e.Message);
			}
		}
		public override void OnCommand(OrbClientInfo clientInfo, OrbCommandArgs cmdArgs)
		{
			if(cmdArgs == null || !(cmdArgs is DeleteCommandArgs) )
				return;

			DeleteCommandArgs args = (DeleteCommandArgs)cmdArgs;

			if(args.Count > 0)
			{
				int[] serials = args.ItemSerials;

				for(int i=0; i < serials.Length; ++i)
				{
					Item item = World.FindItem(serials[i]);

					if(item == null || item.Deleted)
						continue;

					item.Delete();
				}
			}
		}
Beispiel #10
0
        private static void OnExecuteCommand(string alias, OrbClientInfo clientInfo, OrbCommandArgs args)
        {
            OrbClientState client = GetClientState(clientInfo);

            if (client == null)
            {
                return;
            }

            try
            {
                OrbCommand command = GetCommand(alias, client);

                if (command != null)
                {
                    new CommandSyncTimer(client, command, args).Start();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception occurred for OrbServer command {0}\nMessage: {1}", alias, e.Message);
            }
        }
Beispiel #11
0
			public CommandSyncTimer(OrbClientState client, OrbCommand command, OrbCommandArgs args) : base(TimeSpan.FromMilliseconds(20.0), TimeSpan.FromMilliseconds(20.0))
			{
				m_Client = client;
				m_Command = command;
				m_Args = args;
			}
Beispiel #12
0
 private static void ExecuteCommand(string alias, OrbCommandArgs args)
 {
     RaiseBusyEvent();
     OrbClient.SendCommand(alias, args);
     RaiseReadyEvent();
 }
Beispiel #13
0
 public CommandSyncTimer(OrbClientState client, OrbCommand command, OrbCommandArgs args) : base(TimeSpan.FromMilliseconds(20.0), TimeSpan.FromMilliseconds(20.0))
 {
     m_Client  = client;
     m_Command = command;
     m_Args    = args;
 }
Beispiel #14
0
 public abstract void OnCommand(OrbClientInfo clientInfo, OrbCommandArgs args);