Moin,
meine Datenbank läuft soweit lokal auf meinem PC. Allerdings auf Linux funktioniert meine Datenbank nicht
Code
/home/statelife/gameserver/node_modules/mysql/lib/protocol/Parser.js:437
throw err; // Rethrow non-MySQL errors
^
TypeError: Cannot read property 'SocialClub' of undefined
at Query.<anonymous> (file:///home/statelife/gameserver/resources/statelife/server/AccountVerify/AccountVerify.mjs:12:27)
at Query.<anonymous> (/home/statelife/gameserver/node_modules/mysql/lib/Connection.js:525:10)
at Query._callback (/home/statelife/gameserver/node_modules/mysql/lib/Connection.js:491:16)
at Query.Sequence.end (/home/statelife/gameserver/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query._handleFinalResultPacket (/home/statelife/gameserver/node_modules/mysql/lib/protocol/sequences/Query.js:139:8)
at Query.EofPacket (/home/statelife/gameserver/node_modules/mysql/lib/protocol/sequences/Query.js:123:8)
at Protocol._parsePacket (/home/statelife/gameserver/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/home/statelife/gameserver/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/home/statelife/gameserver/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/home/statelife/gameserver/node_modules/mysql/lib/protocol/Protocol.js:38:16)
Alles anzeigen
Code
alt.onClient('AccountVerify', (player) => {
console.log("Wird aufgerufen!");
pool.getConnection(function(err, con) {
if(err) throw err;
var sql = mysql.format('SELECT SocialClub FROM accounts');
con.query(sql, function(error, results, fields) {
if(results[0].SocialClub == player.socialId) {
//Login
alt.emitClient(player, 'AccountVerifyLogin');
} else if(results[0].SocialClub != player.socialId) {
//Register
alt.emitClient(player, 'AccountVerifyRegister');
}
con.release();
if(error) throw error;
});
});
});
Alles anzeigen