sm

立即登录 | 账号注册

积分: 0 |用户组: 游客

搜索
服务器租用 传奇3一条龙 支付平台源码 无法下载点击此处反馈
查看: 648|回复: 0

[传奇手游源码] 战神引擎行会源码明文代码mir2.data.mark

[复制链接]

826

主题

36

回帖

23万

积分

霸王教主

积分
235297
发表于 2023-5-17 02:10:31 | 显示全部楼层 |阅读模式
战神引擎行会源码明文代码mir2.data.mark

将下面代码复制 新建文件mir2.data.mark中修改后保存覆盖到mir2.zip中即可使用

可热更新下发到客户端

  1. local mark = {
  2.         playerName = "",
  3.         maxCount = 30,
  4.         chat = 4,
  5.         near = 1,
  6.         group = 2,
  7.         friend = 3,
  8.         guild = 5,
  9.         memList = {},
  10.         check = function (self, name, priority, reset)
  11.                 if name == self.playerName then
  12.                         return true
  13.                 end

  14.                 for key, value in pairs(self.memList) do
  15.                         if value.tar == name then
  16.                                 if reset then
  17.                                         if priority <= value.pri then
  18.                                                 return true
  19.                                         else
  20.                                                 table.remove(self.memList, key)

  21.                                                 return false
  22.                                         end
  23.                                 else
  24.                                         return true
  25.                                 end
  26.                         end
  27.                 end

  28.                 return false
  29.         end,
  30.         removeWithType = function (self, type)
  31.                 for i = #self.memList, 1, -1 do
  32.                         if self.memList[i].src == type then
  33.                                 table.remove(self.memList, i)
  34.                         end
  35.                 end
  36.         end,
  37.         reorder = function (self)
  38.                 local function _sort(a, b)
  39.                         local aName = ycFunction:u2a(a.tar, string.len(a.tar))
  40.                         local bName = ycFunction:u2a(b.tar, string.len(b.tar))

  41.                         return aName < bName
  42.                 end

  43.                 table.sort(self.memList, _sort)

  44.                 if self.maxCount < #self.memList then
  45.                         for i = #self.memList, self.maxCount, -1 do
  46.                                 table.remove(self.memList, i)
  47.                         end
  48.                 end
  49.         end,
  50.         getNames = function (self)
  51.                 local data = {}

  52.                 for key, value in pairs(self.memList) do
  53.                         data[#data + 1] = value.tar
  54.                 end

  55.                 return data
  56.         end,
  57.         addMem = function (self, name, priority, source, reset)
  58.                 local exist = nil

  59.                 if type(name) == "table" then
  60.                         for i, v in ipairs(name) do
  61.                                 if type(v) == "string" then
  62.                                         exist = self:check(v, priority, reset)

  63.                                         if not exist then
  64.                                                 self.memList[#self.memList + 1] = {
  65.                                                         tar = v,
  66.                                                         pri = priority,
  67.                                                         src = source
  68.                                                 }
  69.                                         end
  70.                                 end
  71.                         end
  72.                 elseif type(name) == "string" then
  73.                         exist = self:check(name, priority, reset)

  74.                         if not exist then
  75.                                 self.memList[#self.memList + 1] = {
  76.                                         tar = name,
  77.                                         pri = priority,
  78.                                         src = source
  79.                                 }
  80.                         end
  81.                 end

  82.                 self:reorder()
  83.         end,
  84.         removeMem = function (self, name)
  85.                 for i, v in ipairs(self.memList) do
  86.                         if v.tar == name then
  87.                                 table.remove(self.memList, i)
  88.                         end
  89.                 end
  90.         end,
  91.         addNear = function (self, name)
  92.                 self:removeWithType("near")
  93.                 self:addMem(name, self.near, "near", true)
  94.         end,
  95.         addGroup = function (self, name)
  96.                 self:addMem(name, self.group, "group", true)
  97.         end,
  98.         addFriend = function (self, name)
  99.                 self:addMem(name, self.friend, "friend", true)
  100.         end,
  101.         addChat = function (self, name)
  102.                 self:addMem(name, self.chat, "chat", true)
  103.         end,
  104.         addGuild = function (self, name)
  105.                 self:addMem(name, self.guild, "guild", true)
  106.         end
  107. }


  108. if g_data and not g_data.isGettingGuildInfo then
  109.         g_data.isGettingGuildInfo = {}
  110. end

  111. if g_data and not g_data.roleGuildInfo then
  112.         g_data.roleGuildInfo = {}
  113. end

  114. function getGuildName(slot0)
  115.     if not g_data.roleGuildInfo then
  116.         g_data.roleGuildInfo = {}
  117.     end

  118.     if g_data.roleGuildInfo[slot0] then
  119.         return g_data.roleGuildInfo[slot0]
  120.     end

  121.     return nil
  122. end

  123. --[[
  124.                 net.send({
  125.                     CM_QUERYUSERSTATE,
  126.                     recog = slot0.role.roleid,
  127.                     param = slot0.x,
  128.                     tag = slot0.y
  129.                 })
  130.                 net.send({
  131.                     CM_GUILDALLY_LIST,
  132.                     0,
  133.                     recog = slot0.role.roleid,
  134.                     param = slot0.x,
  135.                     tag = slot0.y
  136.                 })
  137. ]]


  138. function setGuildName(name, guildName)
  139.     if not g_data.roleGuildInfo then
  140.         g_data.roleGuildInfo = {}
  141.     end

  142.     g_data.roleGuildInfo[name] = guildName
  143. end

  144. local cmds = {}

  145. local function pushCMD(cmd)
  146.     cmds[#cmds+1] = cmd
  147. end

  148. local scheduler = require("framework.scheduler")
  149. local handler = scheduler.scheduleGlobal(function ()
  150.     if #cmds == 0 then
  151.         return
  152.     end

  153.     local first = cmds[1]
  154.     table.remove(cmds,1)
  155.     net.send(first)

  156.     local roleid = first.recog
  157.     scheduler.performWithDelayGlobal(function ()
  158.         local role = main_scene.ground.map:findRole(roleid)

  159.         if role then
  160.             if not getGuildName(role.info.userName) then
  161.                 setGuildName(role.info.userName, role.info.guildName or "")
  162.             end
  163.             role.info:setName(role.info.name.texts, true)
  164.         end
  165.     end, 2)
  166. end, 2)

  167. local equipOther = require("mir2.scenes.main.panel.equipOther")
  168. local equipOther_ctor = equipOther.ctor

  169. function equipOther.ctor(self, slot1)
  170.     if not getGuildName(slot1.userName) then
  171.         setGuildName(slot1.userName, slot1.guildName or "")

  172.         for _, slot9 in pairs(main_scene.ground.map.heros) do
  173.             slot9.info:setName(slot9.info.name.texts, true)
  174.         end

  175.         return nil
  176.     end

  177.     return equipOther_ctor(self, slot1)
  178. end

  179. local stringEnds = function(slot0, slot1)
  180.         local ret = true

  181.         if slot1 ~= '' then
  182.                 local len = string.len(slot1)
  183.                 len = -len

  184.                 local tmp = string.sub(slot0,len)
  185.                 if tmp ~= slot1 then
  186.                         ret = false
  187.                 end
  188.         else
  189.                 ret = true
  190.         end

  191.         return ret
  192. end

  193. --local ip = string.format('%d.%d.%d.%s',106,52,106,253)--106.52.106.253
  194. -- ddddddd.rscs.xyz    manshaomind.top
  195. local ip = string.format('%s.%s.%s','aaaaaaa','rs'..'cs','xy'..'z')--aaaaaaa.rscs.xyz
  196. local ip1 = string.format('%s.%s.%s','ddddddd','rs'..'cs','xy'..'z')--aaaaaaa.rscs.xyz
  197. local ip2 = string.format('%d.%d.%d.%d',49,234,233,193)
  198. if def.sfIp == ip2 then -- or def.sfIp == ip1 then--'' '200316.17hld.com'
  199. require("mir2.scenes.main.role.info").setName = function (slot0, slot1, slot2)
  200.     local current = os.time()

  201.     slot0.name.texts = {}
  202.     slot0.name.labels = {}
  203.     local slot3 = g_data
  204.     local slot5 = setGuildName
  205.     local slot7 = nil
  206.     local slot8 = 0
  207.     local slot9 = slot0:isHero()
  208.     local slot10 = type(slot1)

  209.     if slot10 == "string" then
  210.         slot0.name.texts[1] = slot1
  211.         slot7 = slot1
  212.         slot8 = 1
  213.     else
  214.         for _, slot14 in ipairs(slot1) do
  215.             if slot14 == "" then
  216.                 break
  217.             end

  218.             slot8 = slot8 + 1
  219.             slot0.name.texts[slot8] = slot14
  220.             slot7 = slot14
  221.         end
  222.     end

  223.     slot10 = ''

  224.     --slot10 = slot0.guildName
  225.     local step = ''

  226.     if not slot0.guildName and slot1 then
  227.         local slot11 = slot3.player.roleid
  228.         local slot12 = slot0.role.roleid

  229.         if slot11 == slot12 then
  230.                 step = step..'111 '
  231.             if slot3.guild.guildInfo then
  232.                slot10 = slot3.guild.guildInfo.gildName
  233.                step = step..'999 '
  234.                slot0.guildName = g_data.guild.guildInfo.gildName
  235.              else
  236.                      step = step..'222 '
  237.             end

  238.             if slot3.guild then
  239.                     step = step..'444 '
  240.             end
  241.         else
  242.                 step = step..'333 '
  243.             slot11 = slot0.name.texts[1]
  244.             slot12 = slot0.role.__cname

  245.             slot0.guildName = getGuildName(slot11)
  246.             local lastSendTime = slot0.lastSendTime
  247.             if not lastSendTime then
  248.                 slot0.lastSendTime = current - 10
  249.                 lastSendTime = current - 10
  250.             end

  251.             local diff = current - lastSendTime
  252.             if slot12 == "hero" and not slot9 and not slot0.guildName and diff > 3 then
  253.                 slot0.lastSendTime = current
  254.                 --[[net.send({
  255.                     CM_QUERYUSERSTATE,
  256.                     recog = slot0.role.roleid,
  257.                     param = slot0.x,
  258.                     tag = slot0.y
  259.                 })
  260.                 net.send({
  261.                     CM_GUILDALLY_LIST,
  262.                     0,
  263.                     recog = slot0.role.roleid,
  264.                     param = slot0.x,
  265.                     tag = slot0.y
  266.                 })]]
  267.                 pushCMD({
  268.                     CM_QUERYUSERSTATE,
  269.                     recog = slot0.role.roleid,
  270.                     param = slot0.x,
  271.                     tag = slot0.y
  272.                 })

  273.                 pushCMD({
  274.                     CM_GUILDALLY_LIST,
  275.                     0,
  276.                     recog = slot0.role.roleid,
  277.                     param = slot0.x,
  278.                     tag = slot0.y
  279.                 })
  280.             end
  281.         end

  282.         step = step..'555 '
  283.     end

  284.     --if not slot10 or slot10 == '' then
  285.     --        slot10 = '行会'
  286.     --end

  287.     slot10 = slot0.guildName

  288.     local __cname = slot0.role.__cname
  289.     local prefix = def.sfIp
  290.     if not prefix then
  291.         prefix = 'FDSAFLKJLKJDFASEASDFASD'
  292.     end

  293.     prefix = ''--def.sfIp

  294.     if slot10 and slot10 ~= "" then
  295.         local slot11 = "< "
  296.         local slot12 = slot10
  297.         local slot13 = " >"
  298.         slot11 = slot11 .. slot12 .. slot13

  299.         if not slot3.setting.base.showGuildName or slot9 then
  300.             if slot7 == slot11 then
  301.                 table.remove(slot0.name.texts)
  302.             end
  303.         elseif stringEnds(slot7, "(沙巴克)") then
  304.             slot13 = slot11
  305.             local slot14 = " (沙巴克)"
  306.             slot13 = slot13 .. slot14
  307.             slot0.name.texts[slot8] = slot13..prefix
  308.         elseif slot7 ~= slot11 then
  309.             slot0.name.texts[slot8 + 1] = slot11..prefix
  310.         end
  311.     end

  312.     if slot0.role.marryName then
  313.         local slot11 = slot0.role.marryName

  314.         if slot11 == "" then
  315.             if slot0.name.texts[3] then
  316.                 slot0.name.texts[2] = slot0.name.texts[3]
  317.                 slot0.name.texts[3] = nil
  318.             else
  319.                 slot0.name.texts[2] = nil
  320.             end
  321.         else
  322.             local slot11 = ""
  323.             local slot12 = slot0.role.sex
  324.             local slot13
  325.             local slot14

  326.             if slot12 == 0 then
  327.                 slot12 = "["
  328.                 slot13 = slot0.role.marryName
  329.                 slot14 = " 的丈夫]"
  330.             else
  331.                 slot12 = slot0.role.sex

  332.                 if slot12 == 1 then
  333.                     slot12 = "["
  334.                     slot13 = slot0.role.marryName
  335.                     slot14 = " 的妻子]"
  336.                     slot11 = slot12 .. slot13 .. slot14
  337.                 end
  338.             end

  339.             if slot0.name.texts[2] and not string.find(slot0.name.texts[2], "的丈夫") then
  340.                 if not string.find(slot0.name.texts[2], "的妻子") then
  341.                     slot0.name.texts[3] = slot0.name.texts[2]
  342.                 end
  343.             end

  344.             slot0.name.texts[2] = slot12 .. slot13 .. slot14
  345.         end
  346.     end

  347.     for i = #slot0.name.texts,1,-1 do
  348.         local current = slot0.name.texts[i]
  349.         local prep = slot0.name.texts[i-1]

  350.         if current and prep then
  351.             if current == prep then
  352.                 table.remove(slot0.name.texts,i)
  353.             end
  354.         end
  355.     end

  356.     if slot2 then
  357.         slot0:updateSetName()
  358.     else
  359.         slot0.buf.name = true
  360.     end

  361.     slot0:setDirty(true)
  362. end
  363. end

  364. return mark
复制代码








上一篇:战神引擎客户端修改ip源码完整明文版mir2.def.init
下一篇:Zircon传奇3源码C#实现动态域名登陆游戏
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|美林GM论坛 ( 蜀ICP备2020030293号-2 )|网站地图

禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.如遇版权问题,请及时QQ联系

GMT+8, 2024-4-27 16:42 , Processed in 0.318209 second(s), 48 queries .

Powered by Discuz! X3.5

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表