r3704 - trunk/data/qcsrc/common

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Jun 13 11:07:21 EDT 2008


Author: blub0
Date: 2008-06-13 11:07:18 -0400 (Fri, 13 Jun 2008)
New Revision: 3704

Modified:
   trunk/data/qcsrc/common/gamecommand.qc
Log:
added rpn cmds to store, load, and clear the database

Modified: trunk/data/qcsrc/common/gamecommand.qc
===================================================================
--- trunk/data/qcsrc/common/gamecommand.qc	2008-06-12 10:12:10 UTC (rev 3703)
+++ trunk/data/qcsrc/common/gamecommand.qc	2008-06-13 15:07:18 UTC (rev 3704)
@@ -69,6 +69,8 @@
 		print("    x dbpush -------------------------->     : pushes the top onto the database\n");
 		print("    dbpop|dbget -----------------------> x   : removes/reads DB's top\n");
 		print("    dblen|dbat ------------------------> f   : gets the DB's size/cursor pos\n");
+		print("    dbclr ----------------------------->     : clear the DB\n");
+		print("    s dbsave|dbload-------------------->     : save/load the DB to/from a file\n");
 		print("    x dbins --------------------------->     : moves the top into the DB\n");
 		print("    dbext|dbread ----------------------> x   : extract/get from the DB's cursor\n");
 		print("    f dbmov|dbgoto -------------------->     : move or set the DB's cursor\n");
@@ -347,6 +349,22 @@
 					}
 				} else if(rpncmd == "dblen") {
 					rpn_push(db_get(rpn_db, "stack.pointer"));
+				} else if(rpncmd == "dbclr") {
+					db_close(rpn_db);
+					rpn_db = db_create();
+					db_put(rpn_db, "stack.pointer", "0");
+					db_put(rpn_db, "stack.pos", "-1");
+				} else if(rpncmd == "dbsave") {
+					s = rpn_pop();
+					if(!rpn_error)
+						db_save(rpn_db, s);
+				} else if(rpncmd == "dbload") {
+					s = rpn_pop();
+					if(!rpn_error)
+					{
+						db_close(rpn_db);
+						rpn_db = db_load(s);
+					}
 				} else if(rpncmd == "dbins") {
 					s = rpn_pop();
 					if(!rpn_error)




More information about the nexuiz-commits mailing list