Welcome to the Builder Academy

Question MSDP Inventory

More
04 Jan 2018 07:56 - 04 Jan 2018 07:57 #7294 by zusuk
Replied by zusuk on topic MSDP Inventory
I -think- you will run into issues if someone uses color in your objects, or whatever is being handled by protocol. If you do run into trouble, we wrote strip_colors() as a simple way to get rid of colors from a string:

Code:
/* so it turns out that write_to_descriptor can't handle protocol info * so i made this simple function to strip color codes -zusuk */ void strip_colors(char *str) { char *p = str; char *n = str; while (p && *p) { if (*p == '@') { if (*(p + 1) != '@') { p += 2; } else { p++; *n++ = *p++; } } else if (*p == '\t') { if (*(p + 1) != '\t') { p += 2; } else { p++; *n++ = *p++; } } else { *n++ = *p++; } } *n = '\0'; }

Could be a non-issue for you, since we are a mix of code bases.

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100
Last edit: 04 Jan 2018 07:57 by zusuk.

Please Log in or Create an account to join the conversation.

Time to create page: 0.193 seconds