public void StreamWriteF(ScriptThread thread) { ScriptStream stream = ((NativeObject)thread.GetObjectParameter(0)).Object as ScriptStream; if (stream == null) { DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called StreamWrite with an invalid object.", LogAlertLevel.Error); return; } stream.Writer.Write(thread.GetFloatParameter(1)); }
public void StreamLength(ScriptThread thread) { ScriptStream stream = ((NativeObject)thread.GetObjectParameter(0)).Object as ScriptStream; if (stream == null) { DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called StreamLength with an invalid object.", LogAlertLevel.Error); return; } thread.SetReturnValue(stream.Stream.Length); }
public void StreamPeekDouble(ScriptThread thread) { ScriptStream stream = ((NativeObject)thread.GetObjectParameter(0)).Object as ScriptStream; if (stream == null) { DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called StreamPeekDouble with an invalid object.", LogAlertLevel.Error); return; } long position = stream.Stream.Position; double value = stream.Reader.ReadDouble(); stream.Stream.Position = position; thread.SetReturnValue(value); }
public StreamScriptObject(ScriptStream stream) { _nativeObject = stream; }