Page 1 of 2

Bug 53: (Lokked) Separator Issues

Posted: Sun Dec 14, 2014 2:59 pm
by BugTracker
Bug ID       : 53 - Faction Commands (.faction) do... 
Bug Date     : 2014/11/22 02:21:17
Assigned To  : Ratief
Priority     : High

Category     : VGClient
Sub-Category : Other
Severity     : Standard
Reproducible : Every time
Details:
Faction Commands (.faction) does no work

.faction displays the syntax for using the command
.faction set Cyrcle 661 5000 does not work. ID 661 (or Rindol Field) was pulled from the Faction list on the DB Editor. Should set Rindol Field faction to 5000.
.faction set Cyrcle Rindol Field 5000 comes with the following error "Command Error: No such faction (Rindol)."
.faction set Cyrcle "Rindol Field" 5000 comes with nothing returned.
.faction get returns error "Command Error: internal error"

Originated From World: New Telon (1)
Chunk                : Khal (85)
Location             : -2433 -50516 1611

Re: Bug 53: Faction Commands (.faction) do...

Posted: Mon Dec 15, 2014 11:32 am
by Lokked
The Separator object uses the space as a separator. We either need to do away with the names and use IDs only (along with a lookup table for the user) or remove spaces and punctuation from the name and communicate this to content devs.

Re: Bug 53: Faction Commands (.faction) do...

Posted: Wed Dec 17, 2014 8:07 am
by John Adams
In EQ2, our Sep stuff allowed for quotations to encapsulate multi word strings. Does VGO's not do this? If not, it needs to. I'd like to get away from our current pattern of ID-only, I happen to like strings

Re: Bug 53: Faction Commands (.faction) do...

Posted: Wed Dec 17, 2014 10:58 am
by Lokked
Makes sense. I was thinking of another approach, where space-separated data would be scrunched together into 1 word (not in the DB, but when the list is created in memory from the DB records) and for certain commands using the Separator object, it would also squish words together.

I think it would be more flexible doing something with quotes. I don't know if the system currently does that (I don't know much about Separator except how to use it in Commands).

Re: Bug 53: Faction Commands (.faction) do...

Posted: Wed Dec 17, 2014 5:22 pm
by John Adams
Here's how EQ2 did it. Oddly, in Seperator.h (spelled wrong, Scatman loves that!)

