// 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); } }
public override void OnRequest(OrbClientInfo clientInfo, OrbRequestArgs 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; if (client.OnlineMobile != null) { // char is logged in, return its location GetLocationResponse resp = new GetLocationResponse(); resp.X = client.OnlineMobile.Location.X; resp.Y = client.OnlineMobile.Location.Y; resp.Z = client.OnlineMobile.Location.Z; // send the response back to the test utility SendResponse(resp); } else { // char is offline, return null SendResponse(null); } }