VoiceManagerProxy.lua 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. local DebugProxy = requireProxy("DebugProxy")
  2. local VoiceManagerProxy = class("VoiceManagerProxy", DebugProxy)
  3. VoiceManagerProxy.NAME = global.ProxyTable.VoiceManagerProxy
  4. VoiceManagerProxy.VOICE_TYPE = {
  5. INIT = 1, --初始化
  6. GUILD_CHANGE = 2, --行会更变
  7. GUILD_ROLE_CHANGE = 3, --行会角色更变
  8. TEAM = 4, --组队操作
  9. EXIT = 5, --游戏退出
  10. TEAM_UPDATE = 6, --队伍队长信息刷新 --针对2.0
  11. }
  12. -- 1创建队伍 2解散队伍 3加入队伍 4离开队伍 5换队长 6行会角色信息同步 7踢人
  13. local TEAM_CHANGE_NEW= {
  14. CREATE = 1,
  15. DISMISS = 2,
  16. JOIN_IN = 3,
  17. LEAVE = 4,
  18. UPDATE = 5,
  19. SYNC_UPATE = 6, -- 行会角色信息同步
  20. REMOVE = 7, -- 踢人
  21. }
  22. local GUILD_CHANGE_NEW = {
  23. CREATE = 1, -- 创建
  24. DISMISS = 2, -- 解散
  25. JOIN_IN = 3, -- 加入
  26. LEAVE = 4, -- 离开
  27. UPDATE = 5, -- 职位变更
  28. SYNC_UPATE = 6, -- 行会角色信息同步
  29. REMOVE = 7, -- 踢人
  30. }
  31. -- 游戏+区服唯一标识
  32. local function GetUniqueId()
  33. local loginProxy = global.Facade:retrieveProxy( global.ProxyTable.Login )
  34. local currModule = global.L_ModuleManager:GetCurrentModule()
  35. local gameid = currModule:GetOperID()
  36. local serverId = loginProxy:GetSelectedServerId()
  37. return string.format("%s%s",gameid,serverId)
  38. end
  39. function VoiceManagerProxy:ctor()
  40. VoiceManagerProxy.super.ctor(self)
  41. -- ios旋转屏幕会调用初始化, 暂时没找到问题, 做个状态检测
  42. self.isInit = false
  43. end
  44. --[[
  45. GameInfo {
  46. // 游戏id
  47. var gameId: Int = 0
  48. // 游戏名称
  49. var gameName: String = ""
  50. // 区服名
  51. var gameServer: String = ""
  52. // 行会id
  53. var guildId: Int = 0
  54. // 行会名称
  55. var guildName: String = ""
  56. // 头像
  57. var headImg: String = ""
  58. // 角色id 0会长 1副会长 2其他
  59. var roleId: Int = 2
  60. // 区服id
  61. var serverId: Int = 0
  62. // 游戏+区服唯一标识
  63. var uniqueId: String = ""
  64. // 人员id
  65. var userId: Int = 0
  66. // 用户昵称
  67. var userName: String = ""
  68. // 组队角色id 0队长 2其他 非必传
  69. var teamRoleId: Int = 2
  70. // 组队id,非必传
  71. var teamId: Int = 0
  72. }
  73. ]]
  74. function VoiceManagerProxy:VoiceInit( msgData )
  75. if self.isInit then
  76. return
  77. end
  78. self.isInit = true
  79. local data = {
  80. voiceType = VoiceManagerProxy.VOICE_TYPE.INIT --初始化类型
  81. }
  82. local AuthProxy = global.Facade:retrieveProxy( global.ProxyTable.AuthProxy )
  83. local loginProxy = global.Facade:retrieveProxy( global.ProxyTable.Login )
  84. local GuildProxy = global.Facade:retrieveProxy( global.ProxyTable.GuildProxy )
  85. local GuildPlayerProxy = global.Facade:retrieveProxy( global.ProxyTable.GuildPlayerProxy )
  86. local TeamProxy = global.Facade:retrieveProxy( global.ProxyTable.TeamProxy )
  87. local propertyProxy = global.Facade:retrieveProxy( global.ProxyTable.PlayerProperty )
  88. local isBoxLogin = global.L_GameEnvManager:GetEnvDataByKey("isBoxLogin") and global.L_GameEnvManager:GetEnvDataByKey("isBoxLogin") == 1 --盒子登录
  89. data.enterType = isBoxLogin and 1 or 0 --0 游戏 1 盒子
  90. -- data.emOptions = nil --环信初始化配置,非必传
  91. if isBoxLogin then
  92. data.boxUserId = AuthProxy:GetUID()
  93. end
  94. local GameInfo = {} --游戏相关信息 必传
  95. local currModule = global.L_ModuleManager:GetCurrentModule()
  96. local gameid = currModule:GetOperID()
  97. GameInfo.gameId = gameid
  98. GameInfo.gameName = currModule:GetName()
  99. GameInfo.gameServer = loginProxy:GetSelectedServerName()
  100. GameInfo.guildId = GuildPlayerProxy:GetGuildId()
  101. GameInfo.guildName = GuildPlayerProxy:GetGuildName()
  102. GameInfo.headImg = ""
  103. local guildJob = GuildPlayerProxy:GetRank() or 0
  104. guildJob = guildJob - 1
  105. GameInfo.roleId = (guildJob > 2 or guildJob < 0) and 2 or guildJob
  106. GameInfo.serverId = loginProxy:GetSelectedServerId()
  107. GameInfo.uniqueId = GetUniqueId() -- 游戏+区服唯一标识
  108. GameInfo.userId = global.playerManager:GetMainPlayerID()
  109. GameInfo.userName = propertyProxy:GetName()
  110. GameInfo.teamRoleId = ""
  111. GameInfo.teamId = 0
  112. GameInfo.account = AuthProxy:GetUID()
  113. GameInfo.guildNumber= GuildProxy:GetGuildMember()
  114. data.GameInfo = GameInfo
  115. if GameInfo.roleId == 0 then --会长传创建行会的时间戳
  116. GameInfo.guildCreateTime = GuildPlayerProxy:GetGuildCreateTime()
  117. end
  118. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  119. NativeBridgeProxy:GN_Voice( data )
  120. self:VoiceInit_New()
  121. end
  122. function VoiceManagerProxy:VoiceGuildChange( msgData )
  123. local data = {
  124. voiceType = VoiceManagerProxy.VOICE_TYPE.GUILD_CHANGE --行会变更类型
  125. }
  126. local GuildPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildPlayerProxy)
  127. local AuthProxy = global.Facade:retrieveProxy( global.ProxyTable.AuthProxy )
  128. data.operatorType = msgData.operatorType
  129. data.guildId = msgData.guildId or GuildPlayerProxy:GetGuildId()
  130. data.uniqueId = GetUniqueId() --游戏+区服唯一标识
  131. data.userId = global.playerManager:GetMainPlayerID()
  132. if msgData.operatorType == GuildPlayerProxy.ChangeType.CREATE then --如果是创建就传创建时间戳
  133. data.guildCreateTime = GuildPlayerProxy:GetGuildCreateTime()
  134. data.guildName = GuildPlayerProxy:GetGuildName()
  135. end
  136. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  137. NativeBridgeProxy:GN_Voice( data )
  138. end
  139. function VoiceManagerProxy:VoiceGuildRoleChange( msgData )
  140. local data = {
  141. voiceType = VoiceManagerProxy.VOICE_TYPE.GUILD_ROLE_CHANGE --行会角色变更类型
  142. }
  143. local GuildPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildPlayerProxy)
  144. local AuthProxy = global.Facade:retrieveProxy( global.ProxyTable.AuthProxy )
  145. data.guildId = GuildPlayerProxy:GetGuildId()
  146. local guildJob = GuildPlayerProxy:GetRank() or 0
  147. guildJob = guildJob - 1
  148. data.roleId = (guildJob > 2 or guildJob < 0) and 2 or guildJob
  149. data.uniqueId = GetUniqueId() --游戏+区服唯一标识
  150. data.userId = global.playerManager:GetMainPlayerID()
  151. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  152. NativeBridgeProxy:GN_Voice( data )
  153. end
  154. function VoiceManagerProxy:VoiceTeam( msgData )
  155. local data = {
  156. voiceType = VoiceManagerProxy.VOICE_TYPE.TEAM --组队操作
  157. }
  158. local TeamProxy = global.Facade:retrieveProxy(global.ProxyTable.TeamProxy)
  159. local AuthProxy = global.Facade:retrieveProxy( global.ProxyTable.AuthProxy )
  160. data.guildId = msgData.teamId or TeamProxy:GetTeamLeaderId() --队伍id
  161. data.operatorType = msgData.operateType --0创建队伍 1解散队伍 2加入队伍 3离开队伍
  162. local job = msgData.myRank or TeamProxy:GetMyRank() --1 队长 0其它
  163. job = job == 1 and 0 or 2
  164. data.roleId = job --0队长 2其他
  165. data.uniqueId = GetUniqueId() --游戏+区服唯一标识
  166. data.userId = msgData.teamUserId or global.playerManager:GetMainPlayerID()
  167. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  168. NativeBridgeProxy:GN_Voice( data )
  169. end
  170. function VoiceManagerProxy:VoiceExit( msgData )
  171. self.isInit = false
  172. local data = {
  173. voiceType = VoiceManagerProxy.VOICE_TYPE.EXIT --退出
  174. }
  175. local GuildPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildPlayerProxy)
  176. local AuthProxy = global.Facade:retrieveProxy( global.ProxyTable.AuthProxy )
  177. data.guildId = GuildPlayerProxy:GetGuildId()
  178. data.uniqueId = GetUniqueId() --游戏+区服唯一标识
  179. data.userId = global.playerManager:GetMainPlayerID()
  180. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  181. NativeBridgeProxy:GN_Voice( data )
  182. self:VoiceExit_New()
  183. end
  184. -----------------------------------------new Voice 2.0 begin-----------------------------------------------------
  185. function VoiceManagerProxy:GetVoiceNormalData_New()
  186. local data = {}
  187. local AuthProxy = global.Facade:retrieveProxy( global.ProxyTable.AuthProxy )
  188. local loginProxy = global.Facade:retrieveProxy( global.ProxyTable.Login )
  189. local GuildProxy = global.Facade:retrieveProxy( global.ProxyTable.GuildProxy )
  190. local GuildPlayerProxy = global.Facade:retrieveProxy( global.ProxyTable.GuildPlayerProxy )
  191. local TeamProxy = global.Facade:retrieveProxy( global.ProxyTable.TeamProxy )
  192. local propertyProxy = global.Facade:retrieveProxy( global.ProxyTable.PlayerProperty )
  193. local currModule = global.L_ModuleManager:GetCurrentModule()
  194. local guildId = GuildPlayerProxy:GetGuildId()
  195. local teamId = TeamProxy:GetTeamLeaderId()
  196. local guildRoleType = GuildPlayerProxy:GetRank()
  197. local teamRoleType = TeamProxy:GetMyRank()
  198. data.gameId = tostring(currModule:GetOperID())
  199. data.serverId = loginProxy:GetSelectedServerId()
  200. data.userId = tostring( AuthProxy:GetUID() )
  201. data.roleId = global.playerManager:GetMainPlayerID()
  202. data.roleName = loginProxy:GetSelectedRoleName()
  203. if guildId and string.len(guildId) > 0 then
  204. data.guildId = guildId
  205. end
  206. if teamId and teamId ~= 0 then
  207. data.teamId = teamId
  208. end
  209. if data.guildId then
  210. data.roleType = guildRoleType -- 1 会长 2 副会长 3 成员
  211. if guildRoleType ~= 1 and guildRoleType ~= 2 then
  212. data.roleType = 3
  213. end
  214. end
  215. if data.teamId then
  216. data.teamRoleType = teamRoleType
  217. if teamRoleType ~= 1 then
  218. data.teamRoleType = 3
  219. end
  220. end
  221. return data
  222. end
  223. -- 初始化
  224. function VoiceManagerProxy:VoiceInit_New( msgData )
  225. local data = self:GetVoiceNormalData_New()
  226. data.voiceType = VoiceManagerProxy.VOICE_TYPE.INIT -- 初始化类型
  227. data.printName = "初始化"
  228. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  229. NativeBridgeProxy:GN_Voice_New( data )
  230. end
  231. --[[
  232. 行会操作:
  233. 1、会长-创建行会 由会长调 operationType-1 roleType changeRoleType changeRoleId都传会长本人id或type
  234. 2、会长-解散行会 由会长调 operationType-2 roleType changeRoleType changeRoleId都传会长本人id或type
  235. 3、成员新加入行会 由成员调 operationType-3 roleType changeRoleType changeRoleId都传成员本人id或type
  236. 4、成员/副会长主动离开行会 由成员/副会长调 operationType-4 roleType changeRoleType changeRoleId都传成员/副会长本人id或type
  237. 5、行会角色变更 会长转让 由会长调 perationType-5 roleType传会长转让后type changeRoleType changeRoleId都传新会长id或type
  238. 5、行会角色变更 会长指定职位变更 由会长调 operationType-5 roleType传会长type changeRoleType changeRoleId都传新职位的id或type
  239. 6、行会角色信息同步 使用改名卡的人调用 operationType-6 roleType changeRoleType changeRoleId都传本人id或type
  240. 7、会长/副会长踢人 由会长/副会长调 operationType-7 roleType传会长/副会长type changeRoleType changeRoleId传被踢者的type和ID
  241. ]]
  242. -- 创建行会
  243. function VoiceManagerProxy:VoiceGuildCreate_New( msgData )
  244. if not msgData then
  245. msgData = {}
  246. end
  247. local data = self:GetVoiceNormalData_New()
  248. if data.roleType ~= 1 then
  249. return
  250. end
  251. data.voiceType = VoiceManagerProxy.VOICE_TYPE.GUILD_CHANGE
  252. data.operationType = GUILD_CHANGE_NEW.CREATE
  253. data.changeRoleType = data.roleType -- 1 会长 2 副会长 3 成员
  254. data.changeRoleId = data.roleId
  255. data.printName = "创建行会"
  256. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  257. NativeBridgeProxy:GN_Voice_New( data )
  258. end
  259. -- 解散行会
  260. function VoiceManagerProxy:VoiceGuildDisMiss_New( msgData )
  261. if not msgData then
  262. msgData = {}
  263. end
  264. local data = self:GetVoiceNormalData_New()
  265. data.voiceType = VoiceManagerProxy.VOICE_TYPE.GUILD_CHANGE
  266. data.operationType = GUILD_CHANGE_NEW.DISMISS
  267. data.changeRoleType = data.roleType -- 1 会长 2 副会长 3 成员
  268. data.changeRoleId = data.roleId
  269. data.guildId = msgData.guildId
  270. data.printName = "解散行会"
  271. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  272. NativeBridgeProxy:GN_Voice_New( data )
  273. end
  274. -- 新加入行会
  275. function VoiceManagerProxy:VoiceGuildJoinIn_New( msgData )
  276. if not msgData then
  277. msgData = {}
  278. end
  279. local data = self:GetVoiceNormalData_New()
  280. data.voiceType = VoiceManagerProxy.VOICE_TYPE.GUILD_CHANGE
  281. data.operationType = GUILD_CHANGE_NEW.JOIN_IN
  282. data.changeRoleType = data.roleType -- 1 会长 2 副会长 3 成员
  283. data.changeRoleId = data.roleId
  284. data.printName = "加入行会"
  285. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  286. NativeBridgeProxy:GN_Voice_New( data )
  287. end
  288. -- 离开行会
  289. function VoiceManagerProxy:VoiceGuildLeave_New( msgData )
  290. -- body
  291. if not msgData then
  292. msgData = {}
  293. end
  294. local data = self:GetVoiceNormalData_New()
  295. data.voiceType = VoiceManagerProxy.VOICE_TYPE.GUILD_CHANGE
  296. data.operationType = GUILD_CHANGE_NEW.LEAVE
  297. data.changeRoleType = data.roleType -- 1 会长 2 副会长 3 成员
  298. data.changeRoleId = data.roleId
  299. data.guildId = msgData.guildId
  300. data.printName = "离开行会"
  301. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  302. NativeBridgeProxy:GN_Voice_New( data )
  303. end
  304. -- 行会角色职业变更 由之前的会长操作
  305. function VoiceManagerProxy:VoiceGuildRankChange_New( msgData )
  306. -- body
  307. if not msgData then
  308. msgData = {}
  309. end
  310. -- 1 会长 2 副会长 3 成员
  311. if msgData.newRank then
  312. if msgData.newRank ~= 1 and msgData.newRank ~= 2 then
  313. msgData.newRank = 3
  314. end
  315. end
  316. local data = self:GetVoiceNormalData_New()
  317. data.voiceType = VoiceManagerProxy.VOICE_TYPE.GUILD_ROLE_CHANGE
  318. data.operationType = GUILD_CHANGE_NEW.UPDATE
  319. data.changeRoleType = msgData.newRank or data.roleType -- 1 会长 2 副会长 3 成员
  320. data.changeRoleId = msgData.guildRoleId or data.roleId -- userid
  321. data.printName = "行会角色职业变更"
  322. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  323. NativeBridgeProxy:GN_Voice_New( data )
  324. end
  325. -- 行会角色信息同步
  326. function VoiceManagerProxy:VoiceGuildSyncChange_New( msgData )
  327. -- body
  328. if not msgData then
  329. msgData = {}
  330. end
  331. local data = self:GetVoiceNormalData_New()
  332. data.voiceType = VoiceManagerProxy.VOICE_TYPE.GUILD_CHANGE
  333. data.operationType = GUILD_CHANGE_NEW.SYNC_UPATE
  334. data.changeRoleType = data.roleType -- 1 会长 2 副会长 3 成员
  335. data.changeRoleId = data.roleId
  336. data.printName = "行会角色信息同步"
  337. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  338. NativeBridgeProxy:GN_Voice_New( data )
  339. end
  340. -- 行会踢人
  341. function VoiceManagerProxy:VoiceGuildRemove_New( msgData )
  342. if not msgData then
  343. msgData = {}
  344. end
  345. -- 1 会长 2 副会长 3 成员
  346. if msgData.removeRank then
  347. if msgData.removeRank ~= 1 then
  348. msgData.removeRank = 3
  349. end
  350. end
  351. local data = self:GetVoiceNormalData_New()
  352. data.voiceType = VoiceManagerProxy.VOICE_TYPE.GUILD_CHANGE
  353. data.operationType = GUILD_CHANGE_NEW.REMOVE
  354. data.changeRoleType = msgData.removeRank -- 1 会长 2 副会长 3 成员
  355. data.changeRoleId = msgData.guildRoleId
  356. data.printName = "行会踢人"
  357. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  358. NativeBridgeProxy:GN_Voice_New( data )
  359. end
  360. --[[
  361. 组队操作:
  362. 1、队长-创建组队 由队长调 operationType-1 teamRoleType changeRoleType changeRoleId都传队长本人id或type
  363. 2、队长-解散行会 由队长调 operationType-2 teamRoleType changeRoleType changeRoleId都传队长本人id或type
  364. 3、成员新加入组队 由成员调 operationType-3 teamRoleType changeRoleType changeRoleId都传成员本人id或type
  365. 4、成员离开组队 由成员调 operationType-4 teamRoleType changeRoleType changeRoleId都传成员本人id或type
  366. 5、队长角色变更(队长离开队伍/转让队长给成员)统一由新队长调用 老队长不用调 operationType-5 teamRoleType changeRoleType changeRoleId都传新队长本人id或type
  367. 6、组队角色信息同步 使用改名卡的人调用 operationType-6 teamRoleType changeRoleType changeRoleId都传本人id或type
  368. 7、队长踢人 由队长调 operationType-7 teamRoleType 传队长type changeRoleType changeRoleId传被踢者的type和ID
  369. ]]
  370. -- 队伍创建
  371. function VoiceManagerProxy:VoiceTeamCreate_New( msgData )
  372. -- body
  373. if not msgData then
  374. msgData = {}
  375. end
  376. local data = self:GetVoiceNormalData_New()
  377. data.voiceType = VoiceManagerProxy.VOICE_TYPE.TEAM
  378. data.operationType = TEAM_CHANGE_NEW.CREATE
  379. data.changeRoleType = data.teamRoleType -- 1 队长 3 队员
  380. data.changeRoleId = data.roleId
  381. data.printName = "队伍创建"
  382. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  383. NativeBridgeProxy:GN_Voice_New( data )
  384. end
  385. -- 队伍解散
  386. function VoiceManagerProxy:VoiceTeamDisMiss_New( msgData )
  387. -- body
  388. if not msgData then
  389. msgData = {}
  390. end
  391. local data = self:GetVoiceNormalData_New()
  392. data.voiceType = VoiceManagerProxy.VOICE_TYPE.TEAM
  393. data.operationType = TEAM_CHANGE_NEW.DISMISS
  394. data.changeRoleType = data.teamRoleType -- 1 队长 3 队员
  395. data.changeRoleId = data.roleId
  396. data.printName = "队伍解散"
  397. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  398. NativeBridgeProxy:GN_Voice_New( data )
  399. end
  400. -- 队伍新队员加入
  401. function VoiceManagerProxy:VoiceTeamJoinIn_New( msgData )
  402. if not msgData then
  403. msgData = {}
  404. end
  405. local data = self:GetVoiceNormalData_New()
  406. data.voiceType = VoiceManagerProxy.VOICE_TYPE.TEAM
  407. data.operationType = TEAM_CHANGE_NEW.JOIN_IN
  408. data.changeRoleType = data.teamRoleType -- 1 队长 3 队员
  409. data.changeRoleId = data.roleId
  410. data.printName = "队伍新队员加入"
  411. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  412. NativeBridgeProxy:GN_Voice_New( data )
  413. end
  414. -- 队员离开
  415. function VoiceManagerProxy:VoiceTeamLeave_New( msgData )
  416. if not msgData then
  417. msgData = {}
  418. end
  419. local data = self:GetVoiceNormalData_New()
  420. data.voiceType = VoiceManagerProxy.VOICE_TYPE.TEAM
  421. data.operationType = TEAM_CHANGE_NEW.LEAVE
  422. data.changeRoleType = data.teamRoleType -- 1 队长 3 队员
  423. data.changeRoleId = data.roleId
  424. data.printName = "队伍队员离开"
  425. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  426. NativeBridgeProxy:GN_Voice_New( data )
  427. end
  428. -- 队伍职位变更 由新队长操作
  429. function VoiceManagerProxy:VoiceTeamRankChange_New( msgData )
  430. -- body
  431. if not msgData then
  432. msgData = {}
  433. end
  434. local data = self:GetVoiceNormalData_New()
  435. data.voiceType = VoiceManagerProxy.VOICE_TYPE.TEAM
  436. data.operationType = TEAM_CHANGE_NEW.UPDATE
  437. data.changeRoleType = data.teamRoleType -- 1 队长 3 队员
  438. data.changeRoleId = msgData.roleId or data.roleId
  439. data.printName = "队伍职位变更"
  440. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  441. NativeBridgeProxy:GN_Voice_New( data )
  442. end
  443. -- 队伍角色信息同步
  444. function VoiceManagerProxy:VoiceTeamSyncChange_New( msgData )
  445. -- body
  446. if not msgData then
  447. msgData = {}
  448. end
  449. local data = self:GetVoiceNormalData_New()
  450. data.voiceType = VoiceManagerProxy.VOICE_TYPE.TEAM
  451. data.operationType = TEAM_CHANGE_NEW.SYNC_UPATE
  452. data.changeRoleType = data.teamRoleType -- 1 队长 3 队员
  453. data.changeRoleId = msgData.roleId or data.roleId
  454. data.printName = "队伍角色信息同步"
  455. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  456. NativeBridgeProxy:GN_Voice_New( data )
  457. end
  458. -- 队伍踢人 队长操作
  459. function VoiceManagerProxy:VoiceTeamRemove_New( msgData )
  460. -- body
  461. if not msgData then
  462. msgData = {}
  463. end
  464. local data = self:GetVoiceNormalData_New()
  465. data.voiceType = VoiceManagerProxy.VOICE_TYPE.TEAM
  466. data.operationType = TEAM_CHANGE_NEW.REMOVE
  467. data.changeRoleType = 3 -- 1 队长 3 队员
  468. data.changeRoleId = msgData.teamRoleId --队员id
  469. data.printName = "队伍踢人"
  470. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  471. NativeBridgeProxy:GN_Voice_New( data )
  472. end
  473. -- 队长更换 其他成员操作
  474. function VoiceManagerProxy:VoiceTeamUpdate_New( msgData )
  475. -- body
  476. if not msgData then
  477. msgData = {}
  478. end
  479. if msgData.newRank then
  480. if msgData.newRank ~= 1 then
  481. msgData.newRank = 3
  482. end
  483. end
  484. local data = self:GetVoiceNormalData_New()
  485. data.voiceType = VoiceManagerProxy.VOICE_TYPE.TEAM_UPDATE
  486. data.operationType = TEAM_CHANGE_NEW.UPDATE
  487. data.changeRoleType = 1 -- 1 队长 3 队员
  488. data.changeRoleId = msgData.roleId or data.roleId
  489. data.printName = "更换队长"
  490. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  491. NativeBridgeProxy:GN_Voice_New( data )
  492. end
  493. function VoiceManagerProxy:VoiceExit_New( msgData )
  494. local data = {
  495. voiceType = VoiceManagerProxy.VOICE_TYPE.EXIT --退出
  496. }
  497. local GuildPlayerProxy = global.Facade:retrieveProxy(global.ProxyTable.GuildPlayerProxy)
  498. local AuthProxy = global.Facade:retrieveProxy( global.ProxyTable.AuthProxy )
  499. data.guildId = GuildPlayerProxy:GetGuildId()
  500. data.uniqueId = GetUniqueId() --游戏+区服唯一标识
  501. data.userId = global.playerManager:GetMainPlayerID()
  502. data.printName = "退出"
  503. local NativeBridgeProxy = global.Facade:retrieveProxy( global.ProxyTable.NativeBridgeProxy )
  504. NativeBridgeProxy:GN_Voice_New( data )
  505. end
  506. -----------------------------------------new Voice 2.0 end-----------------------------------------------------
  507. return VoiceManagerProxy