Code: Select all

    Seperator(const char* message, char div = ' ', int16 in_maxargnum = 10, int16 arglen = 100, bool iObeyQuotes = false, char div2 = '\t', char div3 = 0, bool iSkipEmpty = true) {        int i;        argnum = 0;        msg = strdup(message);        this->maxargnum = in_maxargnum;        argplus = new const char *[maxargnum+1];        arg = new char *[maxargnum+1];        for (i=0; i<=maxargnum; i++) {            argplus[i]=arg[i] = new char[arglen+1];            memset(arg[i], 0, arglen+1);        }        int len = strlen(message);        int s = 0, l = 0;        bool inarg = (!iSkipEmpty || !(message[0] == div || message[0] == div2 || message[0] == div3));        bool inquote = (iObeyQuotes && (message[0] == '\"' || message[0] == '\''));        argplus[0] = message;        if (len == 0)            return;        for (i=0; i<len; i++) {//            cout << i << ": 0x" << hex << (int) message[i] << dec << " " << message[i] << endl;            if (inarg) {                if ((inquote == false && (message[i] == div || message[i] == div2 || message[i] == div3)) || (inquote && (message[i] == '\'' || message[i] == '\"') && (message[i+1] == div || message[i+1] == div2 || message[i+1] == div3 || message[i+1] == 0))) {                    inquote = false;                                        l = i-s;                                        if (l >= arglen)                        l = arglen;                    if (l){                        if(l > 1 && (argplus[argnum][0] == '\'' || argplus[argnum][0] == '\"')){                            l--;                            memcpy(arg[argnum], argplus[argnum]+1, l);                        }                        else                            memcpy(arg[argnum], argplus[argnum], l);                    }                    arg[argnum][l] = 0;                    argnum++;                    if (iSkipEmpty)                        inarg = false;                    else {                        s=i+1;                        argplus[argnum] = &message[s];                    }                }            }            else if (iObeyQuotes && (message[i] == '\"' || message[i] == '\'')) {                inquote = true;            }            else {                s = i;                argplus[argnum] = &message[s];                if (!(message[i] == div || message[i] == div2 || message[i] == div3)) {                    inarg = true;                }            }            if (argnum > maxargnum)                break;        }        if (inarg && argnum <= maxargnum) {            l = i-s;            if (l >= arglen)                l = arglen;            if (l)                memcpy(arg[argnum], argplus[argnum], l);        }    }]
The function was const char blah = sep->argplus[index]

example use:

Code: Select all

        else if (strncmp(command, "create", length) == 0 && sep->arg[1])         {            const char* guild_name = sep->argplus[0]; 
/guild create My Guild

No quotes, just anything from that index to the end of the command string was... arg PLUS everything after [index]


But I think if you use quotes, the arg becomes 1 arg. Like in /spawn create npc 1 1 50 'Fierce NPC Named Lokked'

Code: Select all

Syntax: /spawn create [spawn type] [race type] [class type] [level] [name] (difficulty) (size)

spawn->SetName(sep->arg[4])
arg[4] = the name in quotes

Hope this helps. No need to scrunch

Bug 53: (Lokked) Faction Commands (.faction) do... (Re-assigned)

Posted: Sun Jan 11, 2015 11:20 am
by BugTracker
Bug ID       : 53 - Faction Commands (.faction) do... (Re-assigned)
Bug Date     : 2014/11/22 02:21:17
Reassigned To: Lokked
Priority     : High

Category     : VGClient
Sub-Category : Other
Severity     : Standard
Reproducible : Every time
Details:
Faction Commands (.faction) does no work

.faction displays the syntax for using the command
.faction set Cyrcle 661 5000 does not work. ID 661 (or Rindol Field) was pulled from the Faction list on the DB Editor. Should set Rindol Field faction to 5000.
.faction set Cyrcle Rindol Field 5000 comes with the following error "Command Error: No such faction (Rindol)."
.faction set Cyrcle "Rindol Field" 5000 comes with nothing returned.
.faction get returns error "Command Error: internal error"

Originated From World: New Telon (1)
Chunk                : Khal (85)
Location             : -2433 -50516 1611

Re: Bug 53: (Lokked) Separator Issues

Posted: Sun Jan 11, 2015 11:21 am
by John Adams
Changed this to Lokked after our discussion above - also testing Bug Tracker's ability to post a Re-assignment

Bug 53: (Ratief) Faction Commands (.faction) do... (Re-assig

Posted: Wed Jan 21, 2015 7:29 pm
by BugTracker
Bug ID       : 53 - Faction Commands (.faction) do... (Re-assigned)
Bug Date     : 2014/11/22 02:21:17
Reassigned To: Ratief
Priority     : Medium

Category     : VGClient
Sub-Category : Other
Severity     : Standard
Reproducible : Every time
Details:
Faction Commands (.faction) does no work

.faction displays the syntax for using the command
.faction set Cyrcle 661 5000 does not work. ID 661 (or Rindol Field) was pulled from the Faction list on the DB Editor. Should set Rindol Field faction to 5000.
.faction set Cyrcle Rindol Field 5000 comes with the following error "Command Error: No such faction (Rindol)."
.faction set Cyrcle "Rindol Field" 5000 comes with nothing returned.
.faction get returns error "Command Error: internal error"

Originated From World: New Telon (1)
Chunk                : Khal (85)
Location             : -2433 -50516 1611

Re: Bug 53: (Lokked) Separator Issues

Posted: Wed Jan 21, 2015 9:53 pm
by Lokked
John, this is more of a Separator issue than Faction. It's a general issue with Commands. It can be assigned to me. The Subject Lines in this thread are confusing, lol. I'll change assignment.

Bug 53: (Lokked) Separate Issue (Re-assigned)

Posted: Wed Jan 21, 2015 9:54 pm
by BugTracker
Bug ID       : 53 - Separate Issue (Re-assigned)
Bug Date     : 2014/11/22 02:21:17
Reassigned To: Lokked
Priority     : Medium

Category     : VGClient
Sub-Category : Other
Severity     : Standard
Reproducible : Every time
Details:
Faction Commands (.faction) does no work

.faction displays the syntax for using the command
.faction set Cyrcle 661 5000 does not work. ID 661 (or Rindol Field) was pulled from the Faction list on the DB Editor. Should set Rindol Field faction to 5000.
.faction set Cyrcle Rindol Field 5000 comes with the following error "Command Error: No such faction (Rindol)."
.faction set Cyrcle "Rindol Field" 5000 comes with nothing returned.
.faction get returns error "Command Error: internal error"

Originated From World: New Telon (1)
Chunk                : Khal (85)
Location             : -2433 -50516 1611