1.3基础

This commit is contained in:
2026-02-27 15:40:20 +08:00
parent 616a254c31
commit b2881499c6
9 changed files with 121 additions and 27 deletions

View File

@@ -18,6 +18,7 @@ _Hook_Register_Currency_Func_("0x08894782", ["pointer", "int", "pointer"], Cb_It
class EquipmentExpandC {
MysqlObject = null;
@@ -28,7 +29,7 @@ class EquipmentExpandC {
local check_table_sql = "SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'equip_only_id';"
local Ret = MysqlObject.Select(check_table_sql, ["int"]);
if (Ret.len() == 0 || Ret[0][0] == null) {
if (Ret.len() == 0 || Ret[0][0] == 0) {
local sql = "CREATE TABLE equip_only_id (id INT(11) NOT NULL AUTO_INCREMENT COMMENT '32位自增唯一ID初始值10000', PRIMARY KEY (id)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT '纯自增ID表' AUTO_INCREMENT=10000;";
MysqlObject.Exec_Sql(sql);
}
@@ -36,7 +37,7 @@ class EquipmentExpandC {
//HOOKServerId生成uuid
Cb_ItemGloballyUniqueIdentifier_t_SetServerId_Enter_Func["_装备拓展_"] <- function(args) {
args[1] = GenerateUUID();
print("赋予唯一id " + args[1]);
// print("赋予唯一id " + args[1]);
return args;
}.bindenv(this);
@@ -54,17 +55,17 @@ class EquipmentExpandC {
// // Pack.Put_BinaryEx(DB_JewelSocketData.C_Object, 30);
// }.bindenv(this);
// //额外数据包,发送装备数据给本地处理
// Cb_InterfacePacketBuf_put_packet_Leave_Func["_装备拓展_"] <- function(args) {
// local Inven_Item = NativePointer(args[1]);
// if (Inven_Item.add(1).readU8() == 1) {
// local Uuid = Inven_Item.add(21).readInt();
// print("uuid: " + Uuid);
// local Pack = Packet(args[0]);
// print("包位置: " + Pack.GetPos());
// // Pack.Put_BinaryEx(JewelSocketData.C_Object, 30);
// }
// }.bindenv(this);
//额外数据包,发送装备数据给本地处理
Cb_InterfacePacketBuf_put_packet_Leave_Func["_装备拓展_"] <- function(args) {
local Inven_Item = NativePointer(args[1]);
if (Inven_Item.add(1).readU8() == 1) {
local Uuid = Inven_Item.add(21).readInt();
if (Uuid< 10000) {
local uuid = GenerateUUID();
Inven_Item.add(21).writeInt(uuid);
}
}
}.bindenv(this);
}
function GenerateUUID() {
@@ -86,7 +87,6 @@ class EquipmentExpandC {
}
Timer.SetTimeOut(function() {
getroottable()._EquipmentExpand_ <- EquipmentExpandC();