Bug 53: (Lokked) Separator Issues
Moderators: Community Managers, Developers
-
- Posts: 810
- Joined: Wed Aug 28, 2013 9:40 am
Bug 53: (Lokked) Separator Issues
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 timeDetails:
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...
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.
- John Adams
- Retired
- Posts: 4581
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: Bug 53: Faction Commands (.faction) do...
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...
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).
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).
- John Adams
- Retired
- Posts: 4581
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: Bug 53: Faction Commands (.faction) do...
Here's how EQ2 did it. Oddly, in Seperator.h (spelled wrong, Scatman loves that!)
The function was const char blah = sep->argplus[index]
example use:
/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'
arg[4] = the name in quotes
Hope this helps. No need to scrunch
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); } }]
example use:
Code: Select all
else if (strncmp(command, "create", length) == 0 && sep->arg[1]) { const char* guild_name = sep->argplus[0];
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])
Hope this helps. No need to scrunch
-
- Posts: 810
- Joined: Wed Aug 28, 2013 9:40 am
Bug 53: (Lokked) Faction Commands (.faction) do... (Re-assigned)
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 timeDetails:
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
- John Adams
- Retired
- Posts: 4581
- Joined: Wed Aug 28, 2013 9:40 am
- Location: Phoenix, AZ.
- Contact:
Re: Bug 53: (Lokked) Separator Issues
Changed this to Lokked after our discussion above - also testing Bug Tracker's ability to post a Re-assignment
-
- Posts: 810
- Joined: Wed Aug 28, 2013 9:40 am
Bug 53: (Ratief) Faction Commands (.faction) do... (Re-assig
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 timeDetails:
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
Last edited by John Adams on Wed Jan 21, 2015 7:30 pm, edited 1 time in total.
Reason: No idea why this was assigned to Lokked; Faction is Ratief's code
Reason: No idea why this was assigned to Lokked; Faction is Ratief's code
Re: Bug 53: (Lokked) Separator Issues
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.
-
- Posts: 810
- Joined: Wed Aug 28, 2013 9:40 am
Bug 53: (Lokked) Separate Issue (Re-assigned)
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 timeDetails:
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