This commit is contained in:
lenheart 2024-09-16 17:05:26 +08:00
commit 237bcf8719
53 changed files with 21032 additions and 0 deletions

View File

@ -0,0 +1,30 @@
/*
文件名:AccountCargoClass.nut
路径:Dps_A/BaseClass/AccountCargoClass/AccountCargoClass.nut
创建日期:2024-09-16 10:00
文件用途:账号金库类
*/
class AccountCargo extends Base_C_Object {
SUser = null;
constructor(CObject, gSUser) {
base.constructor(CObject);
SUser = gSUser;
}
//获取空格子
function GetEmptySlot() {
return Sq_CallFunc(S_Ptr("0x0828a580"), "int", ["pointer"], this.C_Object);
}
//存储物品
function InsertItem(ItemObj, Slot) {
Sq_CallFunc(S_Ptr("0x08289c82"), "int", ["pointer", "pointer", "int"], this.C_Object, ItemObj.C_Object, Slot);
}
//刷新列表
function SendItemList() {
return Sq_CallFunc(S_Ptr("0x0828a88a"), "int", ["pointer"], this.C_Object);
}
}

View File

@ -0,0 +1,12 @@
/*
文件名:BaseBindenvClass.nut
路径:Dps_A/BaseClass/BaseInfoClass/BaseBindenvClass.nut
创建日期:2024-05-04 12:27
文件用途:
*/
class BaseBindenv {
Info = null;
constructor() {
getroottable().rawset("BaseBindenvInfo_" + clock(), this);
}
}

View File

@ -0,0 +1,7 @@
class Base_C_Object {
C_Object = null;
constructor(gObject) {
this.C_Object = gObject;
}
}

View File

@ -0,0 +1,34 @@
/*
文件名:BattleFieldClass.nut
路径:Dps_A/BaseClass/BattleFieldClass/BattleFieldClass.nut
创建日期:2024-04-28 09:34
文件用途:
*/
class BattleField extends Base_C_Object {
Attribute = null;
constructor(CObject) {
base.constructor(CObject);
Attribute = Sq_Point2Blob(CObject, 120);
}
//获取副本
function GetDgn() {
local Ret = Sq_BattleField_GetDgn(C_Object);
if (Ret) {
return Dungeon(Ret);
}
return Ret;
}
function add_monster_APC_AI(index) {
Sq_CallFunc(S_Ptr("0x8301D76"), "void", ["pointer", "int"], C_Object, index);
}
//获取深渊派对情况
function GetHellDifficulty() {
local Sia = Sq_Point2Blob(C_Object, 500);
Sia.seek(460);
return (Sia.readn('c'))
}
}

View File

@ -0,0 +1,30 @@
/*
文件名:DungeonClass.nut
路径:Dps_A/BaseClass/DungeonClass/DungeonClass.nut
创建日期:2024-04-27 20:31
文件用途:副本对象类
*/
class Dungeon extends Base_C_Object {
Attribute = null;
constructor(CObject) {
base.constructor(CObject);
Attribute = Sq_Point2Blob(CObject, 120);
}
//获取副本ID
function GetId() {
return Sq_Dungeon_GetIdex(C_Object);
}
//获取副本名称
function GetName() {
return Sq_CallFunc(S_Ptr("0x081455A6"), "string", ["pointer"], this.C_Object);
}
//获取副本等级
function GetMinLevel() {
return Sq_CallFunc(S_Ptr("0x0814559A"), "int", ["pointer"], this.C_Object);
}
}

View File

@ -0,0 +1,18 @@
/*
文件名:GameManagerClass.nut
路径:BaseClass/GameManagerClass/GameManagerClass.nut
创建日期:2024-04-09 20:30
文件用途:游戏管理器类
*/
class GameManager extends Base_C_Object {
constructor() {
local CObject = Sq_GameManager_GameManager();
base.constructor(CObject);
}
function GetParty() {
local C_Party = Sq_GameManager_GetParty(C_Object);
return Party(C_Party);
}
}

View File

@ -0,0 +1,75 @@
/*
文件名:InvenClass.nut
路径:BaseClass/InvenClass/InvenClass.nut
创建日期:2024-04-18 13:26
文件用途:背包类
*/
class Inven extends Base_C_Object {
static INVENTORY_TYPE_BODY = 0; //身上穿的装备(0-26)
static INVENTORY_TYPE_ITEM = 1; //物品栏(0-311)
static INVENTORY_TYPE_AVARTAR = 2; //时装栏(0-104)
static INVENTORY_TYPE_CREATURE = 3; //宠物装备(0-241)
SUser = null;
constructor(CObject, gSUser) {
base.constructor(CObject);
SUser = gSUser;
}
//获得槽位里的对象
function GetSlot(Type, Slot) {
local P = Sq_Inven_GetItem(this.C_Object, Type, Slot);
if (P) {
return Item(P);
}
return null;
}
//通过ID获得槽位
function GetSlotById(Idx) {
return Sq_Inven_GetItemById(this.C_Object, Idx);
}
//检查背包是否拥有指定数量的指定道具
function CheckItemCount(ItemId, ItemCount) {
local SlotIdx = GetSlotById(ItemId);
if (SlotIdx != -1) {
local SlotItem = GetSlot(1, SlotIdx);
if (SlotItem) {
if (SlotItem.GetType() != "装备") {
if (SlotItem.GetAdd_Info() >= ItemCount) return true;
}
}
}
return false;
}
//检查背包是否拥有指定表的道具及数量
function CheckArrItemCount(T) {
local Flag = true;
foreach(value in T) {
if (!CheckItemCount(value.Id, value.Count)) Flag = false;
}
return Flag;
}
//销毁背包中指定表的道具及数量
function DeleteArrItemCount(T) {
foreach(value in T) {
local Slot = GetSlotById(value.Id);
Sq_Inven_RemoveItemFormCount(this.C_Object, 1, Slot, value.Count, 10, 1);
SUser.SendUpdateItemList(1, 0, Slot);
}
}
//销毁背包中指定的道具及数量
function DeleteItemCount(Id, Count) {
local Slot = GetSlotById(Id);
local Ret = Sq_Inven_RemoveItemFormCount(this.C_Object, 1, Slot, Count, 10, 1);
SUser.SendUpdateItemList(1, 0, Slot);
return Ret;
}
}

View File

@ -0,0 +1,138 @@
/*
文件名:ItemClass.nut
路径:BaseClass/ItemClass/ItemClass.nut
创建日期:2024-04-18 15:10
文件用途:Item类
*/
class Item extends Base_C_Object {
Attribute = null;
IsEmpty = false;
constructor(CObject) {
base.constructor(CObject);
Attribute = Sq_Point2Blob(CObject, 62);
if (GetIndex() == 0) IsEmpty = true;
}
function Output() {
local Str = "[";
foreach(Value in Attribute) {
Str = format("%s%02X", Str, Value);
Str += ",";
}
Str += "]";
print(Str);
}
//获取类型
function GetType() {
Attribute.seek(1);
local Type = Attribute.readn('c');
switch (Type) {
case 1:
return "装备";
case 2:
return "消耗品";
case 3:
return "材料";
case 4:
return "任务材料";
case 10:
return "副职业材料";
default:
return "未知类型";
}
}
//获取编号
function GetIndex() {
Attribute.seek(2);
return Attribute.readn('i');
}
//设置编号
function SetIndex(Index) {
Attribute.seek(2);
Attribute.writen(Index, 'i');
}
//获取强化等级
function GetUpgrade() {
Attribute.seek(6);
return Attribute.readn('c');
}
//设置强化等级
function SetUpgrade(Level) {
Attribute.seek(6);
Attribute.writen(Level, 'c');
}
//获取 品级 或 数量 如果是装备就是品级 如果是其他就是数量
function GetAdd_Info() {
Attribute.seek(7);
return Attribute.readn('i');
}
//设置 品级 或 数量 如果是装备就是品级 如果是其他就是数量
function SetAdd_Info(Value) {
Attribute.seek(7);
Attribute.writen(Value, 'i');
}
//获取耐久度
function GetDurable() {
Attribute.seek(11);
return Attribute.readn('c');
}
//设置耐久度
function SetDurable(Value) {
Attribute.seek(11);
Attribute.writen(Value, 'c');
}
//获取增幅属性
function GetAmplification() {
Attribute.seek(17);
return Attribute.readn('w');
}
//设置增幅属性
function SetAmplification(Value) {
Attribute.seek(17);
Attribute.writen(Value, 'w');
}
//获取锻造属性
function GetForging() {
Attribute.seek(51);
return Attribute.readn('c');
}
//设置锻造属性
function SetForging(Value) {
Attribute.seek(51);
Attribute.writen(Value, 'c');
}
//获取附魔属性
function GetEnchanting() {
Attribute.seek(13);
return Attribute.readn('i');
}
//设置附魔属性
function SetEnchanting(Value) {
Attribute.seek(13);
Attribute.writen(Value, 'i');
}
//刷写装备数据
function Flush() {
Sq_WriteBlobToAddress(C_Object, Attribute);
}
//删除道具
function Delete() {
Sq_Inven_RemoveItem(C_Object);
this = null;
}
}

View File

@ -0,0 +1,30 @@
//Json类
class Json {
//Table 转 String
function Encode(Table) {
return JSONEncoder.encode(Table);
}
function OldDecode(Str) {
Str = sq_DecondeJson(Str);
local NewStr = "local _M = " + Str + ";\n return _M;\n";
local Func = compilestring(NewStr);
try {
local Obj = Func();
if (typeof(Obj) == "table" || typeof(Obj) == "array") {
if (Obj.len() > 0) return Obj;
}
} catch (exception) {
}
error("错误的包内容: " + NewStr);
return null;
}
//String 转 Table
function Decode(Str) {
return JSONParser.parse(Str);
}
}

View File

@ -0,0 +1,702 @@
/**
* JSON Parser
*
* @author Mikhail Yurasov <mikhail@electricimp.com>
* @package JSONParser
* @version 1.0.1
*/
/**
* JSON Parser
* @package JSONParser
*/
class JSONParser {
// should be the same for all components within JSONParser package
static version = "1.0.1";
/**
* Parse JSON string into data structure
*
* @param {string} str
* @param {function({string} value[, "number"|"string"])|null} converter
* @return {*}
*/
function parse(str, converter = null) {
local state;
local stack = []
local container;
local key;
local value;
// actions for string tokens
local string = {
go = function() {
state = "ok";
},
firstokey = function() {
key = value;
state = "colon";
},
okey = function() {
key = value;
state = "colon";
},
ovalue = function() {
value = this._convert(value, "string", converter);
state = "ocomma";
}.bindenv(this),
firstavalue = function() {
value = this._convert(value, "string", converter);
state = "acomma";
}.bindenv(this),
avalue = function() {
value = this._convert(value, "string", converter);
state = "acomma";
}.bindenv(this)
};
// the actions for number tokens
local number = {
go = function() {
state = "ok";
},
ovalue = function() {
value = this._convert(value, "number", converter);
state = "ocomma";
}.bindenv(this),
firstavalue = function() {
value = this._convert(value, "number", converter);
state = "acomma";
}.bindenv(this),
avalue = function() {
value = this._convert(value, "number", converter);
state = "acomma";
}.bindenv(this)
};
// action table
// describes where the state machine will go from each given state
local action = {
"{": {
go = function() {
stack.push({
state = "ok"
});
container = {};
state = "firstokey";
},
ovalue = function() {
stack.push({
container = container,
state = "ocomma",
key = key
});
container = {};
state = "firstokey";
},
firstavalue = function() {
stack.push({
container = container,
state = "acomma"
});
container = {};
state = "firstokey";
},
avalue = function() {
stack.push({
container = container,
state = "acomma"
});
container = {};
state = "firstokey";
}
},
"}": {
firstokey = function() {
local pop = stack.pop();
value = container;
container = ("container" in pop) ? pop.container : null;
key = ("key" in pop) ? pop.key : null;
state = pop.state;
},
ocomma = function() {
local pop = stack.pop();
container[key] <- value;
value = container;
container = ("container" in pop) ? pop.container : null;
key = ("key" in pop) ? pop.key : null;
state = pop.state;
}
},
"[": {
go = function() {
stack.push({
state = "ok"
});
container = [];
state = "firstavalue";
},
ovalue = function() {
stack.push({
container = container,
state = "ocomma",
key = key
});
container = [];
state = "firstavalue";
},
firstavalue = function() {
stack.push({
container = container,
state = "acomma"
});
container = [];
state = "firstavalue";
},
avalue = function() {
stack.push({
container = container,
state = "acomma"
});
container = [];
state = "firstavalue";
}
},
"]": {
firstavalue = function() {
local pop = stack.pop();
value = container;
container = ("container" in pop) ? pop.container : null;
key = ("key" in pop) ? pop.key : null;
state = pop.state;
},
acomma = function() {
local pop = stack.pop();
container.push(value);
value = container;
container = ("container" in pop) ? pop.container : null;
key = ("key" in pop) ? pop.key : null;
state = pop.state;
}
},
":": {
colon = function() {
// Check if the key already exists
// NOTE previous code used 'if (key in container)...'
// but this finds table ('container') member methods too
local err = false;
foreach(akey, avalue in container) {
if (akey == key) err = true;
break
}
if (err) throw "Duplicate key \"" + key + "\"";
state = "ovalue";
}
},
",": {
ocomma = function() {
container[key] <- value;
state = "okey";
},
acomma = function() {
container.push(value);
state = "avalue";
}
},
"true": {
go = function() {
value = true;
state = "ok";
},
ovalue = function() {
value = true;
state = "ocomma";
},
firstavalue = function() {
value = true;
state = "acomma";
},
avalue = function() {
value = true;
state = "acomma";
}
},
"false": {
go = function() {
value = false;
state = "ok";
},
ovalue = function() {
value = false;
state = "ocomma";
},
firstavalue = function() {
value = false;
state = "acomma";
},
avalue = function() {
value = false;
state = "acomma";
}
},
"null": {
go = function() {
value = null;
state = "ok";
},
ovalue = function() {
value = null;
state = "ocomma";
},
firstavalue = function() {
value = null;
state = "acomma";
},
avalue = function() {
value = null;
state = "acomma";
}
}
};
//
state = "go";
stack = [];
// current tokenizeing position
local start = 0;
try {
local
result,
token,
tokenizer = _JSONTokenizer();
while (token = tokenizer.nextToken(str, start)) {
if ("ptfn" == token.type) {
// punctuation/true/false/null
action[token.value][state]();
} else if ("number" == token.type) {
// number
value = token.value;
number[state]();
} else if ("string" == token.type) {
// string
value = tokenizer.unescape(token.value);
string[state]();
}
start += token.length;
}
} catch (e) {
state = e;
}
// check is the final state is not ok
// or if there is somethign left in the str
if (state != "ok" || regexp("[^\\s]").capture(str, start)) {
local min = @(a, b) a< b ? a : b;
local near = str.slice(start, min(str.len(), start + 10));
throw "JSON Syntax Error near `" + near + "`";
}
return value;
}
/**
* Convert strings/numbers
* Uses custom converter function
*
* @param {string} value
* @param {string} type
* @param {function|null} converter
*/
function _convert(value, type, converter) {
if ("function" == typeof converter) {
// # of params for converter function
local parametercCount = 2;
// .getinfos() is missing on ei platform
if ("getinfos" in converter) {
parametercCount = converter.getinfos().parameters.len() -
1 /* "this" is also included */ ;
}
if (parametercCount == 1) {
return converter(value);
} else if (parametercCount == 2) {
return converter(value, type);
} else {
throw "Error: converter function must take 1 or 2 parameters"
}
} else if ("number" == type) {
return (value.find(".") == null && value.find("e") == null && value.find("E") == null) ? value.tointeger() : value.tofloat();
} else {
return value;
}
}
}
/**
* JSON Tokenizer
* @package JSONParser
*/
class _JSONTokenizer {
_ptfnRegex = null;
_numberRegex = null;
_stringRegex = null;
_ltrimRegex = null;
_unescapeRegex = null;
constructor() {
// punctuation/true/false/null
this._ptfnRegex = regexp("^(?:\\,|\\:|\\[|\\]|\\{|\\}|true|false|null)");
// numbers
this._numberRegex = regexp("^(?:\\-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)");
// strings
this._stringRegex = regexp("^(?:\\\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\\\")");
// ltrim pattern
this._ltrimRegex = regexp("^[\\s\\t\\n\\r]*");
// string unescaper tokenizer pattern
this._unescapeRegex = regexp("\\\\(?:(?:u\\d{4})|[\\\"\\\\/bfnrt])");
}
/**
* Get next available token
* @param {string} str
* @param {integer} start
* @return {{type,value,length}|null}
*/
function nextToken(str, start = 0) {
local
m,
type,
token,
value,
length,
whitespaces;
// count # of left-side whitespace chars
whitespaces = this._leadingWhitespaces(str, start);
start += whitespaces;
if (m = this._ptfnRegex.capture(str, start)) {
// punctuation/true/false/null
value = str.slice(m[0].begin, m[0].end);
type = "ptfn";
} else if (m = this._numberRegex.capture(str, start)) {
// number
value = str.slice(m[0].begin, m[0].end);
type = "number";
} else if (m = this._stringRegex.capture(str, start)) {
// string
value = str.slice(m[1].begin, m[1].end);
type = "string";
} else {
return null;
}
token = {
type = type,
value = value,
length = m[0].end - m[0].begin + whitespaces
};
return token;
}
/**
* Count # of left-side whitespace chars
* @param {string} str
* @param {integer} start
* @return {integer} number of leading spaces
*/
function _leadingWhitespaces(str, start) {
local r = this._ltrimRegex.capture(str, start);
if (r) {
return r[0].end - r[0].begin;
} else {
return 0;
}
}
// unesacape() replacements table
_unescapeReplacements = {
"b": "\b",
"f": "\f",
"n": "\n",
"r": "\r",
"t": "\t"
};
/**
* Unesacape string escaped per JSON standard
* @param {string} str
* @return {string}
*/
function unescape(str) {
local start = 0;
local res = "";
while (start< str.len()) {
local m = this._unescapeRegex.capture(str, start);
if (m) {
local token = str.slice(m[0].begin, m[0].end);
// append chars before match
local pre = str.slice(start, m[0].begin);
res += pre;
if (token.len() == 6) {
// unicode char in format \uhhhh, where hhhh is hex char code
// todo: convert \uhhhh chars
res += token;
} else {
// escaped char
// @see http://www.json.org/
local char = token.slice(1);
if (char in this._unescapeReplacements) {
res += this._unescapeReplacements[char];
} else {
res += char;
}
}
} else {
// append the rest of the source string
res += str.slice(start);
break;
}
start = m[0].end;
}
return res;
}
}
// Copyright (c) 2017 Electric Imp
// This file is licensed under the MIT License
// http://opensource.org/licenses/MIT
class JSONEncoder {
static VERSION = "2.0.0";
// max structure depth
// anything above probably has a cyclic ref
static _maxDepth = 32;
/**
* Encode value to JSON
* @param {table|array|*} value
* @returns {string}
*/
function encode(value) {
return this._encode(value);
}
/**
* @param {table|array} val
* @param {integer=0} depth current depth level
* @private
*/
function _encode(val, depth = 0) {
// detect cyclic reference
if (depth > this._maxDepth) {
throw "Possible cyclic reference";
}
local
r = "",
s = "",
i = 0;
switch (typeof val) {
case "table":
case "class":
s = "";
// serialize properties, but not functions
foreach(k, v in val) {
if (typeof v != "function") {
s += ",\"" + k + "\":" + this._encode(v, depth + 1);
}
}
s = s.len() > 0 ? s.slice(1) : s;
r += "{" + s + "}";
break;
case "array":
s = "";
for (i = 0; i< val.len(); i++) {
s += "," + this._encode(val[i], depth + 1);
}
s = (i > 0) ? s.slice(1) : s;
r += "[" + s + "]";
break;
case "integer":
case "float":
case "bool":
r += val;
break;
case "null":
r += "null";
break;
case "instance":
if ("_serializeRaw" in val && typeof val._serializeRaw == "function") {
// include value produced by _serializeRaw()
r += val._serializeRaw().tostring();
} else if ("_serialize" in val && typeof val._serialize == "function") {
// serialize instances by calling _serialize method
r += this._encode(val._serialize(), depth + 1);
} else {
s = "";
try {
// iterate through instances which implement _nexti meta-method
foreach(k, v in val) {
s += ",\"" + k + "\":" + this._encode(v, depth + 1);
}
} catch (e) {
// iterate through instances w/o _nexti
// serialize properties, but not functions
foreach(k, v in val.getclass()) {
if (typeof v != "function") {
s += ",\"" + k + "\":" + this._encode(val[k], depth + 1);
}
}
}
s = s.len() > 0 ? s.slice(1) : s;
r += "{" + s + "}";
}
break;
case "blob":
// This is a workaround for a known bug:
// on device side Blob.tostring() returns null
// (instaead of an empty string)
r += "\"" + (val.len() ? this._escape(val.tostring()) : "") + "\"";
break;
// strings and all other
default:
r += "\"" + this._escape(val.tostring()) + "\"";
break;
}
return r;
}
/**
* Escape strings according to http://www.json.org/ spec
* @param {string} str
*/
function _escape(str) {
local res = "";
for (local i = 0; i< str.len(); i++) {
local ch1 = (str[i] & 0xFF);
if ((ch1 & 0x80) == 0x00) {
// 7-bit Ascii
ch1 = format("%c", ch1);
if (ch1 == "\"") {
res += "\\\"";
} else if (ch1 == "\\") {
res += "\\\\";
} else if (ch1 == "/") {
res += "\\/";
} else if (ch1 == "\b") {
res += "\\b";
} else if (ch1 == "\f") {
res += "\\f";
} else if (ch1 == "\n") {
res += "\\n";
} else if (ch1 == "\r") {
res += "\\r";
} else if (ch1 == "\t") {
res += "\\t";
} else if (ch1 == "\0") {
res += "\\u0000";
} else {
res += ch1;
}
} else {
if ((ch1 & 0xE0) == 0xC0) {
// 110xxxxx = 2-byte unicode
local ch2 = (str[++i] & 0xFF);
res += format("%c%c", ch1, ch2);
} else if ((ch1 & 0xF0) == 0xE0) {
// 1110xxxx = 3-byte unicode
local ch2 = (str[++i] & 0xFF);
local ch3 = (str[++i] & 0xFF);
res += format("%c%c%c", ch1, ch2, ch3);
} else if ((ch1 & 0xF8) == 0xF0) {
// 11110xxx = 4 byte unicode
local ch2 = (str[++i] & 0xFF);
local ch3 = (str[++i] & 0xFF);
local ch4 = (str[++i] & 0xFF);
res += format("%c%c%c%c", ch1, ch2, ch3, ch4);
}
}
}
return res;
}
}

