Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read sign doesn't work #1

Open
seikichin opened this issue Jan 26, 2020 · 7 comments
Open

read sign doesn't work #1

seikichin opened this issue Jan 26, 2020 · 7 comments

Comments

@seikichin
Copy link

If you are wiz when you are at home read sign doesn't work It shows there is no sign here,in fact sign is virtual object

@seikichin
Copy link
Author

/lib/std/base_dummy.c 把这句 if(!valid_event(previous_object(), this_object())) return 0; 注释下就可以了

@virtustate
Copy link
Contributor

I've been puzzling over this as well. AFAIK, a rooms SetItems and SetRead objects don't work if the file is in under the /realms directory but the exact same code (with appropriate path adjustments) does work if the file is under any other directory. Very strange.

For example, when file under /realms directory.
look sheet or look at sheet results in: You can't look sheet.
read sheet results in: There is no sheet here.

I copied the exits commands to add a list of dummy items in the room to confirm that the 3 dummy objects from SetItems (a workroom, a sheet, a sign) are in the workroom under both the realms and domains directory so it doesn't seem the issue is in populated the room dummy items.

Could something be intercepting or interfering with the look command when a room is under the realms directory?!

@seikichin
Copy link
Author

In the file "/lib/std/base_dummy.c" if you add a comment to
" if(!valid_event(previous_object(), this_object())) return 0; " it will be fine. so I think the sefun valid_event cause this problem.

@seikichin
Copy link
Author

seikichin commented Apr 10, 2020

"lib/secure/sefun/sefun.c" line 495
int valid_event(object dester, object dested){
    string desterbase, destedbase, topdester, topdested;
    string contextdester, contextdested;
    int i;
    if(!dester || !dested) return 0;
    desterbase = base_name(dester);
    destedbase = base_name(dested);
    i = sscanf(desterbase,"/%s/%s/%*s", topdester, contextdester);
    //tc("dester i: "+i);
    //i = sscanf(desterbase,"/%s/%*s", topdester);
    //tc("dester: "+identify(dester));
    if(topdester != "realms" && topdester != "open") return 1;
    i = sscanf(destedbase,"/%s/%s/%*s", topdested, contextdested);
    //tc("dested i: "+i);
    if(contextdested && contextdester && contextdested == contextdester){
        return 1;
    }
    return 0;
}

@virtustate
Copy link
Contributor

virtustate commented Apr 10, 2020

Thanks, that worked.

Replacing the valid_event code in sefun with what's in dead_souls3.9 also seems to work. I'm guessing this valid_event might be intending to restrict who can do things in the /realms and /open top level directories?

int valid_event(object dester, object dested) {
    string desterbase, destedbase, topdester, topdested;
    string contextdester, contextdested;
    int i;
    if (!dester || !dested) return 0;
    return 1;
    desterbase = base_name(dester);
    destedbase = base_name(dested);
    i = sscanf(desterbase, "/%s/%s/%*s", topdester, contextdester);
    if (topdester != "realms" && topdester != "open") return 1;
    i = sscanf(destedbase, "/%s/%s/%*s", topdested, contextdested);
    if (contextdested && contextdester && contextdested == contextdester) {
        return 1;
    }
    return 0;
}

@seikichin
Copy link
Author

seikichin commented Apr 10, 2020 via email

@thefallentree
Copy link
Member

pls submit PR to fix this :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants