Ver Fonte

Exe Updates

Image há 4 anos atrás
pai
commit
f0c58aff35

+ 2 - 0
EQ2/source/LoginServer/LWorld.cpp

@@ -402,6 +402,8 @@ bool LWorld::Process() {
 			else {
 				ServerLSInfo_Struct* lsi = (ServerLSInfo_Struct*) pack->pBuffer;
 				if (strcmp(lsi->protocolversion, EQEMU_PROTOCOL_VERSION) != 0 || !database.CheckVersion(lsi->serverversion)) {
+					cout << "ERROR - KICK BAD VERSION: Got versions: protocol: '" << lsi->protocolversion << "', database version: " << lsi->serverversion << endl;
+					cout << "To allow all world server versions to login, run query on your login database (alternatively replacing * with the database version if preferred): insert into login_versions set version = '*';" << endl;
 					this->Kick(ERROR_BADVERSION);
 					ret = false;
 					struct in_addr  in;

+ 2 - 2
EQ2/source/LoginServer/LoginDatabase.cpp

@@ -561,8 +561,8 @@ void LoginDatabase::UpdateRaceID(char* name){
 bool LoginDatabase::CheckVersion(char* in_version){
 	Query query;
 	query.escaped_data1 = getEscapeString(in_version);
-	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT id from login_versions where version='%s'", query.escaped_data1);
-	if(result && mysql_num_rows(result) == 1)
+	MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT id from login_versions where version='%s' or version='*'", query.escaped_data1);
+	if(result && mysql_num_rows(result) > 0)
 		return true;
 	else
 		return false;

+ 1 - 0
EQ2/source/WorldServer/Rules/Rules.cpp

@@ -294,6 +294,7 @@ RuleManager::RuleManager() {
 
 	RULE_INIT(R_Expansion, GlobalExpansionFlag, "0");
 
+	RULE_INIT(R_World, DatabaseVersion, "0");
 	#undef RULE_INIT
 }
 

+ 3 - 1
EQ2/source/WorldServer/Rules/Rules.h

@@ -161,7 +161,9 @@ enum RuleType {
 	WeatherTimer,
 	SpawnDeleteTimer,
 
-	GlobalExpansionFlag
+	GlobalExpansionFlag,
+
+	DatabaseVersion
 };
 
 class Rule {

+ 6 - 2
EQ2/source/WorldServer/WorldDatabase.cpp

@@ -45,6 +45,7 @@ along with EQ2Emulator.  If not, see <http://www.gnu.org/licenses/>.
 #include "Traits/Traits.h"
 #include "ClientPacketFunctions.h"
 #include "Zone/ChestTrap.h"
+#include "../common/version.h"
 
 extern Classes classes;
 extern Commands commands;
@@ -4499,11 +4500,14 @@ void WorldDatabase::SaveWorldTime(WorldTime* time){
 
 void WorldDatabase::SaveBugReport(const char* category, const char* subcategory, const char* causes_crash, const char* reproducible, const char* summary, const char* description, const char* version, const char* player, int32 account_id, const char* spawn_name, int32 spawn_id, int32 zone_id){
 	Query query;
-	string bug_report = string("insert into bugs (category, subcategory, causes_crash, reproducible, summary, description, version, player, account_id, spawn_name, spawn_id, zone_id) values('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %u, '%s', %u, %u)");
+
+	int32 dbVersion = rule_manager.GetGlobalRule(R_World, DatabaseVersion)->GetInt32();
+
+	string bug_report = string("insert into bugs (category, subcategory, causes_crash, reproducible, summary, description, version, player, account_id, spawn_name, spawn_id, zone_id, dbversion, worldversion) values('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %u, '%s', %u, %u, %u, '%s')");
 	query.RunQuery2(Q_INSERT, bug_report.c_str(), getSafeEscapeString(category).c_str(), getSafeEscapeString(subcategory).c_str(),
 		getSafeEscapeString(causes_crash).c_str(), getSafeEscapeString(reproducible).c_str(), getSafeEscapeString(summary).c_str(),
 		getSafeEscapeString(description).c_str(), getSafeEscapeString(version).c_str(), getSafeEscapeString(player).c_str(), account_id,
-		getSafeEscapeString(spawn_name).c_str(), spawn_id, zone_id);
+		getSafeEscapeString(spawn_name).c_str(), spawn_id, zone_id, dbVersion, CURRENT_VERSION);
 	FixBugReport();
 	FixBugReport();
 	FixBugReport();

+ 8 - 0
EQ2/source/common/version.h

@@ -34,7 +34,15 @@
 #else
 	#define EQ2EMU_MODULE	"EQ2EMu WorldServer"
 #endif
+
+#if defined(LOGIN)
+#define CURRENT_VERSION	"0.8.0-taurus2"
+#elif defined(WORLD)
+#define CURRENT_VERSION	"0.8.0-taurus2"
+#else
 #define CURRENT_VERSION	"0.7.3-dev"
+#endif
+
 #define COMPILE_DATE	__DATE__
 #define COMPILE_TIME	__TIME__
 #ifndef WIN32