1111
This commit is contained in:
parent
9d84fe256d
commit
4d65103501
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"Codegeex.RepoIndex": true
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
/*
|
||||||
|
文件名:BigInt.nut
|
||||||
|
路径:Dps_A/BaseClass/BigInt/BigInt.nut
|
||||||
|
创建日期:2025-03-25 18:28
|
||||||
|
文件用途:大数字类
|
||||||
|
*/
|
||||||
|
|
@ -57,3 +57,65 @@ class BlobEx extends blob {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class blobex extends blob {
|
||||||
|
|
||||||
|
//-----------------Metamethods--------------------//
|
||||||
|
function _typeof() {
|
||||||
|
return "blobex";
|
||||||
|
}
|
||||||
|
//-----------------Metamethods--------------------//
|
||||||
|
|
||||||
|
constructor(arg) {
|
||||||
|
//通过blob构造
|
||||||
|
if (typeof arg == "blob") {
|
||||||
|
base.constructor(arg.len());
|
||||||
|
writeblob(arg);
|
||||||
|
}
|
||||||
|
//直接构造
|
||||||
|
else {
|
||||||
|
base.constructor(arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeblob(B) {
|
||||||
|
base.writeblob(B);
|
||||||
|
seek(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetUShort() {
|
||||||
|
return readn('w');
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetShort() {
|
||||||
|
return readn('s');
|
||||||
|
}
|
||||||
|
|
||||||
|
function charPtrToInt(arr) {
|
||||||
|
local value = ((arr[0]) << 0) |
|
||||||
|
((arr[1]) << 8) |
|
||||||
|
((arr[2]) << 16) |
|
||||||
|
((arr[3]) << 24);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetInt() {
|
||||||
|
local CurTPos = tell();
|
||||||
|
local Ret = charPtrToInt([this[CurTPos], this[CurTPos + 1], this[CurTPos + 2], this[CurTPos + 3]]);
|
||||||
|
seek(4, 'c');
|
||||||
|
return Ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get256() {
|
||||||
|
local Buf = readn('c');
|
||||||
|
return (256.0 + Buf.tofloat()) % 256.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetFloat() {
|
||||||
|
return readn('f');
|
||||||
|
}
|
||||||
|
|
||||||
|
function GetString(count) {
|
||||||
|
return stream_myreadstring(count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -94,6 +94,22 @@ class GameManager extends Base_C_Object {
|
||||||
_AvatarUseJewel_Object <- AvatarUseJewel();
|
_AvatarUseJewel_Object <- AvatarUseJewel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//开启装备镶嵌
|
||||||
|
function FixEquipUseJewel() {
|
||||||
|
//装备镶嵌修复
|
||||||
|
_EquimentUseJewel_Object <- EquimentUseJewel();
|
||||||
|
}
|
||||||
|
|
||||||
|
//修复14技能
|
||||||
|
function Fix14Skill() {
|
||||||
|
Sq_WriteByteArr(S_Ptr("0x08604B1E"), [0x83, 0x7D, 0xEC, 0x07]);
|
||||||
|
Sq_WriteByteArr(S_Ptr("0x08604B8C"), [0xC7, 0x45, 0xE4, 0x08, 0x00, 0x00, 0x00]);
|
||||||
|
Sq_WriteByteArr(S_Ptr("0x08604A09"), [0x83, 0x7D, 0x0C, 0x07]);
|
||||||
|
Sq_WriteByteArr(S_Ptr("0x086050b1"), [0xC7, 0x45, 0xEC, 0x08, 0x00, 0x00, 0x00]);
|
||||||
|
Sq_WriteByteArr(S_Ptr("0x0860511c"), [0xC7, 0x45, 0xE8, 0x08, 0x00, 0x00, 0x00]);
|
||||||
|
Sq_WriteByteArr(S_Ptr("0x08608D7B"), [0x83, 0xF8, 0x0B]);
|
||||||
|
}
|
||||||
|
|
||||||
//修复下线卡城镇
|
//修复下线卡城镇
|
||||||
function FixSaveTown() {
|
function FixSaveTown() {
|
||||||
Cb_Set_Charac_Info_Detail_Enter_Func._FixSaveTown_ <- function(arg) {
|
Cb_Set_Charac_Info_Detail_Enter_Func._FixSaveTown_ <- function(arg) {
|
||||||
|
|
@ -158,6 +174,31 @@ class GameManager extends Base_C_Object {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//副本可丢弃品级 传入一个值 3为神器
|
||||||
|
function FixDungeonDropGrade(Level) {
|
||||||
|
NativePointer("0x085A69F2").writeS8(Level);
|
||||||
|
}
|
||||||
|
|
||||||
|
//邮件去除验证
|
||||||
|
function FixEmailRemovalVerification() {
|
||||||
|
//修改独立掉落原逻辑为不掉落
|
||||||
|
local HexCode = Haker.AsmGenerateMcd(
|
||||||
|
"mov eax, 0x0",
|
||||||
|
"ret");
|
||||||
|
Sq_WriteByteArr(S_Ptr("0x0868A51A"), HexCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
//修复拍卖行消耗品上架,设置最大总价,建议值2E
|
||||||
|
function Fix_Auction_Regist_Item() {
|
||||||
|
Haker.LoadHook("0x08213E40", ["int", "int", "bool"],
|
||||||
|
function(args) {
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
function(args) {
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//热重载
|
//热重载
|
||||||
function _Reload_List_Write_(Path) {
|
function _Reload_List_Write_(Path) {
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,18 @@
|
||||||
class _Hacker {
|
class _Hacker {
|
||||||
HookTable = null;
|
HookTable = null;
|
||||||
|
|
||||||
|
HookJumpMemoryTable = null;
|
||||||
|
|
||||||
|
__strtol__function__address__ = null;
|
||||||
|
|
||||||
|
NextReturnAddress = null;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
HookTable = {};
|
HookTable = {};
|
||||||
|
HookJumpMemoryTable = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function UnLoadHook(AddressStr) {
|
function UnLoadHook(AddressStr) {
|
||||||
Sq_DeHookFunc(HookTable[AddressStr]);
|
Sq_DeHookFunc(HookTable[AddressStr]);
|
||||||
}
|
}
|
||||||
|
|
@ -23,9 +31,57 @@ class _Hacker {
|
||||||
}
|
}
|
||||||
|
|
||||||
local Controler = Sq_HookFunc(S_Ptr(AddressStr), ArgumentArr, EnterFunc, LeaveFunc);
|
local Controler = Sq_HookFunc(S_Ptr(AddressStr), ArgumentArr, EnterFunc, LeaveFunc);
|
||||||
print(Controler);
|
|
||||||
HookTable.rawset(AddressStr, Controler);
|
HookTable.rawset(AddressStr, Controler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function HexStringToInt(Str) {
|
||||||
|
if (!__strtol__function__address__) __strtol__function__address__ = Module.getExportByName(null, "strtol");
|
||||||
|
local Ret = Sq_CallFunc(__strtol__function__address__, "int", ["pointer", "pointer", "int"], Memory.allocUtf8String(Str).C_Object, Memory.alloc(0), 16);
|
||||||
|
return Ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
function AsmGenerateMcd(...) {
|
||||||
|
local CodeArr = [];
|
||||||
|
local CurCode = "";
|
||||||
|
try {
|
||||||
|
foreach(Str in vargv) {
|
||||||
|
CurCode = Str;
|
||||||
|
local Code = Sq_Asmjit_Compile(Str);
|
||||||
|
CodeArr.extend(Code);
|
||||||
|
}
|
||||||
|
} catch (exception) {
|
||||||
|
error("汇编代码有误,错误行: " + CurCode);
|
||||||
|
}
|
||||||
|
return CodeArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
function InsertCode(Address, Code) {
|
||||||
|
//置入代码的大小
|
||||||
|
local CodeSize = Code.len();
|
||||||
|
//申请一块内存
|
||||||
|
local MemBuffer = Memory.alloc(CodeSize);
|
||||||
|
//记录
|
||||||
|
HookJumpMemoryTable.rawset(Address, MemBuffer);
|
||||||
|
//写入置入的代码
|
||||||
|
MemBuffer.writeByteArray(Code);
|
||||||
|
|
||||||
|
//计算偏移
|
||||||
|
local Offset = Sq_PointerOperationPointer(MemBuffer.C_Object, Sq_PointerOperation(S_Ptr(Address), 5, "+"), "-");
|
||||||
|
local Str = "" + Offset;
|
||||||
|
Str = Str.slice(Str.find("0x") + 4, -1);
|
||||||
|
local JumpCodeArr = [0xE9];
|
||||||
|
for (local i = 0; i< 4; i++) {
|
||||||
|
local Index = -2 * (i + 1);
|
||||||
|
local StrBuffer = "0x" + (Str.slice(Index).slice(0, 2));
|
||||||
|
JumpCodeArr.push(HexStringToInt(StrBuffer));
|
||||||
|
}
|
||||||
|
Sq_WriteByteArr(S_Ptr(Address), JumpCodeArr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function _Haker_SetNextReturnAddress(Address) {
|
||||||
|
Haker.NextReturnAddress = "" + Address;
|
||||||
}
|
}
|
||||||
//初始化Hacker
|
//初始化Hacker
|
||||||
Haker <- _Hacker();
|
Haker <- _Hacker();
|
||||||
|
|
@ -14,26 +14,276 @@ class Http {
|
||||||
Service = service;
|
Service = service;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 辅助函数:将参数表编码为 URL 编码字符串
|
||||||
|
function _EncodeParams(params) {
|
||||||
|
local encoded = "";
|
||||||
|
foreach(key, value in params) {
|
||||||
|
if (encoded.len() > 0) encoded += "&";
|
||||||
|
encoded += key + "=" + value; // 需要实现 urlencode
|
||||||
|
}
|
||||||
|
return encoded;
|
||||||
|
}
|
||||||
|
|
||||||
function Request(Type, Url, Content) {
|
function Request(Type, Url, Content) {
|
||||||
local Request = Type + " " + Url + " HTTP/1.1\r\nHost: " + Host + "\r\n";
|
local RequestBuffer = Type + " " + Url + " HTTP/1.1\r\nHost: " + Host + "\r\n";
|
||||||
|
|
||||||
if (Content) {
|
if (Content) {
|
||||||
Request += "Content-Length: " + Content.len() + "\r\n";
|
RequestBuffer += "Content-Length: " + Content.len() + "\r\n";
|
||||||
Request += "Content-Type: application/x-www-form-urlencoded\r\n";
|
RequestBuffer += "Content-Type: application/x-www-form-urlencoded\r\n";
|
||||||
Request += "\r\n";
|
RequestBuffer += "\r\n";
|
||||||
Request += Content;
|
RequestBuffer += Content;
|
||||||
} else {
|
} else {
|
||||||
Request += "Connection: close\r\n\r\n";
|
RequestBuffer += "Connection: close\r\n\r\n";
|
||||||
}
|
}
|
||||||
return Sq_CreateHttp(Host, Service, Request);
|
return Sq_CreateHttp(Host, Service, RequestBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 发送请求
|
// 发送请求
|
||||||
function Post(Url, Content = null) {
|
function Post(Url, params = null) {
|
||||||
return Request("POST", Url, Content);
|
local content = null;
|
||||||
|
if (params != null && typeof params == "table") {
|
||||||
|
content = _EncodeParams(params); // 编码参数
|
||||||
|
}
|
||||||
|
return Request("POST", Url, content);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get(Url, Content = null) {
|
function Get(Url, Content = null) {
|
||||||
return Request("GET", Url, Content);
|
return Request("GET", Url, Content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function xorEncryptDecrypt(BlobObj, Key) {
|
||||||
|
local Arr = [];
|
||||||
|
for (local i = 0; i< BlobObj.len(); i++) {
|
||||||
|
local currentKeyChar = Key[i % Key.len()];
|
||||||
|
Arr.push(BlobObj[i] ^ currentKeyChar);
|
||||||
|
}
|
||||||
|
return Arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
function base64_encode(input) {
|
||||||
|
local base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
local inputLength = input.len();
|
||||||
|
local i = 0;
|
||||||
|
local j = 0;
|
||||||
|
local charArray3 = array(3);
|
||||||
|
local charArray4 = array(4);
|
||||||
|
local encoded = "";
|
||||||
|
|
||||||
|
while (inputLength--) {
|
||||||
|
charArray3[i++] = input[inputLength];
|
||||||
|
if (i == 3) {
|
||||||
|
charArray4[0] = (charArray3[0] & 0xfc) >> 2;
|
||||||
|
charArray4[1] = ((charArray3[0] & 0x03) << 4) + ((charArray3[1] & 0xf0) >> 4);
|
||||||
|
charArray4[2] = ((charArray3[1] & 0x0f) << 2) + ((charArray3[2] & 0xc0) >> 6);
|
||||||
|
charArray4[3] = charArray3[2] & 0x3f;
|
||||||
|
|
||||||
|
for (i = 0; i< 4; i++) {
|
||||||
|
encoded += base64_chars.slice(charArray4[i], charArray4[i] + 1);
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i) {
|
||||||
|
for (j = i; j< 3; j++) {
|
||||||
|
charArray3[j] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
charArray4[0] = (charArray3[0] & 0xfc) >> 2;
|
||||||
|
charArray4[1] = ((charArray3[0] & 0x03) << 4) + ((charArray3[1] & 0xf0) >> 4);
|
||||||
|
charArray4[2] = ((charArray3[1] & 0x0f) << 2) + ((charArray3[2] & 0xc0) >> 6);
|
||||||
|
charArray4[3] = charArray3[2] & 0x3f;
|
||||||
|
|
||||||
|
for (j = 0; j< i + 1; j++) {
|
||||||
|
encoded += base64_chars.slice(charArray4[j], charArray4[j] + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
while (i++<3) {
|
||||||
|
encoded += "=";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return encoded;
|
||||||
|
}
|
||||||
|
|
||||||
|
function AsciiToStr(code) {
|
||||||
|
local str = Memory.alloc(1);
|
||||||
|
str.writeS8(code);
|
||||||
|
return str.readUtf8String();
|
||||||
|
}
|
||||||
|
|
||||||
|
function base64_decode(input) {
|
||||||
|
local base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
local base64_map = {};
|
||||||
|
for (local i = 0; i< base64_chars.len(); i++) {
|
||||||
|
local key = base64_chars.slice(i, i + 1);
|
||||||
|
if (key != "=") {
|
||||||
|
base64_map[key] <- i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
local inputLength = input.len();
|
||||||
|
local i = 0;
|
||||||
|
local j = 0;
|
||||||
|
local charArray4 = array(4);
|
||||||
|
local charArray3 = array(3);
|
||||||
|
local decoded = [];
|
||||||
|
|
||||||
|
while (inputLength--) {
|
||||||
|
if (input.slice(i, i + 1) == "=") {
|
||||||
|
charArray4[j++] = 0;
|
||||||
|
} else {
|
||||||
|
charArray4[j++] = base64_map[input.slice(i, i + 1)];
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
if (j == 4) {
|
||||||
|
charArray3[0] = (charArray4[0] << 2) + ((charArray4[1] & 0x30) >> 4);
|
||||||
|
charArray3[1] = ((charArray4[1] & 0xf) << 4) + ((charArray4[2] & 0x3c) >> 2);
|
||||||
|
charArray3[2] = ((charArray4[2] & 0x3) << 6) + charArray4[3];
|
||||||
|
|
||||||
|
for (j = 0; j< 3; j++) {
|
||||||
|
decoded.push(charArray3[j]);
|
||||||
|
}
|
||||||
|
j = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j) {
|
||||||
|
for (local k = j; k< 4; k++) {
|
||||||
|
charArray4[k] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
charArray3[0] = (charArray4[0] << 2) + ((charArray4[1] & 0x30) >> 4);
|
||||||
|
charArray3[1] = ((charArray4[1] & 0xf) << 4) + ((charArray4[2] & 0x3c) >> 2);
|
||||||
|
charArray3[2] = ((charArray4[2] & 0x3) << 6) + charArray4[3];
|
||||||
|
|
||||||
|
for (local k = 0; k< j - 1; k++) {
|
||||||
|
decoded.push(charArray3[k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
local ret = decoded.reverse();
|
||||||
|
ret.remove(0);
|
||||||
|
ret.push(0);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function GetMyIp() {
|
||||||
|
local Hb = Http("tnedi.me");
|
||||||
|
return Hb.Get("/");
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateRandomString(length) {
|
||||||
|
local alphabet = "abcdefghijklmnopqrstuvwxyz";
|
||||||
|
local result = "";
|
||||||
|
for (local i = 0; i< length; i++) {
|
||||||
|
local randomIndex = math.random(0, alphabet.len() - 1);
|
||||||
|
result += alphabet.get(randomIndex);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Blend(str1, str2) {
|
||||||
|
local alphabet = "abcdefghijklmnopqrstuvwxyz";
|
||||||
|
local result = "";
|
||||||
|
local len = MathClass.getMin(str1.len(), str2.len());
|
||||||
|
for (local i = 0; i< len; i++) {
|
||||||
|
print((str1[i].tointeger() % alphabet.len()) - 1);
|
||||||
|
result += alphabet.slice((str1[i].tointeger() % alphabet.len()), (str1[i].tointeger() % alphabet.len()) + 1) + str2[i];
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Encode(Str, Key = [9, 4, 7, 3, 3, 0, 6, 7, 0]) {
|
||||||
|
local StrPointer = Memory.allocUtf8String(Str);
|
||||||
|
local BlobObj = StrPointer.readBinary(Str.len());
|
||||||
|
local str = "";
|
||||||
|
for (local i = 0; i< BlobObj.len(); i++) {
|
||||||
|
str += BlobObj[i].tostring();
|
||||||
|
str += ","
|
||||||
|
}
|
||||||
|
print(str)
|
||||||
|
// printT(BlobObj);
|
||||||
|
local Arr = xorEncryptDecrypt(BlobObj, Key);
|
||||||
|
local encodestr = base64_encode(Arr);
|
||||||
|
return encodestr;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Decode(Str, Key = [9, 4, 7, 3, 3, 0, 6, 7, 0]) {
|
||||||
|
local StrArr = base64_decode(Str);
|
||||||
|
local Arr = xorEncryptDecrypt(StrArr, Key);
|
||||||
|
local str = "";
|
||||||
|
for (local i = 0; i< Arr.len(); i++) {
|
||||||
|
str += Arr[i].tostring();
|
||||||
|
str += ","
|
||||||
|
}
|
||||||
|
print(str)
|
||||||
|
local StrPointer = Memory.alloc(Arr.len());
|
||||||
|
StrPointer.writeByteArray(Arr);
|
||||||
|
local decodestr = StrPointer.readUtf8String(Arr.len());
|
||||||
|
return decodestr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class HttpResponse {
|
||||||
|
C_Object = null;
|
||||||
|
constructor(obj) {
|
||||||
|
C_Object = obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Write(Msg) {
|
||||||
|
local response = "HTTP/1.1 200 OK\r\n";
|
||||||
|
if (typeof Msg == "table") {
|
||||||
|
response += "Content-Type: application/json\r\n";
|
||||||
|
local JsonString = Json.Encode(Msg);
|
||||||
|
response += "Content-Length: " + JsonString.len() + "\r\n";
|
||||||
|
response += "\r\n";
|
||||||
|
response += JsonString;
|
||||||
|
}
|
||||||
|
else if(typeof Msg == "string") {
|
||||||
|
response += "Content-Type: text/plain\r\n";
|
||||||
|
response += "Content-Length: " + Msg.len() + "\r\n";
|
||||||
|
response += "\r\n";
|
||||||
|
response += Msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
Sq_HttpServerResponse_Write(C_Object, response);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class HttpServer {
|
||||||
|
|
||||||
|
Host = null;
|
||||||
|
Service = null;
|
||||||
|
|
||||||
|
//处理函数
|
||||||
|
Handler = null;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(host, service = "80") {
|
||||||
|
Host = host;
|
||||||
|
Service = service;
|
||||||
|
|
||||||
|
getroottable()["HttpServer_" + Host + "_" + Service] <- this;
|
||||||
|
}
|
||||||
|
|
||||||
|
function Listen(Func) {
|
||||||
|
//记录处理函数
|
||||||
|
Handler = Func;
|
||||||
|
|
||||||
|
local success = Sq_CreateHttpServer(Host, Service, this);
|
||||||
|
if (success) {
|
||||||
|
::print("Server started successfully.");
|
||||||
|
} else {
|
||||||
|
::print("Failed to start server.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Event(SocketObject, Msg) {
|
||||||
|
Timer.SetTimeOut(Handler, 1, HttpResponse(SocketObject), Msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -35,6 +35,26 @@ class Inven extends Base_C_Object {
|
||||||
|
|
||||||
//检查背包是否拥有指定数量的指定道具
|
//检查背包是否拥有指定数量的指定道具
|
||||||
function CheckItemCount(ItemId, ItemCount) {
|
function CheckItemCount(ItemId, ItemCount) {
|
||||||
|
if (ItemId == 0) {
|
||||||
|
//检查金币
|
||||||
|
local Money = Sq_CallFunc(S_Ptr("0x817a188"), "int", ["pointer"], SUser.C_Object);
|
||||||
|
if (Money >= ItemCount) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ItemId == -1) {
|
||||||
|
//检查点券
|
||||||
|
if (SUser.GetCera() >= ItemCount) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ItemId == -2) {
|
||||||
|
//检查代币券
|
||||||
|
if (SUser.GetCeraPoint() >= ItemCount) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
local SlotIdx = GetSlotById(ItemId);
|
local SlotIdx = GetSlotById(ItemId);
|
||||||
if (SlotIdx != -1) {
|
if (SlotIdx != -1) {
|
||||||
local SlotItem = GetSlot(1, SlotIdx);
|
local SlotItem = GetSlot(1, SlotIdx);
|
||||||
|
|
@ -56,6 +76,8 @@ class Inven extends Base_C_Object {
|
||||||
return Flag;
|
return Flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//销毁背包中指定表的道具及数量
|
//销毁背包中指定表的道具及数量
|
||||||
function DeleteArrItemCount(T) {
|
function DeleteArrItemCount(T) {
|
||||||
foreach(value in T) {
|
foreach(value in T) {
|
||||||
|
|
@ -67,6 +89,22 @@ class Inven extends Base_C_Object {
|
||||||
|
|
||||||
//销毁背包中指定的道具及数量
|
//销毁背包中指定的道具及数量
|
||||||
function DeleteItemCount(Id, Count) {
|
function DeleteItemCount(Id, Count) {
|
||||||
|
if (Id == 0) {
|
||||||
|
//处理金币
|
||||||
|
SUser.RechargeMoney(-Count);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (Id == -1) {
|
||||||
|
//处理点券
|
||||||
|
SUser.RechargeCera(-Count);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (Id == -2) {
|
||||||
|
//处理代币券
|
||||||
|
SUser.RechargeCeraPoint(-Count);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
local Slot = GetSlotById(Id);
|
local Slot = GetSlotById(Id);
|
||||||
local Ret = Sq_Inven_RemoveItemFormCount(this.C_Object, 1, Slot, Count, 10, 1);
|
local Ret = Sq_Inven_RemoveItemFormCount(this.C_Object, 1, Slot, Count, 10, 1);
|
||||||
SUser.SendUpdateItemList(1, 0, Slot);
|
SUser.SendUpdateItemList(1, 0, Slot);
|
||||||
|
|
@ -77,4 +115,72 @@ class Inven extends Base_C_Object {
|
||||||
function GetAvatarItemMgr() {
|
function GetAvatarItemMgr() {
|
||||||
return Sq_CallFunc(S_Ptr("0x80DD576"), "pointer", ["pointer"], this.C_Object);
|
return Sq_CallFunc(S_Ptr("0x80DD576"), "pointer", ["pointer"], this.C_Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//销毁背包中指定表的道具及数量 并且需要格子匹配
|
||||||
|
function DeleteArrItemCountRindro(T) {
|
||||||
|
foreach(value in T) {
|
||||||
|
if (value.type == 0) {
|
||||||
|
//如果是装备 按格子直接删除
|
||||||
|
Sq_Inven_RemoveItemFormCount(this.C_Object, 1, value.pos, value.count, 10, 1);
|
||||||
|
SUser.SendUpdateItemList(1, 0, value.pos);
|
||||||
|
} else {
|
||||||
|
//如果不是装备 走原逻辑
|
||||||
|
local Slot = GetSlotById(value.itemId);
|
||||||
|
Sq_Inven_RemoveItemFormCount(this.C_Object, 1, Slot, value.count, 10, 1);
|
||||||
|
SUser.SendUpdateItemList(1, 0, Slot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//检查背包是否拥有指定表的道具及数量 并且是装备还要匹配格子
|
||||||
|
function CheckArrItemCountRindro(T) {
|
||||||
|
local Flag = true;
|
||||||
|
foreach(value in T) {
|
||||||
|
if (!CheckItemCountRindro(value.itemId, value.count, value.pos)) Flag = false;
|
||||||
|
}
|
||||||
|
return Flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
//检查背包是否拥有指定数量的指定道具
|
||||||
|
function CheckItemCountRindro(ItemId, ItemCount, Slot) {
|
||||||
|
if (ItemId == 0) {
|
||||||
|
//检查金币
|
||||||
|
local Money = Sq_CallFunc(S_Ptr("0x817a188"), "int", ["pointer"], SUser.C_Object);
|
||||||
|
if (Money >= ItemCount) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ItemId == -1) {
|
||||||
|
//检查点券
|
||||||
|
if (SUser.GetCera() >= ItemCount) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ItemId == -2) {
|
||||||
|
//检查代币券
|
||||||
|
if (SUser.GetCeraPoint() >= ItemCount) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local SlotIdx = GetSlotById(ItemId);
|
||||||
|
if (SlotIdx != -1) {
|
||||||
|
local SlotItem = GetSlot(1, SlotIdx);
|
||||||
|
if (SlotItem) {
|
||||||
|
if (SlotItem.GetType() != "装备") {
|
||||||
|
if (SlotItem.GetAdd_Info() >= ItemCount) return true;
|
||||||
|
} else {
|
||||||
|
//如果是装备 检查格子所在的道具id
|
||||||
|
local ItemId2 = GetSlot(1, Slot).GetIndex();
|
||||||
|
//如果这个格子的道具id就是发来的id 那么返回true
|
||||||
|
if (ItemId == ItemId2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -27,6 +27,11 @@ class Memory {
|
||||||
|
|
||||||
class NativePointer extends Base_C_Object {
|
class NativePointer extends Base_C_Object {
|
||||||
|
|
||||||
|
function _tyoeof()
|
||||||
|
{
|
||||||
|
return "Sq_Pointer";
|
||||||
|
}
|
||||||
|
|
||||||
constructor(T) {
|
constructor(T) {
|
||||||
if (typeof T == "integer") {
|
if (typeof T == "integer") {
|
||||||
base.constructor(Sq_New_Point(T));
|
base.constructor(Sq_New_Point(T));
|
||||||
|
|
|
||||||
|
|
@ -104,4 +104,5 @@ class Packet extends Base_C_Object {
|
||||||
Sq_Delete_Point(this.C_Object);
|
Sq_Delete_Point(this.C_Object);
|
||||||
// Sq_Packet_Delete(this.C_Object);
|
// Sq_Packet_Delete(this.C_Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -119,6 +119,7 @@ GatewaySocketPackFuncMap[20240416] <- function(Jso) {
|
||||||
|
|
||||||
//客户端包回调Map
|
//客户端包回调Map
|
||||||
if (!getroottable().rawin("ClientSocketPackFuncMap")) ClientSocketPackFuncMap <- {}
|
if (!getroottable().rawin("ClientSocketPackFuncMap")) ClientSocketPackFuncMap <- {}
|
||||||
|
if (!getroottable().rawin("ClientSocketDP_SPackFuncMap")) ClientSocketDP_SPackFuncMap <- {}
|
||||||
|
|
||||||
|
|
||||||
//收到来自客户端的包 只有130
|
//收到来自客户端的包 只有130
|
||||||
|
|
@ -126,6 +127,13 @@ function OnClientSocketMsg(C_User, C_Pack_Str) {
|
||||||
if (PacketDebugModel) print("收到客户端包: " + C_Pack_Str);
|
if (PacketDebugModel) print("收到客户端包: " + C_Pack_Str);
|
||||||
|
|
||||||
local Jso = Json.Decode(C_Pack_Str);
|
local Jso = Json.Decode(C_Pack_Str);
|
||||||
|
if (Jso.op == 2147483646) {
|
||||||
|
if (Jso.dps_id in ClientSocketDP_SPackFuncMap) {
|
||||||
|
Jso.rawdelete("op");
|
||||||
|
local SUser = User(C_User);
|
||||||
|
ClientSocketDP_SPackFuncMap[Jso.dps_id](SUser, Jso);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (Jso.op in ClientSocketPackFuncMap) {
|
if (Jso.op in ClientSocketPackFuncMap) {
|
||||||
local SUser = User(C_User);
|
local SUser = User(C_User);
|
||||||
ClientSocketPackFuncMap[Jso.op](SUser, Jso);
|
ClientSocketPackFuncMap[Jso.op](SUser, Jso);
|
||||||
|
|
@ -138,3 +146,8 @@ function OnClientSocketMsg(C_User, C_Pack_Str) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Register_DPS_Pack(Id, Func) {
|
||||||
|
ClientSocketDP_SPackFuncMap.rawset(Id, Func);
|
||||||
|
}
|
||||||
|
|
@ -118,7 +118,6 @@ class Timer {
|
||||||
_Timer_Object.Date_Exec_Tree.insert(NextTimestep, func_info);
|
_Timer_Object.Date_Exec_Tree.insert(NextTimestep, func_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Update() {
|
function Update() {
|
||||||
CheckTimeOut();
|
CheckTimeOut();
|
||||||
CheckCronTask();
|
CheckCronTask();
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,14 @@ class User extends Base_C_Object {
|
||||||
Pack.Delete();
|
Pack.Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//发送自定义DPS包
|
||||||
|
function Send_DPS_Pack(Id, Jso) {
|
||||||
|
Jso.op <- 2147483646;
|
||||||
|
Jso.dps_id <- Id;
|
||||||
|
SendJso(Jso);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//发送消息包
|
//发送消息包
|
||||||
function SendNotiPacket(Type1, Type2, Type3) {
|
function SendNotiPacket(Type1, Type2, Type3) {
|
||||||
Sq_CUser_SendNotiPacket(this.C_Object, Type1, Type2, Type3);
|
Sq_CUser_SendNotiPacket(this.C_Object, Type1, Type2, Type3);
|
||||||
|
|
@ -532,6 +540,126 @@ class User extends Base_C_Object {
|
||||||
if (Ret) return AccountCargo(Ret, this);
|
if (Ret) return AccountCargo(Ret, this);
|
||||||
else return null;
|
else return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取角色身上的显示时装
|
||||||
|
function GetAva() {
|
||||||
|
//获取背包对象
|
||||||
|
local InvenObj = this.GetInven();
|
||||||
|
if (!InvenObj) return;
|
||||||
|
local re = [];
|
||||||
|
local job = this.GetCharacJob();
|
||||||
|
|
||||||
|
//遍历身上的每一件装备
|
||||||
|
for (local u = 0; u <= 10; u++) {
|
||||||
|
local EquObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_BODY, u);
|
||||||
|
if (EquObj && !EquObj.IsEmpty) {
|
||||||
|
//先拿克隆id 如果这个值有 那说明带的克隆这个是被克隆的装备 直接用这个 但是如果这个人什么都没带 只带了克隆 会显示克隆的id 所以还得判断这个id是不是克隆时装
|
||||||
|
local clearId = Sq_CallFunc(S_Ptr("0x850d374"), "int", ["pointer", "int"], InvenObj.C_Object, u)
|
||||||
|
|
||||||
|
|
||||||
|
local EquObjId = EquObj.GetIndex();
|
||||||
|
//如果这个是克隆
|
||||||
|
if (clearId > 0) {
|
||||||
|
re.push(clearId);
|
||||||
|
} else { //不是克隆 直接把id放上去
|
||||||
|
re.push(EquObjId);
|
||||||
|
}
|
||||||
|
} else { //如果这个部位没东西 直接放默认时装上去
|
||||||
|
re.push(defaultJobItemIdMap[job].index[u]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return re;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class defaultJobItemId {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头发
|
||||||
|
*/
|
||||||
|
hat = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 帽子
|
||||||
|
*/
|
||||||
|
hair = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*脸
|
||||||
|
*/
|
||||||
|
face = 0;
|
||||||
|
/**
|
||||||
|
* 披风
|
||||||
|
*/
|
||||||
|
breast = 0;
|
||||||
|
/**
|
||||||
|
* 上衣
|
||||||
|
*/
|
||||||
|
coat = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下装
|
||||||
|
*/
|
||||||
|
pants = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 腰部
|
||||||
|
*/
|
||||||
|
waist = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 鞋子
|
||||||
|
*/
|
||||||
|
shoes = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 皮肤
|
||||||
|
*/
|
||||||
|
skin = 0;
|
||||||
|
|
||||||
|
index = null;
|
||||||
|
|
||||||
|
constructor(hat, hair, face, breast, coat, pants, waist, shoes, skin) {
|
||||||
|
index = [];
|
||||||
|
this.hat = hat;
|
||||||
|
this.hair = hair;
|
||||||
|
this.face = face;
|
||||||
|
this.breast = breast;
|
||||||
|
this.coat = coat;
|
||||||
|
this.pants = pants;
|
||||||
|
this.waist = waist;
|
||||||
|
this.shoes = shoes;
|
||||||
|
this.skin = skin;
|
||||||
|
|
||||||
|
index.push(hat);
|
||||||
|
index.push(hair);
|
||||||
|
index.push(face);
|
||||||
|
index.push(breast);
|
||||||
|
index.push(coat);
|
||||||
|
index.push(pants);
|
||||||
|
index.push(waist);
|
||||||
|
index.push(shoes);
|
||||||
|
index.push(skin);
|
||||||
|
index.push(0);
|
||||||
|
index.push(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//默认时装
|
||||||
|
if (!(getroottable().rawin("defaultJobItemIdMap"))) {
|
||||||
|
getroottable().defaultJobItemIdMap <- {};
|
||||||
|
defaultJobItemIdMap.rawset(0, defaultJobItemId(39278, 39400, 0, 0, 40600, 41000, 0, 41800, 42200));
|
||||||
|
defaultJobItemIdMap.rawset(1, defaultJobItemId(0, 43400, 0, 0, 44600, 45000, 0, 45800, 46200));
|
||||||
|
defaultJobItemIdMap.rawset(2, defaultJobItemId(0, 47400, 0, 48426, 48600, 49000, 0, 49800, 50200));
|
||||||
|
defaultJobItemIdMap.rawset(3, defaultJobItemId(51265, 51400, 0, 0, 52600, 53000, 0, 53800, 54200));
|
||||||
|
defaultJobItemIdMap.rawset(4, defaultJobItemId(0, 55400, 55820, 0, 56600, 57000, 0, 57800, 58200));
|
||||||
|
|
||||||
|
defaultJobItemIdMap.rawset(5, defaultJobItemId(1600000, 1610000, 0, 0, 1640000, 1650000, 0, 1670000, 1680000));
|
||||||
|
defaultJobItemIdMap.rawset(6, defaultJobItemId(1720000, 1730000, 0, 1750000, 1760000, 1770000, 0, 1790000, 1800000));
|
||||||
|
defaultJobItemIdMap.rawset(7, defaultJobItemId(0, 29201, 0, 0, 29202, 29203, 0, 29204, 29205));
|
||||||
|
defaultJobItemIdMap.rawset(8, defaultJobItemId(0, 2090000, 0, 0, 2120000, 2130000, 0, 2140000, 2150000));
|
||||||
|
defaultJobItemIdMap.rawset(9, defaultJobItemId(39278, 39400, 0, 0, 40600, 41000, 0, 41800, 42200));
|
||||||
|
defaultJobItemIdMap.rawset(10, defaultJobItemId(51265, 51400, 0, 0, 52600, 53000, 0, 53800, 54200));
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取公会名称
|
//获取公会名称
|
||||||
|
|
@ -605,3 +733,14 @@ function User::SendItemMail(UID, CID, ItemList, title, content) {
|
||||||
function User::CheckItemLock(Type, Slot) {
|
function User::CheckItemLock(Type, Slot) {
|
||||||
return Sq_CallFunc(S_Ptr("0x8646942"), "int", ["pointer", "int", "int"], this.C_Object, Type, Slot);
|
return Sq_CallFunc(S_Ptr("0x8646942"), "int", ["pointer", "int", "int"], this.C_Object, Type, Slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//查询本日金币交易额度
|
||||||
|
function User::GetTradeGoldDaily() {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x8696600"), "int", ["pointer"], this.C_Object);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置本日金币交易额度
|
||||||
|
function User::SetTradeGoldDaily(Value) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x84EC002"), "int", ["pointer", "int"], this.C_Object, Value);
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -104,6 +104,10 @@ class ServerControl {
|
||||||
local UserInfo = [];
|
local UserInfo = [];
|
||||||
foreach(_Index, SUser in UserList) {
|
foreach(_Index, SUser in UserList) {
|
||||||
if (SUser) {
|
if (SUser) {
|
||||||
|
local growjob = SUser.GetCharacGrowType();
|
||||||
|
if (growjob >= 16) {
|
||||||
|
growjob = growjob - 16;
|
||||||
|
}
|
||||||
local T = {
|
local T = {
|
||||||
uid = SUser.GetUID(),
|
uid = SUser.GetUID(),
|
||||||
cid = SUser.GetCID(),
|
cid = SUser.GetCID(),
|
||||||
|
|
@ -112,7 +116,7 @@ class ServerControl {
|
||||||
//基础职业
|
//基础职业
|
||||||
job = SUser.GetCharacJob(),
|
job = SUser.GetCharacJob(),
|
||||||
//转职职业
|
//转职职业
|
||||||
growjob = SUser.GetCharacSecondGrowType(),
|
growjob = SUser.GetCharacGrowType(),
|
||||||
//觉醒职业
|
//觉醒职业
|
||||||
Secondjob = SUser.GetCharacSecondGrowType(),
|
Secondjob = SUser.GetCharacSecondGrowType(),
|
||||||
//等级
|
//等级
|
||||||
|
|
@ -129,6 +133,9 @@ class ServerControl {
|
||||||
cerapoint = SUser.GetCeraPoint(),
|
cerapoint = SUser.GetCeraPoint(),
|
||||||
//胜点
|
//胜点
|
||||||
winpoint = SUser.GetWinPoint(),
|
winpoint = SUser.GetWinPoint(),
|
||||||
|
//时装信息
|
||||||
|
avatar = SUser.GetAva()
|
||||||
|
|
||||||
};
|
};
|
||||||
UserInfo.append(T);
|
UserInfo.append(T);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -141,6 +148,51 @@ class ServerControl {
|
||||||
Socket.SendGateway(Jso);
|
Socket.SendGateway(Jso);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//根据名称查询玩家信息
|
||||||
|
GatewaySocketPackFuncMap.rawset(20241124, function(Jso) {
|
||||||
|
local SUser = World.GetUserByName(Jso.Name);
|
||||||
|
|
||||||
|
if (SUser) {
|
||||||
|
local T = {
|
||||||
|
uid = SUser.GetUID(),
|
||||||
|
cid = SUser.GetCID(),
|
||||||
|
//名字
|
||||||
|
name = SUser.GetCharacName(),
|
||||||
|
//基础职业
|
||||||
|
job = SUser.GetCharacJob(),
|
||||||
|
//转职职业
|
||||||
|
growjob = SUser.GetCharacSecondGrowType(),
|
||||||
|
//觉醒职业
|
||||||
|
Secondjob = SUser.GetCharaecondGrowType(),
|
||||||
|
//等级
|
||||||
|
level = SUser.GetCharacLevel(),
|
||||||
|
//使用了多少疲劳
|
||||||
|
fatigue = SUser.GetFatigue(),
|
||||||
|
//总疲劳
|
||||||
|
maxfatigue = SUser.GetMaxFatigue(),
|
||||||
|
//是否是GM
|
||||||
|
isgm = SUser.IsGmMode(),
|
||||||
|
//点券
|
||||||
|
cera = SUser.GetCera(),
|
||||||
|
//代币
|
||||||
|
cerapoint = SUser.GetCeraPoint(),
|
||||||
|
//胜点
|
||||||
|
winpoint = SUser.GetWinPoint(),
|
||||||
|
//时装信息
|
||||||
|
avatar = SUser.GetAva()
|
||||||
|
|
||||||
|
};
|
||||||
|
Jso.userinfo <- T;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Jso.userinfo <- null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Jso.op = Jso.realop;
|
||||||
|
Socket.SendGateway(Jso);
|
||||||
|
});
|
||||||
|
|
||||||
//将玩家移出副本
|
//将玩家移出副本
|
||||||
GatewaySocketPackFuncMap.rawset(20240420, function(Jso) {
|
GatewaySocketPackFuncMap.rawset(20240420, function(Jso) {
|
||||||
local UserList = [];
|
local UserList = [];
|
||||||
|
|
@ -177,6 +229,111 @@ class ServerControl {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//注册区域不可见hook
|
||||||
|
GatewaySocketPackFuncMap.rawset(20241128, function(Jso) {
|
||||||
|
local id = Jso.id;
|
||||||
|
local Town = Jso.Town;
|
||||||
|
local Area = Jso.Area;
|
||||||
|
|
||||||
|
Cb_Insert_User_Func[id] <- function(C_Area, C_User) {
|
||||||
|
local SUser = User(C_User);
|
||||||
|
if (SUser.GetLocation().Town == Town && SUser.GetLocation().Area == Area) {
|
||||||
|
Sq_WriteAddress(C_Area, 0x68, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//设置玩家可见
|
||||||
|
GatewaySocketPackFuncMap.rawset(20241130, function(Jso) {
|
||||||
|
local uids = Jso.uids;
|
||||||
|
|
||||||
|
local RealList = [];
|
||||||
|
foreach(uid in uids) {
|
||||||
|
local SUser = World.GetUserByUid(uid);
|
||||||
|
if (SUser && SUser.GetState() >= 3) RealList.append(SUser);
|
||||||
|
}
|
||||||
|
foreach(_Index, Value in RealList) {
|
||||||
|
local SUser = Value;
|
||||||
|
local Pack = Packet();
|
||||||
|
Pack.Put_Header(0, 24);
|
||||||
|
Pack.Put_Byte(SUser.GetLocation().Town); //城镇
|
||||||
|
Pack.Put_Byte(SUser.GetArea(1)); //区域
|
||||||
|
Pack.Put_Short((RealList.len() - 1)); //几个玩家 要减去自己
|
||||||
|
foreach(__Index, MapObj in RealList) {
|
||||||
|
if (SUser.GetUID() == MapObj.GetUID()) continue;
|
||||||
|
Pack.Put_Short(MapObj.GetUniqueId());
|
||||||
|
Pack.Put_Short(MapObj.GetAreaPos().X);
|
||||||
|
Pack.Put_Short(MapObj.GetAreaPos().Y);
|
||||||
|
Pack.Put_Byte(MapObj.GetDirections()); //朝向
|
||||||
|
Pack.Put_Byte(MapObj.GetVisibleValues()); //是否可见
|
||||||
|
}
|
||||||
|
Pack.Put_Byte(1); //是否可见
|
||||||
|
Pack.Finalize(true);
|
||||||
|
SUser.Send(Pack);
|
||||||
|
Pack.Delete();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//退出可见列表
|
||||||
|
GatewaySocketPackFuncMap.rawset(20241132, function(Jso) {
|
||||||
|
local uids = Jso.uids;
|
||||||
|
local uid = Jso.uid;
|
||||||
|
local MUser = World.GetUserByUid(uid);
|
||||||
|
|
||||||
|
foreach(_Index, Value in uids) {
|
||||||
|
local SUser = World.GetUserByUid(Value);
|
||||||
|
if (!SUser || !(SUser.GetState() >= 3) || !MUser || !(MUser.GetState() >= 3)) continue;
|
||||||
|
if (SUser.GetUID() == MUser.GetUID()) continue;
|
||||||
|
local Pack = Packet();
|
||||||
|
Pack.Put_Header(0, 23);
|
||||||
|
Pack.Put_Short(MUser.GetUniqueId()); //唯一id
|
||||||
|
Pack.Put_Byte(MUser.GetLocation().Town); //城镇
|
||||||
|
|
||||||
|
|
||||||
|
Pack.Put_Byte(99); //区域
|
||||||
|
Pack.Put_Short(MUser.GetAreaPos().X);
|
||||||
|
|
||||||
|
Pack.Put_Short(MUser.GetAreaPos().Y);
|
||||||
|
Pack.Put_Byte(MUser.GetDirections()); //朝向
|
||||||
|
Pack.Put_Byte(MUser.GetVisibleValues()); //是否可见
|
||||||
|
Pack.Finalize(true);
|
||||||
|
|
||||||
|
SUser.Send(Pack);
|
||||||
|
Pack.Delete();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//玩家移动回调
|
||||||
|
GatewaySocketPackFuncMap.rawset(20241134, function(Jso) {
|
||||||
|
|
||||||
|
local MoveSUser = World.GetUserByUid(Jso.uid);
|
||||||
|
if (!MoveSUser) return;
|
||||||
|
|
||||||
|
local uids = Jso.list;
|
||||||
|
local RealList = [];
|
||||||
|
foreach(uid in uids) {
|
||||||
|
local SUser = World.GetUserByUid(uid);
|
||||||
|
if (SUser && SUser.GetState() >= 3) RealList.append(SUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
local Pack = Packet();
|
||||||
|
Pack.Put_Header(0, 22);
|
||||||
|
Pack.Put_Short(MoveSUser.GetUniqueId());
|
||||||
|
Pack.Put_Short(Jso.XPos);
|
||||||
|
Pack.Put_Short(Jso.YPos);
|
||||||
|
Pack.Put_Byte(Jso.Direction);
|
||||||
|
Pack.Put_Short(Jso.Code);
|
||||||
|
Pack.Finalize(true);
|
||||||
|
|
||||||
|
|
||||||
|
foreach(_Index, Value in RealList) {
|
||||||
|
local SUser = Value;
|
||||||
|
if (SUser.GetUniqueId() == MoveSUser.GetUniqueId()) continue;
|
||||||
|
SUser.Send(Pack);
|
||||||
|
}
|
||||||
|
Pack.Delete();
|
||||||
|
});
|
||||||
|
|
||||||
//给注册玩家使用道具回调
|
//给注册玩家使用道具回调
|
||||||
GatewaySocketPackFuncMap.rawset(2023110702, function(Jso) {
|
GatewaySocketPackFuncMap.rawset(2023110702, function(Jso) {
|
||||||
|
|
@ -200,13 +357,14 @@ class ServerControl {
|
||||||
local CID = Jso.cid;
|
local CID = Jso.cid;
|
||||||
local SUser = World.GetUserByUidCid(UID, CID);
|
local SUser = World.GetUserByUidCid(UID, CID);
|
||||||
local ItemId = Jso.itemid;
|
local ItemId = Jso.itemid;
|
||||||
|
local num = 0;
|
||||||
if (SUser) {
|
if (SUser) {
|
||||||
//获取背包对象
|
//获取背包对象
|
||||||
local InvenObj = SUser.GetInven();
|
local InvenObj = SUser.GetInven();
|
||||||
local SlotIdx = InvenObj.GetSlotById(ItemId);
|
local SlotIdx = InvenObj.GetSlotById(ItemId);
|
||||||
if (SlotIdx != -1) {
|
|
||||||
local SlotItem = InvenObj.GetSlot(1, SlotIdx);
|
local SlotItem = InvenObj.GetSlot(1, SlotIdx);
|
||||||
if (SlotItem) {
|
if (SlotItem != null && SlotItem.GetIndex() == ItemId) {
|
||||||
local Count = 1;
|
local Count = 1;
|
||||||
if (SlotItem.GetType() != "装备") {
|
if (SlotItem.GetType() != "装备") {
|
||||||
Count = SlotItem.GetAdd_Info();
|
Count = SlotItem.GetAdd_Info();
|
||||||
|
|
@ -216,10 +374,23 @@ class ServerControl {
|
||||||
Socket.SendGateway(Jso);
|
Socket.SendGateway(Jso);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
print(num);
|
||||||
|
for (local i = 0; i< 120; i++) {
|
||||||
|
local ItemObj = InvenObj.GetSlot(3, i);
|
||||||
|
if (ItemObj != null && ItemObj.GetIndex() == ItemId) {
|
||||||
|
num++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Jso.Count <- 0;
|
ItemObj = InvenObj.GetSlot(2, i);
|
||||||
|
if (ItemObj != null && ItemObj.GetIndex() == ItemId) {
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
print(num);
|
||||||
|
}
|
||||||
|
|
||||||
|
Jso.Count <- num;
|
||||||
Jso.op = Jso.realop;
|
Jso.op = Jso.realop;
|
||||||
Socket.SendGateway(Jso);
|
Socket.SendGateway(Jso);
|
||||||
});
|
});
|
||||||
|
|
@ -347,7 +518,7 @@ class ServerControl {
|
||||||
local InvenObj = SUser.GetInven();
|
local InvenObj = SUser.GetInven();
|
||||||
local FlagBuf = InvenObj.CheckArrItemCount([{
|
local FlagBuf = InvenObj.CheckArrItemCount([{
|
||||||
Id = Jso.itemid,
|
Id = Jso.itemid,
|
||||||
Count = Jso.itemcount
|
Count = Jso.itemcount,
|
||||||
}]);
|
}]);
|
||||||
if (!FlagBuf) Flag = false;
|
if (!FlagBuf) Flag = false;
|
||||||
Jso.Loser <- uid;
|
Jso.Loser <- uid;
|
||||||
|
|
@ -360,6 +531,7 @@ class ServerControl {
|
||||||
local SUser = World.GetUserByUid(uid);
|
local SUser = World.GetUserByUid(uid);
|
||||||
local InvenObj = SUser.GetInven();
|
local InvenObj = SUser.GetInven();
|
||||||
InvenObj.DeleteItemCount(Jso.itemid, Jso.itemcount);
|
InvenObj.DeleteItemCount(Jso.itemid, Jso.itemcount);
|
||||||
|
SUser.SendItemSpace(0);
|
||||||
}
|
}
|
||||||
Jso.DeleteFlag <- true;
|
Jso.DeleteFlag <- true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -369,6 +541,136 @@ class ServerControl {
|
||||||
Socket.SendGateway(Jso);
|
Socket.SendGateway(Jso);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//给指定玩家扣除装备 并且会返回是否成功的
|
||||||
|
GatewaySocketPackFuncMap.rawset(20250318, function(Jso) {
|
||||||
|
local UID = Jso.uid;
|
||||||
|
local SUser = World.GetUserByUid(UID);
|
||||||
|
if (SUser) {
|
||||||
|
local InvenObj = SUser.GetInven();
|
||||||
|
local slot = InvenObj.GetSlotById(Jso.itemId);
|
||||||
|
|
||||||
|
if (slot == -1) {
|
||||||
|
Jso.DeleteFlag <- false;
|
||||||
|
} else {
|
||||||
|
local itemobj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, slot);
|
||||||
|
itemobj.Delete();
|
||||||
|
SUser.SendUpdateItemList(1, 0, slot);
|
||||||
|
Jso.DeleteFlag <- true;
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Jso.DeleteFlag <- false;
|
||||||
|
}
|
||||||
|
Jso.op = Jso.realop;
|
||||||
|
Socket.SendGateway(Jso);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//给一个玩家 批量扣除道具
|
||||||
|
GatewaySocketPackFuncMap.rawset(20241122, function(Jso) {
|
||||||
|
local Flag = true;
|
||||||
|
|
||||||
|
local SUser = World.GetUserByUid(Jso.uid);
|
||||||
|
local InvenObj = SUser.GetInven();
|
||||||
|
|
||||||
|
if (SUser) {
|
||||||
|
//获取背包对象
|
||||||
|
local FlagBuf = InvenObj.CheckArrItemCountRindro(Jso.ItemS);
|
||||||
|
if (!FlagBuf) Flag = false;
|
||||||
|
} else {
|
||||||
|
Flag = false;
|
||||||
|
}
|
||||||
|
if (Flag) {
|
||||||
|
InvenObj.DeleteArrItemCountRindro(Jso.ItemS);
|
||||||
|
SUser.SendItemSpace(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Jso.DeleteFlag <- Flag;
|
||||||
|
Jso.op = Jso.realop;
|
||||||
|
Socket.SendGateway(Jso);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//给一个玩家 设置角色栏上限
|
||||||
|
GatewaySocketPackFuncMap.rawset(20250227, function(Jso) {
|
||||||
|
local Flag = true;
|
||||||
|
|
||||||
|
local SUser = World.GetUserByUid(Jso.uid);
|
||||||
|
if (SUser == null) {
|
||||||
|
SUser = WebAddressUser;
|
||||||
|
}
|
||||||
|
Sq_CallFunc(S_Ptr("0x0869755C"), "int", ["pointer", "int"], SUser.C_Object, Jso.num);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//给一个玩家 设置当天交易额
|
||||||
|
GatewaySocketPackFuncMap.rawset(20250228, function(Jso) {
|
||||||
|
local SUser = World.GetUserByUid(Jso.uid);
|
||||||
|
|
||||||
|
|
||||||
|
SUser.SetTradeGoldDaily(Jso.num);
|
||||||
|
print(SUser.GetTradeGoldDaily());
|
||||||
|
});
|
||||||
|
|
||||||
|
//设置全服交易上限
|
||||||
|
GatewaySocketPackFuncMap.rawset(20250229, function(Jso) {
|
||||||
|
GameManager.FixGlodTradeDaily(Jso.num);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//给一个玩家 批量扣除道具 并且如果第一个道具是装备 就返回装备的强化信息
|
||||||
|
GatewaySocketPackFuncMap.rawset(20241210, function(Jso) {
|
||||||
|
local Flag = true;
|
||||||
|
|
||||||
|
local SUser = World.GetUserByUid(Jso.uid);
|
||||||
|
local InvenObj = SUser.GetInven();
|
||||||
|
|
||||||
|
local ItemObj1 = InvenObj.GetSlot(1, Jso.pos);
|
||||||
|
|
||||||
|
if (SUser) {
|
||||||
|
//获取背包对象
|
||||||
|
local FlagBuf = InvenObj.CheckArrItemCountRindro(Jso.ItemS);
|
||||||
|
if (!FlagBuf) Flag = false;
|
||||||
|
} else {
|
||||||
|
Flag = false;
|
||||||
|
}
|
||||||
|
if (Flag) {
|
||||||
|
if (!ItemObj1.IsEmpty && ItemObj1.GetType() == "装备") {
|
||||||
|
local forging = ItemObj1.GetForging(); //锻造
|
||||||
|
local upgrade = ItemObj1.GetUpgrade(); //强化
|
||||||
|
local amplification = ItemObj1.GetAmplification(); //增幅
|
||||||
|
local enchanting = ItemObj1.GetEnchanting(); //附魔
|
||||||
|
Jso.up <- [forging, upgrade, amplification, enchanting];
|
||||||
|
}
|
||||||
|
InvenObj.DeleteArrItemCountRindro(Jso.ItemS);
|
||||||
|
SUser.SendItemSpace(0);
|
||||||
|
}
|
||||||
|
Jso.DeleteFlag <- Flag;
|
||||||
|
Jso.op = Jso.realop;
|
||||||
|
Socket.SendGateway(Jso);
|
||||||
|
});
|
||||||
|
|
||||||
|
//给指定玩家下发道具 并且如果道具是装备 就给加上强化信息
|
||||||
|
GatewaySocketPackFuncMap.rawset(20241212, function(Jso) {
|
||||||
|
local UID = Jso.uid;
|
||||||
|
local CID = Jso.cid;
|
||||||
|
local SUser = World.GetUserByUidCid(UID, CID);
|
||||||
|
local item = SUser.GiveItem(Jso.itemId, Jso.count);
|
||||||
|
//最后获得的道具
|
||||||
|
local reitem = InvenObj.GetSlot(1, item[1]);
|
||||||
|
if (reitem.GetType() == "装备") {
|
||||||
|
reitem.SetForging(Jso.up[0]);
|
||||||
|
reitem.SetUpgrade(Jso.up[1]);
|
||||||
|
reitem.SetAmplification(Jso.up[2]);
|
||||||
|
reitem.SetEnchanting(Jso.up[3]);
|
||||||
|
reitem.Flush();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
//公告包
|
//公告包
|
||||||
GatewaySocketPackFuncMap.rawset(2023082102, function(Jso) {
|
GatewaySocketPackFuncMap.rawset(2023082102, function(Jso) {
|
||||||
World.SendNotiPacketMessage(Jso.str, Jso.type);
|
World.SendNotiPacketMessage(Jso.str, Jso.type);
|
||||||
|
|
@ -379,8 +681,26 @@ class ServerControl {
|
||||||
local CID = Jso.cid;
|
local CID = Jso.cid;
|
||||||
local SUser = World.GetUserByUidCid(UID, CID);
|
local SUser = World.GetUserByUidCid(UID, CID);
|
||||||
if (SUser) {
|
if (SUser) {
|
||||||
|
if (Jso.type == -1) {
|
||||||
|
SUser.SendNotiBox(Jso.str, 1);
|
||||||
|
} else {
|
||||||
SUser.SendNotiPacketMessage(Jso.str, Jso.type);
|
SUser.SendNotiPacketMessage(Jso.str, Jso.type);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//获取玩家位置信息
|
||||||
|
GatewaySocketPackFuncMap.rawset(20241126, function(Jso) {
|
||||||
|
local SUser = World.GetUserByUid(Jso.uid);
|
||||||
|
local Info = SUser.GetLocation();
|
||||||
|
local list = [];
|
||||||
|
list.append(Info.Town);
|
||||||
|
list.append(Info.Area);
|
||||||
|
list.append(Info.Pos.X);
|
||||||
|
list.append(Info.Pos.Y);
|
||||||
|
Jso.Location <- list;
|
||||||
|
Jso.op = Jso.realop;
|
||||||
|
Socket.SendGateway(Jso);
|
||||||
});
|
});
|
||||||
|
|
||||||
//玩家进入副本
|
//玩家进入副本
|
||||||
|
|
@ -416,10 +736,14 @@ class ServerControl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//给注册玩家通关副本
|
//给注册玩家通关副本
|
||||||
GatewaySocketPackFuncMap.rawset(2023110704, function(Jso) {
|
GatewaySocketPackFuncMap.rawset(2023110704, function(Jso) {
|
||||||
local RealOp = Jso.realop;
|
local RealOp = Jso.realop;
|
||||||
|
print("注册副本了");
|
||||||
Cb_ClearDungeon_Enter_Func[RealOp] <- function(arg) {
|
Cb_ClearDungeon_Enter_Func[RealOp] <- function(arg) {
|
||||||
|
print("通关副本了");
|
||||||
local PartyObj = Party(arg[0]);
|
local PartyObj = Party(arg[0]);
|
||||||
if (PartyObj) {
|
if (PartyObj) {
|
||||||
local Bfobj = PartyObj.GetBattleField();
|
local Bfobj = PartyObj.GetBattleField();
|
||||||
|
|
@ -477,6 +801,7 @@ class ServerControl {
|
||||||
Socket.SendGateway(T);
|
Socket.SendGateway(T);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//返回选择角色
|
//返回选择角色
|
||||||
Cb_return_select_character_Func["Rindro_return_select_character"] <- function(SUser) {
|
Cb_return_select_character_Func["Rindro_return_select_character"] <- function(SUser) {
|
||||||
local T = {
|
local T = {
|
||||||
|
|
@ -546,7 +871,8 @@ class ServerControl {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Cb_History_PCoinDown_Func["Rindro_PCoinDown"] <- function(SUser, Data) {
|
Cb_UseCoin_Enter_Func["Rindro_PCoinDown"] <- function(args) {
|
||||||
|
local SUser = User(args[1]);
|
||||||
if (SUser) {
|
if (SUser) {
|
||||||
local T = {
|
local T = {
|
||||||
op = 25001035,
|
op = 25001035,
|
||||||
|
|
@ -557,7 +883,6 @@ class ServerControl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//组队HOOK包 同意加入或者同意申请
|
//组队HOOK包 同意加入或者同意申请
|
||||||
Cb_User_Party_Agree_Func["Rindro_player_User_Party_Agree"] <- function(SUser) {
|
Cb_User_Party_Agree_Func["Rindro_player_User_Party_Agree"] <- function(SUser) {
|
||||||
local T = {
|
local T = {
|
||||||
|
|
@ -715,13 +1040,31 @@ class ServerControl {
|
||||||
uid = SUser.GetUID(),
|
uid = SUser.GetUID(),
|
||||||
cid = SUser.GetCID(),
|
cid = SUser.GetCID(),
|
||||||
queId = args[1],
|
queId = args[1],
|
||||||
op = 20069009
|
op = 25001041
|
||||||
}
|
}
|
||||||
Socket.SendGateway(Jso);
|
Socket.SendGateway(Jso);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 登录游戏时点击开始游戏的回调
|
||||||
|
Cb_User_Set_WebAddress_Leave_Func.ServerControl <- function(args) {
|
||||||
|
local SUser = User(args[0]);
|
||||||
|
|
||||||
|
local Jso = {
|
||||||
|
uid = SUser.GetUID(),
|
||||||
|
cid = SUser.GetCID(),
|
||||||
|
op = 25001043
|
||||||
}
|
}
|
||||||
|
Socket.SendGateway(Jso);
|
||||||
|
WebAddressUser = SUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//刚登录游戏没办法从世界里找到这个角色 在这暂存下
|
||||||
|
WebAddressUser <- null;
|
||||||
|
|
||||||
|
|
||||||
ProjectInitFuncMap.P_ServerControl <- ServerControl();
|
ProjectInitFuncMap.P_ServerControl <- ServerControl();
|
||||||
|
|
@ -49,6 +49,7 @@ class Anton {
|
||||||
function base_input_hook(CUser, CmdString) {
|
function base_input_hook(CUser, CmdString) {
|
||||||
if (!CUser) return true;
|
if (!CUser) return true;
|
||||||
local SUser = User(CUser);
|
local SUser = User(CUser);
|
||||||
|
|
||||||
//安图恩频道
|
//安图恩频道
|
||||||
if (Sq_Game_GetConfig().find("18") != null) {
|
if (Sq_Game_GetConfig().find("18") != null) {
|
||||||
local Localtion = SUser.GetLocation();
|
local Localtion = SUser.GetLocation();
|
||||||
|
|
@ -69,6 +70,28 @@ class Anton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function base_input_hook2(args) {
|
||||||
|
local type = args[2];
|
||||||
|
local SUser = User(args[1]);
|
||||||
|
local msg = args[3];
|
||||||
|
if ((type == 8 || type == 3) && Sq_Game_GetConfig().find("18") != null) {
|
||||||
|
local Localtion = SUser.GetLocation();
|
||||||
|
if (Localtion.Area <= 1) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
local Jso = {
|
||||||
|
op = 20064027,
|
||||||
|
uid = SUser.GetUID(),
|
||||||
|
cid = SUser.GetCID(),
|
||||||
|
msg = msg
|
||||||
|
}
|
||||||
|
Socket.SendGateway(Jso);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//玩家消息分发
|
//玩家消息分发
|
||||||
function PlayerNotiMsgDistribute(Jso) {
|
function PlayerNotiMsgDistribute(Jso) {
|
||||||
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
|
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
|
||||||
|
|
@ -82,7 +105,7 @@ class Anton {
|
||||||
local SUserName = SUser.GetCharacName();
|
local SUserName = SUser.GetCharacName();
|
||||||
local Type = Jso.type;
|
local Type = Jso.type;
|
||||||
|
|
||||||
Jso.msg = Jso.msg.slice(0, Jso.msg.len() - 11);
|
Jso.msg = Jso.msg;
|
||||||
if (Type == -1) {
|
if (Type == -1) {
|
||||||
Jso.Name <- SUserName;
|
Jso.Name <- SUserName;
|
||||||
foreach(_Index, Value in RealList) {
|
foreach(_Index, Value in RealList) {
|
||||||
|
|
@ -211,8 +234,10 @@ class Anton {
|
||||||
//注册HOOK
|
//注册HOOK
|
||||||
Cb_Insert_User_Func.Anton <- insert_user_hook.bindenv(this); //区域添加角色
|
Cb_Insert_User_Func.Anton <- insert_user_hook.bindenv(this); //区域添加角色
|
||||||
Cb_Move_Area_Func.Anton <- move_area_hook.bindenv(this); //区域移动
|
Cb_Move_Area_Func.Anton <- move_area_hook.bindenv(this); //区域移动
|
||||||
Base_InputHookFunc_Handle.Anton <- base_input_hook.bindenv(this); //玩家发送消息
|
//Base_InputHookFunc_Handle.Anton <- base_input_hook.bindenv(this); //玩家发送消息
|
||||||
Cb_reach_game_world_Func.Anton <- Login_Hook.bindenv(this); //上线HOOK
|
Cb_reach_game_world_Func.Anton <- Login_Hook.bindenv(this); //上线HOOK
|
||||||
|
Cb_Server_Chat_Log_Leave_Func.Anton <- base_input_hook2.bindenv(this); //玩家发送消息
|
||||||
|
|
||||||
|
|
||||||
//注册收包
|
//注册收包
|
||||||
GatewaySocketPackFuncMap.rawset(20064010, AntonSendAreaUserCallBack.bindenv(this)); //玩家移动后的区域广播包
|
GatewaySocketPackFuncMap.rawset(20064010, AntonSendAreaUserCallBack.bindenv(this)); //玩家移动后的区域广播包
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ class CombatRank {
|
||||||
|
|
||||||
//角色更换了装备事件包
|
//角色更换了装备事件包
|
||||||
PacketId_0 = 20072102;
|
PacketId_0 = 20072102;
|
||||||
|
PacketId_1 = 20072602;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
||||||
|
|
@ -24,6 +25,12 @@ class CombatRank {
|
||||||
}
|
}
|
||||||
SUser.SendJso(T);
|
SUser.SendJso(T);
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
|
Cb_player_chanage_equ_Func.CombatRankBFunc <- function(SUser) {
|
||||||
|
local T = {
|
||||||
|
op = PacketId_1
|
||||||
|
}
|
||||||
|
SUser.SendJso(T);
|
||||||
|
}.bindenv(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,6 @@ class EquimentUseJewel {
|
||||||
//从池子拿连接
|
//从池子拿连接
|
||||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||||
local Ret = SqlObj.Select(CheckSql, ["int"]);
|
local Ret = SqlObj.Select(CheckSql, ["int"]);
|
||||||
printT(Ret);
|
|
||||||
//把连接还池子
|
//把连接还池子
|
||||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||||
//没结婚要返回false
|
//没结婚要返回false
|
||||||
|
|
@ -184,7 +183,6 @@ class EquimentUseJewel {
|
||||||
function GetByte(value) {
|
function GetByte(value) {
|
||||||
local Blob = blob();
|
local Blob = blob();
|
||||||
Blob.writen(value, 'w');
|
Blob.writen(value, 'w');
|
||||||
print(Blob.len());
|
|
||||||
return Blob;
|
return Blob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -226,29 +224,21 @@ class EquimentUseJewel {
|
||||||
|
|
||||||
HackReturnAddSocketToAvatarFalg = null;
|
HackReturnAddSocketToAvatarFalg = null;
|
||||||
|
|
||||||
|
|
||||||
function HackReturnAddSocketToAvatar(Code) {
|
function HackReturnAddSocketToAvatar(Code) {
|
||||||
//通过hook get short直接返回0达到错误返回的效果
|
|
||||||
//标记flag
|
//标记flag
|
||||||
HackReturnAddSocketToAvatarFalg = Code;
|
HackReturnAddSocketToAvatarFalg = Code;
|
||||||
Haker.LoadHook("0x0858D0B0", ["pointer", "pointer", "int"],
|
|
||||||
function(args) {
|
Cb_PacketBuf_get_short_Leave_Func.EquimentUseJewel <- function(args) {
|
||||||
return null;
|
Cb_PacketBuf_get_short_Leave_Func.rawdelete("EquimentUseJewel");
|
||||||
},
|
|
||||||
function(args) {
|
|
||||||
Haker.UnLoadHook("0x0858D0B0");
|
|
||||||
return 0;
|
return 0;
|
||||||
});
|
}.bindenv(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function FixFunction() {
|
function FixFunction() {
|
||||||
//称号回包
|
//称号回包
|
||||||
Haker.LoadHook("0x08641A6A", ["pointer", "pointer", "int", "pointer", "int"],
|
Cb_CTitleBook_putItemData_Leave_Func.EquimentUseJewel <- function(args) {
|
||||||
function(args) {
|
|
||||||
return null;
|
|
||||||
}.bindenv(this),
|
|
||||||
|
|
||||||
function(args) {
|
|
||||||
local JewelSocketData = api_get_jewel_socket_data(NativePointer(args[3]).add(25).readU32());
|
local JewelSocketData = api_get_jewel_socket_data(NativePointer(args[3]).add(25).readU32());
|
||||||
local ret = args.pop();
|
local ret = args.pop();
|
||||||
if (JewelSocketData && NativePointer(JewelSocketData).add(0).readU8() != 0) {
|
if (JewelSocketData && NativePointer(JewelSocketData).add(0).readU8() != 0) {
|
||||||
|
|
@ -256,23 +246,17 @@ class EquimentUseJewel {
|
||||||
Pack.Put_BinaryEx(JewelSocketData.C_Object, 30);
|
Pack.Put_BinaryEx(JewelSocketData.C_Object, 30);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}.bindenv(this));
|
}.bindenv(this);
|
||||||
|
|
||||||
//设计图继承
|
//设计图继承
|
||||||
Haker.LoadHook("0x08671EB2", ["pointer", "pointer", "pointer", "int"],
|
Cb_CUsercopyItemOption_Enter_Func.EquimentUseJewel <- function(args) {
|
||||||
function(args) {
|
|
||||||
local jewelSocketID = NativePointer(args[2]).add(25).readU32();
|
local jewelSocketID = NativePointer(args[2]).add(25).readU32();
|
||||||
NativePointer(args[1]).add(25).writeU32(jewelSocketID);
|
NativePointer(args[1]).add(25).writeU32(jewelSocketID);
|
||||||
return null;
|
return null;
|
||||||
}.bindenv(this),
|
}.bindenv(this);
|
||||||
|
|
||||||
function(args) {
|
|
||||||
return null;
|
|
||||||
}.bindenv(this));
|
|
||||||
|
|
||||||
//装备开孔
|
//装备开孔
|
||||||
Haker.LoadHook("0x0821A412", ["pointer", "pointer", "pointer", "int"],
|
Cb_AddSocketToAvatar_Enter_Func.EquimentUseJewel <- function(args) {
|
||||||
function(args) {
|
|
||||||
local SUser = User(args[1]);
|
local SUser = User(args[1]);
|
||||||
local Pack = Packet(args[2]);
|
local Pack = Packet(args[2]);
|
||||||
local equ_slot = Pack.GetShort();
|
local equ_slot = Pack.GetShort();
|
||||||
|
|
@ -285,6 +269,7 @@ class EquimentUseJewel {
|
||||||
equ_slot = equ_slot - 57;
|
equ_slot = equ_slot - 57;
|
||||||
local C_PacketBuf = api_PacketBuf_get_buf(args[2]) //获取原始封包数据
|
local C_PacketBuf = api_PacketBuf_get_buf(args[2]) //获取原始封包数据
|
||||||
C_PacketBuf.add(0).writeShort(equ_slot) //修改掉装备位置信息 时装类镶嵌从57开始。
|
C_PacketBuf.add(0).writeShort(equ_slot) //修改掉装备位置信息 时装类镶嵌从57开始。
|
||||||
|
|
||||||
//执行原逻辑
|
//执行原逻辑
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -308,8 +293,8 @@ class EquimentUseJewel {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
local id = add_equiment_socket(ItemType);
|
local id = add_equiment_socket(ItemType);
|
||||||
|
|
||||||
Sq_Inven_RemoveItemFormCount(CurCharacInvenW.C_Object, 1, sta_slot, 1, 8, 1); //删除打孔道具
|
Sq_Inven_RemoveItemFormCount(CurCharacInvenW.C_Object, 1, sta_slot, 1, 8, 1); //删除打孔道具
|
||||||
NativePointer(inven_item.C_Object).add(25).writeU32(id) //写入槽位标识
|
NativePointer(inven_item.C_Object).add(25).writeU32(id) //写入槽位标识
|
||||||
SUser.SendUpdateItemList(1, 0, equ_slot);
|
SUser.SendUpdateItemList(1, 0, equ_slot);
|
||||||
|
|
@ -327,9 +312,13 @@ class EquimentUseJewel {
|
||||||
Pack.Delete();
|
Pack.Delete();
|
||||||
HackReturnAddSocketToAvatar(0x0);
|
HackReturnAddSocketToAvatar(0x0);
|
||||||
return null;
|
return null;
|
||||||
}.bindenv(this),
|
}.bindenv(this);
|
||||||
|
|
||||||
function(args) {
|
Cb_AddSocketToAvatar_Leave_Func.EquimentUseJewel <- function(args) {
|
||||||
|
|
||||||
|
local Pack = Packet(args[2]);
|
||||||
|
local equ_slot = Pack.GetShort();
|
||||||
|
print(equ_slot);
|
||||||
//跳的错误返回0 正常调用的话不处理返回值
|
//跳的错误返回0 正常调用的话不处理返回值
|
||||||
if (HackReturnAddSocketToAvatarFalg != null) {
|
if (HackReturnAddSocketToAvatarFalg != null) {
|
||||||
local SUser = User(args[1]);
|
local SUser = User(args[1]);
|
||||||
|
|
@ -338,15 +327,14 @@ class EquimentUseJewel {
|
||||||
HackReturnAddSocketToAvatarFalg = null;
|
HackReturnAddSocketToAvatarFalg = null;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}.bindenv(this));
|
}.bindenv(this);
|
||||||
|
|
||||||
//装备镶嵌和时装镶嵌
|
//装备镶嵌和时装镶嵌
|
||||||
Haker.LoadHook("0x8217BD6", ["int", "pointer", "pointer", "int"],
|
Cb_Dispatcher_UseJewel_Enter_Func.EquimentUseJewel <- function(args) {
|
||||||
function(args) {
|
|
||||||
local SUser = User(args[1]);
|
local SUser = User(args[1]);
|
||||||
local Pack = Packet(args[2]);
|
local Pack = Packet(args[2]);
|
||||||
|
local PackIndex = NativePointer(args[2]).add(4).readInt();
|
||||||
local State = SUser.GetState();
|
local State = SUser.GetState();
|
||||||
if (State != 3) return null;
|
if (State != 3) return null;
|
||||||
|
|
||||||
|
|
@ -429,22 +417,20 @@ class EquimentUseJewel {
|
||||||
SUser.Send(Pack);
|
SUser.Send(Pack);
|
||||||
Pack.Delete();
|
Pack.Delete();
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
AvatarLogic(args, PackIndex);
|
||||||
}.bindenv(this),
|
|
||||||
|
|
||||||
function(args) {
|
return null;
|
||||||
return 0;
|
}.bindenv(this);
|
||||||
}.bindenv(this));
|
|
||||||
|
Cb_Dispatcher_UseJewel_Leave_Func.EquimentUseJewel <- function(args) {
|
||||||
|
return -1;
|
||||||
|
}.bindenv(this);
|
||||||
|
|
||||||
//额外数据包,发送装备镶嵌数据给本地处理
|
//额外数据包,发送装备镶嵌数据给本地处理
|
||||||
Haker.LoadHook("0x0815098e", ["pointer", "pointer", "int"],
|
Cb_InterfacePacketBuf_put_packet_Leave_Func.EquimentUseJewel <- function(args) {
|
||||||
function(args) {
|
|
||||||
return null;
|
|
||||||
}.bindenv(this),
|
|
||||||
|
|
||||||
function(args) {
|
|
||||||
local ret = args.pop();
|
local ret = args.pop();
|
||||||
local Inven_Item = NativePointer(args[1]);
|
local Inven_Item = NativePointer(args[1]);
|
||||||
if (Inven_Item.add(1).readU8() == 1) {
|
if (Inven_Item.add(1).readU8() == 1) {
|
||||||
|
|
@ -456,32 +442,140 @@ class EquimentUseJewel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}.bindenv(this));
|
}.bindenv(this);
|
||||||
|
|
||||||
|
L_HookEquimentUseJewel();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function WongWork_CAvatarItemMgr_getJewelSocketData(a, b) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x82F98F8"), "pointer", ["pointer", "int"], a, b);
|
||||||
|
}
|
||||||
|
|
||||||
|
function CStackableItem_getJewelTargetSocket(C_Object) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x0822CA28"), "int", ["pointer"], C_Object);
|
||||||
|
}
|
||||||
|
|
||||||
|
function CInventory_delete_item(C_Object, Type, Slot, Count, Ps, Log) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x850400C"), "int", ["pointer", "int", "int", "int", "int", "int"], C_Object, Type, Slot, Count, Ps, Log);
|
||||||
|
}
|
||||||
|
|
||||||
|
function api_set_JewelSocketData(jewelSocketData, slot, emblem_item_id) {
|
||||||
|
if (jewelSocketData) {
|
||||||
|
NativePointer(jewelSocketData).add(slot * 6 + 2).writeInt(emblem_item_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function DB_UpdateAvatarJewelSlot_makeRequest(a, b, c) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x843081C"), "pointer", ["int", "int", "pointer"], a, b, c);
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取时装在数据库中的uid
|
||||||
|
function api_get_avartar_ui_id(avartar) {
|
||||||
|
return NativePointer(avartar).add(7).readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function AvatarLogic(args, PackIndex) {
|
||||||
|
//角色
|
||||||
|
local SUser = User(args[1]);
|
||||||
|
//包数据
|
||||||
|
local Pack = Packet(args[2]);
|
||||||
|
//还原包读取数据号位
|
||||||
|
NativePointer(args[2]).add(4).writeInt(PackIndex);
|
||||||
|
|
||||||
|
//校验角色状态是否允许镶嵌
|
||||||
|
if (!SUser || SUser.GetState() != 3) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//时装所在的背包槽
|
||||||
|
local Inven_Slot = Pack.GetShort();
|
||||||
|
//时装item_id
|
||||||
|
local Item_Id = Pack.GetInt();
|
||||||
|
//本次镶嵌徽章数量
|
||||||
|
local Emblem_Count = Pack.GetByte();
|
||||||
|
|
||||||
|
//获取时装道具
|
||||||
|
local InvemObj = SUser.GetInven();
|
||||||
|
local AvatarObj = InvemObj.GetSlot(2, Inven_Slot);
|
||||||
|
|
||||||
|
|
||||||
|
//校验时装 数据是否合法
|
||||||
|
if (!AvatarObj || AvatarObj.IsEmpty || (AvatarObj.GetIndex() != Item_Id) || SUser.CheckItemLock(2, Inven_Slot)) return;
|
||||||
|
|
||||||
|
local Avartar_AddInfo = AvatarObj.GetAdd_Info();
|
||||||
|
//获取时装管理器
|
||||||
|
local Inven_AvartarMgr = InvemObj.GetAvatarItemMgr();
|
||||||
|
|
||||||
|
//获取时装插槽数据
|
||||||
|
local Jewel_Socket_Data = WongWork_CAvatarItemMgr_getJewelSocketData(Inven_AvartarMgr, Avartar_AddInfo);
|
||||||
|
if (!Jewel_Socket_Data) return;
|
||||||
|
|
||||||
|
//最多只支持3个插槽
|
||||||
|
if (Emblem_Count <= 3) {
|
||||||
|
local emblems = {};
|
||||||
|
|
||||||
|
for (local i = 0; i< Emblem_Count; i++) {
|
||||||
|
//徽章所在的背包槽
|
||||||
|
local emblem_inven_slot = Pack.GetShort();
|
||||||
|
//徽章item_id
|
||||||
|
local emblem_item_id = Pack.GetInt();
|
||||||
|
//该徽章镶嵌的时装插槽id
|
||||||
|
local avartar_socket_slot = Pack.GetByte();
|
||||||
|
|
||||||
|
//获取徽章道具
|
||||||
|
local EmblemObje = InvemObj.GetSlot(1, emblem_inven_slot);
|
||||||
|
|
||||||
|
//校验徽章及插槽数据是否合法
|
||||||
|
if (!EmblemObje || EmblemObje.IsEmpty || (EmblemObje.GetIndex() != emblem_item_id) || (avartar_socket_slot >= 3)) return;
|
||||||
|
|
||||||
|
//校验徽章是否满足时装插槽颜色要求
|
||||||
|
//获取徽章pvf数据
|
||||||
|
local citem = PvfItem.GetPvfItemById(emblem_item_id);
|
||||||
|
if (!citem) return;
|
||||||
|
|
||||||
|
//校验徽章类型
|
||||||
|
if (!citem.IsStackable() || citem.GetItemType() != 20) return;
|
||||||
|
|
||||||
|
//获取徽章支持的插槽
|
||||||
|
local emblem_socket_type = CStackableItem_getJewelTargetSocket(citem.C_Object);
|
||||||
|
|
||||||
|
//获取要镶嵌的时装插槽类型
|
||||||
|
local avartar_socket_type = NativePointer(Jewel_Socket_Data).add(avartar_socket_slot * 6).readShort();
|
||||||
|
|
||||||
|
if (!(emblem_socket_type & avartar_socket_type)) return;
|
||||||
|
|
||||||
|
emblems[avartar_socket_slot] <- [emblem_inven_slot, emblem_item_id];
|
||||||
|
}
|
||||||
|
|
||||||
|
//开始镶嵌
|
||||||
|
foreach(avartar_socket_slot, emblemObject in emblems) {
|
||||||
|
//删除徽章
|
||||||
|
local emblem_inven_slot = emblemObject[0];
|
||||||
|
CInventory_delete_item(InvemObj.C_Object, 1, emblem_inven_slot, 1, 8, 1);
|
||||||
|
//设置时装插槽数据
|
||||||
|
local emblem_item_id = emblemObject[1];
|
||||||
|
api_set_JewelSocketData(Jewel_Socket_Data, avartar_socket_slot, emblem_item_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
//时装插槽数据存档
|
||||||
|
DB_UpdateAvatarJewelSlot_makeRequest(SUser.GetCID(), api_get_avartar_ui_id(AvatarObj.C_Object), Jewel_Socket_Data);
|
||||||
|
|
||||||
|
//通知客户端时装数据已更新
|
||||||
|
SUser.SendUpdateItemList(1, 1, Inven_Slot);
|
||||||
|
|
||||||
|
//回包给客户端
|
||||||
|
local Pack = Packet();
|
||||||
|
Pack.Put_Header(1, 204);
|
||||||
|
Pack.Put_Int(1);
|
||||||
|
Pack.Finalize(true);
|
||||||
|
SUser.Send(Pack);
|
||||||
|
Pack.Delete();
|
||||||
|
}
|
||||||
|
|
||||||
//装备全字节复制
|
|
||||||
Haker.LoadHook("0x0814A62E", ["pointer", "pointer", "pointer"],
|
|
||||||
function(args) {
|
|
||||||
return null;
|
return null;
|
||||||
}.bindenv(this),
|
|
||||||
|
|
||||||
function(args) {
|
|
||||||
local Old = NativePointer(args[1]);
|
|
||||||
local New = NativePointer(args[0]);
|
|
||||||
Memory.copy(New, Old, 61);
|
|
||||||
return args[0];
|
|
||||||
}.bindenv(this));
|
|
||||||
|
|
||||||
//装备全字节删除
|
|
||||||
Haker.LoadHook("0x080CB7D8", ["pointer", "int"],
|
|
||||||
function(args) {
|
|
||||||
return null;
|
|
||||||
}.bindenv(this),
|
|
||||||
|
|
||||||
function(args) {
|
|
||||||
local New = NativePointer(args[0]);
|
|
||||||
Memory.reset(New, 61);
|
|
||||||
return null;
|
|
||||||
}.bindenv(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -490,7 +584,3 @@ class EquimentUseJewel {
|
||||||
FixFunction();
|
FixFunction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getroottable().RRR <- EquimentUseJewel();
|
|
||||||
|
|
@ -72,6 +72,27 @@ class Fiendwar {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function base_input_hook2(args) {
|
||||||
|
local type = args[2];
|
||||||
|
local SUser = User(args[1]);
|
||||||
|
local msg = args[3];
|
||||||
|
if ((type == 8 || type == 3) && Sq_Game_GetConfig().find("20") != null) {
|
||||||
|
local Localtion = SUser.GetLocation();
|
||||||
|
if (Localtion.Area <= 1) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
local Jso = {
|
||||||
|
op = 20063027,
|
||||||
|
uid = SUser.GetUID(),
|
||||||
|
cid = SUser.GetCID(),
|
||||||
|
msg = msg
|
||||||
|
}
|
||||||
|
Socket.SendGateway(Jso);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//玩家消息分发
|
//玩家消息分发
|
||||||
function PlayerNotiMsgDistribute(Jso) {
|
function PlayerNotiMsgDistribute(Jso) {
|
||||||
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
|
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
|
||||||
|
|
@ -85,21 +106,22 @@ class Fiendwar {
|
||||||
local SUserName = SUser.GetCharacName();
|
local SUserName = SUser.GetCharacName();
|
||||||
local Type = Jso.type;
|
local Type = Jso.type;
|
||||||
|
|
||||||
|
Jso.msg = Jso.msg;
|
||||||
if (Type == -1) {
|
if (Type == -1) {
|
||||||
Jso.Name <- SUserName;
|
Jso.Name <- SUserName;
|
||||||
foreach(_Index, Value in RealList) {
|
foreach(_Index, Value in RealList) {
|
||||||
local SendObj = Value;
|
local SendObj = Value;
|
||||||
SendObj.SendJso(Jso);
|
SendObj.SendJso(Jso);
|
||||||
}
|
}
|
||||||
} else {
|
Type = "长"
|
||||||
local NotiStr = "(" + Type + ") " + "" + SUserName + " : " + Jso.msg;
|
}
|
||||||
|
local NotiStr = "(攻坚队" + Type + ") " + "" + SUserName + " : " + Jso.msg;
|
||||||
foreach(_Index, Value in RealList) {
|
foreach(_Index, Value in RealList) {
|
||||||
local SendObj = Value;
|
local SendObj = Value;
|
||||||
SendObj.SendNotiPacketMessage(NotiStr, 8);
|
SendObj.SendNotiPacketMessage(NotiStr, 8);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function FiendwarSendAreaUserCallBack(Jso) {
|
function FiendwarSendAreaUserCallBack(Jso) {
|
||||||
local CUserList = Jso.list;
|
local CUserList = Jso.list;
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ class Luke {
|
||||||
function base_input_hook(CUser, CmdString) {
|
function base_input_hook(CUser, CmdString) {
|
||||||
if (!CUser) return true;
|
if (!CUser) return true;
|
||||||
local SUser = User(CUser);
|
local SUser = User(CUser);
|
||||||
|
print(111);
|
||||||
//卢克频道
|
//卢克频道
|
||||||
if (Sq_Game_GetConfig().find("19") != null) {
|
if (Sq_Game_GetConfig().find("19") != null) {
|
||||||
local Localtion = SUser.GetLocation();
|
local Localtion = SUser.GetLocation();
|
||||||
|
|
@ -69,6 +70,29 @@ class Luke {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function base_input_hook2(args) {
|
||||||
|
local type = args[2];
|
||||||
|
local SUser = User(args[1]);
|
||||||
|
local msg = args[3];
|
||||||
|
|
||||||
|
if ((type == 8 || type == 3) && Sq_Game_GetConfig().find("19") != null) {
|
||||||
|
|
||||||
|
local Localtion = SUser.GetLocation();
|
||||||
|
if (Localtion.Area <= 1) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
local Jso = {
|
||||||
|
op = 20084027,
|
||||||
|
uid = SUser.GetUID(),
|
||||||
|
cid = SUser.GetCID(),
|
||||||
|
msg = msg
|
||||||
|
}
|
||||||
|
Socket.SendGateway(Jso);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//玩家消息分发
|
//玩家消息分发
|
||||||
function PlayerNotiMsgDistribute(Jso) {
|
function PlayerNotiMsgDistribute(Jso) {
|
||||||
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
|
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
|
||||||
|
|
@ -82,7 +106,7 @@ class Luke {
|
||||||
local SUserName = SUser.GetCharacName();
|
local SUserName = SUser.GetCharacName();
|
||||||
local Type = Jso.type;
|
local Type = Jso.type;
|
||||||
|
|
||||||
Jso.msg = Jso.msg.slice(0, Jso.msg.len() - 11);
|
Jso.msg = Jso.msg;
|
||||||
if (Type == -1) {
|
if (Type == -1) {
|
||||||
Jso.Name <- SUserName;
|
Jso.Name <- SUserName;
|
||||||
foreach(_Index, Value in RealList) {
|
foreach(_Index, Value in RealList) {
|
||||||
|
|
@ -183,6 +207,7 @@ class Luke {
|
||||||
|
|
||||||
//玩家上线
|
//玩家上线
|
||||||
function Login_Hook(SUser) {
|
function Login_Hook(SUser) {
|
||||||
|
Timer.SetTimeOut(function(SUser) {
|
||||||
//玩家上线发信息包
|
//玩家上线发信息包
|
||||||
local evv = {
|
local evv = {
|
||||||
op = 20084502,
|
op = 20084502,
|
||||||
|
|
@ -190,6 +215,7 @@ class Luke {
|
||||||
channel_index = Channel
|
channel_index = Channel
|
||||||
}
|
}
|
||||||
SUser.SendJso(evv);
|
SUser.SendJso(evv);
|
||||||
|
}.bindenv(this), 5, SUser);
|
||||||
|
|
||||||
local T = {
|
local T = {
|
||||||
op = 20084063,
|
op = 20084063,
|
||||||
|
|
@ -211,8 +237,9 @@ class Luke {
|
||||||
//注册HOOK
|
//注册HOOK
|
||||||
Cb_Insert_User_Func.Luke <- insert_user_hook.bindenv(this); //区域添加角色
|
Cb_Insert_User_Func.Luke <- insert_user_hook.bindenv(this); //区域添加角色
|
||||||
Cb_Move_Area_Func.Luke <- move_area_hook.bindenv(this); //区域移动
|
Cb_Move_Area_Func.Luke <- move_area_hook.bindenv(this); //区域移动
|
||||||
Base_InputHookFunc_Handle.Luke <- base_input_hook.bindenv(this); //玩家发送消息
|
//Base_InputHookFunc_Handle.Luke <- base_input_hook.bindenv(this); //玩家发送消息
|
||||||
Cb_reach_game_world_Func.Luke <- Login_Hook.bindenv(this); //上线HOOK
|
Cb_reach_game_world_Func.Luke <- Login_Hook.bindenv(this); //上线HOOK
|
||||||
|
Cb_Server_Chat_Log_Leave_Func.Luke <- base_input_hook2.bindenv(this); //玩家发送消息
|
||||||
|
|
||||||
//注册收包
|
//注册收包
|
||||||
GatewaySocketPackFuncMap.rawset(20084010, LukeSendAreaUserCallBack.bindenv(this)); //玩家移动后的区域广播包
|
GatewaySocketPackFuncMap.rawset(20084010, LukeSendAreaUserCallBack.bindenv(this)); //玩家移动后的区域广播包
|
||||||
|
|
|
||||||
|
|
@ -6,94 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
class defaultJobItemId {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 头发
|
|
||||||
*/
|
|
||||||
hat = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 帽子
|
|
||||||
*/
|
|
||||||
hair = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*脸
|
|
||||||
*/
|
|
||||||
face = 0;
|
|
||||||
/**
|
|
||||||
* 披风
|
|
||||||
*/
|
|
||||||
breast = 0;
|
|
||||||
/**
|
|
||||||
* 上衣
|
|
||||||
*/
|
|
||||||
coat = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下装
|
|
||||||
*/
|
|
||||||
pants = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 腰部
|
|
||||||
*/
|
|
||||||
waist = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 鞋子
|
|
||||||
*/
|
|
||||||
shoes = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 皮肤
|
|
||||||
*/
|
|
||||||
skin = 0;
|
|
||||||
|
|
||||||
index = null;
|
|
||||||
|
|
||||||
constructor(hat, hair, face, breast, coat, pants, waist, shoes, skin) {
|
|
||||||
index = [];
|
|
||||||
this.hat = hat;
|
|
||||||
this.hair = hair;
|
|
||||||
this.face = face;
|
|
||||||
this.breast = breast;
|
|
||||||
this.coat = coat;
|
|
||||||
this.pants = pants;
|
|
||||||
this.waist = waist;
|
|
||||||
this.shoes = shoes;
|
|
||||||
this.skin = skin;
|
|
||||||
|
|
||||||
index.push(hat);
|
|
||||||
index.push(hair);
|
|
||||||
index.push(face);
|
|
||||||
index.push(breast);
|
|
||||||
index.push(coat);
|
|
||||||
index.push(pants);
|
|
||||||
index.push(waist);
|
|
||||||
index.push(shoes);
|
|
||||||
index.push(skin);
|
|
||||||
index.push(0);
|
|
||||||
index.push(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//默认时装
|
|
||||||
if (!(getroottable().rawin("defaultJobItemIdMap"))) {
|
|
||||||
getroottable().defaultJobItemIdMap <- {};
|
|
||||||
defaultJobItemIdMap.rawset(0, defaultJobItemId(39278, 39400, 0, 0, 40600, 41000, 0, 41800, 42200));
|
|
||||||
defaultJobItemIdMap.rawset(1, defaultJobItemId(0, 43400, 0, 0, 44600, 45000, 0, 45800, 46200));
|
|
||||||
defaultJobItemIdMap.rawset(2, defaultJobItemId(0, 47400, 0, 48426, 48600, 49000, 0, 49800, 50200));
|
|
||||||
defaultJobItemIdMap.rawset(3, defaultJobItemId(51265, 51400, 0, 0, 52600, 53000, 0, 53800, 54200));
|
|
||||||
defaultJobItemIdMap.rawset(4, defaultJobItemId(0, 55400, 55820, 0, 56600, 57000, 0, 57800, 58200));
|
|
||||||
|
|
||||||
defaultJobItemIdMap.rawset(5, defaultJobItemId(1600000, 1610000, 0, 0, 1640000, 1650000, 0, 1670000, 1680000));
|
|
||||||
defaultJobItemIdMap.rawset(6, defaultJobItemId(1720000, 1730000, 0, 1750000, 1760000, 1770000, 0, 1790000, 1800000));
|
|
||||||
defaultJobItemIdMap.rawset(7, defaultJobItemId(0, 29201, 0, 0, 29202, 29203, 0, 29204, 29205));
|
|
||||||
defaultJobItemIdMap.rawset(8, defaultJobItemId(0, 2090000, 0, 0, 2120000, 2130000, 0, 2140000, 2150000));
|
|
||||||
defaultJobItemIdMap.rawset(9, defaultJobItemId(39278, 39400, 0, 0, 40600, 41000, 0, 41800, 42200));
|
|
||||||
defaultJobItemIdMap.rawset(10, defaultJobItemId(51265, 51400, 0, 0, 52600, 53000, 0, 53800, 54200));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class Marry {
|
class Marry {
|
||||||
|
|
@ -307,44 +220,26 @@ class Marry {
|
||||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//根据cid查询自己的uid
|
||||||
|
GetUidByCid = function(cid) {
|
||||||
|
local Sql = format(MARRY_SQL_LIST.GetUidByCid, cid);
|
||||||
//获取角色身上的显示时装
|
//从池子拿连接
|
||||||
function GetAva(SUser) {
|
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||||
//获取背包对象
|
local Ret = SqlObj.Select(Sql, ["int"]);
|
||||||
local InvenObj = SUser.GetInven();
|
//把连接还池子
|
||||||
if (!InvenObj) return;
|
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||||
local re = [];
|
if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||||
local job = SUser.GetCharacJob();
|
return null;
|
||||||
|
} else {
|
||||||
//遍历身上的每一件装备
|
return Ret[0][0];
|
||||||
for (local u = 0; u <= 2; u++) {
|
|
||||||
local EquObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_BODY, u);
|
|
||||||
if (EquObj && !EquObj.IsEmpty) {
|
|
||||||
//先拿克隆id 如果这个值有 那说明带的克隆这个是被克隆的装备 直接用这个 但是如果这个人什么都没带 只带了克隆 会显示克隆的id 所以还得判断这个id是不是克隆时装
|
|
||||||
local clearId = Sq_CallFunc(S_Ptr("0x850d374"), "int", ["pointer", "int"], InvenObj.C_Object, u)
|
|
||||||
|
|
||||||
|
|
||||||
local EquObjId = EquObj.GetIndex();
|
|
||||||
//如果这个是克隆
|
|
||||||
if (clearId > 0) {
|
|
||||||
re.push(clearId);
|
|
||||||
} else { //不是克隆 直接把id放上去
|
|
||||||
re.push(EquObjId);
|
|
||||||
}
|
|
||||||
} else { //如果这个部位没东西 直接放默认时装上去
|
|
||||||
re.push(defaultJobItemIdMap[job].index[u]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return re;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//查看是否结婚包
|
//查看是否结婚包
|
||||||
function CheckMarryStateCallBack(SUser, Jso) {
|
function CheckMarryStateCallBack(SUser, Jso) {
|
||||||
local T = {
|
local T = {
|
||||||
|
|
@ -530,7 +425,10 @@ class Marry {
|
||||||
infore.rawset("name", SUser.GetCharacName());
|
infore.rawset("name", SUser.GetCharacName());
|
||||||
infore.rawset("uid", SUser.GetUID());
|
infore.rawset("uid", SUser.GetUID());
|
||||||
|
|
||||||
local Muser = World.GetUserByUid(Target_CId);
|
//根据cid去查uid
|
||||||
|
local Target_Uid = Mysql_Operate_Func.GetUidByCid(Target_CId);
|
||||||
|
|
||||||
|
local Muser = World.GetUserByUid(Target_Uid);
|
||||||
local infore2 = {};
|
local infore2 = {};
|
||||||
infore2.rawset("job", Muser.GetCharacJob());
|
infore2.rawset("job", Muser.GetCharacJob());
|
||||||
infore2.rawset("growjob", Muser.GetCharacGrowType());
|
infore2.rawset("growjob", Muser.GetCharacGrowType());
|
||||||
|
|
@ -613,7 +511,7 @@ class Marry {
|
||||||
local infore = {
|
local infore = {
|
||||||
job = user.GetCharacJob(),
|
job = user.GetCharacJob(),
|
||||||
growjob = user.GetCharacGrowType(),
|
growjob = user.GetCharacGrowType(),
|
||||||
avatar = GetAva(user),
|
avatar = user.GetAva(),
|
||||||
name = user.GetCharacName(),
|
name = user.GetCharacName(),
|
||||||
};
|
};
|
||||||
info.push(infore);
|
info.push(infore);
|
||||||
|
|
@ -686,7 +584,7 @@ class Marry {
|
||||||
local infore = {};
|
local infore = {};
|
||||||
infore.rawset("job", SUser.GetCharacJob());
|
infore.rawset("job", SUser.GetCharacJob());
|
||||||
infore.rawset("growjob", SUser.GetCharacGrowType());
|
infore.rawset("growjob", SUser.GetCharacGrowType());
|
||||||
infore.rawset("avatar", GetAva(SUser));
|
infore.rawset("avatar", SUser.GetAva());
|
||||||
infore.rawset("name", SUser.GetCharacName());
|
infore.rawset("name", SUser.GetCharacName());
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -720,7 +618,6 @@ class Marry {
|
||||||
if (SUser.GetLocation().Area == Config["礼堂区域编号"]) Sq_WriteAddress(C_Area, 0x68, 1);
|
if (SUser.GetLocation().Area == Config["礼堂区域编号"]) Sq_WriteAddress(C_Area, 0x68, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -850,22 +747,23 @@ class Marry {
|
||||||
Channel = ConfigPath.slice(-6).slice(0, 2);
|
Channel = ConfigPath.slice(-6).slice(0, 2);
|
||||||
|
|
||||||
//注册来自客户端的收包
|
//注册来自客户端的收包
|
||||||
ClientSocketPackFuncMap.rawset(OP + 9, CheckMarryStateCallBack.bindenv(this));
|
// ClientSocketPackFuncMap.rawset(OP + 9, CheckMarryStateCallBack.bindenv(this));
|
||||||
ClientSocketPackFuncMap.rawset(OP + 3, RequestMarry.bindenv(this));
|
// ClientSocketPackFuncMap.rawset(OP + 3, RequestMarry.bindenv(this));
|
||||||
ClientSocketPackFuncMap.rawset(OP + 5, ResponseMarry.bindenv(this));
|
// ClientSocketPackFuncMap.rawset(OP + 5, ResponseMarry.bindenv(this));
|
||||||
ClientSocketPackFuncMap.rawset(OP + 7, CancelMarry.bindenv(this));
|
// ClientSocketPackFuncMap.rawset(OP + 7, CancelMarry.bindenv(this));
|
||||||
ClientSocketPackFuncMap.rawset(OP + 11, OpenPreparationWindow.bindenv(this));
|
// ClientSocketPackFuncMap.rawset(OP + 11, OpenPreparationWindow.bindenv(this));
|
||||||
ClientSocketPackFuncMap.rawset(OP + 13, ConfirmMarry.bindenv(this));
|
// ClientSocketPackFuncMap.rawset(OP + 13, ConfirmMarry.bindenv(this));
|
||||||
ClientSocketPackFuncMap.rawset(OP + 15, EnterAuditorium.bindenv(this));
|
// ClientSocketPackFuncMap.rawset(OP + 15, EnterAuditorium.bindenv(this));
|
||||||
ClientSocketPackFuncMap.rawset(OP + 17, LeaveAuditorium.bindenv(this));
|
// ClientSocketPackFuncMap.rawset(OP + 17, LeaveAuditorium.bindenv(this));
|
||||||
ClientSocketPackFuncMap.rawset(OP + 19, GetAuditoriumList.bindenv(this));
|
// ClientSocketPackFuncMap.rawset(OP + 19, GetAuditoriumList.bindenv(this));
|
||||||
ClientSocketPackFuncMap.rawset(OP + 777, GetConfig.bindenv(this));
|
// ClientSocketPackFuncMap.rawset(OP + 777, GetConfig.bindenv(this));
|
||||||
//注册结婚回调函数
|
//注册结婚回调函数
|
||||||
Cb_Insert_User_Func.Marry <- Marry_insert_user_hook.bindenv(this); //区域添加角色
|
Cb_Insert_User_Func.Marry <- Marry_insert_user_hook.bindenv(this); //区域添加角色
|
||||||
|
|
||||||
//玩家重新上线的时候自动给他退出礼堂
|
// //玩家重新上线的时候自动给他退出礼堂
|
||||||
Cb_reach_game_world_Func.Auditorium <- function(SUser) {
|
Cb_reach_game_world_Func.Auditorium <- function(SUser) {
|
||||||
if (EnterAuditoriumPosList.rawin(SUser.GetUID())) {
|
|
||||||
|
if (EnterAuditoriumPosList && EnterAuditoriumPosList.rawin(SUser.GetUID())) {
|
||||||
local Info = EnterAuditoriumPosList[SUser.GetCID()];
|
local Info = EnterAuditoriumPosList[SUser.GetCID()];
|
||||||
//给这个礼堂的人发送退出可见列表的包
|
//给这个礼堂的人发送退出可见列表的包
|
||||||
foreach(cid in AuditoriumUserInfo[Info["所在礼堂编号"]]) {
|
foreach(cid in AuditoriumUserInfo[Info["所在礼堂编号"]]) {
|
||||||
|
|
@ -878,6 +776,7 @@ class Marry {
|
||||||
}.bindenv(this);
|
}.bindenv(this);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//从池子拿连接
|
//从池子拿连接
|
||||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||||
local query = "SELECT COUNT(*) AS table_exists FROM information_schema.tables WHERE table_schema = 'zyk' AND table_name = 'marry';"
|
local query = "SELECT COUNT(*) AS table_exists FROM information_schema.tables WHERE table_schema = 'zyk' AND table_name = 'marry';"
|
||||||
|
|
@ -892,29 +791,34 @@ class Marry {
|
||||||
//把连接还池子
|
//把连接还池子
|
||||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||||
|
|
||||||
}
|
|
||||||
|
Cb_Use_Item_Sp_Func[Config["结婚等级1道具ID"]] <- function(SUser, ItemId) {
|
||||||
|
ExpUp(SUser, Config["道具1给的心意点"]);
|
||||||
|
}.bindenv(this);
|
||||||
|
Cb_Use_Item_Sp_Func[Config["结婚等级2道具ID"]] <- function(SUser, ItemId) {
|
||||||
|
ExpUp(SUser, Config["道具2给的心意点"]);
|
||||||
|
}.bindenv(this);
|
||||||
|
Cb_Use_Item_Sp_Func[Config["结婚等级3道具ID"]] <- function(SUser, ItemId) {
|
||||||
|
ExpUp(SUser, Config["道具3给的心意点"]);
|
||||||
|
}.bindenv(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ExpUp(SUser, expUp) {
|
||||||
// Cb_Use_Item_Sp_Func[Config["结婚等级1道具ID"]] <- function(SUser, ItemId) {
|
exp = Mysql_Operate_Func.GetExpById(SUser.GetCID())
|
||||||
// ExpUp(SUser, Config["道具1给的心意点"]);
|
if (!exp) {
|
||||||
// }
|
return;
|
||||||
// Cb_Use_Item_Sp_Func[Config["结婚等级2道具ID"]] <- function(SUser, ItemId) {
|
}
|
||||||
// ExpUp(SUser, Config["道具2给的心意点"]);
|
exp = exp + expUp;
|
||||||
// }
|
for (local i = 6; i >= 0; i--) {
|
||||||
// Cb_Use_Item_Sp_Func[Config["结婚等级3道具ID"]] <- function(SUser, ItemId) {
|
//如果当前的经验值大于所遍历到的等级 就设定等级为这个 然后不继续向更低等级遍历
|
||||||
// ExpUp(SUser, Config["道具3给的心意点"]);
|
if (Config["戒指等级"][i.tostring()]["所需经验"]< exp) {
|
||||||
// }
|
Mysql_Operate_Func.SetExpAndLvById(SUser.GetCID(), i, exp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// function ExpUp(SUser, expUp) {
|
}
|
||||||
// exp = Mysql_Operate_Func.GetExpById(SUser.GetCID())
|
//初始化结婚
|
||||||
// exp = exp + expUp;
|
// ProjectInitFuncMap.P_Marry <- Marry();
|
||||||
// for (local i = 6; i >= 0; i--) {
|
|
||||||
// //如果当前的经验值大于所遍历到的等级 就设定等级为这个 然后不继续向更低等级遍历
|
|
||||||
// if (Config["戒指等级"][i.tostring()]["所需经验"]< exp) {
|
|
||||||
// Mysql_Operate_Func.SetExpAndLvById(SUser.GetCID(), i, exp)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
@ -47,3 +47,6 @@ MARRY_SQL_LIST.GetExpById <- @"SELECT experience FROM zyk.marry WHERE cid = %d"
|
||||||
|
|
||||||
//设置自己的经验值和等级
|
//设置自己的经验值和等级
|
||||||
MARRY_SQL_LIST.SetExpAndLvById <- @"UPDATE zyk.marry SET level = %d , experience = %d WHERE cid = %d or target_cid = %d";
|
MARRY_SQL_LIST.SetExpAndLvById <- @"UPDATE zyk.marry SET level = %d , experience = %d WHERE cid = %d or target_cid = %d";
|
||||||
|
|
||||||
|
//根据cid获取uid
|
||||||
|
MARRY_SQL_LIST.GetUidByCid <- @"SELECT m_id FROM taiwan_caincharac_info WHERE charac_no = %d";
|
||||||
|
|
@ -341,9 +341,107 @@ Cb_CVillageMonsterMgr_OnKillVillageMonster_Enter_Func <- {};
|
||||||
Cb_CVillageMonsterMgr_OnKillVillageMonster_Leave_Func <- {};
|
Cb_CVillageMonsterMgr_OnKillVillageMonster_Leave_Func <- {};
|
||||||
_Hook_Register_Currency_Func_("0x086B4866", ["pointer", "pointer", "bool", "int"], Cb_CVillageMonsterMgr_OnKillVillageMonster_Enter_Func, Cb_CVillageMonsterMgr_OnKillVillageMonster_Leave_Func);
|
_Hook_Register_Currency_Func_("0x086B4866", ["pointer", "pointer", "bool", "int"], Cb_CVillageMonsterMgr_OnKillVillageMonster_Enter_Func, Cb_CVillageMonsterMgr_OnKillVillageMonster_Leave_Func);
|
||||||
|
|
||||||
|
//玩家使用复活币
|
||||||
|
Cb_UseCoin_Enter_Func <- {};
|
||||||
|
Cb_UseCoin_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x81CA852", ["pointer", "pointer", "pointer", "pointer", "int"], Cb_UseCoin_Enter_Func, Cb_UseCoin_Leave_Func);
|
||||||
|
|
||||||
//玩家完成任务
|
//玩家完成任务
|
||||||
Cb_fnStatQuestClear_Enter_Func <- {};
|
Cb_fnStatQuestClear_Enter_Func <- {};
|
||||||
Cb_fnStatQuestClear_Leave_Func <- {};
|
Cb_fnStatQuestClear_Leave_Func <- {};
|
||||||
_Hook_Register_Currency_Func_("0x8664412", ["pointer", "int", "int"], Cb_fnStatQuestClear_Enter_Func, Cb_fnStatQuestClear_Leave_Func);
|
_Hook_Register_Currency_Func_("0x8664412", ["pointer", "int", "int"], Cb_fnStatQuestClear_Enter_Func, Cb_fnStatQuestClear_Leave_Func);
|
||||||
|
|
||||||
|
//深渊派对开始时
|
||||||
|
Cb_HellPartyStart_dispatch_Enter_Func <- {};
|
||||||
|
Cb_HellPartyStart_dispatch_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x821D9A6", ["pointer", "pointer", "int"], Cb_HellPartyStart_dispatch_Enter_Func, Cb_HellPartyStart_dispatch_Leave_Func);
|
||||||
|
|
||||||
|
//获取道具日志
|
||||||
|
Cb_UserHistoryLog_ItemAdd_Enter_Func <- {};
|
||||||
|
Cb_UserHistoryLog_ItemAdd_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x8682E84", ["pointer", "int", "int", "int", "pointer", "int", "void"], Cb_UserHistoryLog_ItemAdd_Enter_Func, Cb_UserHistoryLog_ItemAdd_Leave_Func);
|
||||||
|
|
||||||
|
//获取绝望之塔进入次数
|
||||||
|
Cb_TOD_UserState_getEnterCount_Enter_Func <- {};
|
||||||
|
Cb_TOD_UserState_getEnterCount_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x8643872", ["pointer", "int"], Cb_TOD_UserState_getEnterCount_Enter_Func, Cb_TOD_UserState_getEnterCount_Leave_Func);
|
||||||
|
|
||||||
|
|
||||||
|
//掉落道具
|
||||||
|
Cb_GetItemRarity_Enter_Func <- {};
|
||||||
|
Cb_GetItemRarity_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x8550BE4", ["pointer", "pointer", "int", "int", "int", ], Cb_GetItemRarity_Enter_Func, Cb_GetItemRarity_Leave_Func);
|
||||||
|
|
||||||
|
//怪物死亡爆奖励的时候
|
||||||
|
Cb_dispatch_sig_Enter_Func <- {};
|
||||||
|
Cb_dispatch_sig_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x81EB0C4", ["pointer", "pointer", "pointer", "int"], Cb_dispatch_sig_Enter_Func, Cb_dispatch_sig_Leave_Func);
|
||||||
|
|
||||||
|
//装备解锁动作
|
||||||
|
Cb_CItemLock_DoItemUnlock_Enter_Func <- {};
|
||||||
|
Cb_CItemLock_DoItemUnlock_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x854231A", ["pointer", "pointer", "int", "int", "int"], Cb_CItemLock_DoItemUnlock_Enter_Func, Cb_CItemLock_DoItemUnlock_Leave_Func);
|
||||||
|
|
||||||
|
//丢弃物品检查错误
|
||||||
|
Cb_DropItem_check_error_Enter_Func <- {};
|
||||||
|
Cb_DropItem_check_error_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x81C2D9A", ["pointer", "pointer", "pointer", "pointer", "int"], Cb_DropItem_check_error_Enter_Func, Cb_DropItem_check_error_Leave_Func);
|
||||||
|
|
||||||
|
//城镇瞬移
|
||||||
|
Cb_GameWorld_move_area_Enter_Func <- {};
|
||||||
|
Cb_GameWorld_move_area_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x086C5A84", ["pointer", "pointer", "int", "int", "int", "int", "int", "int", "int", "int", "int", "int"], Cb_GameWorld_move_area_Enter_Func, Cb_GameWorld_move_area_Leave_Func);
|
||||||
|
|
||||||
|
|
||||||
|
//称号回包
|
||||||
|
Cb_CTitleBook_putItemData_Enter_Func <- {};
|
||||||
|
Cb_CTitleBook_putItemData_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x08641A6A", ["pointer", "pointer", "int", "pointer", "int"], Cb_CTitleBook_putItemData_Enter_Func, Cb_CTitleBook_putItemData_Leave_Func);
|
||||||
|
|
||||||
|
//设计图继承
|
||||||
|
Cb_CUsercopyItemOption_Enter_Func <- {};
|
||||||
|
Cb_CUsercopyItemOption_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x08671EB2", ["pointer", "pointer", "pointer", "int"], Cb_CUsercopyItemOption_Enter_Func, Cb_CUsercopyItemOption_Leave_Func);
|
||||||
|
|
||||||
|
|
||||||
|
//装备开孔
|
||||||
|
Cb_AddSocketToAvatar_Enter_Func <- {};
|
||||||
|
Cb_AddSocketToAvatar_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x0821A412", ["pointer", "pointer", "pointer", "int"], Cb_AddSocketToAvatar_Enter_Func, Cb_AddSocketToAvatar_Leave_Func);
|
||||||
|
|
||||||
|
//装备镶嵌和时装镶嵌
|
||||||
|
Cb_Dispatcher_UseJewel_Enter_Func <- {};
|
||||||
|
Cb_Dispatcher_UseJewel_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x8217BD6", ["int", "pointer", "pointer", "int"], Cb_Dispatcher_UseJewel_Enter_Func, Cb_Dispatcher_UseJewel_Leave_Func);
|
||||||
|
|
||||||
|
//额外数据包,发送装备镶嵌数据给本地处理
|
||||||
|
Cb_InterfacePacketBuf_put_packet_Enter_Func <- {};
|
||||||
|
Cb_InterfacePacketBuf_put_packet_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x0815098e", ["pointer", "pointer", "int"], Cb_InterfacePacketBuf_put_packet_Enter_Func, Cb_InterfacePacketBuf_put_packet_Leave_Func);
|
||||||
|
|
||||||
|
|
||||||
|
//额外数据包,发送装备镶嵌数据给本地处理
|
||||||
|
Cb_PacketBuf_get_short_Enter_Func <- {};
|
||||||
|
Cb_PacketBuf_get_short_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x0858D0B0", ["pointer", "pointer", "int"], Cb_PacketBuf_get_short_Enter_Func, Cb_PacketBuf_get_short_Leave_Func);
|
||||||
|
|
||||||
|
|
||||||
|
//公会普通信息回包
|
||||||
|
Cb_MonitorNoticeGuildChatMsg_Enter_Func <- {};
|
||||||
|
Cb_MonitorNoticeGuildChatMsg_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x084C9E30", ["pointer", "pointer", "pointer", "int"], Cb_MonitorNoticeGuildChatMsg_Enter_Func, Cb_MonitorNoticeGuildChatMsg_Leave_Func);
|
||||||
|
|
||||||
|
//公会超链接信息回包
|
||||||
|
Cb_MonitorNoticeGuildChatMsgHyperLink_Enter_Func <- {};
|
||||||
|
Cb_MonitorNoticeGuildChatMsgHyperLink_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x084E503C", ["pointer", "pointer", "pointer", "int"], Cb_MonitorNoticeGuildChatMsgHyperLink_Enter_Func, Cb_MonitorNoticeGuildChatMsgHyperLink_Leave_Func);
|
||||||
|
|
||||||
|
//检查移动技能槽位
|
||||||
|
Cb_CheckMoveComboSkillSlot_Enter_Func <- {};
|
||||||
|
Cb_CheckMoveComboSkillSlot_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x08608C98", ["pointer", "char", "char", "bool"], Cb_CheckMoveComboSkillSlot_Enter_Func, Cb_CheckMoveComboSkillSlot_Leave_Func);
|
||||||
|
|
||||||
|
//检查插入快捷技能槽位
|
||||||
|
Cb_CheckComboSkillInsertQuickSlot_Enter_Func <- {};
|
||||||
|
Cb_CheckComboSkillInsertQuickSlot_Leave_Func <- {};
|
||||||
|
_Hook_Register_Currency_Func_("0x08608D58", ["pointer", "int", "bool"], Cb_CheckComboSkillInsertQuickSlot_Enter_Func, Cb_CheckComboSkillInsertQuickSlot_Leave_Func);
|
||||||
|
|
@ -32,3 +32,8 @@ function printT(T)
|
||||||
{
|
{
|
||||||
Sq_OutPutTable(Json.Encode(T));
|
Sq_OutPutTable(Json.Encode(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function LoadConfig(Path)
|
||||||
|
{
|
||||||
|
dofile("/dp_s/" + Path);
|
||||||
|
}
|
||||||
|
|
@ -10,7 +10,10 @@ function InitPluginInfo() {
|
||||||
local ConfigPath = Sq_Game_GetConfig();
|
local ConfigPath = Sq_Game_GetConfig();
|
||||||
local Channel = ConfigPath.slice(ConfigPath.find("cfg/") + 4, ConfigPath.len());
|
local Channel = ConfigPath.slice(ConfigPath.find("cfg/") + 4, ConfigPath.len());
|
||||||
// if (Channel.find("15")) GameManager.OpenHotFix("/dp_s/Dps_A");
|
// if (Channel.find("15")) GameManager.OpenHotFix("/dp_s/Dps_A");
|
||||||
if (Channel.find("19")) GameManager.OpenHotFix("/dp_s/Dps_A");
|
if (Channel.find("15")) {
|
||||||
|
GameManager.OpenHotFix("/dp_s/Dps_A");
|
||||||
|
GameManager.OpenHotFix("/dp_s/MyProject");
|
||||||
|
}
|
||||||
|
|
||||||
local PoolObj = MysqlPool.GetInstance();
|
local PoolObj = MysqlPool.GetInstance();
|
||||||
PoolObj.SetBaseConfiguration("127.0.0.1", 3306, "game", "uu5!^%jg");
|
PoolObj.SetBaseConfiguration("127.0.0.1", 3306, "game", "uu5!^%jg");
|
||||||
|
|
@ -19,8 +22,10 @@ function InitPluginInfo() {
|
||||||
//初始化
|
//初始化
|
||||||
PoolObj.Init();
|
PoolObj.Init();
|
||||||
|
|
||||||
|
GameManager.FixEquipUseJewel();
|
||||||
|
GameManager.Fix14Skill();
|
||||||
|
|
||||||
Sq_CreatSocketConnect("192.168.200.24", "65109");
|
Sq_CreatSocketConnect("192.168.200.20", "65109");
|
||||||
|
|
||||||
//初始化结婚
|
//初始化结婚
|
||||||
// ProjectInitFuncMap.P_Marry <- Marry();
|
// ProjectInitFuncMap.P_Marry <- Marry();
|
||||||
|
|
@ -35,6 +40,8 @@ function InitPluginInfo() {
|
||||||
//Log.Put("normal", "测试日志");
|
//Log.Put("normal", "测试日志");
|
||||||
//Log.Put("error", "测试错误日志");
|
//Log.Put("error", "测试错误日志");
|
||||||
|
|
||||||
|
GameManager.OpenCreateJob_CreatorMage();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -55,8 +62,6 @@ function main() {
|
||||||
GameManager.FixDespairGold();
|
GameManager.FixDespairGold();
|
||||||
GameManager.FixGlodTradeDaily(80000000);
|
GameManager.FixGlodTradeDaily(80000000);
|
||||||
|
|
||||||
|
|
||||||
getroottable().RRR <- EquimentUseJewel();
|
|
||||||
// local PvfObject = Script();
|
// local PvfObject = Script();
|
||||||
// local Data = ScriptData.GetEquipment(305014);
|
// local Data = ScriptData.GetEquipment(305014);
|
||||||
// printT(Data);
|
// printT(Data);
|
||||||
|
|
@ -65,6 +70,26 @@ function main() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
function onil() {
|
||||||
|
print(11);
|
||||||
|
local T = {
|
||||||
|
op = 20065005,
|
||||||
|
uid = 0,
|
||||||
|
cid = 0
|
||||||
|
}
|
||||||
|
local WorldMap = World.GetOnlinePlayer();
|
||||||
|
foreach(W_User in WorldMap) {
|
||||||
|
T.uid = W_User.GetUniqueId();
|
||||||
|
T.cid = W_User.GetCID();
|
||||||
|
Socket.SendGateway(T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer.SetCronTask(onil, "0/10 * * * * *");
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// getroottable().CombatRankServerProject <- CombatRank();
|
// getroottable().CombatRankServerProject <- CombatRank();
|
||||||
// getroottable().ServerControlProject <- ServerControl();
|
// getroottable().ServerControlProject <- ServerControl();
|
||||||
|
|
|
||||||
13
Main.nut
13
Main.nut
|
|
@ -4,16 +4,3 @@ function sqr_main() {
|
||||||
print("服务端插件启动");
|
print("服务端插件启动");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//玩家完成任务
|
|
||||||
Cb_fnStatQuestClear_Enter_Func <- {};
|
|
||||||
Cb_fnStatQuestClear_Leave_Func <- {};
|
|
||||||
_Hook_Register_Currency_Func_("0x8664412", ["pointer", "int", "int"], Cb_fnStatQuestClear_Enter_Func, Cb_fnStatQuestClear_Leave_Func);
|
|
||||||
|
|
||||||
|
|
||||||
Cb_fnStatQuestClear_Enter_Func.text <- function(args) {
|
|
||||||
local user = User(args[0])
|
|
||||||
print(args[1]);
|
|
||||||
print(user.GetCharacName());
|
|
||||||
};
|
|
||||||
|
|
@ -0,0 +1,178 @@
|
||||||
|
/*
|
||||||
|
文件名:一键入库.nut
|
||||||
|
路径:MyProject/一键入库.nut
|
||||||
|
创建日期:2025-03-25 14:42
|
||||||
|
文件用途:一键入库
|
||||||
|
*/
|
||||||
|
//获取金库
|
||||||
|
function User::GetCharacCargo() {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x008151A94"), "pointer", ["pointer"], this.C_Object);
|
||||||
|
}
|
||||||
|
|
||||||
|
//检查金库是否有指定ID道具
|
||||||
|
function CharacCargo_Check_Item_Exist(Cargo_C_Object, ItemId) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x0850BC14"), "int", ["pointer", "int"], Cargo_C_Object, ItemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
//检查物上限品堆叠
|
||||||
|
function Check_Item_Stack(ItemId, ItemCount) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x08501A79"), "int", ["int", "int"], ItemId, ItemCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
//将物品存入仓库
|
||||||
|
function CharacCargo_Insert_Item(Cargo_C_Object, Item_C_Object) {
|
||||||
|
return Sq_CallFunc(S_Ptr("0x0850B400"), "int", ["pointer", "pointer"], Cargo_C_Object, Item_C_Object);
|
||||||
|
}
|
||||||
|
|
||||||
|
Gm_InputFunc_Handle.AAWW <- function(SUser, CmdString) {
|
||||||
|
//获取金库
|
||||||
|
local Cargo_C_Object = SUser.GetCharacCargo();
|
||||||
|
//获取背包
|
||||||
|
local InvenObj = SUser.GetInven();
|
||||||
|
|
||||||
|
// 物品槽范围: 57-152 (材料、消耗品栏)
|
||||||
|
local INVENTORY_SLOT_START = 57;
|
||||||
|
local INVENTORY_SLOT_END = 152;
|
||||||
|
|
||||||
|
local anyItemInserted = false; // 标志变量,用于跟踪是否有物品被成功插入
|
||||||
|
|
||||||
|
for (local slot = INVENTORY_SLOT_START; slot <= INVENTORY_SLOT_END; slot++) {
|
||||||
|
local ItemObject = InvenObj.GetSlot(1, slot);
|
||||||
|
local ItemId = ItemObject.GetIndex();
|
||||||
|
local ItemName = PvfItem.GetNameById(ItemId);
|
||||||
|
|
||||||
|
// 如果物品ID无效,跳过当前循环
|
||||||
|
if (ItemId <= 0) continue;
|
||||||
|
local CheckFlag = CharacCargo_Check_Item_Exist(Cargo_C_Object, ItemId);
|
||||||
|
// 如果仓库中没有该物品,跳过
|
||||||
|
if (CheckFlag == -1) continue;
|
||||||
|
|
||||||
|
local Cargo_M_Object = NativePointer(Cargo_C_Object);
|
||||||
|
// 获取仓库中对应物品的指针和数量
|
||||||
|
local CargoItemPointer = NativePointer(Cargo_M_Object.add(4).readPointer()).add(61 * CheckFlag).readPointer();
|
||||||
|
local CargoItem = Item(CargoItemPointer);
|
||||||
|
local CargoItemId = NativePointer(Cargo_M_Object.add(4).readPointer()).add(61 * CheckFlag + 2).readU32();
|
||||||
|
//仓库中的数量
|
||||||
|
local CargoItemCount = CargoItem.GetAdd_Info() ? CargoItem.GetAdd_Info() : 1;
|
||||||
|
//背包中的数量
|
||||||
|
local InventoryItemCount = ItemObject.GetAdd_Info();
|
||||||
|
|
||||||
|
//检查物品堆叠是否超过上限
|
||||||
|
local CanStack = Check_Item_Stack(ItemId, InventoryItemCount + CargoItemCount);
|
||||||
|
if (CanStack == 0) {
|
||||||
|
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "超过堆叠上限,无法放入", 8);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将物品存入仓库
|
||||||
|
local InsertResult = CharacCargo_Insert_Item(Cargo_C_Object, ItemObject.C_Object);
|
||||||
|
if (InsertResult >= 0) {
|
||||||
|
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + InventoryItemCount, 8);
|
||||||
|
InvenObj.DeleteItemCount(ItemId, InventoryItemCount);
|
||||||
|
SUser.SendUpdateItemList(1, 0, slot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新仓库
|
||||||
|
SUser.SendItemSpace(2);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function saveItemToInven(SUser) {
|
||||||
|
// 获取角色背包
|
||||||
|
local InvenObj = SUser.GetInven();
|
||||||
|
// 角色仓库
|
||||||
|
local CargoObj = Sq_CallFunc(S_Ptr("0x08151a94"), "pointer", ["pointer"], SUser.C_Object);
|
||||||
|
// 添加计数器
|
||||||
|
local transferCount = 0;
|
||||||
|
// 遍历背包消耗品栏及材料栏
|
||||||
|
for (local i = 57; i <= 152; ++i) {
|
||||||
|
// 获取背包物品
|
||||||
|
local ItemObj = InvenObj.GetSlot(1, i);
|
||||||
|
// 获取背包物品ID
|
||||||
|
local Item_Id = ItemObj.GetIndex();
|
||||||
|
local ItemName = PvfItem.GetNameById(Item_Id);
|
||||||
|
// 如果物品ID为0或3037,跳过(在此可以添加其他需要跳过的物品ID)
|
||||||
|
if (Item_Id == 0 || Item_Id == 3037) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 角色仓库是否存在背包物品
|
||||||
|
local CargoSlot = Sq_CallFunc(S_Ptr("0x850bc14"), "int", ["pointer", "int"], CargoObj, Item_Id);
|
||||||
|
// 如果角色仓库中没有该物品,跳过
|
||||||
|
if(CargoSlot == -1) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取仓库物品指针
|
||||||
|
local cargoItemPointer = NativePointer(CargoObj).add(4).readPointer();
|
||||||
|
// 获取角色仓库物品对象
|
||||||
|
local cargoItemObj = NativePointer(cargoItemPointer).add(61 * CargoSlot);
|
||||||
|
print(typeof cargoItemObj)
|
||||||
|
// 获取角色仓库物品ID
|
||||||
|
local cargoItemId = NativePointer(cargoItemPointer).add(61 * CargoSlot + 2).readU32();
|
||||||
|
// 获取角色仓库物品数量
|
||||||
|
local cargoItemCount = Sq_CallFunc(S_Ptr("0x80F783A"), "int", ["pointer"], cargoItemObj.C_Object);
|
||||||
|
|
||||||
|
// 获取物品对象
|
||||||
|
local PvfItem = PvfItem.GetPvfItemById(cargoItemId);
|
||||||
|
|
||||||
|
// 获取物品可堆叠数量
|
||||||
|
local getStackableLimit = Sq_CallFunc(S_Ptr("0x0822C9FC"), "int", ["pointer"], PvfItem.C_Object);
|
||||||
|
|
||||||
|
// 如果仓库已达堆叠上限,跳过此物品
|
||||||
|
if(cargoItemCount >= getStackableLimit) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取背包物品数量
|
||||||
|
local inventoryItemCount = Sq_CallFunc(S_Ptr("0x80F783A"), "int", ["pointer"], ItemObj.C_Object);
|
||||||
|
// 获取物品是否可堆叠
|
||||||
|
local checkStackableLimit = Sq_CallFunc(S_Ptr("0x08501A79"), "int", ["int", "int"], cargoItemId, cargoItemCount + inventoryItemCount);
|
||||||
|
// 尝试将物品储存至角色仓库中
|
||||||
|
local tryAddStackItem = Sq_CallFunc(S_Ptr("0x0850B4B0"), "int", ["pointer", "pointer", "int"], CargoObj, ItemObj.C_Object, CargoSlot);
|
||||||
|
if (tryAddStackItem >= 0) {
|
||||||
|
// 正式将物品插入角色仓库中
|
||||||
|
Sq_CallFunc(S_Ptr("0x850b672"), "pointer", ["pointer", "pointer", "int"], CargoObj, ItemObj.C_Object, CargoSlot);
|
||||||
|
// 删除背包中的物品
|
||||||
|
ItemObj.Delete();
|
||||||
|
transferCount++;
|
||||||
|
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + inventoryItemCount, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理可堆叠物品
|
||||||
|
if(checkStackableLimit == 0) {
|
||||||
|
// 获取物品总数
|
||||||
|
local totalCount = cargoItemCount + inventoryItemCount;
|
||||||
|
|
||||||
|
// 如果总数不超过上限,全部堆到仓库
|
||||||
|
if(totalCount <= getStackableLimit) {
|
||||||
|
// 将物品堆到仓库
|
||||||
|
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], cargoItemObj.C_Object, totalCount);
|
||||||
|
// 删除背包中的物品
|
||||||
|
ItemObj.Delete();
|
||||||
|
transferCount++;
|
||||||
|
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + inventoryItemCount, 8);
|
||||||
|
} else {
|
||||||
|
// 如果总数超过上限
|
||||||
|
// 将仓库的物品数量设置为最大数量
|
||||||
|
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], cargoItemObj.C_Object, getStackableLimit);
|
||||||
|
// 将背包数量减去转移至仓库的数量
|
||||||
|
local transferAmount = getStackableLimit - cargoItemCount;
|
||||||
|
Sq_CallFunc(S_Ptr("0x80CB884"), "int", ["pointer", "int"], ItemObj.C_Object, totalCount - getStackableLimit);
|
||||||
|
transferCount++;
|
||||||
|
SUser.SendNotiPacketMessage("[ " + ItemName + " ]" + "成功入库 x " + transferAmount, 8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 通知客户端更新背包
|
||||||
|
SUser.SendUpdateItemList(1, 0, i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (transferCount == 0) {
|
||||||
|
SUser.SendNotiBox("没有可转移的物品!", 1);
|
||||||
|
}
|
||||||
|
// 通知客户端更新仓库
|
||||||
|
SUser.SendItemSpace(2);
|
||||||
|
}
|
||||||
|
|
@ -154,5 +154,8 @@
|
||||||
},
|
},
|
||||||
"Dps_A/ProjectClass/Luke": {
|
"Dps_A/ProjectClass/Luke": {
|
||||||
"description": "卢克攻坚战"
|
"description": "卢克攻坚战"
|
||||||
|
},
|
||||||
|
"Dps_A/BaseClass/BigInt": {
|
||||||
|
"description": "大数字类"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BIN
lib/libAurora.so
BIN
lib/libAurora.so
Binary file not shown.
|
|
@ -0,0 +1,59 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# save as strip_other_funcs.sh
|
||||||
|
|
||||||
|
# 输入参数检查
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "Usage: $0 <binary_file>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
TARGET_BIN="$1"
|
||||||
|
BACKUP_BIN="${TARGET_BIN}.bak"
|
||||||
|
|
||||||
|
# 定义要保留的函数列表
|
||||||
|
TARGET_FUNCTIONS=(
|
||||||
|
"Lenheart()"
|
||||||
|
"_Inter_LoadGeolocation_dispatch_sig(void*, void*, char*)"
|
||||||
|
"SocketThread_function(void*)"
|
||||||
|
"PrintAuroraTag()"
|
||||||
|
"InitSquirrel()"
|
||||||
|
"ReloadingScript(SQVM*, std::string)"
|
||||||
|
"ReqSquirrelScript(SQVM*)"
|
||||||
|
"Cutecode(char*, int*, int)"
|
||||||
|
)
|
||||||
|
|
||||||
|
# 创建备份
|
||||||
|
cp "$TARGET_BIN" "$BACKUP_BIN"
|
||||||
|
|
||||||
|
# 获取保留符号列表
|
||||||
|
KEEP_SYMBOLS=()
|
||||||
|
while read -r symbol; do
|
||||||
|
demangled=$(c++filt "$symbol" 2>/dev/null)
|
||||||
|
for target in "${TARGET_FUNCTIONS[@]}"; do
|
||||||
|
if [[ "$demangled" == "$target" ]]; then
|
||||||
|
KEEP_SYMBOLS+=("$symbol")
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done < <(nm --defined-only "$BACKUP_BIN" | awk '/ [TtWw] /{print $3}')
|
||||||
|
|
||||||
|
if [ ${#KEEP_SYMBOLS[@]} -eq 0 ]; then
|
||||||
|
echo "Error: No target symbols found!"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 生成保留符号文件
|
||||||
|
KEEP_FILE=$(mktemp)
|
||||||
|
printf "%s\n" "${KEEP_SYMBOLS[@]}" > "$KEEP_FILE"
|
||||||
|
|
||||||
|
# 执行符号清理
|
||||||
|
echo "Stripping symbols..."
|
||||||
|
objcopy --strip-all \
|
||||||
|
--keep-symbols="$KEEP_FILE" \
|
||||||
|
"$BACKUP_BIN" \
|
||||||
|
"$TARGET_BIN"
|
||||||
|
|
||||||
|
# 清理临时文件
|
||||||
|
rm -f "$KEEP_FILE"
|
||||||
|
|
||||||
|
echo "Done. Original backup at: $BACKUP_BIN"
|
||||||
BIN
测试加密脚本.sut
BIN
测试加密脚本.sut
Binary file not shown.
Loading…
Reference in New Issue