… | |
… | |
121 | {"version", SC(VersionCmd) PF_IMMEDIATE }, |
121 | {"version", SC(VersionCmd) PF_IMMEDIATE }, |
122 | {"toggleextendedinfos", SC(ToggleExtendedInfos) PF_IMMEDIATE }, /*Added: tchize */ |
122 | {"toggleextendedinfos", SC(ToggleExtendedInfos) PF_IMMEDIATE }, /*Added: tchize */ |
123 | {"toggleextendedtext", SC(ToggleExtendedText) PF_IMMEDIATE }, /*Added: tchize */ |
123 | {"toggleextendedtext", SC(ToggleExtendedText) PF_IMMEDIATE }, /*Added: tchize */ |
124 | {"asksmooth", SC(AskSmooth) 0 }, /*Added: tchize (smoothing technologies) */ |
124 | {"asksmooth", SC(AskSmooth) 0 }, /*Added: tchize (smoothing technologies) */ |
125 | }; |
125 | }; |
126 | |
|
|
127 | /** |
|
|
128 | * RequestInfo is sort of a meta command. There is some specific |
|
|
129 | * request of information, but we call other functions to provide |
|
|
130 | * that information. |
|
|
131 | */ |
|
|
132 | void |
|
|
133 | RequestInfo (char *buf, int len, client_socket * ns) |
|
|
134 | { |
|
|
135 | char *params = NULL, *cp; |
|
|
136 | |
|
|
137 | /* No match */ |
|
|
138 | char bigbuf[MAX_BUF]; |
|
|
139 | int slen; |
|
|
140 | |
|
|
141 | /* Set up replyinfo before we modify any of the buffers - this is used |
|
|
142 | * if we don't find a match. |
|
|
143 | */ |
|
|
144 | strcpy (bigbuf, "replyinfo "); |
|
|
145 | slen = strlen (bigbuf); |
|
|
146 | safe_strcat (bigbuf, buf, &slen, MAX_BUF); |
|
|
147 | |
|
|
148 | /* find the first space, make it null, and update the |
|
|
149 | * params pointer. |
|
|
150 | */ |
|
|
151 | for (cp = buf; *cp != '\0'; cp++) |
|
|
152 | if (*cp == ' ') |
|
|
153 | { |
|
|
154 | *cp = '\0'; |
|
|
155 | params = cp + 1; |
|
|
156 | break; |
|
|
157 | } |
|
|
158 | |
|
|
159 | if (!strcmp (buf, "image_info")) |
|
|
160 | send_image_info (ns, params); |
|
|
161 | else if (!strcmp (buf, "image_sums")) |
|
|
162 | send_image_sums (ns, params); |
|
|
163 | else if (!strcmp (buf, "skill_info")) |
|
|
164 | send_skill_info (ns, params); |
|
|
165 | else if (!strcmp (buf, "spell_paths")) |
|
|
166 | send_spell_paths (ns, params); |
|
|
167 | else |
|
|
168 | ns->send_packet (bigbuf, len); |
|
|
169 | } |
|
|
170 | |
126 | |
171 | /** |
127 | /** |
172 | * Handle client input. |
128 | * Handle client input. |
173 | * |
129 | * |
174 | * HandleClient is actually not named really well - we only get here once |
130 | * HandleClient is actually not named really well - we only get here once |