public void SubPlatformLaunch(string object_id, string parent_id, double xpos, double ypos, double zpos) { _SubPEvent = SimulationEventFactory.BuildEvent(ref _SimModel, "SubplatformLaunchRequest"); ((StringValue)(_SubPEvent["UserID"])).value = DDD_Global.Instance.PlayerID; ((StringValue)(_SubPEvent["ObjectID"])).value = object_id; ((StringValue)(_SubPEvent["ParentObjectID"])).value = parent_id; ((LocationValue)(_SubPEvent["LaunchDestinationLocation"])).X = (double)UTM_Mapping.HorizontalPixelsToMeters((float)xpos); ((LocationValue)(_SubPEvent["LaunchDestinationLocation"])).Y = (double)UTM_Mapping.VerticalPixelsToMeters((float)ypos); ((LocationValue)(_SubPEvent["LaunchDestinationLocation"])).Z = zpos; ((LocationValue)(_SubPEvent["LaunchDestinationLocation"])).exists = true; if (DDD_Global.Instance.IsConnected) { DDD_Global.Instance.PutEvent(_SubPEvent); } else { lock (this) { if (DemoEvents != null) { DemoEvents.Add(_SubPEvent); } } } }
public void DoMove(string user_id, string object_id, double throttle, double xpos, double ypos, double zpos) { _MoveEvent = SimulationEventFactory.BuildEvent(ref _SimModel, "MoveObjectRequest"); ((StringValue)(_MoveEvent["UserID"])).value = user_id; ((StringValue)(_MoveEvent["ObjectID"])).value = object_id; ((DoubleValue)(_MoveEvent["Throttle"])).value = throttle; ((LocationValue)(_MoveEvent["DestinationLocation"])).X = (double)UTM_Mapping.HorizontalPixelsToMeters((float)xpos); ((LocationValue)(_MoveEvent["DestinationLocation"])).Y = (double)UTM_Mapping.VerticalPixelsToMeters((float)ypos); ((LocationValue)(_MoveEvent["DestinationLocation"])).Z = zpos; ((LocationValue)(_MoveEvent["DestinationLocation"])).exists = true; if (DDD_Global.Instance.IsConnected) { DDD_Global.Instance.PutEvent(_MoveEvent); } else { lock (this) { if (DemoEvents != null) { DemoEvents.Add(_MoveEvent); } } } }
// So here's the deal. I created a generic attack request event for you called "ClientAttackRequest". It has the following attributes in it: //* PlayerID - StringValue - Your user's PlayerID //* AttackingObjectID - StringValue - The ID of the attacking object //* TargetObjectID - StringValue - The ID of the target object //* WeaponOrCapabilityName - StringValue - The capability name or the weapon ID of the weapon or capability being used. public void DoAttack(string user_id, string object_id, string target_id, string capability) { _AttackEvent = SimulationEventFactory.BuildEvent(ref _SimModel, "ClientAttackRequest"); ((StringValue)(_AttackEvent["PlayerID"])).value = user_id; ((StringValue)(_AttackEvent["AttackingObjectID"])).value = object_id; ((StringValue)(_AttackEvent["TargetObjectID"])).value = target_id; ((StringValue)(_AttackEvent["WeaponOrCapabilityName"])).value = capability; if (DDD_Global.Instance.IsConnected) { DDD_Global.Instance.PutEvent(_AttackEvent); } else { lock (this) { if (DemoEvents != null) { DemoEvents.Add(_AttackEvent); } } } }