/** * @param text */ public static void AddText(string text) { var l = text.Length; if (Globals.cmd_text.cursize + l >= Globals.cmd_text.maxsize) { Com.Printf("Cbuf_AddText: overflow\n"); return; } SZ.Write(Globals.cmd_text, Lib.stringToBytes(text), l); }
// had a bug, now its ok. public static void WriteString(sizebuf_t sb, string s) { var x = s; if (s == null) { x = ""; } SZ.Write(sb, Lib.stringToBytes(x)); MSG.WriteByte(sb, 0); //Com.dprintln("MSG.WriteString:" + s.replace('\0', '@')); }
public static void InsertText(string text) { var templen = 0; // copy off any commands still remaining in the exec buffer templen = Globals.cmd_text.cursize; if (templen != 0) { Array.Copy(Globals.cmd_text.data, 0, Cbuf.tmp, 0, templen); SZ.Clear(Globals.cmd_text); } // add the entire text of the file Cbuf.AddText(text); // add the copied off data if (templen != 0) { SZ.Write(Globals.cmd_text, Cbuf.tmp, templen); } }