111
This commit is contained in:
parent
825ab4366c
commit
3e73f1ae54
|
|
@ -90,6 +90,6 @@ class GameManager extends Base_C_Object {
|
|||
}
|
||||
//热重载
|
||||
function _Reload_List_Write_(Path) {
|
||||
sq_RunScript(Path);
|
||||
dofile(Path);
|
||||
print("位于 [" + Path + "] 的脚本已重载")
|
||||
}
|
||||
|
|
@ -177,6 +177,10 @@ class NativePointer extends Base_C_Object {
|
|||
return Sq_ReadPoint(this.C_Object);
|
||||
}
|
||||
|
||||
function readBinary(Size) {
|
||||
return Sq_Point2Blob(this.C_Object, Size);
|
||||
}
|
||||
|
||||
function tostring() {
|
||||
return this.C_Object.tostring();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Mysql extends Base_C_Object {
|
|||
}
|
||||
|
||||
function Fetch() {
|
||||
Sq_CallFunc(S_Ptr("0x83F44BC"), "int", ["pointer"], this.C_Object);
|
||||
return Sq_CallFunc(S_Ptr("0x83F44BC"), "int", ["pointer"], this.C_Object);
|
||||
}
|
||||
|
||||
function Close() {
|
||||
|
|
@ -77,7 +77,7 @@ class Mysql extends Base_C_Object {
|
|||
Sq_Delete_Point(intSizePoint);
|
||||
return result;
|
||||
}
|
||||
Sq_Delete_Point(intSizePoint);
|
||||
// Sq_Delete_Point(intSizePoint);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -131,16 +131,12 @@ class Mysql extends Base_C_Object {
|
|||
//MySQL_get_binary_length
|
||||
local binary_length = Sq_CallFunc(S_Ptr("0x81253DE"), "int", ["pointer", "int"], this.C_Object, columnIndex);
|
||||
if (binary_length > 0) {
|
||||
local binary_length_point = Sq_New_Point(binary_length);
|
||||
local binary_length_point = Memory.alloc(binary_length);
|
||||
//MySQL_get_binary
|
||||
if (1 == Sq_CallFunc(S_Ptr("0x812531A"), "int", ["pointer", "int", "pointer", "int"], this.C_Object, columnIndex, binary_length_point, binary_length)) {
|
||||
//转为blob
|
||||
local blob = Sq_Point2Blob(binary_length_point, binary_length);
|
||||
Sq_Delete_Point(intSizePoint);
|
||||
return blob;
|
||||
if (1 == Sq_CallFunc(S_Ptr("0x812531A"), "int", ["pointer", "int", "pointer", "int"], this.C_Object, columnIndex, binary_length_point.C_Object, binary_length)) {
|
||||
return binary_length_point;
|
||||
}
|
||||
}
|
||||
Sq_Delete_Point(intSizePoint);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -161,19 +157,18 @@ class Mysql extends Base_C_Object {
|
|||
Fetch();
|
||||
local row = [];
|
||||
for (local j = 0; j< column_type_list.len(); j++) {
|
||||
if (column_type_list[j] == "int") {
|
||||
//判断是否为空值
|
||||
if (!Sq_CallFunc(S_Ptr("0x85F41B2"), "bool", ["pointer", "int"], this.C_Object, j)) {
|
||||
row.push(null);
|
||||
} else if (column_type_list[j] == "int") {
|
||||
row.push(ReadIntColumn(j));
|
||||
}
|
||||
if (column_type_list[j] == "string") {
|
||||
} else if (column_type_list[j] == "string") {
|
||||
row.push(ReadStringColumn(j));
|
||||
}
|
||||
if (column_type_list[j] == "uint") {
|
||||
} else if (column_type_list[j] == "uint") {
|
||||
row.push(ReadUIntColumn(j));
|
||||
}
|
||||
if (column_type_list[j] == "float") {
|
||||
} else if (column_type_list[j] == "float") {
|
||||
row.push(ReadFloatColumn(j));
|
||||
}
|
||||
if (column_type_list[j] == "binary") {
|
||||
} else if (column_type_list[j] == "binary") {
|
||||
row.push(ReadBinaryColumn(j));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,40 +5,363 @@
|
|||
文件用途:结婚系统
|
||||
*/
|
||||
class Marry {
|
||||
//配置
|
||||
Config = null;
|
||||
//包头
|
||||
OP = 20078000;
|
||||
//请求结婚的列表
|
||||
RequestMarryList = {};
|
||||
//进入礼堂前的位置信息
|
||||
EnterAuditoriumPosList = {};
|
||||
|
||||
//查看是否结婚
|
||||
function CheckMarryCallBack(SUser, Jso) {
|
||||
// print("申请查看结婚信息的人是: " + SUser.GetCharacName());
|
||||
|
||||
|
||||
|
||||
|
||||
//数据库操作集
|
||||
Mysql_Operate_Func = {
|
||||
//查询结婚状态
|
||||
CheckMarryState = function(Cid) {
|
||||
local CheckSql = format(MARRY_SQL_LIST.CheckMarryState, Cid);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local Ret = SqlObj.Select(CheckSql, ["int"]);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
//没结婚要返回false
|
||||
if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
return 0;
|
||||
} else {
|
||||
return Ret[0][0];
|
||||
}
|
||||
}
|
||||
//新增结婚信息
|
||||
InseartMarryInfo = function(Cid, Name, TargerCid, Job, Level, Experience, Equip, State) {
|
||||
local sql = format(MARRY_SQL_LIST.InseartMarryInfo, Cid, Name, TargerCid, Job, Level, Experience, Equip, State, TargerCid, Equip, State);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
SqlObj.Exec_Sql(sql);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
}
|
||||
//查询结婚对象CID
|
||||
CheckMarryTarget = function(Cid) {
|
||||
local CheckSql = format(MARRY_SQL_LIST.CheckMarryTarget, Cid);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local Ret = SqlObj.Select(CheckSql, ["int"]);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
//没结婚要返回false
|
||||
if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Ret[0][0];
|
||||
}
|
||||
}
|
||||
//删除结婚信息
|
||||
DeleteMarryInfo = function(Cid) {
|
||||
local delete_sql = format(MARRY_SQL_LIST.DeleteMarryInfo, Cid);
|
||||
//从池子拿连接
|
||||
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);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
local Ret = SqlObj.Select(CheckSql, ["string"]);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
//没结婚要返回false
|
||||
if (Ret.len()< 1 || Ret[0][0] == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Ret[0][0];
|
||||
}
|
||||
}
|
||||
//修改结婚状态
|
||||
ChangeMarryState = function(Cid, State) {
|
||||
local Sql = format(MARRY_SQL_LIST.ChangeMarryState, State, Cid);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
SqlObj.Exec_Sql(Sql);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
}
|
||||
//新增礼堂信息
|
||||
InsertMarryRoom = function(Cid, Name, Time, Level, Target_CId, Target_Name, State, Index) {
|
||||
local Sql = format(MARRY_SQL_LIST.InsertMarryRoom, Cid, Name, Time, Level, Target_CId, Target_Name, State, Index);
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
SqlObj.Exec_Sql(Sql);
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//查看是否结婚包
|
||||
function CheckMarryStateCallBack(SUser, Jso) {
|
||||
local T = {
|
||||
op = OP + 2,
|
||||
Flag = false, //结婚返回true 未结婚返回flase
|
||||
op = OP + 10,
|
||||
Flag = Mysql_Operate_Func.CheckMarryState(SUser.GetCID())
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
}
|
||||
|
||||
//申请结婚
|
||||
//申请订婚包
|
||||
function RequestMarry(SUser, Jso) {
|
||||
local PSUser = World.GetUserByName(Jso.Name);
|
||||
if (PSUser) {
|
||||
//判断对象角色是否在线
|
||||
if (!PSUser) {
|
||||
//没找到这个角色要返回一个错误包
|
||||
local T = {
|
||||
op = OP + 3,
|
||||
cid = SUser.GetCID(),
|
||||
cid2 = PSUser.GetCID(),
|
||||
op = OP + 90,
|
||||
str = "未找到角色,请检查角色名或查看玩家是否在线"
|
||||
}
|
||||
Socket.SendGateway(T);
|
||||
SUser.SendNotiBox("未找到角色,请检查角色名或查看玩家是否在线", 1);
|
||||
}
|
||||
//判断是否是自己
|
||||
if (SUser.GetCID() == PSUser.GetCID()) {
|
||||
SUser.SendNotiBox("不能和自己结婚!", 1);
|
||||
return;
|
||||
}
|
||||
//查询两人状态必须都为未结婚
|
||||
local SUserState = Mysql_Operate_Func.CheckMarryState(SUser.GetCID());
|
||||
local PSUserState = Mysql_Operate_Func.CheckMarryState(PSUser.GetCID());
|
||||
if (SUserState) {
|
||||
SUser.SendNotiBox("抱歉,您已经结婚了!", 1);
|
||||
return;
|
||||
}
|
||||
if (PSUserState) {
|
||||
SUser.SendNotiBox("抱歉,对方已经结婚了...", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
local T = {
|
||||
op = OP + 4,
|
||||
applicantCid = SUser.GetCID(),
|
||||
applicantUid = SUser.GetUID(),
|
||||
applicantName = SUser.GetCharacName(),
|
||||
}
|
||||
PSUser.SendJso(T);
|
||||
|
||||
//把请求加入到请求列表
|
||||
RequestMarryList.rawset(SUser.GetCID(), PSUser.GetCID());
|
||||
}
|
||||
|
||||
//订婚答复包
|
||||
function ResponseMarry(SUser, Jso) {
|
||||
local Flag = Jso.Flag;
|
||||
local applicantUser = World.GetUserByUidCid(Jso.applicantUid, Jso.applicantCid);
|
||||
if (Flag) {
|
||||
if (applicantUser) {
|
||||
//在请求列表里查看是否有请求
|
||||
if (!(RequestMarryList.rawin(Jso.applicantCid)) || RequestMarryList[Jso.applicantCid] != SUser.GetCID()) {
|
||||
SUser.SendNotiBox("抱歉,对方未发送请求!", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
applicantUser.SendNotiBox("恭喜您!\n对方同意了您的请求。\n请寻找大司祭制定结婚的详细事宜。", 1);
|
||||
|
||||
Mysql_Operate_Func.InseartMarryInfo(Jso.applicantCid, applicantUser.GetCharacName(), SUser.GetCID(), applicantUser.GetCharacJob(), 0, 0, "no", 1);
|
||||
Mysql_Operate_Func.InseartMarryInfo(SUser.GetCID(), SUser.GetCharacName(), Jso.applicantCid, SUser.GetCharacJob(), 0, 0, "no", 1);
|
||||
|
||||
//刷新客户端的订婚状态
|
||||
local T = {
|
||||
op = OP + 10,
|
||||
Flag = 1
|
||||
};
|
||||
applicantUser.SendJso(T);
|
||||
SUser.SendJso(T);
|
||||
}
|
||||
} else {
|
||||
if (applicantUser) applicantUser.SendNotiBox("很遗憾!\n对方拒绝了您的请求", 1);
|
||||
}
|
||||
}
|
||||
|
||||
//退婚包
|
||||
function CancelMarry(SUser, Jso) {
|
||||
//加判断 必须两人都在订婚状态才能退婚
|
||||
|
||||
local DeleteArr = [];
|
||||
DeleteArr.push(SUser.GetCID());
|
||||
local Target_CId = Mysql_Operate_Func.CheckMarryTarget(SUser.GetCID());
|
||||
if (Target_CId) {
|
||||
DeleteArr.push(Target_CId);
|
||||
//如果对象存在则判断两人是否都在订婚状态
|
||||
local SUserState = Mysql_Operate_Func.CheckMarryState(SUser.GetCID())
|
||||
local TargetState = Mysql_Operate_Func.CheckMarryTarget(Target_CId);
|
||||
if (SUserState != 1 || TargetState != 1) return;
|
||||
}
|
||||
|
||||
|
||||
foreach(s_cid in DeleteArr) {
|
||||
Mysql_Operate_Func.DeleteMarryInfo(s_cid);
|
||||
}
|
||||
//刷新客户端的订婚状态
|
||||
local T = {
|
||||
op = OP + 10,
|
||||
Flag = 0
|
||||
};
|
||||
SUser.SendJso(T);
|
||||
//如果需要通知被退婚的对象
|
||||
if (DeleteArr.len() > 1) {
|
||||
local WorldMap = World.GetOnlinePlayer();
|
||||
foreach(W_User in WorldMap) {
|
||||
if (W_User.GetCID() == DeleteArr[1]) {
|
||||
W_User.SendJso(T);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//打开准备婚礼窗口
|
||||
function OpenPreparationWindow(SUser, Jso) {
|
||||
local Target_CId = Mysql_Operate_Func.CheckMarryTarget(SUser.GetCID());
|
||||
if (!Target_CId) {
|
||||
SUser.SendNotiBox("没有婚礼信息!", 1);
|
||||
return;
|
||||
}
|
||||
local Target_Name = Mysql_Operate_Func.CheckMarryTargetName(Target_CId);
|
||||
if (!Target_Name) {
|
||||
SUser.SendNotiBox("没有婚礼信息!", 1);
|
||||
return;
|
||||
}
|
||||
local T = {
|
||||
op = OP + 12,
|
||||
MyName = SUser.GetCharacName(),
|
||||
TargetName = Target_Name,
|
||||
};
|
||||
SUser.SendJso(T);
|
||||
}
|
||||
|
||||
//确认婚礼
|
||||
function ConfirmMarry(SUser, Jso) {
|
||||
local Target_CId = Mysql_Operate_Func.CheckMarryTarget(SUser.GetCID());
|
||||
if (!Target_CId) {
|
||||
SUser.SendNotiBox("没有婚礼信息!", 1);
|
||||
return;
|
||||
}
|
||||
local Time = Jso.Time;
|
||||
local Level = Jso.Level;
|
||||
local NeedItem = Config[("结婚等级" + (Level + 1) + "道具ID")];
|
||||
|
||||
//获取背包对象
|
||||
local InvenObj = SUser.GetInven();
|
||||
local SlotIdx = InvenObj.GetSlotById(NeedItem);
|
||||
if (SlotIdx == -1) {
|
||||
SUser.SendNotiBox("没有足够的道具!", 1);
|
||||
return;
|
||||
} else {
|
||||
InvenObj.DeleteItemCount(NeedItem, 1);
|
||||
|
||||
// //注册婚礼礼堂信息
|
||||
// AuditoriumList.rawset(SUser.GetCID(), {
|
||||
// Time = Time,
|
||||
// Level = Level,
|
||||
// Target_CId = Target_CId,
|
||||
// Target_Name = Mysql_Operate_Func.CheckMarryTargetName(Target_CId),
|
||||
// });
|
||||
|
||||
//当前时间戳 作为礼堂编号
|
||||
local Index = time();
|
||||
//注册婚礼礼堂信息
|
||||
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.ChangeMarryState(SUser.GetCID(), 2);
|
||||
Mysql_Operate_Func.ChangeMarryState(Target_CId, 2);
|
||||
|
||||
local T = {
|
||||
op = OP + 10,
|
||||
Flag = 2
|
||||
}
|
||||
|
||||
local WorldMap = World.GetOnlinePlayer();
|
||||
foreach(W_User in WorldMap) {
|
||||
if (W_User.GetCID() == Target_CId) {
|
||||
W_User.SendJso(T);
|
||||
W_User.SendNotiBox(format("婚礼将在%d分钟后举行!\n点击大司祭可进入礼堂。", (Time + 1) * 10), 1);
|
||||
}
|
||||
}
|
||||
SUser.SendJso(T);
|
||||
SUser.SendNotiBox(format("婚礼将在%d分钟后举行!\n点击大司祭可进入礼堂。", (Time + 1) * 10), 1);
|
||||
}
|
||||
}
|
||||
|
||||
//进入礼堂
|
||||
function EnterAuditorium(SUser, Jso) {
|
||||
local RoomId = Jso.room;
|
||||
//进入自己的礼堂
|
||||
if (RoomId == -1) {
|
||||
local MyState = Mysql_Operate_Func.CheckMarryState(SUser.GetCID());
|
||||
if (MyState != 2) {
|
||||
SUser.SendNotiBox("您访问的礼堂不存在!", 1);
|
||||
return;
|
||||
}
|
||||
|
||||
//向缓存写入进入时的坐标
|
||||
EnterAuditoriumPosList.rawset(SUser.GetCID(), SUser.GetLocation());
|
||||
//移动到礼堂
|
||||
World.MoveArea(SUser, Config["礼堂城镇编号"], Config["礼堂区域编号"], 55, 349);
|
||||
}
|
||||
}
|
||||
|
||||
//离开礼堂
|
||||
function LeaveAuditorium(SUser, Jso) {
|
||||
if (EnterAuditoriumPosList.rawin(SUser.GetCID())) {
|
||||
local Info = EnterAuditoriumPosList[SUser.GetCID()];
|
||||
//离开礼堂回到进入时的位置
|
||||
World.MoveArea(SUser, Info.Town, Info.Area, Info.Pos.X, Info.Pos.Y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
constructor() {
|
||||
//注册来自客户端的收包
|
||||
ClientSocketPackFuncMap.rawset(OP + 1, CheckMarryCallBack.bindenv(this));
|
||||
ClientSocketPackFuncMap.rawset(OP + 3, RequestMarry.bindenv(this));
|
||||
}
|
||||
Config = dofile("/root/娱心插件配置/结婚系统配置.dat");
|
||||
|
||||
//注册来自客户端的收包
|
||||
ClientSocketPackFuncMap.rawset(OP + 9, CheckMarryStateCallBack.bindenv(this));
|
||||
ClientSocketPackFuncMap.rawset(OP + 3, RequestMarry.bindenv(this));
|
||||
ClientSocketPackFuncMap.rawset(OP + 5, ResponseMarry.bindenv(this));
|
||||
ClientSocketPackFuncMap.rawset(OP + 7, CancelMarry.bindenv(this));
|
||||
ClientSocketPackFuncMap.rawset(OP + 11, OpenPreparationWindow.bindenv(this));
|
||||
ClientSocketPackFuncMap.rawset(OP + 13, ConfirmMarry.bindenv(this));
|
||||
ClientSocketPackFuncMap.rawset(OP + 15, EnterAuditorium.bindenv(this));
|
||||
ClientSocketPackFuncMap.rawset(OP + 17, LeaveAuditorium.bindenv(this));
|
||||
|
||||
//从池子拿连接
|
||||
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 Res = SqlObj.Select(query, ["int"]);
|
||||
//需要建库
|
||||
if (Res.len() > 0 && Res[0][0] == 0) {
|
||||
local CreateSql = "CREATE TABLE IF NOT EXISTS zyk.marry (cid INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), target_cid INT(11), job INT(11), level INT(11), experience INT(11), equip VARCHAR(255), state INT(11));"
|
||||
local CreateSql2 = "CREATE TABLE IF NOT EXISTS zyk.marry_room (cid INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), time INT(11), level INT(11), target_cid INT(11), target_name VARCHAR(255), state INT(11), index INT(11));"
|
||||
SqlObj.Exec_Sql(CreateSql);
|
||||
SqlObj.Exec_Sql(CreateSql2);
|
||||
}
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ProjectInitFuncMap.P_Marry <- Marry();
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
文件名:Marry_sql.nut
|
||||
路径:Dps_A/ProjectClass/MarrySystem/Marry_sql.nut
|
||||
创建日期:2024-10-03 20:57
|
||||
文件用途:结婚系统数据库命令
|
||||
*/
|
||||
|
||||
MARRY_SQL_LIST <- {};
|
||||
|
||||
//查询婚姻状态
|
||||
MARRY_SQL_LIST.CheckMarryState <- "SELECT state FROM zyk.marry WHERE cid = %d;";
|
||||
//查询婚姻对象
|
||||
MARRY_SQL_LIST.CheckMarryTarget <- "SELECT target_cid FROM zyk.marry WHERE cid = %d;";
|
||||
//查询婚姻对象名字
|
||||
MARRY_SQL_LIST.CheckMarryTargetName <- "SELECT name FROM zyk.marry WHERE cid = %d;";
|
||||
//通过cid删除一条婚姻信息
|
||||
MARRY_SQL_LIST.DeleteMarryInfo <- "DELETE FROM zyk.marry WHERE cid = %d;";
|
||||
//新增婚姻信息
|
||||
MARRY_SQL_LIST.InseartMarryInfo <- @"INSERT INTO zyk.marry (cid, name, target_cid, job, level, experience, equip, state)
|
||||
VALUES (%d, '%s', %d, %d, %d, %d,'%s',%d)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
target_cid = %d,
|
||||
equip = '%s',
|
||||
state = %d;";
|
||||
//通过cid修改婚姻状态
|
||||
MARRY_SQL_LIST.ChangeMarryState <- "UPDATE zyk.marry SET state = %d WHERE cid = %d;";
|
||||
//新增礼堂信息
|
||||
MARRY_SQL_LIST.InsertMarryRoom <- @"INSERT INTO zyk.marry_room (cid, name, time, level, target_cid, target_name, state, rindex)
|
||||
VALUES (%d, '%s', %d, %d, %d, '%s', %d, %d);";
|
||||
|
|
@ -3,8 +3,12 @@ getroottable().DebugModelFlag <- false;
|
|||
function InitPluginInfo() {
|
||||
//初始化定时器
|
||||
_Timer_Object <- Timer();
|
||||
//初始化自动重载
|
||||
GameManager.OpenHotFix("/dp_s/Dps_A");
|
||||
|
||||
|
||||
//初始化自动重载 只在15线开启
|
||||
local ConfigPath = Sq_Game_GetConfig();
|
||||
local Channel = ConfigPath.slice(ConfigPath.find("cfg/") + 4, ConfigPath.len());
|
||||
if (Channel.find("15")) GameManager.OpenHotFix("/dp_s/Dps_A");
|
||||
|
||||
local PoolObj = MysqlPool.GetInstance();
|
||||
PoolObj.SetBaseConfiguration("127.0.0.1", 3306, "game", "uu5!^%jg");
|
||||
|
|
@ -13,19 +17,13 @@ function InitPluginInfo() {
|
|||
//初始化
|
||||
PoolObj.Init();
|
||||
|
||||
//从池子拿连接
|
||||
local SqlObj = MysqlPool.GetInstance().GetConnect();
|
||||
|
||||
//建库
|
||||
SqlObj.Select("create database if not exists frida default charset utf8;", []);
|
||||
|
||||
SqlObj.Select("CREATE TABLE `frida`.`setCharacSlotLimit` (`account_id` INT NOT NULL,`slot` INT NOT NULL DEFAULT 2,PRIMARY KEY (`account_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;", []);
|
||||
|
||||
//把连接还池子
|
||||
MysqlPool.GetInstance().PutConnect(SqlObj);
|
||||
|
||||
// Sq_CreatCConnectPool(2, 4, "127.0.0.1", 3306, "game", "uu5!^%jg");
|
||||
Sq_CreatSocketConnect("192.168.200.24", "65109");
|
||||
|
||||
//初始化结婚
|
||||
ProjectInitFuncMap.P_Marry <- Marry();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue