This commit is contained in:
parent
e82c5ceee3
commit
6c71c79563
|
|
@ -0,0 +1,209 @@
|
|||
/*
|
||||
文件名:AdMsg.nut
|
||||
路径:Dps_A/BaseClass/AdMsg/AdMsg.nut
|
||||
创建日期:2024-10-23 20:46
|
||||
文件用途:高级消息类
|
||||
*/
|
||||
class AdMsg {
|
||||
|
||||
RarityColor = [
|
||||
[255, 255, 255, 255], // 普通
|
||||
[104, 213, 237, 255], // 高级
|
||||
[179, 107, 255, 255], // 稀有
|
||||
[255, 0, 255, 255], // 神器
|
||||
[255, 180, 0, 255], // 史诗
|
||||
[255, 102, 102, 255], // 勇者
|
||||
[255, 20, 147, 255], // 深粉红色
|
||||
[255, 215, 0, 255] // 金色
|
||||
];
|
||||
|
||||
SendBinary = null;
|
||||
SendInfoArr = null;
|
||||
SendStrArr = null;
|
||||
|
||||
//写入分隔
|
||||
function PutSeparate() {
|
||||
SendBinary.writen(0xc2, 'c');
|
||||
SendBinary.writen(0x80, 'c');
|
||||
}
|
||||
//写入普通字符串
|
||||
function WriteStr(Str) {
|
||||
local Point = Memory.allocUtf8String(Str);
|
||||
local Blob = Sq_Point2Blob(Point.C_Object, Str.len());
|
||||
SendBinary.writeblob(Blob);
|
||||
}
|
||||
//写入颜色字符串
|
||||
function WriteColorStr(Str, Color) {
|
||||
//写入分隔
|
||||
PutSeparate();
|
||||
WriteStr(Str);
|
||||
PutSeparate();
|
||||
|
||||
local ColorBlob = blob(104);
|
||||
for (local i = 0; i< 3; i++) {
|
||||
ColorBlob.writen(Color[i], 'c');
|
||||
}
|
||||
for (local i = 0; i< 101; i++) {
|
||||
ColorBlob.writen(0xff, 'c');
|
||||
}
|
||||
SendInfoArr.push(ColorBlob);
|
||||
}
|
||||
//写入表情
|
||||
function WriteImotIcon(Var) {
|
||||
//写入分隔
|
||||
SendBinary.writen(0x1e, 'c');
|
||||
SendBinary.writen(0x25, 'c');
|
||||
SendBinary.writen(Var, 'c');
|
||||
SendBinary.writen(0x1f, 'c');
|
||||
}
|
||||
//写入装备
|
||||
function JumpWrite(Blob, Pos, Value, Type) {
|
||||
Blob.seek(Pos, 'b');
|
||||
Blob.writen(Value, Type);
|
||||
}
|
||||
|
||||
function WriteEquipment(Str, Var, Color) {
|
||||
local ItemObj = Var;
|
||||
//写入分隔
|
||||
PutSeparate();
|
||||
WriteStr(Str);
|
||||
PutSeparate();
|
||||
|
||||
local InfoBlob = blob(104);
|
||||
for (local i = 0; i< 3; i++) {
|
||||
InfoBlob.writen(Color[i], 'c');
|
||||
}
|
||||
//装备代码
|
||||
JumpWrite(InfoBlob, 0x4, ItemObj.GetIndex(), 'i');
|
||||
//品级
|
||||
JumpWrite(InfoBlob, 0x8, ItemObj.GetAdd_Info(), 'i');
|
||||
//强化等级
|
||||
JumpWrite(InfoBlob, 0xc, ItemObj.GetUpgrade(), 'c');
|
||||
//装备耐久
|
||||
JumpWrite(InfoBlob, 0xe, ItemObj.GetDurable(), 's');
|
||||
//是否封装 //TODO
|
||||
JumpWrite(InfoBlob, 0x10, ItemObj.GetAttachType(), 'c');
|
||||
//封装次数 //TODO
|
||||
JumpWrite(InfoBlob, 0x12, ItemObj.GetDurable(), 'c');
|
||||
//附魔卡片
|
||||
JumpWrite(InfoBlob, 0x14, ItemObj.GetEnchanting(), 'i');
|
||||
//红字类型
|
||||
JumpWrite(InfoBlob, 0x18, ItemObj.GetAmplification(), 'c');
|
||||
//红字数值
|
||||
JumpWrite(InfoBlob, 0x1a, 112, 'c');
|
||||
|
||||
|
||||
SendInfoArr.push(InfoBlob);
|
||||
}
|
||||
|
||||
constructor() {
|
||||
SendStrArr = [];
|
||||
SendInfoArr = [];
|
||||
SendBinary = blob(0);
|
||||
//写入分隔
|
||||
PutSeparate();
|
||||
|
||||
}
|
||||
|
||||
//构造信息段结构体
|
||||
function MakeInfo() {
|
||||
return {
|
||||
Str = "",
|
||||
Flag = 0,
|
||||
Var = 0,
|
||||
Color = 0
|
||||
}
|
||||
}
|
||||
|
||||
Type = 0;
|
||||
//put 类型
|
||||
function PutType(gType) {
|
||||
Type = gType;
|
||||
}
|
||||
|
||||
//put 普通信息
|
||||
function PutString(Str) {
|
||||
local Info = MakeInfo();
|
||||
Info.Str = Str;
|
||||
SendStrArr.push(Info);
|
||||
}
|
||||
|
||||
//put 颜色信息
|
||||
function PutColorString(Str, Color) {
|
||||
local Info = MakeInfo();
|
||||
Info.Str = Str;
|
||||
Info.Flag = 1;
|
||||
Info.Color = Color;
|
||||
SendStrArr.push(Info);
|
||||
}
|
||||
|
||||
//put 表情
|
||||
function PutImoticon(Index) {
|
||||
local Info = MakeInfo();
|
||||
Info.Flag = 2;
|
||||
Info.Var = Index;
|
||||
SendStrArr.push(Info);
|
||||
}
|
||||
|
||||
//put 装备
|
||||
function PutEquipment(...) {
|
||||
local Info = MakeInfo();
|
||||
if (vargv.len() > 1) {
|
||||
Info.Str = vargv[0];
|
||||
Info.Var = vargv[1];
|
||||
Info.Color = vargv[2];
|
||||
} else {
|
||||
Info.Var = vargv[0];
|
||||
Info.Str = PvfItem.GetNameById(vargv[0].GetIndex());
|
||||
Info.Color = RarityColor[PvfItem.GetPvfItemById(vargv[0].GetIndex()).GetRarity()];
|
||||
}
|
||||
|
||||
|
||||
Info.Flag = 3;
|
||||
SendStrArr.push(Info);
|
||||
}
|
||||
|
||||
function Finalize() {
|
||||
//写入字符串
|
||||
foreach(Info in SendStrArr) {
|
||||
//普通字符串
|
||||
if (Info.Flag == 0) WriteStr(Info.Str);
|
||||
//写入颜色字符串
|
||||
else if (Info.Flag == 1) WriteColorStr(Info.Str, Info.Color);
|
||||
//写入表情
|
||||
else if (Info.Flag == 2) WriteImotIcon(Info.Var);
|
||||
//写入装备
|
||||
else if (Info.Flag == 3) WriteEquipment(Info.Str, Info.Var, Info.Color);
|
||||
}
|
||||
}
|
||||
|
||||
Pack = null;
|
||||
|
||||
function MakePack() {
|
||||
//文字信息长度
|
||||
local SendBinaryLen = SendBinary.len();
|
||||
//申请内存
|
||||
local SendStrPoint = Memory.alloc(SendBinaryLen);
|
||||
Sq_WriteBlobToAddress(SendStrPoint.C_Object, SendBinary);
|
||||
|
||||
Pack = Packet();
|
||||
Pack.Put_Header(0, 370);
|
||||
Pack.Put_Byte(Type);
|
||||
Pack.Put_Short(0);
|
||||
Pack.Put_Byte(3);
|
||||
Pack.Put_Int(SendBinaryLen);
|
||||
Pack.Put_BinaryEx(SendStrPoint.C_Object, SendBinaryLen);
|
||||
Pack.Put_Byte(SendInfoArr.len());
|
||||
for (local i = 0; i< SendInfoArr.len(); i++) {
|
||||
local Point = Memory.alloc(104);
|
||||
Sq_WriteBlobToAddress(Point.C_Object, SendInfoArr[i]);
|
||||
Pack.Put_BinaryEx(Point.C_Object, 104);
|
||||
}
|
||||
Pack.Finalize(true);
|
||||
return Pack;
|
||||
}
|
||||
|
||||
function Delete() {
|
||||
Pack.Delete();
|
||||
}
|
||||
}
|
||||
|
|
@ -55,4 +55,5 @@ class BlobEx extends blob {
|
|||
function GetString(count) {
|
||||
return stream_myreadstring(count);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -132,6 +132,19 @@ class GameManager extends Base_C_Object {
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//修改交易金币上限
|
||||
function FixGlodTradeDaily(Count) {
|
||||
local Arr = [0xB8];
|
||||
local BlobObj = blob(0);
|
||||
BlobObj.writen(Count, 'i');
|
||||
for (local i = 0; i< 4; i++) {
|
||||
Arr.append(BlobObj[i]);
|
||||
}
|
||||
Arr.append(0x90);
|
||||
Sq_WriteByteArr(S_Ptr("0x86464CE"), Arr);
|
||||
}
|
||||
|
||||
}
|
||||
//热重载
|
||||
function _Reload_List_Write_(Path) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
文件名:HttpClass.nut
|
||||
路径:Dps_A/BaseClass/HttpClass/HttpClass.nut
|
||||
创建日期:2024-10-16 18:41
|
||||
文件用途:Http类
|
||||
*/
|
||||
class Http {
|
||||
|
||||
Host = null;
|
||||
Service = null;
|
||||
|
||||
constructor(host, service = "http") {
|
||||
Host = host;
|
||||
Service = service;
|
||||
}
|
||||
|
||||
function Request(Type, Url, Content) {
|
||||
local Request = Type + " " + Url + " HTTP/1.1\r\nHost: " + Host + "\r\n";
|
||||
|
||||
if (Content) {
|
||||
Request += "Content-Length: " + Content.len() + "\r\n";
|
||||
Request += "Content-Type: application/x-www-form-urlencoded\r\n";
|
||||
Request += "\r\n";
|
||||
Request += Content;
|
||||
} else {
|
||||
Request += "Connection: close\r\n\r\n";
|
||||
}
|
||||
return Sq_CreateHttp(Host, Service, Request);
|
||||
}
|
||||
|
||||
// 发送请求
|
||||
function Post(Url, Content = null) {
|
||||
return Request("POST", Url, Content);
|
||||
}
|
||||
|
||||
function Get(Url, Content = null) {
|
||||
return Request("GET", Url, Content);
|
||||
}
|
||||
}
|
||||
|
||||
Timer.SetTimeOut(function() {
|
||||
// local Dio = Http("192.168.200.189", "45123");
|
||||
// local Jso = {
|
||||
// a = 1,
|
||||
// b = 4.8,
|
||||
// c = "测试"
|
||||
// }
|
||||
// local JsonStr = Json.Encode(Jso);
|
||||
// local Res = Dio.Post("/", JsonStr);
|
||||
// print(Res);
|
||||
|
||||
// local NowTimesstamp = Sq_GetTimestampString();
|
||||
// print(NowTimesstamp);
|
||||
|
||||
// local Trad = Sq_Conversion("這是繁體語句", 0);
|
||||
// local Simple = Sq_Conversion("这是简体语句", 1);
|
||||
// print(Trad);
|
||||
// print(Simple);
|
||||
|
||||
}, 0);
|
||||
|
||||
// local Dio = Http("myip.ipip.net", "443");
|
||||
// local Res = Dio.Get("/", "");
|
||||
|
||||
// print(Res);
|
||||
|
|
@ -26,7 +26,7 @@ class IO extends Base_C_Object {
|
|||
local FileObj = Sq_CallFunc(_Fopen_Address, "pointer", ["pointer", "pointer"], Str_Ptr(FileName), Str_Ptr(Modes));
|
||||
if (FileObj) {
|
||||
base.constructor(FileObj);
|
||||
} else throw("文件打开错误! FileName: " + FileName);
|
||||
} else throw ("文件打开错误! FileName: " + FileName);
|
||||
}
|
||||
|
||||
//读取一行
|
||||
|
|
|
|||
|
|
@ -48,6 +48,10 @@ class Item extends Base_C_Object {
|
|||
Attribute.seek(2);
|
||||
return Attribute.readn('i');
|
||||
}
|
||||
//获取品级
|
||||
function GetRarity() {
|
||||
return Sq_CallFunc(S_Ptr("0x80F12D6"), "int", ["pointer"], this.C_Object);
|
||||
}
|
||||
//设置编号
|
||||
function SetIndex(Index) {
|
||||
Attribute.seek(2);
|
||||
|
|
@ -120,6 +124,12 @@ class Item extends Base_C_Object {
|
|||
Attribute.writen(Value, 'i');
|
||||
}
|
||||
|
||||
|
||||
//获取交易类型
|
||||
function GetAttachType() {
|
||||
return Sq_CallFunc(S_Ptr("0x80F12E2"), "int", ["pointer"], this.C_Object);
|
||||
}
|
||||
|
||||
//刷写装备数据
|
||||
function Flush() {
|
||||
Sq_WriteBlobToAddress(C_Object, Attribute);
|
||||
|
|
@ -138,3 +148,8 @@ class Item extends Base_C_Object {
|
|||
|
||||
|
||||
}
|
||||
|
||||
//是否可打包
|
||||
function Item::IsPackagble() {
|
||||
return Sq_CallFunc(S_Ptr("0x828B5B4"), "int", ["pointer"], this.C_Object);
|
||||
}
|
||||
|
|
@ -44,6 +44,7 @@ class PvfItem extends Base_C_Object {
|
|||
return Sq_GetNameByIdFromPvf(GetIndex());
|
||||
}
|
||||
|
||||
|
||||
//Public
|
||||
function GetNameById(Id) {
|
||||
return Sq_GetNameByIdFromPvf(Id);
|
||||
|
|
|
|||
|
|
@ -277,4 +277,13 @@ class RedBlackTree {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function GetPop() {
|
||||
if (this.size <= 0) return null;
|
||||
local z = this.minimum();
|
||||
if (z != this.nil) {
|
||||
return z;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -24,26 +24,6 @@ class Script {
|
|||
InitStringBin(FileRo);
|
||||
InitLoadString(FileRo);
|
||||
|
||||
// local AllFileStartPos = ScriptData.StartPos;
|
||||
// foreach(FilePath, Info in ScriptData.PvfFileInfo) {
|
||||
|
||||
// //Ani太多了 加载的时候解密 其他文件 现在解密
|
||||
// //构建AniMap
|
||||
// if (endswith(FilePath, ".ani") && !endswith(FilePath, ".als")) {
|
||||
// // ScriptData.Ani[FilePath] <- InitPvfAni(FileRo);
|
||||
// ScriptData.AniPathTable[FilePath] <- {
|
||||
// Pos = (AllFileStartPos + Info.ROffset),
|
||||
// Length = Info.Length,
|
||||
// Cr32 = Info.Cr32
|
||||
// }
|
||||
// } else {
|
||||
// FileRo.seek(AllFileStartPos + Info.ROffset);
|
||||
// CrcDecode(FileRo, Info.Length, Info.Cr32);
|
||||
// // 解密完需要重新调整指针位置
|
||||
// FileRo.seek(AllFileStartPos + Info.ROffset);
|
||||
// }
|
||||
// }
|
||||
|
||||
ScriptData.IO = FileRo;
|
||||
ScriptData.Init();
|
||||
|
||||
|
|
@ -1043,7 +1023,7 @@ class GlobaData {
|
|||
i += 5;
|
||||
}
|
||||
//grade 套装Id
|
||||
else if (str == "[grade]" || str == "[part set index]" || str == "[anti evil]") {
|
||||
else if (str == "[grade]" || str == "[part set index]" || str == "[anti evil]" || str == "[sb dongcai]") {
|
||||
local RealKey = str.slice(1, str.len() - 1);
|
||||
EquipmentAtt[RealKey] <- UnpackData(FilePos, i).tointeger() - 9;
|
||||
i += 5;
|
||||
|
|
|
|||
|
|
@ -17,9 +17,13 @@ class Timer {
|
|||
Cb_timer_dispatch_Func.rawset("__System__Timer__Event", Update.bindenv(this));
|
||||
}
|
||||
|
||||
function ClockTime() {
|
||||
return Sq_GetTimestampString().slice(-10).tointeger();
|
||||
}
|
||||
|
||||
//检测延时任务
|
||||
function CheckTimeOut() {
|
||||
local Node = Wait_Exec_Tree.pop();
|
||||
local Node = Wait_Exec_Tree.GetPop();
|
||||
if (!Node) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -27,11 +31,13 @@ class Timer {
|
|||
local Info = Node.Info;
|
||||
//执行时间
|
||||
local exec_time = Node.time;
|
||||
//如果没到执行时间,放回去,等待下次扫描
|
||||
if (clock() <= exec_time) {
|
||||
Wait_Exec_Tree.insert(exec_time, Node.Info);
|
||||
//如果没到执行时间,就不管
|
||||
if (ClockTime() <= exec_time) {
|
||||
return;
|
||||
}
|
||||
//该执行了从树中删除这个元素
|
||||
Wait_Exec_Tree.pop();
|
||||
|
||||
//函数
|
||||
local func = Info[0];
|
||||
//参数
|
||||
|
|
@ -47,10 +53,9 @@ class Timer {
|
|||
target_arg_list.push(vargv[i]);
|
||||
}
|
||||
//当前时间戳,单位:秒
|
||||
local time_sec = clock();
|
||||
local time_sec = ClockTime();
|
||||
//计算下一次执行的时间
|
||||
local exec_time_sec = time_sec + (delay_time / 1000.0).tofloat();
|
||||
|
||||
local exec_time_sec = time_sec + delay_time;
|
||||
//设置下一次执行
|
||||
local func_info = [];
|
||||
|
||||
|
|
@ -62,7 +67,7 @@ class Timer {
|
|||
|
||||
//检测定时任务
|
||||
function CheckCronTask() {
|
||||
local Node = Date_Exec_Tree.pop();
|
||||
local Node = Date_Exec_Tree.GetPop();
|
||||
if (!Node) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -72,9 +77,10 @@ class Timer {
|
|||
local exec_time = Node.time;
|
||||
//如果没到执行时间,放回去,等待下次扫描
|
||||
if (time() <= exec_time) {
|
||||
Date_Exec_Tree.insert(exec_time, Node.Info);
|
||||
// Date_Exec_Tree.insert(exec_time, Node.Info);
|
||||
return;
|
||||
}
|
||||
Date_Exec_Tree.pop();
|
||||
//函数
|
||||
local func = Info[0];
|
||||
//参数
|
||||
|
|
@ -88,18 +94,6 @@ class Timer {
|
|||
}
|
||||
|
||||
function SetCronTask(target_func, CronString, ...) {
|
||||
// local parts = split(CronString, "/");
|
||||
// local minute = parts[0].tointeger();
|
||||
// local hour = parts[1].tointeger();
|
||||
// local day = parts[2].tointeger();
|
||||
// local weekday = parts[3].tointeger();
|
||||
|
||||
// local S_minute = minute * 60;
|
||||
// local S_hour = hour * 60 * 60;
|
||||
// local S_day = day * 24 * 60 * 60;
|
||||
// local S_weekday = weekday * 7 * 24 * 60 * 60;
|
||||
|
||||
// local AddTimestep = S_minute + S_hour + S_day + S_weekday;
|
||||
local NowTimestep = time();
|
||||
|
||||
//下一次执行的时间
|
||||
|
|
|
|||
|
|
@ -252,13 +252,79 @@ function TestCronTask(str) {
|
|||
print("定时任务已执行一次");
|
||||
}
|
||||
|
||||
// class Map{
|
||||
|
||||
// }
|
||||
// Timer.SetTimeOut(function() {
|
||||
// local dgn_requirements = {
|
||||
// [1] = [0, 10, 1, 20, 2, 30, 3, 40, 4, 40],
|
||||
// [2] = [0, 20],
|
||||
// };
|
||||
// print(dgn_requirements[1]);
|
||||
// printT(dgn_requirements);
|
||||
|
||||
// }, 0);
|
||||
// Timer.SetTimeOut(function() {
|
||||
// local SUser = World.GetUserByUid(1);
|
||||
// local InvenObj = SUser.GetInven();
|
||||
// local EquObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_ITEM, 56);
|
||||
|
||||
// local AdMsgObj = AdMsg();
|
||||
// AdMsgObj.PutType(8);
|
||||
// AdMsgObj.PutString("测试文字");
|
||||
// AdMsgObj.PutColorString("测试文字", [255, 85, 0]);
|
||||
// AdMsgObj.PutImoticon(2);
|
||||
// AdMsgObj.PutEquipment("主动提供名字", EquObj, [255, 85, 0]);
|
||||
// AdMsgObj.PutEquipment(EquObj);
|
||||
// AdMsgObj.Finalize();
|
||||
|
||||
// // SUser.Send(AdMsgObj.MakePack());
|
||||
// World.SendAll(AdMsgObj.MakePack());
|
||||
// AdMsgObj.Delete();
|
||||
// }, 0);
|
||||
|
||||
Gm_InputFunc_Handle.TTT <- function(SUser, CmdString) {
|
||||
print("初始化开始时间: " + time());
|
||||
local PvfObject = Script();
|
||||
print("初始化结束时间: " + time());
|
||||
// print("初始化开始时间: " + time());
|
||||
// local PvfObject = Script();
|
||||
// print("初始化结束时间: " + time());
|
||||
local Data = ScriptData.GetEquipment(305014);
|
||||
printT(Data);
|
||||
|
||||
local Pack = Packet();
|
||||
Pack.Put_Header(0, 370);
|
||||
Pack.Put_Byte(8);
|
||||
Pack.Put_Short(0);
|
||||
Pack.Put_Byte(3);
|
||||
Pack.Put_Int(SendStrLen);
|
||||
Pack.Put_BinaryEx(Memory.allocUtf8String(SendStr).C_Object, SendStrLen);
|
||||
Pack.Put_Byte(1);
|
||||
Pack.Put_BinaryEx(Memory.alloc(104).C_Object, 104);
|
||||
// foreach(color in ColorArr) {
|
||||
// Pack.Put_BinaryEx(color, 104);
|
||||
// }
|
||||
Pack.Finalize(true);
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
|
||||
|
||||
|
||||
// local Sing = Memory.alloc(100);
|
||||
// Sing.add(0).writeU32(1200);
|
||||
// Sing.add(4).writeU32(3037);
|
||||
// Sing.add(8).writeU32(1);
|
||||
// Sing.add(12).writeU32(100);
|
||||
// Sing.add(16).writeU32(100);
|
||||
// Sing.add(20).writeU32(100);
|
||||
// Sing.add(40).writeU32(time());
|
||||
// Sing.add(68).writeU32(100);
|
||||
|
||||
// local Sing = Memory.alloc(100);
|
||||
// Sing.add(10).writeInt(1200);
|
||||
// Sing.add(14).writeInt(100);
|
||||
// Sing.add(18).writeInt(100);
|
||||
|
||||
// Sq_CallFunc(S_Ptr(0x84DB452), "pointer", ["pointer", "pointer", "pointer"], S_Ptr("0x0"), SUser.C_Object, Sing.C_Object);
|
||||
|
||||
// //修复金币异常
|
||||
// //CParty::UseAncientDungeonItems
|
||||
// var CParty_UseAncientDungeonItems_ptr = ptr(0x859EAC2);
|
||||
|
|
@ -681,30 +747,28 @@ Gm_InputFunc_Handle.TTT <- function(SUser, CmdString) {
|
|||
};
|
||||
|
||||
Gm_InputFunc_Handle.AAA <- function(SUser, CmdString) {
|
||||
print(789456);
|
||||
local Str = "{\"op\":20078034,\"info\":[{\"uid\":1,\"name\":\"Kina\",\"growjob\":4,\"avatar\":[101550559,101560718,101570470,101520542,101500739,101510903,101540654,101580144,101530499],\"job\":0},{\"uid\":2,\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[105550431,105560424,105570386,105520415,105500424,105510429,105540408,105580144,105530361],\"job\":5},{\"name\":\"Kina\",\"growjob\":4,\"avatar\":[601550071,601560067,601570062,601500069,601510068,601540069,601520061,601530060,601580026,42219],\"job\":0},{\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021],\"job\":0},{\"name\":\"Kina\",\"growjob\":4,\"avatar\":[601550071,601560067,601570062,601500069,601510068,601540069,601520061,601530060,601580026,42219],\"job\":0},{\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021],\"job\":0},{\"name\":\"Kina\",\"growjob\":4,\"avatar\":[601550071,601560067,601570062,601500069,601510068,601540069,601520061,601530060,601580026,42219],\"job\":0},{\"name\":\"SQDQSD\",\"growjob\":17,\"avatar\":[601550058, 601560056, 601570051, 601520050, 601500058, 601510057, 601530049, 601540058, 601580021],\"job\":0}]}";
|
||||
|
||||
// //查询的sql语句
|
||||
// local sql = "SELECT m_id,charac_name,lev,village,job,exp,Hp FROM charac_info WHERE charac_no = 1;";
|
||||
// //查询的元素类型,按sql中的顺序
|
||||
// local column_type_list = ["int", "string", "int", "int", "int", "int", "int"];
|
||||
// local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
// local result = SqlObj.Select(sql, column_type_list);
|
||||
local Pack = Packet();
|
||||
Pack.Put_Header(1, 130);
|
||||
Pack.Put_Byte(1);
|
||||
Pack.Put_Int(Str.len());
|
||||
Pack.Put_Binary(Str);
|
||||
Pack.Finalize(true);
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
|
||||
// printT(result);
|
||||
print("asdasdadad");
|
||||
|
||||
// MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
|
||||
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
|
||||
//建库
|
||||
local sql = "SELECT slot FROM frida.setCharacSlotLimit WHERE account_id = " + account_id + ";";
|
||||
local column_type_list = ["int"];
|
||||
local result = SqlObj.Select(sql, column_type_list);
|
||||
if (result.len() > 0) {
|
||||
|
||||
}
|
||||
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Timer.SetTimeOut(function() {
|
||||
print("执行任务")
|
||||
}, 2000);
|
||||
|
|
@ -688,6 +688,25 @@ class ServerControl {
|
|||
Socket.SendGateway(T);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Cb_GetUserInfo_Leave_Func.ServerControl <- function(args) {
|
||||
if (args.pop() >= 0) {
|
||||
local SUser = User(args[1]);
|
||||
local Unid = NativePointer(args[2]).add(13).readShort();
|
||||
local OtherUser = World.GetUserBySession(Unid);
|
||||
if (OtherUser && SUser) {
|
||||
local Jso = {
|
||||
seeUid = SUser.GetUID(),
|
||||
seeCid = SUser.GetCID(),
|
||||
viewedUid = OtherUser.GetUID(),
|
||||
viewedCid = OtherUser.GetCID(),
|
||||
op = 20069009
|
||||
}
|
||||
Socket.SendGateway(Jso);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class AvatarUseJewel {
|
|||
local AvatarObj = InvemObj.GetSlot(2, Inven_Slot);
|
||||
|
||||
//校验时装 数据是否合法
|
||||
if (!AvatarObj || AvatarObj.IsEmpty() || (AvatarObj.GetIndex() != Item_Id) || SUser.CheckItemLock(2, Inven_Slot)) return;
|
||||
if (!AvatarObj || AvatarObj.IsEmpty || (AvatarObj.GetIndex() != Item_Id) || SUser.CheckItemLock(2, Inven_Slot)) return;
|
||||
|
||||
|
||||
local Avartar_AddInfo = AvatarObj.GetAdd_Info();
|
||||
|
|
@ -85,7 +85,7 @@ class AvatarUseJewel {
|
|||
local EmblemObje = InvemObj.GetSlot(1, emblem_inven_slot);
|
||||
|
||||
//校验徽章及插槽数据是否合法
|
||||
if (!EmblemObje || EmblemObje.IsEmpty() || (EmblemObje.GetIndex() != emblem_item_id) || (avartar_socket_slot >= 3)) return;
|
||||
if (!EmblemObje || EmblemObje.IsEmpty || (EmblemObje.GetIndex() != emblem_item_id) || (avartar_socket_slot >= 3)) return;
|
||||
|
||||
//校验徽章是否满足时装插槽颜色要求
|
||||
//获取徽章pvf数据
|
||||
|
|
|
|||
|
|
@ -6,8 +6,94 @@
|
|||
*/
|
||||
|
||||
|
||||
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 {
|
||||
|
|
@ -27,6 +113,8 @@ class Marry {
|
|||
//角色时装信息
|
||||
UserAvaList = {};
|
||||
|
||||
//礼堂id 对应礼堂的宾客信息
|
||||
AuditoriumUserInfoNewPeople = {};
|
||||
|
||||
//数据库操作集
|
||||
Mysql_Operate_Func = {
|
||||
|
|
@ -78,6 +166,19 @@ class Marry {
|
|||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
}
|
||||
|
||||
|
||||
//清空礼堂信息列表
|
||||
RomoveRoom = function(Cid) {
|
||||
local delete_sql = format(MARRY_SQL_LIST.RomoveRoom);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
SqlObj.Exec_Sql(delete_sql);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
}
|
||||
|
||||
|
||||
//查询结婚对象名字
|
||||
CheckMarryTargetName = function(Cid) {
|
||||
local CheckSql = format(MARRY_SQL_LIST.CheckMarryTargetName, Cid);
|
||||
|
|
@ -157,19 +258,58 @@ class Marry {
|
|||
return Ret[0][0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//根据cid查询2个人的姓名
|
||||
GetAuditoriumName2ById = function(cid) {
|
||||
local Sql = format(MARRY_SQL_LIST.GetAuditoriumName2ById, cid, cid);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local Ret = SqlObj.Select(Sql, ["int"]);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
|
||||
if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Ret[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//获取角色身上的显示时装
|
||||
function GetAva(SUser) {
|
||||
//获取背包对象
|
||||
local InvenObj = SUser.GetInven();
|
||||
if (!InvenObj) return;
|
||||
local re = [];
|
||||
local job = SUser.GetCharacJob();
|
||||
|
||||
//遍历身上的每一件装备
|
||||
for (local u = 0; u <= 11; u++) {
|
||||
local EquObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_BODY, u);
|
||||
if (EquObj && !EquObj.IsEmpty) {
|
||||
//先拿克隆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;
|
||||
}
|
||||
|
||||
|
||||
//查看是否结婚包
|
||||
|
|
@ -333,8 +473,8 @@ class Marry {
|
|||
//获得婚礼仪式开始时间
|
||||
local Index = time() + (Time + 1) * 10 * 60;
|
||||
//注册婚礼礼堂信息
|
||||
Mysql_Operate_Func.InsertMarryRoom(SUser.GetCID(), SUser.GetCharacName(), Time, Level, Target_CId, Mysql_Operate_Func.CheckMarryTargetName(Target_CId), 1, Index);
|
||||
Mysql_Operate_Func.InsertMarryRoom(Target_CId, Mysql_Operate_Func.CheckMarryTargetName(Target_CId), Time, Level, SUser.GetCID(), SUser.GetCharacName(), 1, Index);
|
||||
Mysql_Operate_Func.InsertMarryRoom(SUser.GetCID(), SUser.GetCharacName(), Time, Level, Target_CId, Mysql_Operate_Func.CheckMarryTargetName(Target_CId), Time, Index);
|
||||
Mysql_Operate_Func.InsertMarryRoom(Target_CId, Mysql_Operate_Func.CheckMarryTargetName(Target_CId), Time, Level, SUser.GetCID(), SUser.GetCharacName(), Time, Index);
|
||||
AuditoriumUserInfo.rawset(SUser.GetCID(), {});
|
||||
|
||||
|
||||
|
|
@ -348,6 +488,28 @@ class Marry {
|
|||
}
|
||||
|
||||
|
||||
//这里放2个新人的信息
|
||||
local avatra = [];
|
||||
local infore = {};
|
||||
infore.rawset("job", SUser.GetCharacJob());
|
||||
infore.rawset("growjob", SUser.GetCharacGrowType());
|
||||
infore.rawset("avatar", Config["职业对应的结婚礼服"][SUser.GetCharacJob().tostring()]);
|
||||
infore.rawset("name", SUser.GetCharacName());
|
||||
infore.rawset("uid", SUser.GetUID());
|
||||
|
||||
local Muser = World.GetUserByUid(Target_CId);
|
||||
local infore2 = {};
|
||||
infore2.rawset("job", Muser.GetCharacJob());
|
||||
infore2.rawset("growjob", Muser.GetCharacGrowType());
|
||||
infore2.rawset("avatar", Config["职业对应的结婚礼服"][Muser.GetCharacJob().tostring()]);
|
||||
infore2.rawset("name", Muser.GetCharacName());
|
||||
infore2.rawset("uid", Muser.GetUID());
|
||||
avatra.push(infore);
|
||||
avatra.push(infore2);
|
||||
|
||||
AuditoriumUserInfoNewPeople.rawset(SUser.GetCID(), avatra);
|
||||
|
||||
|
||||
|
||||
local WorldMap = World.GetOnlinePlayer();
|
||||
foreach(W_User in WorldMap) {
|
||||
|
|
@ -356,54 +518,108 @@ class Marry {
|
|||
W_User.SendNotiBox(format("婚礼将在%d分钟后举行!\n点击大司祭可进入礼堂。", (Time + 1) * 10), 1);
|
||||
}
|
||||
}
|
||||
|
||||
SUser.SendJso(T);
|
||||
SUser.SendNotiBox(format("婚礼将在%d分钟后举行!\n点击大司祭可进入礼堂。", (Time + 1) * 10), 1);
|
||||
print(time());
|
||||
Timer.SetTimeOut(OpenAuditorium.bindenv(this), (Time + 1) * 10 * 1000, SUser.GetCID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//婚礼前的准备 把2个新人先传进去
|
||||
function OpenPreparation(index) {
|
||||
//拿到两个新人的信息
|
||||
local uidsInfo = AuditoriumUserInfoNewPeople[index];
|
||||
|
||||
local uid1 = uidsInfo[0].rawget("uid");
|
||||
local uid2 = uidsInfo[1].rawget("uid");
|
||||
|
||||
//拿到礼堂所有宾客的信息
|
||||
local userlist = AuditoriumUserInfo[index];
|
||||
//如果不在里面就传送进来
|
||||
if (!(userlist.rawin(uid1))) {
|
||||
EnterAuditorium(World.GetUserByUid(uid1), {
|
||||
room = -1
|
||||
});
|
||||
}
|
||||
if (!(userlist.rawin(uid2))) {
|
||||
EnterAuditorium(World.GetUserByUid(uid2), {
|
||||
room = -1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//开启婚礼 参数为礼堂编号 也就是其中一个人的cid
|
||||
function OpenAuditorium(index) {
|
||||
print(time());
|
||||
|
||||
//婚礼准备
|
||||
OpenPreparation(index);
|
||||
|
||||
//通知所有在这个礼堂里的人 婚礼开始了
|
||||
local userlist = AuditoriumUserInfo[RoomId];
|
||||
local userlist = AuditoriumUserInfo[index];
|
||||
|
||||
local dxcid = Mysql_Operate_Func.CheckMarryTarget(index);
|
||||
foreach(uid in userlist) {
|
||||
|
||||
//先拿到新人存的信息
|
||||
local info = AuditoriumUserInfoNewPeople[index];
|
||||
|
||||
local uid1 = info[0].rawget("uid");
|
||||
local uid2 = info[1].rawget("uid");
|
||||
|
||||
|
||||
//比那里礼堂所有人信息
|
||||
foreach(uid, v in userlist) {
|
||||
local user = World.GetUserByUid(uid);
|
||||
//todo 这里要判断 如果是结婚的人就不加到宾客里
|
||||
if (!user) {
|
||||
|
||||
//发包通知 如果是2个结婚的人的cid 下发另外的包
|
||||
if (user.GetCID() == index || user.GetCID() == dxcid) {
|
||||
local T = {
|
||||
op = OP + 32,
|
||||
userlist = userlist
|
||||
}
|
||||
} else {
|
||||
//发包通知 普通宾客的包
|
||||
local T = {
|
||||
op = OP + 34,
|
||||
userlist = userlist
|
||||
}
|
||||
}
|
||||
user.SendJso(T);
|
||||
local infore = {
|
||||
job = user.GetCharacJob(),
|
||||
growjob = user.GetCharacGrowType(),
|
||||
avatar = GetAva(user),
|
||||
name = user.GetCharacName(),
|
||||
};
|
||||
info.push(infore);
|
||||
if (info.len() >= 8) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
foreach(uid, v in userlist) {
|
||||
local user = World.GetUserByUid(uid);
|
||||
//发包通知 普通宾客的包
|
||||
local T = {
|
||||
op = OP + 34,
|
||||
info = info
|
||||
}
|
||||
user.SendJso(T);
|
||||
}
|
||||
|
||||
|
||||
//删除礼堂信息
|
||||
AuditoriumUserInfo.rawdelete(RoomId);
|
||||
AuditoriumUserInfo.rawdelete(index);
|
||||
//删除数据库信息
|
||||
Mysql_Operate_Func.DeleteMarryInfo(index);
|
||||
Mysql_Operate_Func.DeleteMarryInfo(dxcid);
|
||||
//Mysql_Operate_Func.RomoveRoom();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//进入礼堂
|
||||
function EnterAuditorium(SUser, Jso) {
|
||||
local RoomId = Jso.room;
|
||||
|
||||
local location = SUser.GetLocation();
|
||||
|
||||
//进入自己的礼堂
|
||||
// //进入自己的礼堂
|
||||
if (RoomId == -1) {
|
||||
local MyState = Mysql_Operate_Func.CheckMarryState(SUser.GetCID());
|
||||
if (MyState != 2) {
|
||||
|
|
@ -420,6 +636,7 @@ class Marry {
|
|||
location.rawset("所在礼堂编号", RoomId);
|
||||
//向缓存写入进入时的坐标
|
||||
EnterAuditoriumPosList.rawset(SUser.GetCID(), location);
|
||||
|
||||
//移动到礼堂
|
||||
World.MoveArea(SUser, Config["礼堂城镇编号"], Config["礼堂区域编号"], 55, 349);
|
||||
} else {
|
||||
|
|
@ -433,21 +650,47 @@ class Marry {
|
|||
|
||||
|
||||
|
||||
AuditoriumUserInfo[RoomId].rawset(SUser.GetUID(), GetAva(SUser));
|
||||
local infore = {};
|
||||
infore.rawset("job", SUser.GetCharacJob());
|
||||
infore.rawset("growjob", SUser.GetCharacGrowType());
|
||||
infore.rawset("avatar", GetAva(SUser));
|
||||
infore.rawset("name", SUser.GetCharacName());
|
||||
|
||||
|
||||
|
||||
AuditoriumUserInfo[RoomId].rawset(SUser.GetUID(), infore);
|
||||
|
||||
//遍历这个礼堂里的人 给他们发送可见列表
|
||||
local UserCanSee = [];
|
||||
foreach(cid in AuditoriumUserInfo[RoomId]) {
|
||||
UserCanSee.push(cid);
|
||||
foreach(uid, info in AuditoriumUserInfo[RoomId]) {
|
||||
UserCanSee.push(uid);
|
||||
}
|
||||
MarryUserCallBack(UserCanSee, SUser)
|
||||
|
||||
|
||||
local T = {
|
||||
op = OP + 22,
|
||||
time = Mysql_Operate_Func.GetAuditoriumTimeById(RoomId) - time()
|
||||
}
|
||||
|
||||
|
||||
SUser.SendJso(T);
|
||||
}
|
||||
|
||||
|
||||
//服务端区域移动添加玩家HOOK 让大家不可见
|
||||
function Marry_insert_user_hook(C_Area, C_User) {
|
||||
//如果有城镇配置
|
||||
if (Config) {
|
||||
local SUser = User(C_User);
|
||||
if (SUser.GetLocation().Town == Config["礼堂城镇编号"]) {
|
||||
if (SUser.GetLocation().Area == Config["礼堂区域编号"]) Sq_WriteAddress(C_Area, 0x68, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//离开礼堂
|
||||
function LeaveAuditorium(SUser, Jso) {
|
||||
if (EnterAuditoriumPosList.rawin(SUser.GetCID())) {
|
||||
|
|
@ -455,11 +698,15 @@ class Marry {
|
|||
//离开礼堂回到进入时的位置
|
||||
World.MoveArea(SUser, Info.Town, Info.Area, Info.Pos.X, Info.Pos.Y);
|
||||
|
||||
//给这个礼堂的人发送退出可见列表的包
|
||||
foreach(uid in AuditoriumUserInfo[Info["所在礼堂编号"]]) {
|
||||
UserCanSee.push(uid);
|
||||
}
|
||||
MarryUserDeleteCallBack(UserCanSee, SUser)
|
||||
|
||||
|
||||
AuditoriumUserInfo[Info["所在礼堂编号"]].rawdelete(SUser.GetUID());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -500,13 +747,18 @@ class Marry {
|
|||
}
|
||||
|
||||
|
||||
//表示是否可见 参数为用户数组
|
||||
function MarryUserCallBack(RealList, MUser) {
|
||||
//加入到可见列表
|
||||
function MarryUserCallBack(CUserList, MUser) {
|
||||
|
||||
|
||||
local RealList = [];
|
||||
foreach(uid in CUserList) {
|
||||
local SUser = World.GetUserByUid(uid);
|
||||
if (SUser && SUser.GetState() >= 3) RealList.append(SUser);
|
||||
}
|
||||
|
||||
foreach(_Index, Value in RealList) {
|
||||
local SUser = Value;
|
||||
if (!SUser || !SUser.GetState() >= 3) continue;
|
||||
if (SUser.GetUID() == MUser.GetUID()) continue;
|
||||
local Pack = Packet();
|
||||
Pack.Put_Header(0, 24);
|
||||
Pack.Put_Byte(SUser.GetLocation().Town); //城镇
|
||||
|
|
@ -522,7 +774,6 @@ class Marry {
|
|||
}
|
||||
Pack.Put_Byte(1); //是否可见
|
||||
Pack.Finalize(true);
|
||||
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
}
|
||||
|
|
@ -550,7 +801,7 @@ class Marry {
|
|||
Pack.Put_Byte(MUser.GetDirections()); //朝向
|
||||
Pack.Put_Byte(MUser.GetVisibleValues()); //是否可见
|
||||
Pack.Finalize(true);
|
||||
print(111);
|
||||
|
||||
SUser.Send(Pack);
|
||||
Pack.Delete();
|
||||
}
|
||||
|
|
@ -561,6 +812,7 @@ class Marry {
|
|||
|
||||
constructor() {
|
||||
Config = dofile("/root/娱心插件配置/结婚系统配置.dat");
|
||||
|
||||
local ConfigPath = Sq_Game_GetConfig();
|
||||
Channel = ConfigPath.slice(-6).slice(0, 2);
|
||||
|
||||
|
|
@ -575,53 +827,24 @@ class Marry {
|
|||
ClientSocketPackFuncMap.rawset(OP + 17, LeaveAuditorium.bindenv(this));
|
||||
ClientSocketPackFuncMap.rawset(OP + 19, GetAuditoriumList.bindenv(this));
|
||||
ClientSocketPackFuncMap.rawset(OP + 777, GetConfig.bindenv(this));
|
||||
|
||||
//每次加载的时候都注册礼堂信息
|
||||
AuditoriumUserInfo.rawset(1, {});
|
||||
|
||||
|
||||
//注册结婚回调函数
|
||||
Cb_Insert_User_Func.Marry <- Marry_insert_user_hook.bindenv(this); //区域添加角色
|
||||
|
||||
//玩家重新上线的时候自动给他退出礼堂
|
||||
Cb_reach_game_world_Func.Auditorium <- function(SUser) {
|
||||
if (EnterAuditoriumPosList.rawin(SUser.GetUID())) {
|
||||
local Info = EnterAuditoriumPosList[SUser.GetCID()];
|
||||
//给这个礼堂的人发送退出可见列表的包
|
||||
foreach(cid in AuditoriumUserInfo[Info["所在礼堂编号"]]) {
|
||||
UserCanSee.push(cid);
|
||||
}
|
||||
MarryUserDeleteCallBack(UserCanSee, SUser)
|
||||
|
||||
AuditoriumUserInfo[Info["所在礼堂编号"]].rawdelete(SUser.GetUID());
|
||||
}
|
||||
}.bindenv(this);
|
||||
|
||||
|
||||
// local RealList = [];
|
||||
|
||||
// RealList.push(World.GetUserByUid(1));
|
||||
// RealList.push(World.GetUserByUid(2));
|
||||
|
||||
|
||||
|
||||
// Timer.SetTimeOut(function() {
|
||||
// // Sq_CallFunc(S_Ptr("0x850d374"), "int", ["pointer", "int"], S_Ptr("0x1"), "sss")
|
||||
// // local S = Memory.alloc(100);
|
||||
// // Sq_Delete_Point(S.C_Object);
|
||||
// Sq_CallFunc(S_Ptr("0x08692af6"), "int", ["pointer", "int", "int"], 1, 1, 1);
|
||||
// }, 3000);
|
||||
|
||||
|
||||
// local Suser = World.GetUserByUid(2);
|
||||
// //获取背包对象
|
||||
// local InvenObj = Suser.GetInven();
|
||||
// //遍历身上的每一件装备
|
||||
// for (local u = 0; u <= 10; u++) {
|
||||
// //如果装备存在 并且存在于 加成表中 就给提升率加上对应的值
|
||||
// local EquObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_BODY, u);
|
||||
// if (EquObj && !EquObj.IsEmpty) {
|
||||
// local EquObjId = EquObj.GetIndex();
|
||||
// print(EquObj.Output());
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local query = "SELECT COUNT(*) AS table_exists FROM information_schema.tables WHERE table_schema = 'zyk' AND table_name = 'marry';"
|
||||
|
|
@ -636,123 +859,31 @@ class Marry {
|
|||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
|
||||
defaultJobItemIdMap.rawset(0, defaultJobItemId(39278, 39400, 0, 0, 40600, 41000, 41800, 42200));
|
||||
defaultJobItemIdMap.rawset(1, defaultJobItemId(0, 43400, 0, 0, 44600, 45000, 45800, 46200));
|
||||
defaultJobItemIdMap.rawset(2, defaultJobItemId(0, 47400, 0, 48426, 48600, 49000, 49800, 50200));
|
||||
defaultJobItemIdMap.rawset(3, defaultJobItemId(51265, 51400, 0, 0, 52600, 53000, 53800, 54200));
|
||||
defaultJobItemIdMap.rawset(4, defaultJobItemId(0, 55400, 55820, 0, 56600, 57000, 57800, 58200));
|
||||
|
||||
defaultJobItemIdMap.rawset(5, defaultJobItemId(1600000, 1610000, 0, 0, 1640000, 1650000, 1670000, 1680000));
|
||||
defaultJobItemIdMap.rawset(6, defaultJobItemId(1720000, 1730000, 0, 1750000, 1760000, 1770000, 1790000, 1800000));
|
||||
defaultJobItemIdMap.rawset(7, defaultJobItemId(0, 29201, 0, 0, 29202, 29203, 29204, 29205));
|
||||
defaultJobItemIdMap.rawset(8, defaultJobItemId(0, 2090000, 0, 0, 2120000, 2130000, 2140000, 2150000));
|
||||
defaultJobItemIdMap.rawset(9, defaultJobItemId(39278, 39400, 0, 0, 40600, 41000, 41800, 42200));
|
||||
defaultJobItemIdMap.rawset(10, defaultJobItemId(51265, 51400, 0, 0, 52600, 53000, 53800, 54200));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//获取角色身上的显示时装
|
||||
function GetAva(SUser) {
|
||||
//获取背包对象
|
||||
local InvenObj = SUser.GetInven();
|
||||
|
||||
local re = [];
|
||||
Timer.SetTimeOut(function() {
|
||||
ProjectInitFuncMap.P_Marry <- Marry();
|
||||
}, 0)
|
||||
|
||||
|
||||
local job = SUser.GetCharacJob();
|
||||
//遍历身上的每一件装备
|
||||
for (local u = 0; u <= 2; u++) {
|
||||
local EquObj = InvenObj.GetSlot(Inven.INVENTORY_TYPE_BODY, u);
|
||||
if (EquObj && !EquObj.IsEmpty) {
|
||||
//先拿克隆id 如果这个值有 那说明带的克隆 直接用这个
|
||||
local clearId = Sq_CallFunc(S_Ptr("0x850d374"), "int", ["pointer", "int"], 1, u)
|
||||
// print(clearId);
|
||||
local EquObjId = EquObj.GetIndex();
|
||||
// print(EquObjId);
|
||||
//如果这个是克隆
|
||||
if (clearId > 0) {
|
||||
re.push(clearId);
|
||||
} else { //不是克隆 直接把id放上去
|
||||
|
||||
re.push(EquObjId);
|
||||
Gm_InputFunc_Handle.ss <- function(SUser, CmdString) {
|
||||
|
||||
}
|
||||
} else { //如果这个部位没东西 直接放默认时装上去
|
||||
re.push(defaultJobItemIdMap[job].index[u]);
|
||||
}
|
||||
|
||||
}
|
||||
return re;
|
||||
}
|
||||
//默认时装
|
||||
defaultJobItemIdMap <- {};
|
||||
local aa = Marry.GetAva(SUser);
|
||||
printT(aa);
|
||||
|
||||
|
||||
class defaultJobItemId {
|
||||
|
||||
/**
|
||||
* 头发
|
||||
*/
|
||||
hat = 0;
|
||||
}.bindenv(this);
|
||||
|
||||
/**
|
||||
* 帽子
|
||||
*/
|
||||
hair = 0;
|
||||
print("-----------------------")
|
||||
print(time());
|
||||
|
||||
/**
|
||||
*脸
|
||||
*/
|
||||
face = 0;
|
||||
/**
|
||||
* 披风
|
||||
*/
|
||||
breast = 0;
|
||||
/**
|
||||
* 上衣
|
||||
*/
|
||||
coat = 0;
|
||||
|
||||
/**
|
||||
* 下装
|
||||
*/
|
||||
pants = 0;
|
||||
|
||||
/**
|
||||
* 鞋子
|
||||
*/
|
||||
shoes = 0;
|
||||
|
||||
/**
|
||||
* 皮肤
|
||||
*/
|
||||
skin = 0;
|
||||
|
||||
index = [];
|
||||
|
||||
constructor(hat, hair, face, breast, coat, pants, shoes, skin) {
|
||||
this.hat = hat;
|
||||
this.hair = hair;
|
||||
this.face = face;
|
||||
this.breast = breast;
|
||||
this.coat = coat;
|
||||
this.pants = pants;
|
||||
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(shoes);
|
||||
index.push(skin);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ProjectInitFuncMap.P_Marry <- Marry();
|
||||
Timer.SetTimeOut(function() {
|
||||
print(time());
|
||||
}, 5000);
|
||||
|
|
@ -37,3 +37,8 @@ MARRY_SQL_LIST.GetAuditoriumIndexById <- @"SELECT target_cid FROM zyk.marry_room
|
|||
|
||||
//根据cid查询自己的礼堂编号
|
||||
MARRY_SQL_LIST.GetAuditoriumTimeById <- @"SELECT rindex FROM zyk.marry_room WHERE cid = %d";
|
||||
|
||||
MARRY_SQL_LIST.GetAuditoriumName2ById <- @"SELECT name, FROM zyk.marry_room WHERE cid = %d or target_cid = %d";
|
||||
|
||||
MARRY_SQL_LIST.RomoveRoom <- @"DELETE FROM marry_room where rindex < UNIX_TIMESTAMP();";
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ function InitPluginInfo() {
|
|||
PoolObj.Init();
|
||||
|
||||
|
||||
// Sq_CreatSocketConnect("192.168.200.24", "65109");
|
||||
Sq_CreatSocketConnect("192.168.200.24", "65109");
|
||||
|
||||
//初始化结婚
|
||||
ProjectInitFuncMap.P_Marry <- Marry();
|
||||
|
|
@ -52,10 +52,13 @@ function main() {
|
|||
GameManager.FixAvatarUseJewel();
|
||||
GameManager.FixSaveTown();
|
||||
GameManager.FixDespairGold();
|
||||
GameManager.FixGlodTradeDaily(80000000);
|
||||
// local PvfObject = Script();
|
||||
// local Data = ScriptData.GetEquipment(305014);
|
||||
// printT(Data);
|
||||
|
||||
// Sq_Conversion("這是一個繁體字符串");
|
||||
|
||||
local PvfObject = Script();
|
||||
local Data = ScriptData.GetEquipment(305014);
|
||||
printT(Data);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -166,4 +166,79 @@ _Hook_Register_Currency_Func_("0x0830DD2C", ["pointer", "bool", "char"], Cb_Batt
|
|||
//放弃副本
|
||||
Cb_Party_giveup_game_Enter_Func <- {};
|
||||
Cb_Party_giveup_game_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x085B2BAA", ["pointer", "bool", "bool", "bool", "void"], Cb_Party_giveup_game_Enter_Func, Cb_Party_giveup_game_Leave_Func);
|
||||
_Hook_Register_Currency_Func_("0x085B2BAA", ["pointer", "pointer", "bool", "bool", "bool", "void"], Cb_Party_giveup_game_Enter_Func, Cb_Party_giveup_game_Leave_Func);
|
||||
|
||||
//迷妄之塔 死亡之塔通关时
|
||||
Cb_CDeathTower_onClear_Enter_Func <- {};
|
||||
Cb_CDeathTower_onClear_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08467E60", ["pointer", "bool", "int"], Cb_CDeathTower_onClear_Enter_Func, Cb_CDeathTower_onClear_Leave_Func);
|
||||
|
||||
//无尽祭坛通关时
|
||||
Cb_CBloodClearRewardData_Enter_Func <- {};
|
||||
Cb_CBloodClearRewardData_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08306FC4", ["pointer", "bool", "int", "pointer", "pointer", "bool"], Cb_CBloodClearRewardData_Enter_Func, Cb_CBloodClearRewardData_Leave_Func);
|
||||
|
||||
//进入迷妄之塔 死亡之塔时
|
||||
Cb_DeathTowerStageCommand_Enter_Func <- {};
|
||||
Cb_DeathTowerStageCommand_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x08208A9E", ["pointer", "pointer", "pointer", "int"], Cb_DeathTowerStageCommand_Enter_Func, Cb_DeathTowerStageCommand_Leave_Func);
|
||||
|
||||
//离开迷妄之塔 死亡之塔时
|
||||
Cb_CDeathTower_onLeaveUser_Enter_Func <- {};
|
||||
Cb_CDeathTower_onLeaveUser_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x084636F2", ["pointer", "pointer", "int"], Cb_CDeathTower_onLeaveUser_Enter_Func, Cb_CDeathTower_onLeaveUser_Leave_Func);
|
||||
|
||||
//玩家交易过程
|
||||
Cb_TradeSpace_proceed_trade_Enter_Func <- {};
|
||||
Cb_TradeSpace_proceed_trade_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0853087A", ["pointer", "int"], Cb_TradeSpace_proceed_trade_Enter_Func, Cb_TradeSpace_proceed_trade_Leave_Func);
|
||||
|
||||
//发送多物品邮件
|
||||
Cb_MultiMailBoxReqSend_Enter_Func <- {};
|
||||
Cb_MultiMailBoxReqSend_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x084E27B8", ["pointer", "pointer", "pointer", "int"], Cb_MultiMailBoxReqSend_Enter_Func, Cb_MultiMailBoxReqSend_Leave_Func);
|
||||
|
||||
//发送单物品邮件
|
||||
Cb_MailBox_Send_Enter_Func <- {};
|
||||
Cb_MailBox_Send_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x081CC958", ["pointer", "pointer", "pointer", "pointer", "int"], Cb_MailBox_Send_Enter_Func, Cb_MailBox_Send_Leave_Func);
|
||||
|
||||
//发送金币邮件时是否通过验证
|
||||
Cb_checkHumanCertify_Enter_Func <- {};
|
||||
Cb_checkHumanCertify_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0867F4C8", ["pointer", "int", "pointer", "int"], Cb_checkHumanCertify_Enter_Func, Cb_checkHumanCertify_Leave_Func);
|
||||
|
||||
//摆摊购买
|
||||
Cb_CPrivateStore_BuyItem_Enter_Func <- {};
|
||||
Cb_CPrivateStore_BuyItem_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x085C924C", ["pointer", "int", "pointer", "int", "int", "int", "int", "int"], Cb_CPrivateStore_BuyItem_Enter_Func, Cb_CPrivateStore_BuyItem_Leave_Func);
|
||||
|
||||
//拍卖行上架
|
||||
Cb_AuctionResultAskRegistedItemNum_Enter_Func <- {};
|
||||
Cb_AuctionResultAskRegistedItemNum_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x084D5930", ["pointer", "pointer", "pointer", "int"], Cb_AuctionResultAskRegistedItemNum_Enter_Func, Cb_AuctionResultAskRegistedItemNum_Leave_Func);
|
||||
|
||||
//拍卖行购买物品
|
||||
Cb_AuctionLogMessage_Enter_Func <- {};
|
||||
Cb_AuctionLogMessage_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x084D7A90", ["pointer", "pointer", "pointer", "int"], Cb_AuctionLogMessage_Enter_Func, Cb_AuctionLogMessage_Leave_Func);
|
||||
|
||||
//副本内生成物品时
|
||||
Cb_Battle_Field_MakeDropItems_Enter_Func <- {};
|
||||
Cb_Battle_Field_MakeDropItems_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x081CC958", ["pointer", "int", "int", "int", "int", "int", "int", "int", "char", "int", "int", "int", "void"], Cb_Battle_Field_MakeDropItems_Enter_Func, Cb_Battle_Field_MakeDropItems_Leave_Func);
|
||||
|
||||
//独立掉落几率
|
||||
Cb_IndependentItemRateControl_Enter_Func <- {};
|
||||
Cb_IndependentItemRateControl_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0834972F", ["pointer", "pointer", "int"], Cb_IndependentItemRateControl_Enter_Func, Cb_IndependentItemRateControl_Leave_Func);
|
||||
|
||||
//黑钻机添加物品到User时
|
||||
Cb_UseVendingMachine_putItemIntoUser_Enter_Func <- {};
|
||||
Cb_UseVendingMachine_putItemIntoUser_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x0821B71C", ["int", "pointer", "int", "int", "int", "int"], Cb_UseVendingMachine_putItemIntoUser_Enter_Func, Cb_UseVendingMachine_putItemIntoUser_Leave_Func);
|
||||
|
||||
//查看信息
|
||||
Cb_GetUserInfo_Enter_Func <- {};
|
||||
Cb_GetUserInfo_Leave_Func <- {};
|
||||
_Hook_Register_Currency_Func_("0x081C3DD8", ["pointer", "pointer", "pointer", "int"], Cb_GetUserInfo_Enter_Func, Cb_GetUserInfo_Leave_Func);
|
||||
|
|
@ -145,5 +145,8 @@
|
|||
},
|
||||
"Dps_A/BaseClass/ScriptManager": {
|
||||
"description": "pvf管理器"
|
||||
},
|
||||
"Dps_A/BaseClass/AdMsg": {
|
||||
"description": "高级消息类"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue