This commit is contained in:
lenheart
2025-11-03 21:13:01 +08:00
parent 2ef9cfef42
commit 10de73a395
91 changed files with 2497 additions and 2329 deletions

View File

@@ -11,7 +11,9 @@ class Memory {
}
function allocUtf8String(Str) {
return NativePointer(Str_Ptr(Str));
local P = NativePointer(Str_Ptr(Str));
P.Size = Str.len();
return P;
}
function copy(P1, P2, Size) {
@@ -26,6 +28,8 @@ class Memory {
}
class NativePointer extends Base_C_Object {
//大小
Size = -1;
function _tyoeof()
{
@@ -35,6 +39,7 @@ class NativePointer extends Base_C_Object {
constructor(T) {
if (typeof T == "integer") {
base.constructor(Sq_New_Point(T));
Size = T;
//注册销毁伪析构
Register_Destruction(C_Object, this);
} else if (typeof T == "userdata") {

View File

@@ -9,6 +9,7 @@ class Script {
C_Object = null;
constructor(Path = "/home/neople/game/Script.pvf") {
if(getroottable().rawin("_Script_Data_"))return;
print("正在初始化PVF...");
local StartTime = time();

View File

@@ -40,6 +40,8 @@ function OnGatewaySocketConnect() {
foreach(value in OnGatewaySocketConnectFunc) {
value();
}
}
//网关包回调Map
if (!getroottable().rawin("GatewaySocketPackFuncMap")) GatewaySocketPackFuncMap <- {}

View File

@@ -242,6 +242,19 @@ class User extends Base_C_Object {
Pack.Delete();
}
//发送字节包
function SendBlob(Np) {
if(!Np || Np.Size == -1)return;
local Pack = Packet();
Pack.Put_Header(1, 131);
Pack.Put_Byte(1);
Pack.Put_Int(Np.Size);
Pack.Put_BinaryEx(Np.C_Object,Np.Size);
Pack.Finalize(true);
Send(Pack);
Pack.Delete();
}
//发送自定义DPS包
function Send_DPS_Pack(Id, Jso) {
Jso.op <- 2147483646;
@@ -781,7 +794,7 @@ function User::DropItem(ItemId, Xpos, Ypos) {
//角色类 发送邮件函数 (标题, 正文, 金币, 道具列表[[3037,100],[3038,100]])
function User::ReqDBSendMultiMail(title, text, gold, item_list) {
Timer.SetTimeOut(function(SUser,title, text, gold, item_list) {
Timer.SetTimeOut(function(SUser, title, text, gold, item_list) {
local Cid = SUser.GetCID();
// 获取分割后的道具列表
local subLists;
@@ -843,5 +856,5 @@ function User::ReqDBSendMultiMail(title, text, gold, item_list) {
Sq_CallFunc(S_Ptr("0x8556B68"), "int", ["pointer", "pointer", "int", "int", "int", "pointer", "int", "int", "int", "int"], title_ptr.C_Object, addition_slots.C_Object, subList.len(), gold, Cid, text_ptr.C_Object, text_len, 0, 99, 1);
}
}
}, 1,this,title, text, gold, item_list);
}, 1, this, title, text, gold, item_list);
}