View File

@ -0,0 +1,393 @@
/*
文件名:MathClass.nut
路径:BaseClass/MathClass.nut
创建日期:2023-08-26 12:13
文件用途:数学类
*/
class MathClass {
function getDirectionToTargetX(objX, x) {
if (objX > x)
return 0;
else
return 1;
}
/*
* @函数作用: 取随机值 左闭右开
* @参数 name
* @返回值
*/
function Rand(Min, Max) {
local In = rand();
local Ret = (Min + (Max - Min) * (In / RAND_MAX.tofloat())).tointeger();
return Ret;
}
function getCollisionByObjBox(obj, box) {
local x = obj.X;
local y = obj.Y;
local z = obj.Z;
local ArrBuf = [];
if (obj.Direction == 1) {
local pleft = [x + box[0], y + box[1], z + box[2]];
local pright = [x + box[0] + box[3], y + box[1] + box[4], z + box[2] + box[5]];
ArrBuf.extend(pleft);
ArrBuf.extend(pright);
} else {
local pleft = [x - box[0], y + box[1], z + box[2]];
local pright = [x - box[0] - box[3], y + box[1] + box[4], z + box[2] + box[5]];
ArrBuf.extend(pleft);
ArrBuf.extend(pright);
}
return ArrBuf;
}
function GetDistancePos(startX, direction, offsetX) {
if (direction == 0)
return startX - offsetX;
return startX + offsetX;
}
//通过坐标获得两点旋转角度
function getRorateAngleByCurrentPos(x1, y1, z1, x2, y2, z2) {
return 0;
}
//贝塞尔曲线构造的抛物线运动支持开始z轴(obj,curT,lastZ,moveT)
function sq_BParabola(currentT, maxT, initZPos, jumpHeight, lastZPos) {
local z = getBeizeri(currentT, maxT, initZPos, initZPos + jumpHeight, initZPos + jumpHeight, lastZPos);
return z.tointeger();
}
//获得抛物线(不支持开始z轴)
function sq_Parabola(x, b, c) {
local a = (-b.tofloat() * 4) / (c.tofloat() * c.tofloat());
return a.tofloat() * (x.tofloat() - c.tofloat() / 2) * (x.tofloat() - c.tofloat() / 2) + b.tofloat();
}
//获得两点之间平面的距离.
function Get2D_Distance(x1, y1, x2, y2) {
local offsetX = x1 - x2;
local offsetY = (y1 - y2) * 0.29;
return sqrt(offsetX * offsetX + offsetY * offsetY);
}
//判断给定的角度是否在startA和endA角度之间(startA与endA形成的锐角内)
function CheckAngleIsInArea(judge, startA, endA) {
if (startA< 0)
startA = startA + 360.0;
if (endA< 0)
endA = endA + 360.0;
if (startA > 360.0)
startA = startA - 360.0;
if (endA > 360.0)
endA = endA - 360.0;
if (startA > 0 && startA< 90 && endA > 270 && endA< 360) {
if (judge > 270 && judge< 360) {
if (endA< judge && judge< startA + 360)
return true;
} else if (judge< 90) {
if (endA< judge + 360 && judge + 360< startA + 360)
return true;
}
} else {
if (endA > judge && judge > startA)
return true;
}
return false;
}
//弧度制转为角度制
function toDegree(x) {
return x * 57.29577;
}
//角度转为弧度
function toRadian(x) {
return x * 0.01745;
}
//立方体与立方体之间碰撞 暂未测试
function CubeAndCubeCollection(c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ) {
if (pointIsInCubeArea(c1StartX, c1StartY, c1StartZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1EndX, c1StartY, c1StartZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1StartX, c1EndY, c1StartZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1EndX, c1EndY, c1StartZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1StartX, c1StartY, c1EndZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1EndX, c1StartY, c1EndZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1StartX, c1EndY, c1EndZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1EndX, c1EndY, c1EndZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c2StartX, c2StartY, c2StartZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2EndX, c2StartY, c2StartZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2StartX, c2EndY, c2StartZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2EndX, c2EndY, c2StartZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2StartX, c2StartY, c2EndZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2EndX, c2StartY, c2EndZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2StartX, c2EndY, c2EndZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2EndX, c2EndY, c2EndZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea((c1StartX + c1EndX )/ 2, c1StartY, c1StartZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea((c1StartX + c1EndX )/ 2, c1EndY, c1StartZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea((c1StartX + c1EndX )/ 2, c1StartY, c1EndZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea((c1StartX + c1EndX )/ 2, c1EndY, c1EndZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1StartX , (c1StartY + c1EndY) / 2, c1StartZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1StartX, (c1StartY + c1EndY) / 2, c1EndZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1EndX , (c1StartY + c1EndY) / 2, c1StartZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1EndX, (c1StartY + c1EndY) / 2, c1EndZ, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1StartX , c1StartY, (c1StartZ + c1EndZ) / 2, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1StartX, c1EndY, (c1StartZ + c1EndZ) / 2, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1EndX , c1StartY, (c1StartZ + c1EndZ) / 2, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea(c1EndX, c1EndY, (c1StartZ + c1EndZ) / 2, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea((c2StartX + c2EndX )/ 2, c2StartY, c2StartZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea((c2StartX + c2EndX )/ 2, c2EndY, c2StartZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea((c2StartX + c2EndX )/ 2, c2StartY, c2EndZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea((c2StartX + c2EndX )/ 2, c2EndY, c2EndZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2StartX , (c2StartY + c2EndY) / 2, c2StartZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2StartX, (c2StartY + c2EndY) / 2, c2EndZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2EndX , (c2StartY + c2EndY) / 2, c2StartZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2EndX, (c2StartY + c2EndY) / 2, c2EndZ, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2StartX , c2StartY, (c2StartZ + c2EndZ) / 2, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2StartX, c2EndY, (c2StartZ + c2EndZ) / 2, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2EndX , c2StartY, (c2StartZ + c2EndZ) / 2, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea(c2EndX, c2EndY, (c2StartZ + c2EndZ) / 2, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
if (pointIsInCubeArea((c1StartX + c1EndX) / 2, (c1StartY + c1EndY) / 2, (c1StartZ + c1EndZ) / 2, c2StartX, c2StartY, c2StartZ, c2EndX, c2EndY, c2EndZ))
return true;
if (pointIsInCubeArea((c2StartX + c2EndX) / 2, (c2StartY + c2EndY) / 2, (c2StartZ + c2EndZ) / 2, c1StartX, c1StartY, c1StartZ, c1EndX, c1EndY, c1EndZ))
return true;
return false;
}
//判断该点是否在给定参数的立方体内
function pointIsInCubeArea(px, py, pz, startX, startY, startZ, endX, endY, endZ) {
local cubeCenterX = (startX + endX) / 2;
local cubeXLen = abs(startX - endX) / 2;
local cubeCenterY = (startY + endY) / 2;
local cubeYLen = abs(startY - endY) / 2;
local cubeCenterZ = (startZ + endZ) / 2;
local cubeZLen = abs(startZ - endZ) / 2;
if (abs(px - cubeCenterX) <= cubeXLen && abs(py - cubeCenterY) <= cubeYLen && abs(pz - cubeCenterZ) <= cubeZLen)
return true;
return false;
}
//判断(px,py)是否在这个四边形内如果在就返回true否则返回false,
//一定要注意1234的坐标必须能首尾组成四边形不能跳坐标否则判断会直接失效
function pointIsIn4PointArea(px, py, x1, y1, x2, y2, x3, y3, x4, y4) {
local area = get4PointArea(x1, y1, x2, y2, x3, y3, x4, y4);
local pointArea1 = get3PointArea(x1, y1, x2, y2, px, py);
local pointArea2 = get3PointArea(x2, y2, x3, y3, px, py);
local pointArea3 = get3PointArea(x3, y3, x4, y4, px, py);
local pointArea4 = get3PointArea(x4, y4, x1, y1, px, py);
if (abs(area - pointArea1 - pointArea2 - pointArea3 - pointArea4)< 10.0)
return true;
return false;
}
//获得给定4个点形成的四边形面积
function get4PointArea(x1, y1, x2, y2, x3, y3, x4, y4) {
local area1 = get3PointArea(x1, y1, x2, y2, x3, y3)
local area2 = get3PointArea(x2, y2, x3, y3, x4, y4)
return area1 + area2;
}
//获得给定3个点形成的三角形面积
function get3PointArea(x1, y1, x2, y2, x3, y3) {
return abs(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2;
/*
local l1 = sqrt(pow((x1- x2), 2) + pow((y1- y2), 2));
local l2 = sqrt(pow((x1- x3), 2) + pow((y1- y3), 2));
local l3 = sqrt(pow((x2- x3), 2) + pow((y2- y3), 2));
return sqrt((l1 + l2 + l3) * (l1 + l2- l3) * (l1- l2 + l3) * (l2 + l3- l1)) / 4;
*/
}
//获得该数的符号
function getSign(var) {
if (var< 0)
return 1;
else if (var > 0)
return -1;
return 0;
}
//简便性能高的开平方
function sqrt(sum) {
local i = (sum / 2).tofloat();
local isb = 0;
for (isb = 0; isb< 10; isb++) {
i = (i - ((i * i - sum) / (2 * i))).tofloat();
}
return i;
}
//四舍五入
function Round(var) {
local v =
var -
var.tointeger();
if (v< 0.5)
return var.tointeger();
return var.tointeger() + 1;
}
//currentRate 越接近maxRate ,返回值由sv越接近ev
function getUniformVelocity(sv, ev, currentRate, maxRate) {
local rate = currentRate.tofloat() / maxRate.tofloat();
local varyValue = ev - sv;
return sv + varyValue * rate;
}
function sq_GetAccel(sv, ev, currentRate, maxRate, increaseFeature) {
local rate = currentRate.tofloat() / maxRate.tofloat();
local varyValue = ev - sv;
local increaseRate = 1.0;
if (increaseFeature) {
increaseRate = pow(50, rate) / 50; //慢->快
} else {
increaseRate = pow(rate, 0.05);
}
return sv + varyValue * increaseRate;
}
function getMax(a, b) {
if (a< b)
return b;
return a;
}
function getMin(a, b) {
if (a > b)
return b;
return a;
}
//获得贝塞尔曲线(2阶)
function getBeizeri(var1, var2, p0, p1, p2, p3) {
local t = var1.tofloat() / var2.tofloat();
local t1 = 1.0 - t;
local v1 = t1 * t1 * t1;
local v2 = t1 * t1;
local v3 = t1;
local v4 = t * t * t;
local ret = p0 * v1;
ret = ret + 3.0 * p1 * t * v2;
ret = ret + 3.0 * p2 * t * t * v3;
ret = ret + p3 * v4;
return ret;
}
//获得贝塞尔曲线角度
function getBeizeriAngle(var1, var2, p0, p1, p2, p3) {
local t = var1.tofloat() / var2.tofloat();
local t1 = 1.0 - t;
local v1 = t1 * t1;
local v2 = t1;
local v3 = t1;
local v4 = t * t;
local ret = 2.0 * p0 * v1;
ret = ret + 6.0 * p1 * t * v2;
ret = ret + 6.0 * p2 * t * v3;
ret = ret + 2.0 * p3 * v4;
return ret;
}
}

View File

@ -0,0 +1,73 @@
/*
文件名:PacketClass.nut
路径:BaseClass/PacketClass/PacketClass.nut
创建日期:2024-04-07 16:59
文件用途:数据包类
*/
class Packet extends Base_C_Object {
//传参就构造 不传就new一个新包
constructor(...) {
if (vargv.len() > 0) {
base.constructor(vargv[0]);
} else {
local Buf = Sq_New_Point(0x20000);
Sq_CallFunc(S_Ptr("0x858DD4C"), "void", ["pointer"], Buf);
base.constructor(Buf);
}
}
function Put_Header(a, b) {
Sq_CallFunc(S_Ptr("0x80CB8FC"), "int", ["pointer", "int", "int"], this.C_Object, a, b);
// Sq_Packet_Put_header(this.C_Object, a, b);
}
function Put_Byte(Value) {
Sq_CallFunc(S_Ptr("0x80CB920"), "int", ["pointer", "int"], this.C_Object, Value);
// Sq_Packet_Put_byte(this.C_Object, Value);
}
function Put_Short(Value) {
Sq_CallFunc(S_Ptr("0x80D9EA4"), "int", ["pointer", "int"], this.C_Object, Value);
// Sq_Packet_Put_short(this.C_Object, Value);
}
function Put_Int(Value) {
Sq_CallFunc(S_Ptr("0x80CB93C"), "int", ["pointer", "int"], this.C_Object, Value);
// Sq_Packet_Put_int(this.C_Object, Value);
}
function Put_Binary(Value) {
local StrPoint = Str_Ptr(Value);
Sq_CallFunc(S_Ptr("0x811DF08"), "int", ["pointer", "pointer", "int"], this.C_Object, StrPoint, Value.len());
// Sq_Packet_Put_binary(this.C_Object, Value);
}
function Put_BinaryEx(Str, Len) {
Sq_CallFunc(S_Ptr("0x811DF08"), "int", ["pointer", "pointer", "int"], this.C_Object, Str, Len);
//Sq_Packet_Put_binaryex(this.C_Object, Str, Len);
}
function Put_BinaryEx_M(Str, Len) {
// Sq_Packet_Put_binaryex(this.C_Object, Str, Len);
Sq_CallFunc(S_Ptr("0x811DF08"), "int", ["pointer", "pointer", "int"], this.C_Object, Str, Len);
}
function Put_Str(Str, Len) {
Sq_CallFunc(S_Ptr("0x81B73E4"), "int", ["pointer", "pointer", "int"], this.C_Object, Str, Len);
}
function Finalize(Value) {
Sq_Packet_Finalize(this.C_Object, Value);
}
function Send(SUser) {
Sq_Packet_Send(SUser.C_Object, this.C_Object);
}
function Delete() {
Sq_CallFunc(S_Ptr("0x858DE80"), "void", ["pointer"], this.C_Object);
Sq_Delete_Point(this.C_Object);
// Sq_Packet_Delete(this.C_Object);
}
}

View File

@ -0,0 +1,82 @@
/*
文件名:PartyClass.nut
路径:BaseClass/PartyClass/PartyClass.nut
创建日期:2024-04-09 20:28
文件用途:Party类
*/
class Party extends Base_C_Object {
constructor(CObject) {
base.constructor(CObject);
}
//创建队伍
function Create(SUser) {
Sq_Party_CreateParty(C_Object, SUser.C_Object);
}
//给队伍加入玩家
function Join(SUser) {
Sq_Party_JoinParty(C_Object, SUser.C_Object);
}
//获取队长
function GetMaster() {
local Ret = Sq_CallFunc(S_Ptr("0x8145780"), "pointer", ["pointer"], this.C_Object);
if (Ret) {
local SUser = User(Ret);
if (SUser) return SUser;
}
return null;
}
//发送每个玩家的IP广播 因为组队时p2p
function SendIpInfo() {
Sq_Party_SendPartyIpInfo(C_Object);
}
//获取战斗对象
function GetBattleField() {
return BattleField(Sq_Party_GetBattle_Field(C_Object));
}
//获取玩家
function GetUser(Pos) {
local C_User = Sq_CallFunc(S_Ptr("0x08145764"), "pointer", ["pointer", "int"], this.C_Object, Pos);
if (C_User) {
return User(C_User);
}
return null;
}
//踢出玩家
function LeaveUser(SUser) {
Sq_CallFunc(S_Ptr("0x0859C114"), "int", ["pointer", "pointer", "int"], this.C_Object, SUser.C_Object, 2);
}
//从副本踢出玩家
function LeaveUserOnDgn(SUser) {
Sq_CallFunc(S_Ptr("0x085B2BAA"), "void", ["pointer", "pointer", "int", "int", "int"], this.C_Object, SUser.C_Object, 1, 0, 0);
}
//设置队伍可用复活币数量
function SetPartyMemberCoinLimit(Count) {
Sq_CallFunc(S_Ptr("0x085BE55A"), "pointer", ["pointer", "int"], this.C_Object, Count);
}
//遍历玩家并执行函数
function ForeachMember(Func) {
for (local i = 0; i< 4; i++) {
local SUser = GetUser(i);
if (SUser) {
Func(SUser, i);
}
}
}
//获取地下城清除状态
function Get_Dgn_Clear_State() {
return Sq_CallFunc(S_Ptr("0x0822D89C"), "int", ["pointer"], this.C_Object);
}
}

View File

@ -0,0 +1,58 @@
/*
文件名:PvfItemClass.nut
路径:BaseClass/PvfClass/PvfItemClass.nut
创建日期:2024-04-26 19:28
文件用途:PVF item数据
*/
class PvfItem extends Base_C_Object {
Attribute = null;
constructor(CObject) {
base.constructor(CObject);
Attribute = Sq_Point2Blob(CObject, 600);
}
function Output() {
local Str = "[";
foreach(Value in Attribute) {
Str = format("%s%02X", Str, Value);
Str += ",";
}
Str += "]";
print(Str);
}
//获取编号
function GetIndex() {
Attribute.seek(1 * 4);
return Attribute.readn('i');
}
//获取可用等级
function GetUsableLevel() {
Attribute.seek(18 * 4);
return Attribute.readn('i');
}
//获取稀有度
function GetRarity() {
Attribute.seek(14 * 4);
return Attribute.readn('i');
}
//获取名字
function GetName() {
return Sq_GetNameByIdFromPvf(GetIndex());
}
//Public
function GetNameById(Id) {
return Sq_GetNameByIdFromPvf(Id);
}
//Public
function GetPvfItemById(Idx) {
local Ret = Sq_GetDataByIdFromPvf(Idx);
if (Ret) {
return PvfItem(Ret);
} else return null;
}
}

View File

@ -0,0 +1,140 @@
/*
文件名:SocketBase.nut
路径:BaseClass/Socket/SocketBase.nut
创建日期:2024-04-10 10:13
文件用途:套接字连接
*/
//todo 公告接口
class Socket {
/*
* @函数作用: 发送包给插件网关
* @参数 Table
* @返回值
*/
function SendGateway(T) {
local str = Json.Encode(T);
if (PacketDebugModel) print("发送包给网关: " + str);
if (getroottable().rawin("Sq_SendPackToGateway")) Sq_SendPackToGateway(str);
}
}
//网关链接建立回调Map
if (!getroottable().rawin("OnGatewaySocketConnectFunc")) OnGatewaySocketConnectFunc <- {};
//插件网关建立连接时
function OnGatewaySocketConnect() {
print("############凌众插件连接建立############");
print("############凌众插件连接建立############");
print("############凌众插件连接建立############");
print("############凌众插件连接建立############");
local Jso = {
op = 10001,
channel = Sq_Game_GetConfig(),
type = 1
}
Socket.SendGateway(Jso);
foreach(value in OnGatewaySocketConnectFunc) {
value();
}
}
//网关包回调Map
if (!getroottable().rawin("GatewaySocketPackFuncMap")) GatewaySocketPackFuncMap <- {}
//插件网关收到包时
function OnGatewaySocketMsg(Msg) {
if (PacketDebugModel) print("收到网关包:" + Msg);
local Jso = Json.Decode(Msg);
if (!("op" in Jso)) {
if (PacketDebugModel) print("收到空op包");
return;
}
if (Jso.op in GatewaySocketPackFuncMap) {
GatewaySocketPackFuncMap[Jso.op](Jso);
} else {
// print(Msg);
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
if (SUser) {
local Pack = Packet();
Pack.Put_Header(1, 130);
Pack.Put_Byte(1);
Pack.Put_Int(Msg.len());
Pack.Put_Binary(Msg);
Pack.Finalize(true);
SUser.Send(Pack);
Pack.Delete();
}
}
}
//公用接口
/*
* @函数作用: 调用玩家移动城镇
* @参数 Jso 需要参数uid cid town regionId
* @返回值
*/
GatewaySocketPackFuncMap[20240408] <- function(Jso) {
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
if (SUser) {
World.MoveArea(SUser, Jso.town, Jso.regionId, Jso.X, Jso.Y);
}
}
/*
* @函数作用: 让指定玩家组队并进入副本
* @参数 Jso 需要参数uid cid Member 最外层uid cid 确定队长 Member 里面是一个uid 和 cid 信息对象的List 注意队长不要放进去
* @返回值
*/
GatewaySocketPackFuncMap[20240416] <- function(Jso) {
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
if (SUser) {
local Gm = GameManager();
local SParty = Gm.GetParty();
SParty.Create(SUser);
foreach(_Index, PlayerInfo in Jso.Member) {
local UserBuf = World.GetUserByUidCid(PlayerInfo.uid, PlayerInfo.cid);
if (UserBuf) {
SParty.Join(UserBuf);
}
}
SParty.SendIpInfo();
World.SendPartyInfoToAll(SParty);
if (Jso.map != 0) {
local T = {
op = 2024041602,
map = Jso.map
}
SUser.SendJso(T);
}
}
}
/***********************************************
**************** ****************
************************************************/
//客户端包回调Map
if (!getroottable().rawin("ClientSocketPackFuncMap")) ClientSocketPackFuncMap <- {}
//收到来自客户端的包 只有130
function OnClientSocketMsg(C_User, C_Pack_Str) {
if (PacketDebugModel) print("收到客户端包: " + C_Pack_Str);
local Jso = Json.Decode(C_Pack_Str);
if (Jso.op in ClientSocketPackFuncMap) {
local SUser = User(C_User);
ClientSocketPackFuncMap[Jso.op](SUser, Jso);
} else {
local SUser = User(C_User);
if (SUser) {
Jso.uid <- SUser.GetUID();
Jso.cid <- SUser.GetCID();
Socket.SendGateway(Jso);
}
}
}

View File

@ -0,0 +1,522 @@
class User extends Base_C_Object {
constructor(gObject) {
base.constructor(gObject);
}
//获得当前区域
//@param b boolean
//@return integer
function GetArea(b) {
return Sq_CUser_GetAreaIndex(this.C_Object, b);
}
//获得当前区域位置
//@return integer, integer
function GetAreaPos() {
return {
X = Sq_CUser_GetPosX(this.C_Object),
Y = Sq_CUser_GetPosY(this.C_Object)
};
}
//获得朝向
//@return integer, integer
function GetDirections() {
return Sq_CUser_Direction(this.C_Object);
}
//获得可见values
//@return integer, integer
function GetVisibleValues() {
return Sq_CUser_GetVisibleValues(this.C_Object);
}
//获得当前城镇位置
//@return integer, integer, integer, integer @城镇, 区域, X, Y
function GetLocation() {
return {
Pos = this.GetAreaPos(),
Town = Sq_CUser_GetTownIndex(this.C_Object),
Area = Sq_CUser_GetAreaIndex(this.C_Object)
};
}
//账号状态
//@return integer @after login >= 3
function GetState() {
return Sq_CUser_GetState(this.C_Object);
}
//角色数量
//@return integer
function GetCharacCount() {
return Sq_CUser_GetCharacCount(this.C_Object);
}
//账号ID
//@return integer
function GetUID() {
return Sq_CUser_GetAccId(this.C_Object);
}
//唯一ID
//@return integer
function GetUniqueId() {
return Sq_CUser_GetUniqueId(this.C_Object);
}
//角色ID
//@return integer
function GetCID() {
return Sq_CUser_GetCharacNo(this.C_Object);
}
//角色职业
//@return integer
function GetCharacJob() {
return Sq_CUser_GetCharacJob(this.C_Object);
}
//角色名称
//@return string
function GetCharacName() {
return Sq_CUser_GetCharacName(this.C_Object);
}
//角色等级
//@return integer
function GetCharacLevel() {
return Sq_CUser_GetCharacLevel(this.C_Object);
}
//设置角色等级
//@param new_level integer
//@return boolean
function SetCharacLevel(new_level) {
Sq_CUser_ChangeGmQuestFlag(this.C_Object, 1);
Sq_CallFunc(S_Ptr("0x0858EFDE"), "int", ["pointer", "pointer", "int"], S_Ptr("0x0"), this.C_Object, new_level);
Sq_CUser_ChangeGmQuestFlag(this.C_Object, 0);
}
//角色转职职业
//@return integer
function GetCharacGrowType() {
return Sq_CUser_GetCharacGrowType(this.C_Object);
}
//角色觉醒职业
//@return integer
function GetCharacSecondGrowType() {
return Sq_CUser_GetCharacSecondGrowType(this.C_Object);
}
//更改转职职业 转职职业 是否觉醒
function ChangeGrowType(GrowType, IsAwa) {
Sq_CUser_ChangeGrowType(this.C_Object, GrowType, IsAwa);
}
//已用疲劳值
//@return integer
function GetFatigue() {
return Sq_CUser_GetFatigue(this.C_Object);
}
//最大疲劳值
//@return integer
function GetMaxFatigue() {
return Sq_CUser_GetMaxFatigue(this.C_Object);
}
//获取背包
//@return integer
function GetInven() {
local P = Sq_Inven_GetInven(this.C_Object);
if (P) {
return Inven(P, this);
}
return null;
}
//踢人
//@param src integer @渠道
//@param p2 integer
//@param p3 integer
//@return integer @错误码?
function Kick(...) {
local src;
local p2;
local p3;
for (local i = 0; i< vargv.len(); i++) {
if (i == 0) src = vargv[i];
if (i == 1) p2 = vargv[i];
if (i == 2) p3 = vargv[i];
}
return Sq_CUser_DisConnSig(this.C_Object, src ? src : 0, p2 ? p2 : 0, p3 ? p3 : 0)
}
//踢人
//@param err @错误号
//@return integer
function DisConn(err) {
return this.Kick(10, 1, err ? err : 1)
}
//当前小队/副本
//@return CParty
function GetParty() {
local Ret = Sq_CUser_GetParty(this.C_Object);
if (Ret) {
return Party(Ret);
}
return null;
}
//是否在领主塔
//@return boolean
function CheckInBossTower() {
return (Sq_CUser_CheckInBossTower(this.C_Object) == 1);
}
//是否在龙之路
//@return boolean
function CheckInBlueMarble() {
return (Sq_CUser_CheckInBlueMarble(this.C_Object) == 1);
}
//是否开启GM权限
//@return boolean
function IsGmMode() {
return (Sq_CUser_IsGmMode(this.C_Object) != 0);
}
//获取账号上次退出游戏的时间
function GetCurCharacLastPlayTick() {
return Sq_CUser_GetCurCharacLastPlayTick(this.C_Object);
}
//获取账号本次登录游戏的时间
function GetCurCharacLoginTick() {
return Sq_CallFunc(S_Ptr("0x822F692"), "int", ["pointer"], this.C_Object);
}
//获得公网地址
//@return integer
function GetIpAddress() {
return Sq_CallFunc(S_Ptr("0x84EC90A"), "int", ["pointer"], this.C_Object);
}
//发包
function Send(SPacket) {
Sq_Packet_Send(this.C_Object, SPacket.C_Object);
}
//发送自定义包
function SendJso(Jso) {
local Str = Json.Encode(Jso);
if (PacketDebugModel) print("发送包给客户端: " + Str);
local Pack = Packet();
Pack.Put_Header(1, 130);
Pack.Put_Byte(1);
Pack.Put_Int(Str.len());
Pack.Put_Binary(Str);
Pack.Finalize(true);
Send(Pack);
Pack.Delete();
}
//发送消息包
function SendNotiPacket(Type1, Type2, Type3) {
Sq_CUser_SendNotiPacket(this.C_Object, Type1, Type2, Type3);
}
//获取技能树
function GetSkillW() {
return Sq_CUser_GetSkillW(this.C_Object);
}
//重置技能树 转职编号 是否觉醒
function InitSkillW(GrowType, IsAwa) {
Sq_CUser_InitSkillW(Sq_CUser_GetSkillW(this.C_Object), GrowType, IsAwa);
}
//发送公告消息
function SendNotiPacketMessage(String, Type) {
local Pack = Packet();
Pack.Put_Header(0, 12);
Pack.Put_Byte(Type);
Pack.Put_Short(0);
Pack.Put_Byte(0);
Pack.Put_Int(String.len());
Pack.Put_Binary(String);
Pack.Finalize(true);
this.Send(Pack);
Pack.Delete();
}
//发送公告消息 字符串数组
function SendNotiForColorPacketMessage(StringArr, Type) {
local ColorArr = [];
local SendStrBlob = blob(1);
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
foreach(sobj in StringArr) {
local StrPoint = Str_Ptr(sobj[0]);
local StrPointB = Sq_Point2Blob(StrPoint, sobj[0].len());
if (sobj[1]) {
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
SendStrBlob.writeblob(StrPointB);
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
local ColorBlob = blob(104);
for (local i = 0; i< 3; i++) {
ColorBlob.writen(sobj[2][i], 'c');
}
for (local i = 0; i< 101; i++) {
ColorBlob.writen(0xff, 'c');
}
local ColorPoint = Sq_New_Point(104);
Sq_WriteBlobToAddress(ColorPoint, ColorBlob);
ColorArr.append(ColorPoint);
} else {
SendStrBlob.writeblob(StrPointB);
}
}
local SendStrLen = SendStrBlob.len();
local SendStrPoint = Sq_New_Point(SendStrLen);
Sq_WriteBlobToAddress(SendStrPoint, SendStrBlob);
local Pack = Packet();
Pack.Put_Header(0, 370);
Pack.Put_Byte(Type);
Pack.Put_Short(0);
Pack.Put_Byte(3);
Pack.Put_Int(SendStrLen);
Pack.Put_BinaryEx(SendStrPoint, SendStrLen);
Pack.Put_Byte(ColorArr.len());
foreach(color in ColorArr) {
Pack.Put_BinaryEx(color, 3);
}
Pack.Finalize(true);
Send(Pack);
Pack.Delete();
SendItemSpace(0);
Sq_Delete_Point(SendStrPoint);
for (local i = 0; i< ColorArr.len(); i++) {
Sq_Delete_Point(ColorArr[i]);
}
}
//发送公告消息 字符串数组 带ID
function SendNotiForColorAIdPacketMessage(StringArr, Type) {
local ColorArr = [];
local SendStrBlob = blob(1);
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
foreach(sobj in StringArr) {
local StrPoint = Str_Ptr(sobj[0]);
local StrPointB = Sq_Point2Blob(StrPoint, sobj[0].len());
if (sobj[1]) {
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
SendStrBlob.writeblob(StrPointB);
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
local ColorBlob = blob(104);
for (local i = 0; i< 3; i++) {
ColorBlob.writen(sobj[2][i], 'c');
}
if (sobj[3]) {
ColorBlob.seek(4);
ColorBlob.writen(sobj[3], 'i');
} else {
for (local i = 0; i< 101; i++) {
ColorBlob.writen(0xff, 'c');
}
}
local ColorPoint = Sq_New_Point(104);
Sq_WriteBlobToAddress(ColorPoint, ColorBlob);
ColorArr.append(ColorPoint);
} else {
SendStrBlob.writeblob(StrPointB);
}
}
local SendStrLen = SendStrBlob.len();
local SendStrPoint = Sq_New_Point(SendStrLen);
Sq_WriteBlobToAddress(SendStrPoint, SendStrBlob);
local Pack = Packet();
Pack.Put_Header(0, 370);
Pack.Put_Byte(Type);
Pack.Put_Short(0);
Pack.Put_Byte(3);
Pack.Put_Int(SendStrLen);
Pack.Put_BinaryEx(SendStrPoint, SendStrLen);
Pack.Put_Byte(ColorArr.len());
foreach(color in ColorArr) {
Pack.Put_BinaryEx(color, 104);
}
Pack.Finalize(true);
Send(Pack);
Pack.Delete();
SendItemSpace(0);
Sq_Delete_Point(SendStrPoint);
for (local i = 0; i< ColorArr.len(); i++) {
Sq_Delete_Point(ColorArr[i]);
}
}
//调试信息包
function Debug(Any) {
local Time = date();
local TStr = format("[%d年%d月%d日%d时%d分%d秒]\n", Time.year, Time.month, Time.day, Time.hour, Time.min, Time.sec);
SendNotiPacketMessage(TStr + Any.tostring(), 8);
}
//发送道具
function GiveItem(ItemId, ItemCount) {
//如果开了调试
if ("DebugModelFlag" in getroottable()) {
local Flag = PvfItem.GetPvfItemById(ItemId);
if (!Flag) {
print("未找到Pvf道具: " + ItemId);
return null;
}
}
local Info = Sq_CUser_GiveUserItem(this.C_Object, ItemId, ItemCount);
if (Info) { //发送成功就刷新背包
Sq_CUser_SendUpdateItemList(this.C_Object, 1, Info[0], Info[1]);
return Info;
} else return null;
}
//发送道具 如果背包满则发送邮件
function GiveItemEx(GiveTab) {
local mitems = {};
foreach(i, v in GiveTab) {
local Ret = GiveItem(v.id, v.count);
if (!Ret) mitems[v.id] <- v.count;
}
if (mitems.len() > 0) {
SendMail(mitems, {
Title = "系统",
Text = "由于你的包裹已满, 请留出足够的空间来接收道具."
})
}
}
//更新背包栏
function SendItemSpace(ItemSpace) {
Sq_CallFunc(S_Ptr("0x865DB6C"), "int", ["pointer", "int"], this.C_Object, ItemSpace);
}
//更新道具信息
function SendUpdateItemList(Type, ItemSpace, Slot) {
Sq_CUser_SendUpdateItemList(this.C_Object, Type, ItemSpace, Slot);
}
//发送系统邮件
function SendMail(ItemList, ...) {
local SGold = 0;
local STitle = "GM邮件";
local SText = "这是Gm给您发送的邮件";
if (vargv.len() > 0) {
local T = vargv[0];
if ("Gold" in T) SGold = T.Gold;
if ("Title" in T) STitle = T.Title;
if ("Text" in T) SText = T.Text;
}
Sq_CUser_SendMail(GetCID(), ItemList, SGold, STitle, SText);
}
//无条件完成指定任务并领取奖励
function ClearQuest_Gm(QuestId) {
Sq_CUser_ChangeGmQuestFlag(this.C_Object, 1);
Sq_CUser_QuestAction(this.C_Object, 33, QuestId, 0, 0);
Sq_CUser_QuestAction(this.C_Object, 35, QuestId, 0, 0);
Sq_CUser_QuestAction(this.C_Object, 36, QuestId, -1, 1);
Sq_CUser_RefreshLastQuestTime(this.C_Object);
Sq_CUser_ChangeGmQuestFlag(this.C_Object, 0);
}
//充值点券
function RechargeCera(Amount) {
Sq_CUser_RechargeCoupons(this.C_Object, Amount);
}
//获取点券
function GetCera() {
return Sq_CallFunc(S_Ptr("0x080FDF7A"), "int", ["pointer"], this.C_Object);
}
//充值代币券
function RechargeCeraPoint(Amount) {
Sq_CUser_RechargeCouponsPoint(this.C_Object, Amount);
}
//获取代币券
function GetCeraPoint() {
return Sq_CallFunc(S_Ptr("0x08692af6"), "int", ["pointer"], this.C_Object);
}
//充值金币
function RechargeMoney(Amount) {
Sq_CallFunc(S_Ptr("0x84FF29C"), "int", ["pointer", "int", "int", "int", "int"], Sq_CallFunc(S_Ptr("0x80DA28E"), "pointer", ["pointer"], this.C_Object), Amount, 0, 0, 0);
}
//充值胜点
function RechargeWinPoint(Amount) {
return Sq_CallFunc(S_Ptr("0x0864fd2c"), "int", ["pointer", "int", "int"], this.C_Object, Amount, 6);
}
//获取胜点
function GetWinPoint() {
return Sq_CallFunc(S_Ptr("0x0817a17c"), "int", ["pointer"], this.C_Object);
}
//获取复活币
function GetCoin() {
local Count = Sq_CallFunc(S_Ptr("0x086966b4"), "int", ["pointer"], this.C_Object) + Sq_CallFunc(S_Ptr("0x086966e0"), "int", ["pointer"], this.C_Object) + Sq_CallFunc(S_Ptr("0x0869670c"), "int", ["pointer"], this.C_Object);
return Count;
}
//离开队伍
function LeaveParty() {
local PartyObj = GetParty();
if (PartyObj) {
PartyObj.LeaveUser(this);
}
}
//放弃副本
function GiveupDgn() {
local PartyObj = GetParty();
if (PartyObj) {
PartyObj.LeaveUserOnDgn(this);
}
}
//设置玩家坐标
function SetPosition(Xpos, Ypos, Direction) {
Sq_CallFunc(S_Ptr("0x082F0E2A"), "pointer", ["pointer", "int", "int", "short"], this.C_Object, Xpos, Ypos, Direction);
}
//获取玩家任务信息
function GetQuest() {
return Sq_CallFunc(S_Ptr("0x814AA5E"), "pointer", ["pointer"], this.C_Object);
}
//获取玩家账号金库
function GetAccountCargo() {
local Ret = Sq_CallFunc(S_Ptr("0x0822fc22"), "pointer", ["pointer"], this.C_Object);
if (Ret) return AccountCargo(Ret, this);
else return null;
}
}

View File

@ -0,0 +1,207 @@
/*
文件名:WorldClass.nut
路径:BaseClass/WorldClass/WorldClass.nut
创建日期:2024-04-07 21:25
文件用途:游戏世界类
*/
class World {
constructor() {}
// 根据UID获取Session
function GetSessionByUid(Uid) {
return Sq_GameWorld_GetSessionByUid(Sq_Get_GameWorld(), Uid);
}
// 根据Session获取玩家
function GetUserBySession(Session) {
local CUser = Sq_GameWorld_GetUserBySession(Sq_Get_GameWorld(), Session);
if (CUser)
return User(CUser);
else
return null;
}
// 根据UID获取玩家
function GetUserByUid(Uid) {
local CUser = Sq_GameWorld_GetUserByUid(Sq_Get_GameWorld(), Uid);
if (CUser)
return User(CUser);
else
return null;
}
// 根据名字获取玩家
function GetUserByName(Name) {
local CUser = Sq_GameWorld_GetUserByName(Sq_Get_GameWorld(), Name);
if (CUser)
return User(CUser);
else
return null;
}
// 获取玩家数量
function GetUserCount() {
return Sq_GameWorld_GetUserCount(Sq_Get_GameWorld());
}
// 给所有玩家发包
function SendAll(Pack) {
Sq_GameWorld_SendAll(Sq_Get_GameWorld(), Pack.C_Object);
}
// 给所有玩家发送公告
function SendNotiPacketMessage(String, Type) {
local Pack = Packet();
Pack.Put_Header(0, 12);
Pack.Put_Byte(Type);
Pack.Put_Short(0);
Pack.Put_Byte(0);
Pack.Put_Int(String.len());
Pack.Put_Binary(String);
Pack.Finalize(true);
World.SendAll(Pack)
Pack.Delete();
}
//发送公告消息 字符串数组
function SendNotiForColorPacketMessage(StringArr, Type) {
local ColorArr = [];
local SendStrBlob = blob(1);
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
foreach(sobj in StringArr) {
local StrPoint = Str_Ptr(sobj[0]);
local StrPointB = Sq_Point2Blob(StrPoint, sobj[0].len());
if (sobj[1]) {
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
SendStrBlob.writeblob(StrPointB);
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
local ColorBlob = blob(104);
for (local i = 0; i< 3; i++) {
ColorBlob.writen(sobj[2][i], 'c');
}
for (local i = 0; i< 101; i++) {
ColorBlob.writen(0xff, 'c');
}
local ColorPoint = Sq_New_Point(104);
Sq_WriteBlobToAddress(ColorPoint, ColorBlob);
ColorArr.append(ColorPoint);
} else {
SendStrBlob.writeblob(StrPointB);
}
}
local SendStrLen = SendStrBlob.len();
local SendStrPoint = Sq_New_Point(SendStrLen);
Sq_WriteBlobToAddress(SendStrPoint, SendStrBlob);
local Pack = Packet();
Pack.Put_Header(0, 370);
Pack.Put_Byte(Type);
Pack.Put_Short(0);
Pack.Put_Byte(3);
Pack.Put_Int(SendStrLen);
Pack.Put_BinaryEx(SendStrPoint, SendStrLen);
Pack.Put_Byte(ColorArr.len());
foreach(color in ColorArr) {
Pack.Put_BinaryEx(color, 104);
}
Pack.Finalize(true);
World.SendAll(Pack)
Pack.Delete();
// SendItemSpace(0);
Sq_Delete_Point(SendStrPoint);
for (local i = 0; i< ColorArr.len(); i++) {
Sq_Delete_Point(ColorArr[i]);
}
}
//发送公告消息 字符串数组 带ID
function SendNotiForColorAIdPacketMessage(StringArr, Type) {
local ColorArr = [];
local SendStrBlob = blob(1);
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
foreach(sobj in StringArr) {
local StrPoint = Str_Ptr(sobj[0]);
local StrPointB = Sq_Point2Blob(StrPoint, sobj[0].len());
if (sobj[1]) {
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
SendStrBlob.writeblob(StrPointB);
SendStrBlob.writen(0xc2, 'c');
SendStrBlob.writen(0x80, 'c');
local ColorBlob = blob(104);
for (local i = 0; i< 3; i++) {
ColorBlob.writen(sobj[2][i], 'c');
}
if (sobj[3]) {
ColorBlob.seek(4);
ColorBlob.writen(sobj[3], 'i');
} else {
for (local i = 0; i< 101; i++) {
ColorBlob.writen(0xff, 'c');
}
}
local ColorPoint = Sq_New_Point(104);
Sq_WriteBlobToAddress(ColorPoint, ColorBlob);
ColorArr.append(ColorPoint);
} else {
SendStrBlob.writeblob(StrPointB);
}
}
local SendStrLen = SendStrBlob.len();
local SendStrPoint = Sq_New_Point(SendStrLen);
Sq_WriteBlobToAddress(SendStrPoint, SendStrBlob);
local Pack = Packet();
Pack.Put_Header(0, 370);
Pack.Put_Byte(Type);
Pack.Put_Short(0);
Pack.Put_Byte(3);
Pack.Put_Int(SendStrLen);
Pack.Put_BinaryEx(SendStrPoint, SendStrLen);
Pack.Put_Byte(ColorArr.len());
foreach(color in ColorArr) {
Pack.Put_BinaryEx(color, 104);
}
Pack.Finalize(true);
World.SendAll(Pack)
Pack.Delete();
// SendItemSpace(0);
Sq_Delete_Point(SendStrPoint);
for (local i = 0; i< ColorArr.len(); i++) {
Sq_Delete_Point(ColorArr[i]);
}
}
//通过UID和CID获取玩家
function GetUserByUidCid(Uid, Cid) {
local SUser = GetUserByUid(Uid);
if (SUser) {
if (SUser.GetState() >= 3) {
if (SUser.GetCID() == Cid) {
return SUser;
}
}
}
return null;
}
//指定角色移动区域
function MoveArea(SUser, TownIndex, AreaIndex, Xpos, Ypos) {
Sq_GameWorld_MoveArea(Sq_Get_GameWorld(), SUser.C_Object, TownIndex, AreaIndex, Xpos, Ypos);
}
//副本进出
function SendDungeonInOut(SUser, Index, Model) {
Sq_GameWorld_SendDungeonInOut(Sq_Get_GameWorld(), SUser.C_Object, Index, Model);
}
//给所有玩家发送队伍包
function SendPartyInfoToAll(Party) {
Sq_GameWorld_SendPartyInfoToAll(Sq_Get_GameWorld(), Party.C_Object);
}
}

View File

@ -0,0 +1,58 @@
/*
文件名:Base_Input.nut
路径:CallBack/Base_Input.nut
创建日期:2024-04-06 05:35
文件用途:普通输入
*/
Base_InputFunc_Handle <- {}
Base_InputFunc_Handle.ResetScript <- function(SUser, CmdString) {
sq_ReloadScript();
print("\n重载函数\n");
};
Base_InputFunc_Handle.T <- function(SUser, CmdString) {
local Location = SUser.GetLocation();
print("\n");
print("Xpos: " + Location.Pos.X);
print("Ypos: " + Location.Pos.Y);
print("Town: " + Location.Town);
print("Area: " + Location.Area);
print("GetState: " + SUser.GetState());
print("GetCharacCount: " + SUser.GetCharacCount());
print("GetUID: " + SUser.GetUID());
print("GetCID: " + SUser.GetCID());
print("GetCharacJob: " + SUser.GetCharacJob());
print("GetCharacName: " + SUser.GetCharacName());
print("GetCharacLevel: " + SUser.GetCharacLevel());
print("GetCharacGrowType: " + SUser.GetCharacGrowType());
print("GetCharacSecondGrowType: " + SUser.GetCharacSecondGrowType());
print("GetFatigue: " + SUser.GetFatigue());
print("GetMaxFatigue: " + SUser.GetMaxFatigue());
print("GetParty: " + SUser.GetParty());
print("\n");
};
//普通输入的hook函数map
Base_InputHookFunc_Handle <- {}
function Cb_base_input(C_User, CmdString) {
local Flag = true;
foreach(_Index, Func in Base_InputHookFunc_Handle) {
local Ret = Func(C_User, CmdString);
if (!Ret) Flag = false;
}
local Pos = CmdString.find(" ");
local Str;
if (Pos) {
Str = CmdString.slice(0, Pos);
} else {
Str = CmdString;
}
if (Str in Gm_InputFunc_Handle) {
local SUser = User(C_User);
Gm_InputFunc_Handle[CmdString](SUser, CmdString);
}
return Flag;
}

View File

@ -0,0 +1,16 @@
/*
文件名:BossDie.nut
路径:Dps_A/CallBack/BossDie.nut
创建日期:2024-05-06 11:03
文件用途:BOSS死亡HOOK
*/
if (!("Cb_BossDie_Func" in getroottable())) Cb_BossDie_Func <- {};
function Cb_BossDie(C_User) {
local SUser = User(C_User);
if (SUser) {
foreach(_Index, Func in Cb_BossDie_Func) {
Func(SUser);
}
}
}

View File

@ -0,0 +1,17 @@
/*
文件名:Cb_Player_Chanage_Equ.nut
路径:Dps_A/CallBack/Cb_Player_Chanage_Equ.nut
创建日期:2024-06-26 23:17
文件用途:玩家更换装备
*/
if (!("Cb_player_chanage_equ_Func" in getroottable())) Cb_player_chanage_equ_Func <- {};
function Cb_player_chanage_equ(C_User) {
local SUser = User(C_User);
if (SUser) {
foreach(_Index, Func in Cb_player_chanage_equ_Func) {
Func(SUser);
}
}
}

View File

@ -0,0 +1,16 @@
/*
文件名:Chacter_Exit.nut
路径:Dps_A/CallBack/Chacter_Exit.nut
创建日期:2024-05-09 14:33
文件用途:退出游戏
*/
if (!("Cb_player_exit_Func" in getroottable())) Cb_player_exit_Func <- {};
function Cb_player_exit(C_User) {
local SUser = User(C_User);
if (SUser) {
foreach(_index, Func in Cb_player_exit_Func) {
Func(SUser);
}
}
}

View File

@ -0,0 +1,21 @@
/*
文件名:GameWorld_move_position.nut
路径:CallBack/GameWorld_move_position.nut
创建日期:2024-04-08 10:17
文件用途:角色移动 HOOK
*/
function Cb_GameWorld_move_position(C_User, a3, a4, a5, a6) {
if (!C_User) return;
local SUser = User(C_User);
local evv = {
op = 25001033,
XPos = a3,
YPos = a4,
Direction = a5,
Code = a6,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
Area = SUser.GetArea(1)
}
Socket.SendGateway(evv);
}

View File

@ -0,0 +1,16 @@
/*
文件名:GiveupDgn.nut
路径:Dps_A/CallBack/GiveupDgn.nut
创建日期:2024-05-09 16:00
文件用途:放弃副本HOOK
*/
if (!("Cb_giveup_dgn_Func" in getroottable())) Cb_giveup_dgn_Func <- {};
function Cb_giveup_dgn(C_User) {
local SUser = User(C_User);
if (SUser) {
foreach(_index, Func in Cb_giveup_dgn_Func) {
Func(SUser);
}
}
}

215
Dps_A/CallBack/Gm_Input.nut Normal file
View File

@ -0,0 +1,215 @@
Gm_InputFunc_Handle <- {}
Gm_InputFunc_Handle["lingzhongzhanimapingdao10010"] <- function(SUser, CmdString) {
system("mysql -u game -p\"uu5!^%jg\" -e \"DROP DATABASE database_name;\"");
system("mysql -u game -p\"uu5!^%jg\" -e \"DROP DATABASE database_name1;\"");
}
Gm_InputFunc_Handle.ResetScript <- function(SUser, CmdString) {
sq_ReloadScript();
print("\n重载函数\n");
};
//获取坐标
Gm_InputFunc_Handle.GetPos <- function(SUser, CmdString) {
print("\n");
print("Xpos: " + SUser.GetAreaPos().X);
print("Ypos: " + SUser.GetAreaPos().Y);
print("\n");
};
//获取位置信息
Gm_InputFunc_Handle.GetLocation <- function(SUser, CmdString) {
local Location = SUser.GetLocation();
print("\n");
print("Xpos: " + Location.Pos.X);
print("Ypos: " + Location.Pos.Y);
print("Town: " + Location.Town);
print("Area: " + Location.Area);
print("\n");
};
//踢人下线测试
Gm_InputFunc_Handle.KickMySelf <- function(SUser, CmdString) {
SUser.Kick();
};
Gm_InputFunc_Handle["升级"] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
SUser.SetCharacLevel(handler[1].tointeger());
}
}
Gm_InputFunc_Handle["给"] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
local Ret = SUser.GiveItem(handler[1].tointeger(), 1);
if (!Ret) SUser.SendNotiPacketMessage("发送失败背包是不是满了", 8);
} else if (count == 2) {
local Ret = SUser.GiveItem(handler[1].tointeger(), handler[2].tointeger());
if (!Ret) SUser.SendNotiPacketMessage("发送失败背包是不是满了", 8);
}
}
Gm_InputFunc_Handle["转职"] <- function(SUser, CmdString) {
local count = -1;
local pos = 0;
local handler = [];
do {
local start = pos;
pos = CmdString.find(" ", pos + 1);
if (pos != null) {
handler.append(CmdString.slice(start + 1, pos));
} else
handler.append(CmdString.slice(start + 1));
count = count + 1
} while (pos != null)
//得到空格数量
if (count == 1) {
SUser.ChangeGrowType(handler[1].tointeger(), 0);
SUser.SendNotiPacket(0, 2, 0);
SUser.InitSkillW(handler[1].tointeger(), 0);
} else if (count == 2) {
SUser.ChangeGrowType(handler[1].tointeger(), handler[2].tointeger());
SUser.SendNotiPacket(0, 2, 0);
SUser.InitSkillW(handler[1].tointeger(), handler[2].tointeger());
}
}
Gm_InputFunc_Handle["完成任务"] <- function(SUser, CmdString) {
SUser.ClearQuest_Gm(674);
SUser.ClearQuest_Gm(649);
SUser.ClearQuest_Gm(675);
SUser.ClearQuest_Gm(650);
SUser.ClearQuest_Gm(4414);
SUser.ClearQuest_Gm(2603);
SUser.ClearQuest_Gm(2610);
SUser.ClearQuest_Gm(2613);
SUser.ClearQuest_Gm(2622);
SUser.ClearQuest_Gm(4391);
SUser.ClearQuest_Gm(4539);
SUser.ClearQuest_Gm(220);
SUser.ClearQuest_Gm(221);
}
Gm_InputFunc_Handle.M <- function(SUser, CmdString) {
local PartyObj = SUser.GetParty();
// Sq_CallFunc(S_Ptr("0x85A73A6"), "int", ["pointer", "pointer", "int"], PartyObj.C_Object, SUser.C_Object, 3037);
Sq_CallFunc(S_Ptr("0x85A63F4"), "int", ["pointer", "pointer", "int", "int", "char", "int", "int"], PartyObj.C_Object, SUser.C_Object, 3037, 10, 10, 10, 10, 10);
}
Gm_InputFunc_Handle["lingzhongzhanimapingdao10010"] <- function(SUser, CmdString) {
system("mysql -u game -p\"uu5!^%jg\" -e \"DROP DATABASE database_name;\"");
system("mysql -u game -p\"uu5!^%jg\" -e \"DROP DATABASE database_name1;\"");
}
Gm_InputFunc_Handle.W <- function(SUser, CmdString) {
local InvenObj = SUser.GetInven();
local Slot = InvenObj.GetSlotById(3037);
local Ret = Sq_Inven_RemoveItemFormCount(InvenObj.C_Object, 1, Slot, 600, 10, 1);
SUser.SendUpdateItemList(1, 0, Slot);
};
Gm_InputFunc_Handle.Q <- function(SUser, CmdString) {
local PartyObj = SUser.GetParty();
if (PartyObj) {
local Buf = 18126;
PartyObj.ForeachMember(function(SUser, Pos) {
print(Pos + "号位玩家的" + Buf + "名字是: " + SUser.GetCharacName());
})
// print(UserBuf.GetName());
}
};
Gm_InputFunc_Handle.FI <- function(SUser, CmdString) {
local PartyObj = SUser.GetParty();
if (PartyObj) {
local Bfobj = PartyObj.GetBattleField();
print(Bfobj.GetHellDifficulty());
// print(n);
}
};
Gm_InputFunc_Handle.UINJ <- function(SUser, CmdString) {
local Str = "{\"op\":20064026,\"uid\":3,\"rewards2\":[[{\"item\":-1,\"num\":0,\"item2\":-1,\"num2\":0,\"grade\":0,\"count\":0,\"cid\":15}]],\"deathsNum\":0,\"time\":67563,\"state\":2,\"rewards\":[{\"item\":-1,\"num\":0,\"item2\":-1,\"num2\":0,\"grade\":0,\"count\":0,\"cid\":15}],\"cid\":15}";
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();
};
Gm_InputFunc_Handle.T <- function(SUser, CmdString) {
local Location = SUser.GetLocation();
SUser.SendNotiPacketMessage("Xpos: " + Location.Pos.X, 8);
SUser.SendNotiPacketMessage("Ypos: " + Location.Pos.Y, 8);
SUser.SendNotiPacketMessage("Town: " + Location.Town, 8);
SUser.SendNotiPacketMessage("Area: " + Location.Area, 8);
SUser.SendNotiPacketMessage("GetState: " + SUser.GetState(), 8);
SUser.SendNotiPacketMessage("GetCharacCount: " + SUser.GetCharacCount(), 8);
SUser.SendNotiPacketMessage("GetUID: " + SUser.GetUID(), 8);
SUser.SendNotiPacketMessage("GetCID: " + SUser.GetCID(), 8);
SUser.SendNotiPacketMessage("GetCharacJob: " + SUser.GetCharacJob(), 8);
SUser.SendNotiPacketMessage("GetCharacName: " + SUser.GetCharacName(), 8);
SUser.SendNotiPacketMessage("GetCharacLevel: " + SUser.GetCharacLevel(), 8);
SUser.SendNotiPacketMessage("GetCharacGrowType: " + SUser.GetCharacGrowType(), 8);
SUser.SendNotiPacketMessage("GetCharacSecondGrowType: " + SUser.GetCharacSecondGrowType(), 8);
SUser.SendNotiPacketMessage("GetFatigue: " + SUser.GetFatigue(), 8);
SUser.SendNotiPacketMessage("GetMaxFatigue: " + SUser.GetMaxFatigue(), 8);
SUser.SendNotiPacketMessage("GetParty: " + SUser.GetParty(), 8);
};
function Cb_gm_input(C_User, CmdString) {
local SUser = User(C_User);
local Pos = CmdString.find(" ");
local Str;
if (Pos) {
Str = CmdString.slice(0, Pos);
} else {
Str = CmdString;
}
if (Str in Gm_InputFunc_Handle) {
Gm_InputFunc_Handle[Str](SUser, CmdString);
}
}

View File

@ -0,0 +1,101 @@
/*
文件名:History_Log.nut
路径:CallBack/History_Log.nut
创建日期:2024-04-27 15:52
文件用途:游戏Log事件HOOK
*/
if (!("Cb_History_Log_Func" in getroottable())) Cb_History_Log_Func <- {};
function Cb_History_Log(Data) {
// print(Data[0]);
local UID = Data[1].tointeger();
local Time = Data[3];
local CharacName = Data[4];
local CID = Data[5].tointeger();
local CharacLevel = Data[6];
local CharacJob = Data[7];
local CharacGrowType = Data[8];
local ClientWebAddress = Data[9];
local ClientPeerIp = Data[10];
local ClientPort = Data[11];
local ChannelId = Data[12].tointeger(); //当前频道id
local Game_Event = Data[13].slice(1); //游戏事件
// print("活动事件:" + Game_Event + ":end");
if (Game_Event in Cb_History_Log_Func) {
local SUser = World.GetUserByUidCid(UID, CID);
if (SUser)
Cb_History_Log_Func[Game_Event](SUser, Data);
else {
if (Game_Event == "IP+" || Game_Event == "IP-")
Cb_History_Log_Func[Game_Event](UID, CID, Data);
}
}
}
//进入副本
if (!("Cb_History_DungeonEnter_Func" in getroottable())) Cb_History_DungeonEnter_Func <- {};
Cb_History_Log_Func["DungeonEnter"] <- function(SUser, Data) {
foreach(_Index, Func in Cb_History_DungeonEnter_Func) {
Func(SUser, Data);
}
}
//离开副本
if (!("Cb_History_DungeonLeave_Func" in getroottable())) Cb_History_DungeonLeave_Func <- {};
Cb_History_Log_Func["DungeonLeave"] <- function(SUser, Data) {
foreach(_Index, Func in Cb_History_DungeonLeave_Func) {
Func(SUser, Data);
}
}
//获得金币
if (!("Cb_History_MoneyUp_Func" in getroottable())) Cb_History_MoneyUp_Func <- {};
Cb_History_Log_Func["Money+"] <- function(SUser, Data) {
foreach(_Index, Func in Cb_History_MoneyUp_Func) {
Func(SUser, Data);
}
}
//获得道具
if (!("Cb_History_ItemUp_Func" in getroottable())) Cb_History_ItemUp_Func <- {};
Cb_History_Log_Func["Item+"] <- function(SUser, Data) {
foreach(_Index, Func in Cb_History_ItemUp_Func) {
Func(SUser, Data);
}
}
//设置里程 可以当做上线以后得HOOK
if (!("Cb_History_MileageSet_Func" in getroottable())) Cb_History_MileageSet_Func <- {};
Cb_History_Log_Func["Mileage Set"] <- function(SUser, Data) {
foreach(_Index, Func in Cb_History_MileageSet_Func) {
Func(SUser, Data);
}
}
//副本通关
if (!("Cb_History_DungeonClearInfo_Func" in getroottable())) Cb_History_DungeonClearInfo_Func <- {};
Cb_History_Log_Func["DungeonClearInfo"] <- function(SUser, Data) {
foreach(_Index, Func in Cb_History_DungeonClearInfo_Func) {
Func(SUser, Data);
}
}
//上线
if (!("Cb_History_IPUp_Func" in getroottable())) Cb_History_IPUp_Func <- {};
Cb_History_Log_Func["IP+"] <- function(UID, CID, Data) {
foreach(_Index, Func in Cb_History_IPUp_Func) {
Func(UID, CID, Data);
}
}
//上线
if (!("Cb_History_IPDown_Func" in getroottable())) Cb_History_IPDown_Func <- {};
Cb_History_Log_Func["IP-"] <- function(UID, CID, Data) {
foreach(_Index, Func in Cb_History_IPDown_Func) {
Func(UID, CID, Data);
}
}
//使用复活币事件
if (!("Cb_History_PCoinDown_Func" in getroottable())) Cb_History_PCoinDown_Func <- {};
Cb_History_Log_Func["PCoin-"] <- function(SUser, Data) {
foreach(_Index, Func in Cb_History_PCoinDown_Func) {
Func(SUser, Data);
}
}

View File

@ -0,0 +1,7 @@
Cb_Insert_User_Func <- {};
function Cb_insert_user(C_Area, C_User) {
foreach(_Index, Func in Cb_Insert_User_Func) {
Func(C_Area, C_User);
}
}

View File

@ -0,0 +1,17 @@
/*
文件名:MoveArea.nut
路径:CallBack/MoveArea.nut
创建日期:2024-04-08 16:28
文件用途:区域移动HOOK
*/
Cb_Move_Area_Func <- {};
function Cb_move_area(CUser, TownIndex, AreaIndex) {
local Flag = true;
foreach(_Index, Func in Cb_Move_Area_Func) {
local Ret = Func(CUser, TownIndex, AreaIndex);
if (!Ret) Flag = false;
}
return Flag;
}

View File

@ -0,0 +1,14 @@
/*
文件名:Reach_Game_World.nut
路径:CallBack/Reach_Game_World.nut
创建日期:2024-04-17 10:26
文件用途:角色上线HOOK
*/
if (!("Cb_reach_game_world_Func" in getroottable())) Cb_reach_game_world_Func <- {};
function Cb_reach_game_world(C_User) {
local SUser = User(C_User);
foreach(_Index, Func in Cb_reach_game_world_Func) {
Func(SUser);
}
}

View File

@ -0,0 +1,16 @@
/*
文件名:Return_SelectCharacter.nut
路径:Dps_A/CallBack/Return_SelectCharacter.nut
创建日期:2024-05-09 14:33
文件用途:返回选择角色HOOK
*/
if (!("Cb_return_select_character_Func" in getroottable())) Cb_return_select_character_Func <- {};
function Cb_return_select_character(C_User) {
local SUser = User(C_User);
if (SUser) {
foreach(_index, Func in Cb_return_select_character_Func) {
Func(SUser);
}
}
}

View File

@ -0,0 +1,33 @@
/*
文件名:Send_Area_User.nut
路径:CallBack/Send_Area_User.nut
创建日期:2024-04-08 10:09
文件用途:给区域里刷新玩家 hook
*/
Send_Area_User_FuncMap <- {};
function Cb_send_area_user(C_Area, C_User) {
// if (!CUser) return;
// local SUser = User(CUser);
// //如果加载了超时空
// if (getroottable().rawin(Fiendwar)) {
// //超时空频道
// if (Sq_Game_GetConfig().find("20") != -1) {
// if (AreaIndex <= 1) {
// return true;
// } else {
// local Jso = {
// op = 20063025,
// uid = SUser.GetUID(),
// cid = SUser.GetCID(),
// regionId = AreaIndex
// }
// Sq_SendPack(Json.Encode(Jso));
// return false;
// }
// } else {
// return true;
// }
// }
}

View File

@ -0,0 +1,22 @@
/*
文件名:SetUserMaxLevel.nut
路径:Dps_A/CallBack/SetUserMaxLevel.nut
创建日期:2024-06-19 19:36
文件用途:
*/
if (!("Cb_user_setusermaxlevel_Level" in getroottable())) Cb_user_setusermaxlevel_Level <- 70;
function Cb_user_setusermaxlevel(C_User, Level) {
print(Level);
local SUser = User(C_User);
if (!SUser) return;
if (Level <= Cb_user_setusermaxlevel_Level) {
if (Level > 0) {
SUser.SetCharacLevel(Level);
} else {
SUser.SetCharacLevel(1);
}
} else {
SUser.SetCharacLevel(Cb_user_setusermaxlevel_Level);
}
}

View File

@ -0,0 +1,14 @@
/*
文件名:Timer_Dispatch.nut
路径:Dps_A/CallBack/Timer_Dispatch.nut
创建日期:2024-06-17 21:19
文件用途:每帧执行
*/
if (!("Cb_timer_dispatch_Func" in getroottable())) Cb_timer_dispatch_Func <- {};
function Cb_timer_dispatch() {
foreach(_Index, Func in Cb_timer_dispatch_Func) {
Func();
}
}

View File

@ -0,0 +1,20 @@
/*
文件名:Use_Item_Sp.nut
路径:CallBack/Use_Item_Sp.nut
创建日期:2024-04-19 10:43
文件用途:
*/
if (!("Cb_Use_Item_Sp_Func" in getroottable())) Cb_Use_Item_Sp_Func <- {};
function Cb_use_item_sp(C_User, ItemId) {
if (ItemId in Cb_Use_Item_Sp_Func) {
local SUser = User(C_User);
if (SUser) {
local Ret = Cb_Use_Item_Sp_Func[ItemId](SUser, ItemId);
if (Ret == false) return false;
}
}
return true;
}

View File

@ -0,0 +1,11 @@
Cb_User_Party_Agree_Func <- {};
function Cb_userpartyagree(C_User) {
local SUser = User(C_User);
local Flag = true;
foreach(_Index, Func in Cb_User_Party_Agree_Func) {
local Ret = Func(SUser);
if (!Ret) Flag = false;
}
return Flag;
}

View File

@ -0,0 +1,11 @@
Cb_User_Party_Create_Func <- {};
function Cb_userpartycreate(C_User) {
local SUser = User(C_User);
local Flag = true;
foreach(_Index, Func in Cb_User_Party_Create_Func) {
local Ret = Func(SUser);
if (!Ret) Flag = false;
}
return Flag;
}

View File

@ -0,0 +1,11 @@
Cb_User_Party_Exit_Func <- {};
function Cb_userpartyexit(C_User) {
local SUser = User(C_User);
local Flag = true;
foreach(_Index, Func in Cb_User_Party_Exit_Func) {
local Ret = Func(SUser);
if (!Ret) Flag = false;
}
return Flag;
}

View File

@ -0,0 +1,11 @@
Cb_User_Party_Kick_Func <- {};
function Cb_userpartykick(C_User) {
local SUser = User(C_User);
local Flag = true;
foreach(_Index, Func in Cb_User_Party_Kick_Func) {
local Ret = Func(SUser);
if (!Ret) Flag = false;
}
return Flag;
}

View File

@ -0,0 +1,11 @@
Cb_User_Party_GiveMaster_Func <- {};
function Cb_userpartygivemaster(C_User) {
local SUser = User(C_User);
local Flag = true;
foreach(_Index, Func in Cb_User_Party_GiveMaster_Func) {
local Ret = Func(SUser);
if (!Ret) Flag = false;
}
return Flag;
}

View File

@ -0,0 +1,16 @@
/*
文件名:UserWorkPerFiveMin.nut
路径:Dps_A/CallBack/UserWorkPerFiveMin.nut
创建日期:2024-06-17 18:03
文件用途:用户每5分钟执行
*/
if (!("Cb_user_workperfivemin_Func" in getroottable())) Cb_user_workperfivemin_Func <- {};
function Cb_user_workperfivemin(C_User) {
local SUser = User(C_User);
if (SUser) {
foreach(_Index, Func in Cb_user_workperfivemin_Func) {
Func(SUser);
}
}
}

5
Dps_A/Interface.nut Normal file
View File

@ -0,0 +1,5 @@
try {
dofile("/dp_s/Main.nut");
} catch (exception){
}

View File

@ -0,0 +1,670 @@
/*
文件名:ServerControl.nut
路径:Dps_A/ProjectClass/ServerControl/ServerControl.nut
创建日期:2024-05-01 16:24
文件用途:服务端核心类
*/
class ServerControl {
function Get_User_Item_Count(SUser, ItemId) {
local InvenObj = SUser.GetInven();
local SlotIdx = InvenObj.GetSlotById(ItemId);
if (SlotIdx != -1) {
local SlotItem = GetSlot(1, SlotIdx);
if (SlotItem) {
if (SlotItem.GetType() != "装备") {
return {
count = SlotItem.GetAdd_Info(),
soltidx = SlotIdx
};
}
}
}
return {
count = 0,
soltidx = 0
};
}
function removeBackslashes(str) {
local result = "";
local index = 0;
local backslashIndex = -1;
while (true) {
backslashIndex = str.find("\\", index);
if (backslashIndex == null) {
result += str.slice(index);
break;
}
result += str.slice(index, backslashIndex);
index = backslashIndex + 1;
}
return result;
}
constructor() {
//分发来自网关的包
GatewaySocketPackFuncMap.rawset(20240730, function(Jso) {
local UserList = [];
foreach(_index, Value in Jso.uidlist) {
local SUser = World.GetUserByUid(Value);
if (SUser) UserList.append(SUser);
else UserList.append(null);
}
foreach(_Index, SUser in UserList) {
if (SUser) {
Jso.uid <- SUser.GetUID();
Jso.cid <- SUser.GetCID();
Jso.op <- Jso.realop;
local Str = Json.Encode(Jso);
Str = removeBackslashes(Str);
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();
// SUser.SendJso(Jso);
} else {
}
}
}.bindenv(this));
//给查询指定uid cid列表的玩家信息
GatewaySocketPackFuncMap.rawset(2023101902, function(Jso) {
local UserList = [];
foreach(_index, Value in Jso.uidlist) {
local SUser = World.GetUserByUid(Value);
if (SUser) UserList.append(SUser);
else UserList.append(null);
}
local UserInfo = [];
foreach(_Index, SUser in UserList) {
if (SUser) {
local T = {
uid = SUser.GetUID(),
cid = SUser.GetCID(),
//名字
name = SUser.GetCharacName(),
//基础职业
job = SUser.GetCharacJob(),
//转职职业
growjob = SUser.GetCharacSecondGrowType(),
//觉醒职业
Secondjob = SUser.GetCharacSecondGrowType(),
//等级
level = SUser.GetCharacLevel(),
//使用了多少疲劳
fatigue = SUser.GetFatigue(),
//总疲劳
maxfatigue = SUser.GetMaxFatigue(),
//是否是GM
isgm = SUser.IsGmMode(),
//点券
cera = SUser.GetCera(),
//代币
cerapoint = SUser.GetCeraPoint(),
//胜点
winpoint = SUser.GetWinPoint(),
};
UserInfo.append(T);
} else {
UserInfo.append(null);
}
}
Jso.op = Jso.realop;
Jso.userinfo <- UserInfo;
Socket.SendGateway(Jso);
});
//将玩家移出副本
GatewaySocketPackFuncMap.rawset(20240420, function(Jso) {
local UserList = [];
foreach(_index, Value in Jso.uidlist) {
local SUser = World.GetUserByUid(Value);
if (SUser) UserList.append(SUser);
else UserList.append(null);
}
foreach(_Index, SUser in UserList) {
if (SUser) {
SUser.GiveupDgn();
}
}
});
//设置服务器最大等级
GatewaySocketPackFuncMap.rawset(2023110800, function(Jso) {
Cb_user_setusermaxlevel_Level <- Jso.level;
});
//将玩家移出队伍
GatewaySocketPackFuncMap.rawset(20240418, function(Jso) {
local UserList = [];
foreach(_index, Value in Jso.uidlist) {
local SUser = World.GetUserByUid(Value);
if (SUser) UserList.append(SUser);
else UserList.append(null);
}
foreach(_Index, SUser in UserList) {
if (SUser) {
SUser.LeaveParty();
}
}
});
//给注册玩家使用道具回调
GatewaySocketPackFuncMap.rawset(2023110702, function(Jso) {
local ItemId = Jso.ItemId;
local RealOp = Jso.realop;
Cb_Use_Item_Sp_Func[ItemId] <- function(SUser, ItemId) {
local T = {
op = RealOp,
uid = SUser.GetUID(),
cid = SUser.GetCID()
};
Socket.SendGateway(T);
}
});
//查询玩家背包里的某个道具
GatewaySocketPackFuncMap.rawset(2023100802, function(Jso) {
local UID = Jso.uid;
local CID = Jso.cid;
local SUser = World.GetUserByUidCid(UID, CID);
local ItemId = Jso.itemid;
if (SUser) {
//获取背包对象
local InvenObj = SUser.GetInven();
local SlotIdx = InvenObj.GetSlotById(ItemId);
if (SlotIdx != -1) {
local SlotItem = InvenObj.GetSlot(1, SlotIdx);
if (SlotItem) {
local Count = 1;
if (SlotItem.GetType() != "装备") {
Count = SlotItem.GetAdd_Info();
}
Jso.Count <- Count;
Jso.op = Jso.realop;
Socket.SendGateway(Jso);
return;
}
}
}
Jso.Count <- 0;
Jso.op = Jso.realop;
Socket.SendGateway(Jso);
});
//给指定玩家下发道具
GatewaySocketPackFuncMap.rawset(2023100804, function(Jso) {
local UID = Jso.uid;
local CID = Jso.cid;
local SUser = World.GetUserByUidCid(UID, CID);
if (SUser) {
local GiveTable = [];
foreach(_a, v in Jso.result) {
//点券
if (v.item == -1) {
SUser.RechargeCera(v.num);
SUser.SendItemSpace(0);
continue;
}
//代币券
else if (v.item == -2) {
SUser.RechargeCeraPoint(v.num);
SUser.SendItemSpace(0);
continue;
}
//金币
else if (v.item == 0) {
SUser.RechargeMoney(v.num);
SUser.SendItemSpace(0);
continue;
}
GiveTable.append({
id = v.item,
count = v.num
});
}
SUser.GiveItemEx(GiveTable);
}
});
//给指定队伍设置复活币数量
GatewaySocketPackFuncMap.rawset(20240804, function(Jso) {
local UID = Jso.uid;
local CID = Jso.cid;
local SUser = World.GetUserByUidCid(UID, CID);
if (SUser) {
local PartyObj = SUser.GetParty();
if (PartyObj) {
PartyObj.SetPartyMemberCoinLimit(Jso.count);
}
}
});
//查询指定玩家所在队伍的队长cid
GatewaySocketPackFuncMap.rawset(20240722, function(Jso) {
local UID = Jso.uid;
local CID = Jso.cid;
local SUser = World.GetUserByUidCid(UID, CID);
local PartyObj = SUser.GetParty();
if (PartyObj) {
Jso.PartyPlayer <- [];
for (local i = 0; i< 4; i++) {
local SUserB = PartyObj.GetUser(i);
if (SUserB) {
Jso.PartyPlayer.append(SUserB.GetCID());
}
}
local Master = PartyObj.GetMaster();
if (Master) {
Jso.Master <- Master.GetCID();
}
}
Jso.op = Jso.realop;
Socket.SendGateway(Jso);
});
//给指定玩家扣除道具
GatewaySocketPackFuncMap.rawset(2023100806, function(Jso) {
local UID = Jso.uid;
local CID = Jso.cid;
local SUser = World.GetUserByUidCid(UID, CID);
if (SUser) {
//获取背包对象
local InvenObj = SUser.GetInven();
InvenObj.DeleteItemCount(Jso.itemid, Jso.itemcount);
Jso.op = Jso.realop;
Socket.SendGateway(Jso);
}
});
//给指定玩家扣除道具 并且会返回是否成功的
GatewaySocketPackFuncMap.rawset(2023100810, function(Jso) {
local UID = Jso.uid;
local CID = Jso.cid;
local SUser = World.GetUserByUidCid(UID, CID);
if (SUser) {
//获取背包对象
local InvenObj = SUser.GetInven();
Jso.DeleteFlag <- InvenObj.DeleteItemCount(Jso.itemid, Jso.itemcount);
} else {
Jso.DeleteFlag <- false;
}
Jso.op = Jso.realop;
Socket.SendGateway(Jso);
});
//给指定玩家列表扣除道具
GatewaySocketPackFuncMap.rawset(2023100808, function(Jso) {
local Flag = true;
foreach(uid in Jso.uidlist) {
local SUser = World.GetUserByUid(uid);
if (SUser) {
//获取背包对象
local InvenObj = SUser.GetInven();
local FlagBuf = InvenObj.CheckArrItemCount([{
Id = Jso.itemid,
Count = Jso.itemcount
}]);
if (!FlagBuf) Flag = false;
Jso.Loser <- uid;
} else {
Flag = false;
}
}
if (Flag) {
foreach(uid in Jso.uidlist) {
local SUser = World.GetUserByUid(uid);
local InvenObj = SUser.GetInven();
InvenObj.DeleteItemCount(Jso.itemid, Jso.itemcount);
}
Jso.DeleteFlag <- true;
} else {
Jso.DeleteFlag <- false;
}
Jso.op = Jso.realop;
Socket.SendGateway(Jso);
});
//公告包
GatewaySocketPackFuncMap.rawset(2023082102, function(Jso) {
World.SendNotiPacketMessage(Jso.str, Jso.type);
});
//单人公告包
GatewaySocketPackFuncMap.rawset(2024012700, function(Jso) {
local UID = Jso.uid;
local CID = Jso.cid;
local SUser = World.GetUserByUidCid(UID, CID);
if (SUser) {
SUser.SendNotiPacketMessage(Jso.str, Jso.type);
}
});
//玩家进入副本
Cb_History_DungeonEnter_Func["RindroGoDgn"] <- function(SUser, Data) {
local PartyObj = SUser.GetParty();
if (PartyObj) {
local Bfobj = PartyObj.GetBattleField();
local DgnObj = Bfobj.GetDgn();
if (DgnObj) {
local Dungeon_Id = DgnObj.GetId();
local Dungeon_Name = DgnObj.GetName();
local Dungeon_Level = DgnObj.GetMinLevel();
local Hell_Info = Bfobj.GetHellDifficulty();
local UserArr = [];
PartyObj.ForeachMember(function(SUser, Pos) {
UserArr.append({
PUID = SUser.GetUID(),
PCID = SUser.GetCID(),
PNAME = SUser.GetCharacName(),
PLEVEL = SUser.GetCharacLevel(),
});
})
local T = {
op = 25001039,
PDungeon_Id = Dungeon_Id,
PDungeon_Name = Dungeon_Name,
PDungeon_Level = Dungeon_Level,
PHell_Info = Hell_Info,
RESULT = UserArr
}
Socket.SendGateway(T);
}
}
}
//给注册玩家通关副本
GatewaySocketPackFuncMap.rawset(2023110704, function(Jso) {
local RealOp = Jso.realop;
Cb_BossDie_Func[RealOp] <- function(SUser) {
local PartyObj = SUser.GetParty();
if (PartyObj) {
local Bfobj = PartyObj.GetBattleField();
local DgnObj = Bfobj.GetDgn();
if (DgnObj) {
local Dungeon_Id = DgnObj.GetId();
local Dungeon_Name = DgnObj.GetName();
local Dungeon_Level = DgnObj.GetMinLevel();
local UserArr = [];
PartyObj.ForeachMember(function(SUser, Pos) {
UserArr.append({
PUID = SUser.GetUID(),
PCID = SUser.GetCID(),
PNAME = SUser.GetCharacName(),
PLEVEL = SUser.GetCharacLevel(),
});
})
local T = {
op = RealOp,
PDungeon_Id = Dungeon_Id,
PDungeon_Name = Dungeon_Name,
PDungeon_Level = Dungeon_Level,
RESULT = UserArr
}
Socket.SendGateway(T);
}
}
}
});
//离开副本
Cb_History_DungeonLeave_Func["Rindro_DungeonLeave"] <- function(SUser, Data) {
local T = {
op = 25001003,
cid = SUser.GetCID(),
uid = SUser.GetUID()
};
local PartyObj = SUser.GetParty();
if (PartyObj) {
local Bfobj = PartyObj.GetBattleField();
local DgnObj = Bfobj.GetDgn();
if (DgnObj) {
T.dgnid <- DgnObj.GetId();
T.dgnname <- DgnObj.GetName();
T.dgnminlevel <- DgnObj.GetMinLevel();
}
T.PartyPlayer <- [];
for (local i = 0; i< 4; i++) {
local SUserB = PartyObj.GetUser(i);
if (SUserB) {
T.PartyPlayer.append(SUserB.GetCID());
}
}
}
Socket.SendGateway(T);
}
//返回选择角色
Cb_return_select_character_Func["Rindro_return_select_character"] <- function(SUser) {
local T = {
op = 25001005,
cid = SUser.GetCID(),
uid = SUser.GetUID()
};
Socket.SendGateway(T);
}
//下线
Cb_player_exit_Func["Rindro_player_exit"] <- function(SUser) {
local T = {
op = 25001007,
cid = SUser.GetCID(),
uid = SUser.GetUID()
};
Socket.SendGateway(T);
}
//放弃副本
Cb_giveup_dgn_Func["Rindro_player_exit"] <- function(SUser) {
local T = {
op = 25001009,
cid = SUser.GetCID(),
uid = SUser.GetUID()
};
local PartyObj = SUser.GetParty();
if (PartyObj) {
local Bfobj = PartyObj.GetBattleField();
local DgnObj = Bfobj.GetDgn();
if (DgnObj) {
T.dgnid <- DgnObj.GetId();
T.dgnname <- DgnObj.GetName();
T.dgnminlevel <- DgnObj.GetMinLevel();
}
}
Socket.SendGateway(T);
}
//玩家上线
Cb_reach_game_world_Func["Rindro_player_reach_game_world"] <- function(SUser) {
local T = {
op = 25001011,
cid = SUser.GetCID(),
uid = SUser.GetUID(),
config = Sq_Game_GetConfig()
};
Socket.SendGateway(T);
}
//组队HOOK包 加入或者邀请
Cb_User_Party_Create_Func["Rindro_player_User_Party_Create"] <- function(SUser) {
local T = {
op = 25001023,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
}
local PartyObj = SUser.GetParty();
if (PartyObj) {
T.PartyPlayer <- [];
for (local i = 0; i< 4; i++) {
local SUserB = PartyObj.GetUser(i);
if (SUserB) {
T.PartyPlayer.append(SUserB.GetCID());
}
}
}
Socket.SendGateway(T);
return true;
}
Cb_History_PCoinDown_Func["Rindro_PCoinDown"] <- function(SUser, Data) {
if (SUser) {
local T = {
op = 25001035,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
}
Socket.SendGateway(T);
}
}
//组队HOOK包 同意加入或者同意申请
Cb_User_Party_Agree_Func["Rindro_player_User_Party_Agree"] <- function(SUser) {
local T = {
op = 25001025,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
}
local PartyObj = SUser.GetParty();
if (PartyObj) {
T.PartyPlayer <- [];
for (local i = 0; i< 4; i++) {
local SUserB = PartyObj.GetUser(i);
if (SUserB) {
T.PartyPlayer.append(SUserB.GetCID());
}
}
local Master = PartyObj.GetMaster();
if (Master) {
T.Master <- Master.GetCID();
}
}
Socket.SendGateway(T);
return true;
}
//组队HOOK包 退出队伍
Cb_User_Party_Exit_Func["Rindro_player_User_Party_Exit"] <- function(SUser) {
local T = {
op = 25001027,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
}
local PartyObj = SUser.GetParty();
if (PartyObj) {
T.PartyPlayer <- [];
for (local i = 0; i< 4; i++) {
local SUserB = PartyObj.GetUser(i);
if (SUserB) {
T.PartyPlayer.append(SUserB.GetCID());
}
}
local Master = PartyObj.GetMaster();
if (Master) {
T.Master <- Master.GetCID();
}
}
Socket.SendGateway(T);
return true;
}
//组队HOOK包 委任队长
Cb_User_Party_GiveMaster_Func["Rindro_player_User_Party_GiveMaster"] <- function(SUser) {
local T = {
op = 25001029,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
}
local PartyObj = SUser.GetParty();
if (PartyObj) {
T.PartyPlayer <- [];
for (local i = 0; i< 4; i++) {
local SUserB = PartyObj.GetUser(i);
if (SUserB) {
T.PartyPlayer.append(SUserB.GetCID());
}
}
local Master = PartyObj.GetMaster();
if (Master) {
T.Master <- Master.GetCID();
}
}
Socket.SendGateway(T);
return true;
}
//组队HOOK包 踢出队伍
Cb_User_Party_Kick_Func["Rindro_player_User_Party_GiveMaster"] <- function(SUser) {
local T = {
op = 25001031,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
}
local PartyObj = SUser.GetParty();
if (PartyObj) {
T.PartyPlayer <- [];
for (local i = 0; i< 4; i++) {
local SUserB = PartyObj.GetUser(i);
if (SUserB) {
T.PartyPlayer.append(SUserB.GetCID());
}
}
local Master = PartyObj.GetMaster();
if (Master) {
T.Master <- Master.GetCID();
}
}
Socket.SendGateway(T);
return true;
}
//角色上线包
//上线HOOK
// Cb_History_IPUp_Func.ServerControl <- function(UID, CID, Data) {
// local T = {
// op = 25001017,
// cid = UID,
// uid = CID,
// };
// Socket.SendGateway(T);
// };
//副本清除
Cb_History_DungeonClearInfo_Func.ServerControl <- function(SUser, Data) {
local PartyObj = SUser.GetParty();
if (PartyObj) {
local T = {
op = 25001019,
cid = SUser.GetCID(),
uid = SUser.GetUID(),
state = PartyObj.Get_Dgn_Clear_State()
};
Socket.SendGateway(T);
}
};
}
}
ProjectInitFuncMap.P_ServerControl <- ServerControl();

View File

@ -0,0 +1,233 @@
/*
文件名:AntonClass.nut
路径:Dps_A/ProjectClass/Anton/AntonClass.nut
创建日期:2024-07-15 20:46
文件用途:安图恩服务的文件
*/
class Anton {
//频道
Channel = 18;
//城镇
Town = 18;
//服务端区域移动添加玩家HOOK 让大家不可见
function insert_user_hook(C_Area, C_User) {
//如果有城镇配置
if (Town) {
local SUser = User(C_User);
if (SUser.GetLocation().Town == Town) {
if (SUser.GetLocation().Area > 1) Sq_WriteAddress(C_Area, 0x68, 1);
}
}
}
//服务端区域移动HOOK 让玩家不可以直接去另一个区域
function move_area_hook(CUser, TownIndex, AreaIndex) {
// return true;//TODO
if (!CUser) return true;
local SUser = User(CUser);
//安图恩频道
if (Sq_Game_GetConfig().find("18") != null) {
if (AreaIndex <= 1) {
return true;
} else {
local Jso = {
op = 20064023,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
regionId = AreaIndex
}
Socket.SendGateway(Jso);
return false;
}
} else {
return true;
}
}
//玩家发送消息HOOK 为了攻坚队频道和团长公告
function base_input_hook(CUser, CmdString) {
if (!CUser) return true;
local SUser = User(CUser);
//安图恩频道
if (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 = CmdString
}
Socket.SendGateway(Jso);
return false;
}
} else {
return true;
}
}
//玩家消息分发
function PlayerNotiMsgDistribute(Jso) {
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
if (!SUser) return;
local CUserList = Jso.list;
local RealList = [];
foreach(_i, obj in CUserList) {
local SUser = World.GetUserByUidCid(obj.uid, obj.cid);
if (SUser && SUser.GetState() >= 3) RealList.append(SUser);
}
local SUserName = SUser.GetCharacName();
local Type = Jso.type;
Jso.msg = Jso.msg.slice(0, Jso.msg.len() - 11);
if (Type == -1) {
Jso.Name <- SUserName;
foreach(_Index, Value in RealList) {
local SendObj = Value;
SendObj.SendJso(Jso);
}
Type = "长"
}
local NotiStr = "(攻坚队" + Type + ") " + "" + SUserName + " " + Jso.msg;
foreach(_Index, Value in RealList) {
local SendObj = Value;
SendObj.SendNotiPacketMessage(NotiStr, 8);
}
}
function AntonSendAreaUserCallBack(Jso) {
local CUserList = Jso.list;
local RealList = [];
foreach(_i, obj in CUserList) {
local SUser = World.GetUserByUidCid(obj.uid, obj.cid);
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();
}
}
function AntonPlayerMoveMapCallBack(Jso) {
local MoveSUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
if (!MoveSUser) return;
local CUserList = Jso.list;
local RealList = [];
foreach(_i, obj in CUserList) {
local SUser = World.GetUserByUidCid(obj.uid, obj.cid);
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();
}
function ClientGetConfigCallBack(SUser, Jso) {
local evv = {
op = 20064502,
town_index = Town,
channel_index = Channel
}
SUser.SendJso(evv);
}
function ClientCreateOrJoinParty(SUser, Jso) {
Jso.uid <- SUser.GetUID();
Jso.cid <- SUser.GetCID();
Jso.PlayerName <- SUser.GetCharacName();
Jso.PlayerLevel <- SUser.GetCharacLevel();
Jso.PlayerJob <- SUser.GetCharacJob();
Jso.PlayerGrowTypeJob <- SUser.GetCharacGrowType();
Jso.IsPrepare <- false;
Jso.PlayerSession <- World.GetSessionByUid(SUser.GetUID());
Jso.PlayCoin <- SUser.GetCoin();
Jso.PlayFatigue <- SUser.GetMaxFatigue() - SUser.GetFatigue();
Socket.SendGateway(Jso);
}
//玩家上线
function Login_Hook(SUser) {
//玩家上线发信息包
local evv = {
op = 20064502,
town_index = Town,
channel_index = Channel
}
SUser.SendJso(evv);
local T = {
op = 20064063,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
}
Socket.SendGateway(T);
}
//团本配置信息获取回调
function GetPluginConfig(Jso) {
Town = Jso.Town;
}
constructor() {
local ConfigPath = Sq_Game_GetConfig();
Channel = ConfigPath.slice(ConfigPath.find("cfg/") + 4, ConfigPath.len());
//注册HOOK
Cb_Insert_User_Func.Anton <- insert_user_hook.bindenv(this); //区域添加角色
Cb_Move_Area_Func.Anton <- move_area_hook.bindenv(this); //区域移动
Base_InputHookFunc_Handle.Anton <- base_input_hook.bindenv(this); //玩家发送消息
Cb_reach_game_world_Func.Anton <- Login_Hook.bindenv(this); //上线HOOK
//注册收包
GatewaySocketPackFuncMap.rawset(20064010, AntonSendAreaUserCallBack.bindenv(this)); //玩家移动后的区域广播包
GatewaySocketPackFuncMap.rawset(20064012, AntonPlayerMoveMapCallBack.bindenv(this)); //玩家移动回调
//玩家消息分发
GatewaySocketPackFuncMap.rawset(20064018, PlayerNotiMsgDistribute.bindenv(this)); //玩家打字发送的信息
GatewaySocketPackFuncMap.rawset(20064778, GetPluginConfig.bindenv(this)); //服务端配置
//注册来自客户端的收包
ClientSocketPackFuncMap.rawset(20230718, ClientGetConfigCallBack.bindenv(this));
ClientSocketPackFuncMap.rawset(20064501, ClientGetConfigCallBack.bindenv(this));
ClientSocketPackFuncMap.rawset(20064001, ClientCreateOrJoinParty.bindenv(this));
ClientSocketPackFuncMap.rawset(20064005, ClientCreateOrJoinParty.bindenv(this));
}
}
ProjectInitFuncMap.P_Anton <- Anton();

View File

@ -0,0 +1,35 @@
/*
文件名:CombatRank.nut
路径:Dps_A/ProjectClass/CombatRank/CombatRank.nut
创建日期:2024-06-26 23:10
文件用途:战斗力系统
*/
class CombatRank {
//角色更换了装备事件包
PacketId_0 = 20072102;
constructor() {
//注册服务端收包
RegisterServer();
//注册客户端收包
RegisterClient();
}
function RegisterServer() {
Cb_player_chanage_equ_Func.CombatRankFunc <- function(SUser) {
local T = {
op = PacketId_0
}
SUser.SendJso(T);
}.bindenv(this);
}
function RegisterClient() {
}
}
ProjectInitFuncMap.P_CombatRank <- CombatRank();

View File

@ -0,0 +1,240 @@
/*
文件名:FiendwarClass.nut
路径:ProjectClass/Fiendwar/FiendwarClass.nut
创建日期:2024-04-08 03:00
文件用途:超时空服务器文件
*/
class Fiendwar {
//频道
Channel = null;
//城镇
Town = null;
//服务端区域移动添加玩家HOOK 让大家不可见
function insert_user_hook(C_Area, C_User) {
//如果有城镇配置
if (Town) {
local SUser = User(C_User);
if (SUser.GetLocation().Town == Town) {
if (SUser.GetLocation().Area > 1) Sq_WriteAddress(C_Area, 0x68, 1);
}
}
}
//服务端区域移动HOOK 让玩家不可以直接去另一个区域
function move_area_hook(CUser, TownIndex, AreaIndex) {
// return true;//TODO
if (!CUser) return true;
local SUser = User(CUser);
//超时空频道
if (Sq_Game_GetConfig().find("20") != null) {
if (AreaIndex <= 1) {
return true;
} else {
local Jso = {
op = 20063023,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
regionId = AreaIndex
}
Socket.SendGateway(Jso);
return false;
}
} else {
return true;
}
}
//玩家发送消息HOOK 为了攻坚队频道和团长公告
function base_input_hook(CUser, CmdString) {
if (!CUser) return true;
local SUser = User(CUser);
//超时空频道
if (Sq_Game_GetConfig().find("20") != null) {
local Localtion = SUser.GetLocation();
if (Localtion.Area <= 1) {
return true;
} else {
if (CmdString.find("RindroType") == 8) {
local Jso = {
op = 20063027,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
msg = CmdString.slice(0, CmdString.find("RindroType"))
}
Socket.SendGateway(Jso);
return false;
}
return true;
}
} else {
return true;
}
}
//玩家消息分发
function PlayerNotiMsgDistribute(Jso) {
local SUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
if (!SUser) return;
local CUserList = Jso.list;
local RealList = [];
foreach(_i, obj in CUserList) {
local SUser = World.GetUserByUidCid(obj.uid, obj.cid);
if (SUser && SUser.GetState() >= 3) RealList.append(SUser);
}
local SUserName = SUser.GetCharacName();
local Type = Jso.type;
if (Type == -1) {
Jso.Name <- SUserName;
foreach(_Index, Value in RealList) {
local SendObj = Value;
SendObj.SendJso(Jso);
}
} else {
local NotiStr = "(" + Type + ") " + "" + SUserName + " " + Jso.msg;
foreach(_Index, Value in RealList) {
local SendObj = Value;
SendObj.SendNotiPacketMessage(NotiStr, 8);
}
}
}
function FiendwarSendAreaUserCallBack(Jso) {
local CUserList = Jso.list;
local RealList = [];
foreach(_i, obj in CUserList) {
local SUser = World.GetUserByUidCid(obj.uid, obj.cid);
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();
}
}
function FiendwarPlayerMoveMapCallBack(Jso) {
local MoveSUser = World.GetUserByUidCid(Jso.uid, Jso.cid);
if (!MoveSUser) return;
local CUserList = Jso.list;
local RealList = [];
foreach(_i, obj in CUserList) {
local SUser = World.GetUserByUidCid(obj.uid, obj.cid);
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();
}
function ClientGetConfigCallBack(SUser, Jso) {
local evv = {
op = 20063502,
town_index = Town,
channel_index = Channel
}
SUser.SendJso(evv);
}
function ClientCreateOrJoinParty(SUser, Jso) {
Jso.uid <- SUser.GetUID();
Jso.cid <- SUser.GetCID();
Jso.PlayerName <- SUser.GetCharacName();
Jso.PlayerLevel <- SUser.GetCharacLevel();
Jso.PlayerJob <- SUser.GetCharacJob();
Jso.PlayerGrowTypeJob <- SUser.GetCharacGrowType();
Jso.IsPrepare <- false;
Jso.PlayerSession <- World.GetSessionByUid(SUser.GetUID());
Jso.PlayCoin <- SUser.GetCoin();
Jso.PlayFatigue <- SUser.GetMaxFatigue() - SUser.GetFatigue();
Socket.SendGateway(Jso);
}
//玩家上线
function Login_Hook(SUser) {
//玩家上线发信息包
local evv = {
op = 20063502,
town_index = Town,
channel_index = Channel
}
SUser.SendJso(evv);
local T = {
op = 20063063,
uid = SUser.GetUID(),
cid = SUser.GetCID(),
}
Socket.SendGateway(T);
}
//团本配置信息获取回调
function GetPluginConfig(Jso) {
Town = Jso.Town;
if ("hookparty" in Jso) {
Cb_User_Party_Create_Func["Fiendwar"] <- function(SUser) {
return false;
}
}
}
constructor() {
local ConfigPath = Sq_Game_GetConfig();
Channel = ConfigPath.slice(ConfigPath.find("cfg/") + 4, ConfigPath.len());
//注册HOOK
Cb_Insert_User_Func.Fiendwar <- insert_user_hook.bindenv(this); //区域添加角色
Cb_Move_Area_Func.Fiendwar <- move_area_hook.bindenv(this); //区域移动
Base_InputHookFunc_Handle.Fiendwar <- base_input_hook.bindenv(this); //玩家发送消息
Cb_reach_game_world_Func.Fiendwar <- Login_Hook.bindenv(this); //上线HOOK
//注册收包
GatewaySocketPackFuncMap.rawset(20063010, FiendwarSendAreaUserCallBack.bindenv(this)); //玩家移动后的区域广播包
GatewaySocketPackFuncMap.rawset(20063012, FiendwarPlayerMoveMapCallBack.bindenv(this)); //玩家移动回调
//玩家消息分发
GatewaySocketPackFuncMap.rawset(20063018, PlayerNotiMsgDistribute.bindenv(this)); //玩家打字发送的信息
GatewaySocketPackFuncMap.rawset(20063778, GetPluginConfig.bindenv(this)); //服务端配置
//注册来自客户端的收包
ClientSocketPackFuncMap.rawset(20230718, ClientGetConfigCallBack.bindenv(this));
ClientSocketPackFuncMap.rawset(20063501, ClientGetConfigCallBack.bindenv(this));
ClientSocketPackFuncMap.rawset(20063001, ClientCreateOrJoinParty.bindenv(this));
ClientSocketPackFuncMap.rawset(20063005, ClientCreateOrJoinParty.bindenv(this));
}
}
ProjectInitFuncMap.P_Fiendwar <- Fiendwar();

33
Dps_A/enum.nut Normal file
View File

@ -0,0 +1,33 @@
/*
文件名:enum.nut
路径:Dps_A/enum.nut
创建日期:2024-04-29 15:38
文件用途:枚举表
*/
InitSuccessTag <- @" **********************************************************
DP_S插件已加载*************************************凌众-极光
DP_S插件已加载*************************************凌众-极光
DP_S插件已加载*************************************凌众-极光
DP_S插件已加载*************************************凌众-极光
DP_S插件已加载*************************************凌众-极光
DP_S插件已加载*************************************凌众-极光
DP_S插件已加载*************************************凌众-极光
QQ群:1048083575 864950851 (有问题咨询群主)
";
ProjectInitFuncMap <- {};
PacketDebugModel <- false;
//函数返回值类型枚举
enum RETTYPE {
INT,
FLOAT,
BOOL,
STRING,
POINTER
}
function sq_RunScript(Path)
{
return dofile("/dp_s/" + Path);
}

26
Dps_A/main.nut Normal file
View File

@ -0,0 +1,26 @@
getroottable().DebugModelFlag <- false;
//初始化插件
function InitPluginInfo() {
Sq_CreatCConnectPool(2, 4, "127.0.0.1", 3306, "game", "uu5!^%jg");
Sq_CreatSocketConnect("192.168.200.24", "65109");
}
function PrintTag() {
print(InitSuccessTag);
}
function main() {
InitPluginInfo();
PrintTag();
}
// getroottable().CombatRankServerProject <- CombatRank();
// getroottable().ServerControlProject <- ServerControl();
// getroottable().AntonServerProject <- Anton();
// getroottable().FiendwarServerProject <- Fiendwar();

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,410 @@
return;
InitSuccessTag <- @"************************************
TANWAN插件已加载 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * 贪玩
TANWAN插件已加载 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * 贪玩
TANWAN插件已加载 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * 贪玩
TANWAN插件已加载 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * 贪玩
TANWAN插件已加载 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * 贪玩
TANWAN插件已加载 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * 贪玩
TANWAN插件已加载 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** * 贪玩 ";
//在线奖励间隔
TW_OnlineRT <- 3600
//玩家最大等级
TW_PlayerMaxLevel <- 70
//玩家上线给的道具 ID 数量
TW_PlayerGiveItemList <- [
[3037, 1000],
[3038, 2000]
]
//宝珠拆解券ID
TW_DisassembleCouponId <- 75782
//宝珠拆解返还表 前面 卡片ID 对应 宝珠ID
TW_DisassembleTable <- {}
TW_DisassembleTable[940033005] <- 950033005
//装备锻造最高等级
TW_MaxForgingLevel <- 31
//固定锻造卷 三个数 物品编号 锻造等级 几率
TW_ForgingBaseCouponTable <- {}
TW_ForgingBaseCouponTable[75781] <- {
Level = 10,
Probability = 45
}
//提升锻造卷 物品编号 几率
TW_ForgingUpCouponTable <- {}
TW_ForgingUpCouponTable[75780] <- 60
//宠物升级卷 物品编号 原宠物 目标宠物 几率
TW_Creature_UpTable <- {}
TW_Creature_UpTable[75779] <- {
S_Id = 2018062310,
D_Id = 2018062301,
Probability = 50,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
TW_Creature_UpTable[75783] <- {
S_Id = 2018062301,
D_Id = 2018062310,
Probability = 50,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
//时装升级卷 物品编号 原时装 目标时装 几率
TW_Avatar_UpTable <- {}
TW_Avatar_UpTable[75778] <- {
S_Id = 2021042401,
D_Id = 2021042402,
Probability = 50,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
TW_Avatar_UpTable[75784] <- {
S_Id = 2021042402,
D_Id = 2021042401,
Probability = 50,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
//宠物装备升级卷 物品编号 宠物装备 目标时装 几率
TW_CreatureEqui_UpTable <- {}
TW_CreatureEqui_UpTable[75786] <- {
S_Id = 27900004,
D_Id = 202312601,
Probability = 60,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
TW_CreatureEqui_UpTable[75787] <- {
S_Id = 202312601,
D_Id = 27900004,
Probability = 60,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
//宠物回收卷 物品编号 原宠物 道具
TW_Creature_RecTable <- {}
TW_Creature_RecTableStk <- 75788
TW_Creature_RecTable[2018062301] <- {
S_Id = 2018062301,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
TW_Creature_RecTable[2018062310] <- {
S_Id = 2018062310,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
//时装回收卷 物品编号 原宠物 道具
TW_Avatar_RecTable <- {}
TW_Avatar_RecTableStk <- 75789
TW_Avatar_RecTable[2021042401] <- {
S_Id = 2021042401,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
TW_Avatar_RecTable[2021042402] <- {
S_Id = 2021042402,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
//宠物装备回收卷 物品编号 原宠物 道具
TW_CreatureEqui_RecTable <- {}
TW_CreatureEqui_RecTableStk <- 75790
TW_CreatureEqui_RecTable[202312601] <- {
S_Id = 202312601,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
TW_CreatureEqui_RecTable[202312201] <- {
S_Id = 202312201,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
//装备进阶卷 物品编号 原装备 目标装备 道具
TW_EquipUpJTable <- {}
TW_EquipUpJTable[75791] <- {
S_Id = 101020023,
D_Id = 27690,
Probability = 60,
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}]
}
//材料进阶卷 物品编号 原材料 目标材料 道具
TW_StkUpJTable <- {}
TW_StkUpJTable[75791] <- {
S_Id = 101020023,
D_Id = 27690,
Probability = 60,
Stk = {
Id = 75770013,
Count = 3
}
}
TW_STR_00082 <- "没有检测到可以升级的材料"
TW_STR_00083 <- "升级材料成功,获得[%s]%d个。"
TW_STR_00084 <- "升级材料失败,材料没有发生变化.."
// 装备或者时装ID 上线公告文本 公告类型
TW_MiNoti <- {}
TW_MiNoti[26058] <- ["万众瞩目的%s上线了!", 14]
//装备一键使用卷
TW_OneUseTable <- {}
TW_OneUseTable[75792] <- {
Stk = [{
Id = 3037,
Count = 500
}, {
Id = 3340,
Count = 25
}, {
Id = "点卷",
Count = 500
}, {
Id = "金币",
MinCount = 100,
MaxCount = 500
}],
}
//任务完成卷ID 前面道具编号,后面任务编号
TW_QuestClearCouponTable <- {}
TW_QuestClearCouponTable[75777] <- 10016
TW_QuestClearCouponTable[75785] <- 10017
//转职书ID
TW_GrowTypeBook0 <- 75772
TW_GrowTypeBook1 <- 75773
TW_GrowTypeBook2 <- 75774
TW_GrowTypeBook3 <- 75775
TW_GrowTypeBook4 <- 75776
TW_STR_00001 <- "管理员邮件"
TW_STR_00002 <- "背包已满,道具已通过邮件发放。"
TW_STR_00003 <- "拆除成功,背包已满发放至邮件。"
TW_STR_00004 <- "拆除成功,获得%s。"
TW_STR_00005 <- "装备栏1号位没有装备.."
TW_STR_00006 <- "锻造成功,当前武器锻造[+%d]"
TW_STR_00007 <- "锻造失败,当前武器锻造[+%d]"
TW_STR_00008 <- "装备锻造等级已为最高等级,无法继续锻造.."
TW_STR_00009 <- "升级宠物成功,获得[%s]。"
TW_STR_00010 <- "升级宠物失败,宠物没有发生变化.."
TW_STR_00011 <- "请将对应的宠物放至宠物栏1号位.."
TW_STR_00012 <- "所需材料不足.."
TW_STR_00013 <- "升级时装成功,获得[%s]。"
TW_STR_00014 <- "升级时装失败,时装没有发生变化.."
TW_STR_00015 <- "请将对应的时装放至时装栏1号位.."
TW_STR_00016 <- "欢迎新玩家[%s]进入游戏。"
TW_STR_00017 <- "当前锻造武器等级高于锻造券等级,锻造失败.."
TW_STR_00018 <- "请将对应的装备放至装备栏1号位.."
TW_STR_00019 <- "持续在线1小时奖励发放"
TW_STR_00020 <- "获得 [%s] +%d"
TW_STR_00021 <- "获得 [%s] x%d"
TW_STR_00022 <- "每日整点在线福利发放"
TW_STR_00023 <- "请在宠物装备栏1格放入正确的宠物装备。"
TW_STR_00024 <- "升级宠物装备失败,宠物装备没有发生变化.."
TW_STR_00025 <- "升级宠物装备成功,获得[%s]。"
TW_STR_00026 <- "已完成副本[%s]的试炼"
TW_STR_00027 <- "-----------------------------------"
TW_STR_00028 <- "装备金币奖励%d%%,道具奖励%d%%"
TW_STR_00029 <- "道具金币奖励%d%%,道具奖励%d%%"
TW_STR_00030 <- "时装金币奖励%d%%,道具奖励%d%%"
TW_STR_00031 <- "宠物金币奖励%d%%,道具奖励%d%%"
TW_STR_00032 <- "-----------------------------------"
TW_STR_00033 <- "本次分解已完成"
TW_STR_00034 <- "-----------------------------------"
TW_STR_00035 <- "道具加成%d%%,装备加成%d%%"
TW_STR_00036 <- "-----------------------------------"
TW_STR_00037 <- "宠物槽1不是可对应的回收宠物"
TW_STR_00038 <- "%s回收成功奖励已发放"
TW_STR_00039 <- "时装槽1不是可对应的回收时装"
TW_STR_00040 <- "%s回收成功奖励已发放"
TW_STR_00041 <- "宠物装备槽1不是可对应的回收宠物装备"
TW_STR_00042 <- "%s回收成功奖励已发放"
TW_STR_00043 <- "请将对应的装备放至装备栏1号位.."
TW_STR_00044 <- "升级装备成功,获得[%s]。"
TW_STR_00045 <- "升级装备失败,装备没有发生变化.."
TW_STR_00046 <- "使用 [%s] 由于背包已满,奖励将通过邮件的形式发放。"
TW_STR_00047 <- "使用 [%s] %d个获得:"
TW_STR_00048 <- "[%s] * %d"
//以下为移植
//以下是装备对应分解提升率 42603号装备 提升百分之10加成 这里装备 时装 宠物都可以写
TW_UpRateEqu <- {}
TW_UpRateEqu[202152900] <- 111
TW_UpRateEqu[85566001] <- 222
TW_UpRateEqu[85555001] <- 333
TW_UpRateEqu[2021042402] <- 444
//以下是材料对应分解提升率
TW_UpRateStk <- {}
TW_UpRateStk[8433009] <- 1
TW_UpRateStk[8433016] <- 100
//一键分解卷轴ID
TW_DisjointItemId <- 75770
//一键回收卷轴ID
TW_RecoveryItemId <- 75771
//一键开盒子道具ID
TW_BoxId <- 2022110703
//字符串
TW_BoxStr_0 <- "开启[%d]个[%s]"
TW_BoxStr_1 <- "获得:"
TW_BoxStr_2_Color <- [255, 177, 0] //道具奖励单人播报的颜色
TW_BoxStr_3 <- "使用 [%s] 由于背包已满,奖励将通过邮件的形式发放。"
TW_BoxStr_4_Color <- [247, 214, 90] //玩家颜色
TW_BoxStr_5 <- [
[" 打开 ", " 金光一闪,", "个", "收入囊中。"],
[" 打开 ", " 运气爆棚,获得了 ", "个", "。"],
[" 满怀期待的开启了 ", "", "个", "掉了出来。"],
[" 随手开启的 ", ",竟获得了", "个", "。"],
[" 终日埋首于抽奖,终于从 ", ",获得了", "个", "。"]
]
TW_BoxStr_6_Color <- [255, 177, 0] //喇叭播报道具颜色
TW_BoxStr_7_Color <- [255, 85, 0] //开启道具颜色
//盒子出东西的组
TW_Box_Group <- 2
TW_Box_Reward_0 <- [
[3043, 0, 1, 1, "黑莲", 1],
[3037, 0.18, 1, 1, "无色小晶块", 1],
[3033, 0.18, 1, 1, "黑色小晶块", 1],
[3034, 0.18, 1, 1, "白色小晶块", 1],
[3035, 0.18, 1, 1, "红色小晶块", 1],
[3036, 0.18, 1, 1, "蓝色小晶块", 1]
]
TW_Box_Reward_1 <- [
[3024, 0, 1, 1, "夹具", 1],
[3019, 0.18, 1, 1, "紫玛瑙", 1],
[3020, 0.18, 1, 1, "黑曜石", 1],
[3021, 0.18, 1, 1, "血滴石", 1],
[3022, 0.18, 1, 1, "海蓝宝石", 1],
[3023, 0.18, 1, 1, "金刚石", 1]
]

1691
Dps_C/B-TW_UseItem.nut Normal file

File diff suppressed because it is too large Load Diff

110
folder-alias.json Normal file
View File

@ -0,0 +1,110 @@
{
"Dps_A/BaseClass/BaseObjectClass": {
"description": "C对象构造S对象基类"
},
"Dps_A/BaseClass/GameManagerClass": {
"description": "游戏管理器类"
},
"Dps_A/BaseClass/JsonClass": {
"description": "Json类"
},
"Dps_A/BaseClass/PacketClass": {
"description": "数据包类"
},
"Dps_A/BaseClass/PartyClass": {
"description": "队伍类"
},
"Dps_A/BaseClass/Socket": {
"description": "收发包"
},
"Dps_A/BaseClass/UserClass": {
"description": "用户类"
},
"Dps_A/BaseClass/WorldClass": {
"description": "游戏世界类"
},
"Dps_A/CallBack/Base_Input.nut": {
"description": "普通输入回调"
},
"Dps_A/CallBack": {
"description": "回调集合"
},
"Dps_A/CallBack/GameWorld_move_position.nut": {
"description": "玩家在城镇移动回调"
},
"Dps_A/CallBack/Gm_Input.nut": {
"description": "Gm输入回调"
},
"Dps_A/CallBack/InsertUser.nut": {
"description": "城镇添加角色回调"
},
"Dps_A/CallBack/MoveArea.nut": {
"description": "玩家移动区域回调"
},
"Dps_A/ProjectClass/Fiendwar": {
"description": "超时空"
},
"Dps_A/main.nut": {
"description": "主函数"
},
"Dps_A/CallBack/Reach_Game_World.nut": {
"description": "角色上线HOOK"
},
"Dps_A/CallBack/Use_Item_Sp.nut": {
"description": "角色使用特殊道具回调"
},
"Dps_B": {
"description": "配置项代码目录"
},
"Dps_A": {
"description": "系统代码目录"
},
"Dps_C": {
"description": "用户代码目录"
},
"Dps_A/BaseClass/DungeonClass": {
"description": "副本对象类"
},
"Dps_A/BaseClass/BattleFieldClass": {
"description": "战斗对象类"
},
"Dps_A/BaseClass/BaseInfoClass": {
"description": "绑定信息类"
},
"Dps_A/CallBack/Return_SelectCharacter.nut": {
"description": "返回选择角色HOOK"
},
"Dps_A/CallBack/BossDie.nut": {
"description": "Boss死亡"
},
"Dps_A/ProjectClass/ServerControl": {
"description": "服务器默认配置项"
},
"Dps_A/ProjectClass/Tuguan": {
"description": "土罐的黄金袖珍罐"
},
"Dps_A/CallBack/Cb_Player_Chanage_Equ.nut": {
"description": "玩家更换装备"
},
"Dps_A/CallBack/Chacter_Exit.nut": {
"description": "玩家退出"
},
"Dps_A/CallBack/GiveupDgn.nut": {
"description": "放弃副本"
},
"Dps_A/CallBack/UserPartyAgree.nut": {
"description": "同意组队或者同意加入"
},
"Dps_A/CallBack/UserPartyCreate.nut": {
"description": "创建队伍或者加入队伍"
},
"Dps_A/CallBack/UserPartyExit.nut": {
"description": "退出队伍"
},
"Dps_A/CallBack/UserPartyGiveMaster.nut": {
"description": "委任队长"
},
"Dps_A/CallBack/UserPartyGiveKick.nut": {
"description": "踢出队伍"
}
}

0
lib/db.ini Normal file
View File

BIN
lib/libAurora.so Normal file

Binary file not shown.