Changeset 237
- Timestamp:
- 11/19/08 13:49:31 (17 years ago)
- Location:
- trunk/src
- Files:
-
- 7 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/DynamicObject.cpp
r233 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 … … 71 71 } 72 72 73 Set UInt32Value( OBJECT_FIELD_ENTRY, spellId);73 SetEntry(spellId); 74 74 SetFloatValue( OBJECT_FIELD_SCALE_X, 1 ); 75 75 SetUInt64Value( DYNAMICOBJECT_CASTER, caster->GetGUID() ); … … 154 154 bool DynamicObject::isVisibleForInState(Player const* u, bool inVisibleList) const 155 155 { 156 return IsInWorld() && u->IsInWorld() /*&& IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f))*/; 156 return IsInWorld() && u->IsInWorld() 157 && (IsWithinDistInMap(u,World::GetMaxVisibleDistanceForObject()+(inVisibleList ? World::GetVisibleObjectGreyDistance() : 0.0f)) 158 || GetCasterGUID() == u->GetGUID()); 157 159 } -
trunk/src/game/ObjectAccessor.cpp
r233 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 … … 613 613 (cell_min.y_coord <= p.y_coord && p.y_coord <= cell_max.y_coord) ) 614 614 return true; 615 616 615 } 617 616 -
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 -
trunk/src/trinitycore/Main.cpp
r102 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 … … 138 138 return 1; 139 139 } 140 141 140 sLog.outString("Using configuration file %s.", cfg_file); 142 141 -
trunk/src/trinitycore/Master.cpp
r149 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 … … 84 84 //DEBUG_LOG("anti-freeze: time=%u, counters=[%u; %u]",curtime,Master::m_masterLoopCounter,World::m_worldLoopCounter); 85 85 86 // There is no Master anymore 87 // TODO: clear the rest of the code 86 // There is no Master anymore 87 // TODO: clear the rest of the code 88 88 // // normal work 89 89 // if(m_loops != Master::m_masterLoopCounter) … … 92 92 // m_loops = Master::m_masterLoopCounter; 93 93 // } 94 // // possible freeze 94 // // possible freeze 95 95 // else if(getMSTimeDiff(m_lastchange,curtime) > _delaytime) 96 96 // { … … 105 105 w_loops = World::m_worldLoopCounter; 106 106 } 107 // possible freeze 107 // possible freeze 108 108 else if(getMSTimeDiff(w_lastchange,curtime) > _delaytime) 109 109 { … … 251 251 ZThread::Thread td1(new CliRunnable); 252 252 } 253 253 254 254 ZThread::Thread td2(new RARunnable); 255 255 … … 329 329 330 330 sWorldSocketMgr->Wait (); 331 331 332 332 // set server offline 333 333 loginDatabase.PExecute("UPDATE realmlist SET color = 2 WHERE id = '%d'",realmID); … … 340 340 t.wait(); 341 341 td2.wait (); 342 342 343 343 ///- Clean database before leaving 344 344 clearOnlineAccounts(); … … 460 460 sWorld.LoadDBVersion(); 461 461 462 462 sLog.outString("Using %s", sWorld.GetDBVersion()); 463 463 return true; 464 464 } … … 472 472 "UPDATE account SET online = 0 WHERE online > 0 " 473 473 "AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')",realmID); 474 474 475 475 476 476 CharacterDatabase.Execute("UPDATE characters SET online = 0"); -
trunk/src/trinitycore/RASocket.cpp
r149 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 … … 198 198 199 199 QueryResult *check = loginDatabase.PQuery( 200 201 200 "SELECT 1 FROM account WHERE username = '%s' AND sha_pass_hash=SHA1(CONCAT(username,':','%s'))", 201 login.c_str(), pw.c_str()); 202 202 203 203 if(check) … … 245 245 #ifdef RA_CRYPT 246 246 247 247 char *megabuffer=strdup(szText); 248 248 unsigned int sz=strlen(megabuffer); 249 249 Encrypt(megabuffer,sz); 250 250 send(r,megabuffer,sz,0); 251 251 delete [] megabuffer; 252 253 252 253 #else 254 254 255 255 unsigned int sz=strlen(szText); -
trunk/src/trinitycore/WorldRunnable.cpp
r102 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 … … 78 78 sWorld.KickAll(); // save and kick all players 79 79 sWorld.UpdateSessions( 1 ); // real players unload required UpdateSessions call 80 80 81 81 sWorldSocketMgr->StopNetwork(); 82 82