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);
				}
			}
		}
示例#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");
            }
        }
示例#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);
                }
            }
        }
示例#5
0
 public void SendCommand(string alias, OrbClientInfo client, OrbCommandArgs args)
 {
     if (OnExecuteCommand != null)
     {
         OnExecuteCommand(alias, client, args);
     }
 }
示例#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);
            }
        }
示例#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();
            }
        }
示例#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);
			}
		}
示例#9
0
		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();
				}
			}
		}
示例#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);
            }
        }
示例#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;
			}
示例#12
0
 private static void ExecuteCommand(string alias, OrbCommandArgs args)
 {
     RaiseBusyEvent();
     OrbClient.SendCommand(alias, args);
     RaiseReadyEvent();
 }
示例#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;
 }
示例#14
0
 public abstract void OnCommand(OrbClientInfo clientInfo, OrbCommandArgs args);