+ $this->user[$idx]->name = $name_new; // OK - add new user
+ $this->user[$idx]->stat_set("room");
+ $this->user[$idx]->step_set(0);
+ while (array_pop($this->user[$idx]->comm) != NULL);
+ $this->user[$idx]->subst = "standup";
+ $this->user[$idx]->lacc = $curtime;
+ $this->user[$idx]->laccwr = $curtime;
+ $this->user[$idx]->bantime = 0;
+ $this->user[$idx]->ip = $ip;
+
+ $this->user[$idx]->rec = $authenticate;
+ $this->user[$idx]->flags = $user_type;
+ $this->user[$idx]->flags |= ($authenticate != FALSE ? USER_FLAG_AUTH : 0x00);
+ $this->user[$idx]->flags |= ( ($pass != FALSE && $bdb == FALSE) ? USER_FLAG_DBFAILED : 0x00);
+ log_auth("XXX", sprintf("FLAGS: [%x]", $this->user[$idx]->flags));
+
+ if ($authenticate != FALSE) {
+ $this->user[$idx]->code = $authenticate->code_get();
+ if (0 == 1) {
+ // all this part is included in the db server
+ $this->user[$idx]->flags |= USER_FLAG_LISTAUTH;
+
+ if (isset($cookie['CO_list'])) {
+ // fprintf(STDERR, "QQ: %s CO_list: [%s]\n", __FUNCTION__, $cookie['CO_list']);
+ if (strcmp($cookie['CO_list'], "auth") == 0) {
+ $this->user[$idx]->flags &= ~USER_FLAG_MAP_AUTH;
+ $this->user[$idx]->flags |= USER_FLAG_LISTAUTH;
+ }
+ if (strcmp($cookie['CO_list'], "isolation") == 0) {
+ $this->user[$idx]->flags &= ~USER_FLAG_MAP_AUTH;
+ $this->user[$idx]->flags |= USER_FLAG_ISOLAUTH;
+ }
+ else {
+ $this->user[$idx]->flags &= ~USER_FLAG_MAP_AUTH;
+ }
+ }
+ }
+ // else {
+ // fprintf(STDERR, "QQ: CO_list not set flags: %x\n", __FUNCTION__, $this->user[$idx]->flags);
+ // }
+ }
+ // fprintf(STDERR, "QQ %s: flag %x\n", __FUNCTION__, $this->user[$idx]->flags);
+ if ($ghost > -1) {
+ log_main("ghost: rename!");
+ $ghost_user = $this->user[$ghost];
+
+ if ($ghost_auth == FALSE) {
+ for ($sfx = 1 ; $sfx <= MAX_PLAYERS ; $sfx++) {
+ $ghostname = 'ghost'.$sfx;
+ for ($i = 0 ; $i < MAX_PLAYERS ; $i++) {
+ if (strcmp("", $this->user[$i]->sess) == 0)
+ continue;
+
+ if (strcasecmp($this->user[$i]->name, $ghostname) == 0) {
+ $ghostname = '';
+ break;
+ }
+ }
+ if ($ghostname != '')
+ break;
+ }