public void CameraSetMode(coCamera camera, string mode, string arg1 = "", string arg2 = "", string arg3 = "") { coSimDataBlock t = camera.getDataBlock(); System.Console.WriteLine(t.getName()); console.Call_Classname(camera.getDataBlock().AsString(), "setMode", new string[] { camera, mode, arg1, arg2, arg3 }); // Punt this one over to our datablock }
public void ObserverObserverOnTrigger(coCameraData cameradata, coCamera camera, string trigger, bool state) { // state = 0 means that a trigger key was released if (state == false) return; // Default player triggers: 0=fire 1=altFire 2=jump coGameConnection client = camera.getControllingClient(); string mode = camera["mode"]; switch (mode) { case "Observer": // Do something interesting. break; case "Corpse": //Here is a winner... if you send the prepare too soon, it will crash out the client. The GameConnectionOnControlObjectChange needs //time to run, and since it's still processing the first change (Switch to camera) this second change (Camera->player) will crash //out the client. //ServerCmdSetEditorCameraStandard(client); //ServerCmdDropCameraAtPlayer(client); camera.setFlyMode(); client.setControlObject(camera); GameConnectiOnPreparePlayer(client); break; } }
public void CameraOnAdd(coCamera camera, string obj) { CameraSetMode(camera, camera["mode"]); }
public void ObserverObserverSetMode(coCamera camera, string mode, coSceneObject arg1, string arg2, string arg3) { switch (mode) { case "Observer": camera.setFlyMode(); break; case "Corpse": camera.setOrbitMode(arg1, arg1.getTransform(), (float)0.5, (float)4.5, (float)4.5, false, new Point3F(), false); camera["orbitObj"] = arg1; break; } camera["mode"] = mode; }