* Added an initial version of the goto command
[citadel.git] / ctdlphp / ctdlprotocol.php
index 45c136e3de8ff1934efbd138c3938ed03a9575a6..cebf9f45210a99795eeca50fb6bebb40dae5cb12 100644 (file)
@@ -108,6 +108,7 @@ function create_new_user($user, $pass) {
 //
 function become_logged_in($server_parms) {
        $_SESSION["logged_in"] = 1;
+       ctdl_goto("_BASEROOM_");
 }
 
 
@@ -209,5 +210,25 @@ function ctdl_rwho() {
 }
 
 
+//
+// Goto a room.
+//
+function ctdl_goto($to_where) {
+       
+       serv_puts("GOTO " . $to_where);
+       $response = serv_gets();
+
+       if (substr($response, 0, 1) == "2") {
+               $_SESSION["room"] = strtok(substr($response, 4), "|");
+               return array(TRUE, substr($response, 0, 3));
+       }
+
+       else {
+               return array(FALSE, substr($response, 0, 3));
+       }
+
+}
+
+
 
 ?>