private DeleteFormedParty ( int partynetid ) : void | ||
partynetid | int | |
리턴 | void |
void LeaveParty() { try { //Make sure the party isnt null to prevent errors. if (Character.Network.Party != null) { //Remove the character member info Character.Network.Party.Members.Remove(Character.Information.UniqueID); //Remove client Character.Network.Party.MembersClient.Remove(client); //If the owner removes the party set new leader if (Character.Information.UniqueID == Character.Network.Party.LeaderID) { //Repeat for each member in the party foreach (int partymembers in Character.Network.Party.Members) { Systems partymember = GetPlayer(partymembers); //Send party update data to player client.Send(Packet.Party_Data(1, 0)); //If the count is 1, we remove the party information if (partymember != null) { if (Character.Network.Party.Members.Count == 1) { //If its a formed party remove the entry. (check). if (Character.Network.Party.IsFormed) { DeleteFormedParty(Character.Network.Party.ptid); } //Remove party member from member list partymember.Character.Network.Party.Members.Remove(partymember.Character.Information.UniqueID); //Remove the party member client from the list partymember.Character.Network.Party.MembersClient.Remove(partymember.client); //Set party to null partymember.Character.Network.Party = null; //Set bool to false so the player can join another party partymember.Character.Information.CheckParty = false; //Send packet to member partymember.client.Send(Packet.Party_Data(1, 0)); } //If more party members are in the party we dont remove the party. else { //Get first available member for new leader partymember.Character.Network.Party.LeaderID = Character.Network.Party.Members[0]; //Send update packet to member partymember.client.Send(Packet.Party_Data(9, Character.Network.Party.Members[0])); //Send removal of the user partymember.client.Send(Packet.Party_Data(3, Character.Information.UniqueID)); } } } //Set player information Character.Network.Party = null; Character.Information.CheckParty = false; } else { //Send party update data to player client.Send(Packet.Party_Data(1, 0)); //For each member in the party foreach (int partymember in Character.Network.Party.Members) { //Get player information Systems partym = GetPlayer(partymember); //If auto disband party if (Character.Network.Party.Members.Count == 1) { //If its a formed party remove the entry. (check). if (partym.Character.Network.Party.IsFormed) { partym.DeleteFormedParty(Character.Network.Party.ptid); } //Remove the owner member partym.Character.Network.Party.Members.Remove(this.Character.Information.UniqueID); //Remove the client partym.Character.Network.Party.MembersClient.Remove(this.client); //Set party to null partym.Character.Network.Party = null; //Bool to false so can be invited again partym.Character.Information.CheckParty = false; //Visual update packet partym.client.Send(Packet.Party_Data(1, 0)); } //If the player has enough players (Not auto disband). else { //Remove information for all party members partym.Character.Network.Party.Members.Remove(Character.Information.UniqueID); //Remove the client partym.Character.Network.Party.MembersClient.Remove(client); //Remove the id partym.client.Send(Packet.Party_Data(3, Character.Information.UniqueID)); //Set null party info partym.Character.Network.Party = null; //Set bool partym.Character.Information.CheckParty = false; } } //Set party network to null Character.Network.Party = null; //Set bool to false so player can go in new party. Character.Information.CheckParty = false; } } } catch (Exception ex) { Console.WriteLine("Leave party error {0}", ex); Systems.Debugger.Write(ex); } }
public static void oPCode(Decode de) { try { Systems sys = (Systems)de.Packet; sys.PacketInformation = de; //Console.WriteLine("Recv: (0x{0})", de.opcode.ToString("X4")); switch (de.opcode) { case 0x7481: break; case CLIENT_PING: case CLIENT_PING2: break; case CLIENT_PATCH: sys.Patch(); break; case CLIENT_CONNECTION: sys.Connect(); break; case CLIENT_CHARACTERSCREEN: sys.CharacterScreen(); sys.Ping(); break; case CLIENT_INGAME_REQUEST: sys.IngameLogin(); break; case CLIENT_INGAME_SUCCESS: sys.InGameSuccess(); break; case CLIENT_REQUEST_WEATHER: sys.LoadWeather(); break; case CLIENT_SIT: sys.Doaction(); break; case CLIENT_QUESTMARK: sys.QuestionMark(); break; case CLIENT_MOVEMENT: sys.Movement(); break; case CLIENT_ANGLE_MOVE: sys.Angle(); break; case CLIENT_SAVE_BAR: sys.Save(); break; case CLIENT_LEAVE_REQUEST: sys.LeaveGame(); break; case CLIENT_LEAVE_CANCEL: sys.CancelLeaveGame(); break; case CLIENT_ITEM_MOVE: sys.ItemMain(); break; case CLIENT_SELECT_OBJECT: sys.SelectObject(); break; case CLIENT_GM: sys.GM(); break; case CLIENT_EMOTE: sys.Emote(); break; case CLIENT_TELEPORTSTART: sys.Teleport_Start(); break; case CLIENT_TELEPORTDATA: sys.Teleport_Data(); break; case CLIENT_CHAT: sys.Chat(); break; case CLIENT_MAINACTION: sys.ActionMain(); break; case CLIENT_MASTERY_UP: sys.Mastery_Up(); break; case CLIENT_SKILL_UP: sys.Mastery_Skill_Up(); break; case CLIENT_GETUP: sys.Player_Up(); break; case CLIENT_REQUEST_PARTY: sys.NormalRequest(); break; case CLIENT_PARTY_REQUEST: sys.CharacterRequest(); break; case CLIENT_EXCHANGE_REQUEST: sys.Exchange_Request(); break; case CLIENT_EXCHANGE_WINDOWS_CLOSE: sys.Exchange_Close(); break; case CLIENT_EXCHANGE_ACCEPT: sys.Exchange_Accept(); break; case CLIENT_EXCHANGE_APPROVE: sys.Exchange_Approve(); break; case CLIENT_PARTY_ADDMEMBERS: sys.PartyAddmembers(); break; case CLIENT_PARTY_LEAVE: sys.LeaveParty(); break; case CLIENT_PARTY_BANPLAYER: sys.PartyBan(); break; case CLIENT_GUIDE: sys.Gameguide(); break; case CLIENT_PLAYER_UPDATE_INT: sys.InsertInt(); break; case CLIENT_PLAYER_UPDATE_STR: sys.InsertStr(); break; case CLIENT_PLAYER_HANDLE: sys.Handle(); break; case CLIENT_PLAYER_BERSERK: sys.Player_Berserk_Up(); break; case CLIENT_CLOSE_NPC: sys.Close_NPC(); break; case CLIENT_OPEN_NPC: sys.Open_NPC(); break; case CLIENT_NPC_BUYPACK: sys.Player_BuyPack(); break; case CLIENT_OPEN_WAREHOUSE: sys.Open_Warehouse(); break; case CLIENT_CLOSE_SCROLL: sys.StopScrollTimer(); break; case CLIENT_SAVE_PLACE: sys.SavePlace(); break; case CLIENT_ALCHEMY: sys.AlchemyElixirMain(); break; case CLIENT_ALCHEMY_CREATE_STONE: sys.AlchemyCreateStone(); break; case CLIENT_PET_MOVEMENT: sys.MovementPet(); break; case CLIENT_PET_TERMINATE: sys.HandleClosePet(); break; case CLIENT_PARTYMATCHING_LIST_REQUEST: sys.ListPartyMatching(Party); break; case CLIENT_CREATE_FORMED_PARTY: sys.CreateFormedParty(); break; case CLIENT_FORMED_PARTY_DELETE: sys.DeleteFormedParty(0); break; case CLIENT_JOIN_FORMED_RESPONSE: sys.FormedResponse(); break; case CLIENT_CHANGE_PARTY_NAME: sys.RenameParty(); break; case CLIENT_JOIN_FORMED_PARTY: sys.JoinFormedParty(); break; case CLIENT_START_PK: sys.PkPlayer(); break; case CLIENT_GUILD: sys.GuildCreate(); break; case CLIENT_GUILD_TRANSFER: sys.GuildTransferLeaderShip(); break; case CLIENT_GUILD_PERMISSIONS: sys.GuildPermissions(); break; case CLIENT_GUILD_PROMOTE: sys.GuildPromote(); break; case CLIENT_GUILD_DISBAND: sys.GuildDisband(); break; case CLIENT_GUILD_MESSAGE: sys.GuildMessage(); break; case CLIENT_OPEN_GUILD_STORAGE: sys.GuildStorage(); break; case CLIENT_CLOSE_GUILD_STORAGE: sys.GuildStorageClose(); break; case CLIENT_GUILD_WAR_GOLD: sys.GuildWarGold(); break; case CLIENT_OPEN_GUILD_STORAGE2: sys.GuildStorage2(); break; case CLIENT_GUILD_KICK: sys.KickFromGuild(); break; case CLIENT_GUILD_LEAVE: sys.GuildLeave(); break; case CLIENT_GUILD_TITLE_SET: sys.GuildTitle(); break; case CLIENT_GUILD_INVITE: sys.GuildInvite(); break; case CLIENT_GUILD_DONATE_GP: sys.DonateGP(); break; case CLIENT_GACHA_PLAY: //Add function break; case CLIENT_JOIN_MERC: sys.JoinMerc(); break; case CLIENT_RANKING_LISTS: sys.RankList(); break; case CLIENT_PREV_JOB: sys.PrevJob(); break; case CLIENT_HONOR_RANK: sys.HonorRank(); break; case CLIENT_PM_MESSAGE: sys.PrivateMessage(); break; case CLIENT_PM_SEND: sys.PrivateMessageSend(); break; case CLIENT_PM_OPEN: sys.PrivateMessageOpen(); break; case CLIENT_PM_DELETE: sys.PrivateMessageDelete(); break; case CLIENT_PET_UNSUMMON: sys.UnSummonPet(); break; case CLIENT_PET_RENAME: sys.RenamePet(); break; case CLIENT_GPET_SETTINGS: sys.GrabPetSettings(); break; case CLIENT_MAKE_ALIAS: sys.MakeAlias(); break; case CLIENT_LEAVE_JOB: sys.LeaveJob(); break; case CLIENT_DISSEMBLE_ITEM: sys.BreakItem(); break; case CLIENT_STALL_OPEN: sys.StallOpen(); break; case CLIENT_STALL_CLOSE: sys.StallClose(); break; case CLIENT_STALL_BUY: sys.StallBuy(); break; case CLIENT_STALL_ACTION: sys.StallMain(); break; case CLIENT_STALL_OTHER_OPEN: sys.EnterStall(); break; case CLIENT_STALL_OTHER_CLOSE: sys.LeaveStall(); break; case CLIENT_PVP: sys.StartPvpTimer(10000); break; case CLIENT_ALCHEMY_STONE: sys.AlchemyStoneMain(); break; case CLIENT_ITEM_MALL_WEB: sys.ItemMallWeb(); break; case CLIENT_ITEM_STORAGE_BOX: sys.ItemStorageBox(); break; case CLIENT_ITEM_BOX_LOG: sys.ItemStorageBoxLog(); break; case CLIENT_FRIEND_REMOVAL: sys.FriendRemoval(); break; case CLIENT_FRIEND_INVITE: sys.FriendAdd(); break; case CLIENT_FRIEND_GROUP: sys.FriendGroup("ADD"); break; case CLIENT_FRIEND_GROUP_REMOVE: sys.FriendGroup("REMOVE"); break; case CLIENT_FRIEND_GROUP_MANAGE_FRIEND: sys.FriendGroup("MOVE"); break; case CLIENT_FRIEND_INVITE_RESPONSE: sys.FriendAddResponse(); break; case CLIENT_UNION_APPLY: sys.unionapply(); break; case CLIENT_ICON_REQUEST: sys.RequestIcons(); break; default: Print.Format("(0x{0}) {1}", de.opcode.ToString("X4"), Decode.StringToPack(sys.PacketInformation.buffer)); break; } } catch (Exception ex) { Systems.Debugger.Write(ex); } }
void PartyBan() { try { //Open our packet reader PacketReader Reader = new PacketReader(PacketInformation.buffer); int TargetID = Reader.Int32(); Reader.Close(); //Get targeted player information Systems s = GetPlayers(TargetID); //Remove id of the member Character.Network.Party.Members.Remove(s.Character.Information.UniqueID); //Remove the client of the member Character.Network.Party.MembersClient.Remove(s.client); //Repeat for each member the updated party information foreach (int partymember in Character.Network.Party.Members) { //Get player information for the next member Systems partym = GetPlayer(partymember); //Remove the kicked player partym.Character.Network.Party.Members.Remove(s.Character.Information.UniqueID); partym.Character.Network.Party.MembersClient.Remove(s.client); //If we have one member remaining in the party we disband the party if (partym.Character.Network.Party.Members.Count == 1) { //If its formed in the list remove the listening if (partym.Character.Network.Party.IsFormed) { partym.DeleteFormedParty(Character.Network.Party.ptid); } //Send update packet to the party member partym.client.Send(Packet.Party_Data(1, 0)); //Send update packet to the current player client.Send(Packet.Party_Data(1, 0)); //Set party to null for the current player Character.Network.Party = null; //Set party to null for the remaining member partym.Character.Network.Party = null; //Set bool for current player Character.Information.CheckParty = false; //Set bool for the remaining party member partym.Character.Information.CheckParty = false; } //If there are more members (Not autodisband party). else { //Send the update packet to the party member partym.client.Send(Packet.Party_Data(3, TargetID)); } } //Set the kicked player bool to false s.Character.Information.CheckParty = false; //Remove the party network for the kicked player s.Character.Network.Party = null; //Send update packet to the kicked player s.client.Send(Packet.Party_Data(1, 0)); } catch (Exception ex) { Console.WriteLine("Party Ban Error {0}", ex); Systems.Debugger.Write(ex); } }