internal void DismissGroup(GroupInfo group) { if (null == group) { return; } UserInfo leader = LobbyServer.Instance.DataProcessScheduler.GetUserInfo(group.CreatorGuid); TeamOperateResult result = TeamOperateResult.OR_Dismiss; foreach (GroupMemberInfo m in group.Members) { UserInfo user = LobbyServer.Instance.DataProcessScheduler.GetUserInfo(m.Guid); if (null != user) { JsonMessageWithGuid msg = new JsonMessageWithGuid(JsonMessageID.SyncLeaveGroup); msg.m_Guid = m.Guid; ArkCrossEngineMessage.Msg_LC_SyncLeaveGroup protoData = new ArkCrossEngineMessage.Msg_LC_SyncLeaveGroup(); if (null != leader) { protoData.m_GroupNick = leader.Nickname; } protoData.m_Result = (int)result; msg.m_ProtoData = protoData; JsonMessageDispatcher.SendDcoreMessage(leader.NodeName, msg); user.Group = null; } } m_Groups.Remove(group.CreatorGuid); if (null != group.Members) { group.Members.Clear(); } recycles.Enqueue(group); }
private void HandleSyncLeaveGroup(JsonMessage lobbyMsg) { RoleInfo role_info = LobbyClient.Instance.CurrentRole; if (null == role_info) { return; } GroupInfo group = role_info.Group; if (null == group) { return; } JsonData jsonData = lobbyMsg.m_JsonData; ArkCrossEngineMessage.Msg_LC_SyncLeaveGroup protoData = lobbyMsg.m_ProtoData as ArkCrossEngineMessage.Msg_LC_SyncLeaveGroup; if (null != protoData) { string group_nick = protoData.m_GroupNick; TeamOperateResult result = (TeamOperateResult)protoData.m_Result; if (TeamOperateResult.OR_Succeed == result) { group.Reset(); } GfxSystem.PublishGfxEvent("ge_leave_group_result", "group", group_nick, result); switch (result) { case TeamOperateResult.OR_Succeed: GfxSystem.PublishGfxEvent("ge_quitFromABandUserJoined", "gt"); break; case TeamOperateResult.OR_Kickout: GfxSystem.PublishGfxEvent("ge_quitFromABandUserJoined", "gt"); break; case TeamOperateResult.OR_Dismiss: GfxSystem.PublishGfxEvent("ge_breakBandUserJoined", "gt"); break; } } }