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