Changeset 237 for trunk/src/trinitycore/CliRunnable.cpp
- Timestamp:
- 11/19/08 13:49:31 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/trinitycore/CliRunnable.cpp
r112 r237 11 11 * This program is distributed in the hope that it will be useful, 12 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 * GNU General Public License for more details. 15 15 * 16 16 * You should have received a copy of the GNU General Public License 17 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307USA18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 19 */ 20 20 … … 52 52 printf(temp_buf); 53 53 #else 54 54 printf(str); 55 55 #endif 56 56 } … … 119 119 } 120 120 121 121 return true; 122 122 } 123 123 … … 127 127 return false; 128 128 129 129 char *character_name_str = strtok((char*)args," "); 130 130 if(!character_name_str) 131 131 return false; 132 132 133 133 std::string character_name = character_name_str; 134 134 if(!normalizePlayerName(character_name)) 135 135 return false; 136 136 137 137 uint64 character_guid; 138 138 uint32 account_id; 139 139 140 140 Player *player = objmgr.GetPlayer(character_name.c_str()); 141 141 if(player) 142 142 { … … 158 158 } 159 159 160 160 std::string account_name; 161 161 accmgr.GetName (account_id,account_name); 162 162 163 Player::DeleteFromDB(character_guid, account_id, true); 163 Player::DeleteFromDB(character_guid, account_id, true); 164 164 PSendSysMessage(LANG_CHARACTER_DELETED,character_name.c_str(),GUID_LOPART(character_guid),account_name.c_str(), account_id); 165 165 return true; … … 171 171 SendSysMessage(LANG_COMMAND_EXIT); 172 172 World::m_stopEvent = true; 173 173 return true; 174 174 } 175 175 … … 228 228 char *szPassword = strtok(NULL, " "); 229 229 if(!szAcc || !szPassword) 230 230 return false; 231 231 232 232 // normilized in accmgr.CreateAccount … … 257 257 return false; 258 258 } 259 260 259 260 return true; 261 261 } 262 262 … … 269 269 char *NewLevel = strtok((char*)args, " "); 270 270 if (!NewLevel) 271 271 return false; 272 272 273 273 sLog.SetLogLevel(NewLevel); 274 274 return true; 275 275 } 276 276 … … 326 326 for(int x=0;command_str[x];x++) 327 327 if(command_str[x]=='\r'||command_str[x]=='\n') 328 { 329 command_str[x]=0; 330 break; 331 } 332 333 if(!*command_str) 328 { 329 command_str[x]=0; 330 break; 331 } 332 333 334 if(!*command_str) 334 335 { 335 336 printf("TC>"); … … 347 348 } 348 349 else if (feof(stdin)) 350 { 349 351 World::m_stopEvent = true; 352 } 350 353 } 351 354