mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	Kicked/Promote leader added but broke login. D/Cing now.
This commit is contained in:
		| @@ -81,10 +81,9 @@ | ||||
|     <Compile Include="actors\chara\player\Equipment.cs" /> | ||||
|     <Compile Include="actors\chara\player\Inventory.cs" /> | ||||
|     <Compile Include="actors\chara\Work.cs" /> | ||||
|     <Compile Include="actors\group\GroupInvitationRelationGroup.cs" /> | ||||
|     <Compile Include="actors\group\LinkshellGroup.cs" /> | ||||
|     <Compile Include="actors\group\PartyGroup.cs" /> | ||||
|     <Compile Include="actors\group\RetainerGroup.cs" /> | ||||
|     <Compile Include="actors\group\Group.cs" /> | ||||
|     <Compile Include="actors\group\Party.cs" /> | ||||
|     <Compile Include="actors\group\Relation.cs" /> | ||||
|     <Compile Include="actors\group\work\ContentWork.cs" /> | ||||
|     <Compile Include="actors\debug\Debug.cs" /> | ||||
|     <Compile Include="actors\director\Director.cs" /> | ||||
| @@ -94,7 +93,6 @@ | ||||
|     <Compile Include="actors\director\quest\QuestDirectorMan0u001.cs" /> | ||||
|     <Compile Include="actors\director\WeatherDirector.cs" /> | ||||
|     <Compile Include="actors\EventList.cs" /> | ||||
|     <Compile Include="actors\group\Group.cs" /> | ||||
|     <Compile Include="actors\group\work\GroupGlobalSave.cs" /> | ||||
|     <Compile Include="actors\group\work\GroupGlobalTemp.cs" /> | ||||
|     <Compile Include="actors\group\work\GroupMemberSave.cs" /> | ||||
| @@ -288,6 +286,7 @@ | ||||
|     <Compile Include="packets\WorldPackets\Send\Group\CreateLinkshellPacket.cs" /> | ||||
|     <Compile Include="packets\WorldPackets\Send\Group\DeleteLinkshellPacket.cs" /> | ||||
|     <Compile Include="packets\WorldPackets\Send\Group\ModifyLinkshellPacket.cs" /> | ||||
|     <Compile Include="packets\WorldPackets\Send\Group\PartyModifyPacket.cs" /> | ||||
|     <Compile Include="packets\WorldPackets\Send\SessionBeginConfirmPacket.cs" /> | ||||
|     <Compile Include="packets\WorldPackets\Send\SessionEndConfirmPacket.cs" /> | ||||
|     <Compile Include="Program.cs" /> | ||||
|   | ||||
| @@ -248,7 +248,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                         break; | ||||
|                     //Party Window Opened, Request State | ||||
|                     case 0x01C5: | ||||
|                         client.QueuePacket(BasePacket.CreatePacket(RecruiterStatePacket.BuildPacket(session.id, true, true, 1), true, false)); | ||||
|                         client.QueuePacket(BasePacket.CreatePacket(RecruiterStatePacket.BuildPacket(session.id, false, false, 0), true, false)); | ||||
|                         break; | ||||
|                     //Search Recruiting | ||||
|                     case 0x01C7: | ||||
|   | ||||
| @@ -33,6 +33,8 @@ namespace FFXIVClassic_Map_Server | ||||
|         private Dictionary<uint, ActorClass> actorClasses = new Dictionary<uint,ActorClass>(); | ||||
|         private Dictionary<ulong, Party> currentPlayerParties = new Dictionary<ulong, Party>(); //GroupId, Party object | ||||
|  | ||||
|         private Object groupLock = new Object(); | ||||
|  | ||||
|         private Server mServer; | ||||
|  | ||||
|         public WorldManager(Server server) | ||||
| @@ -700,37 +702,41 @@ namespace FFXIVClassic_Map_Server | ||||
|         //World server sent a party member list synch packet to the zone server. Add and update players that may be a part of it. | ||||
|         public void PartyMemberListRecieved(PartySyncPacket syncPacket) | ||||
|         { | ||||
|             Party group;          | ||||
|  | ||||
|             //If no members on this server, get out or clean | ||||
|             if (!currentPlayerParties.ContainsKey(syncPacket.partyGroupId) && syncPacket.memberActorIds.Length == 0) | ||||
|                 return; | ||||
|             else if (!currentPlayerParties.ContainsKey(syncPacket.partyGroupId) && syncPacket.memberActorIds.Length == 0) | ||||
|                 NoMembersInParty(currentPlayerParties[syncPacket.partyGroupId]); | ||||
|  | ||||
|             //Get or create group | ||||
|             if (!currentPlayerParties.ContainsKey(syncPacket.partyGroupId)) | ||||
|             lock (currentPlayerParties) | ||||
|             { | ||||
|                 group = new Party(syncPacket.partyGroupId, syncPacket.owner); | ||||
|                 currentPlayerParties.Add(syncPacket.partyGroupId, group); | ||||
|             } | ||||
|             else | ||||
|                 group = currentPlayerParties[syncPacket.partyGroupId]; | ||||
|                 Party group; | ||||
|  | ||||
|             currentPlayerParties[syncPacket.partyGroupId].members = syncPacket.memberActorIds.ToList(); | ||||
|                 //If no members on this server, get out or clean | ||||
|                 if (!currentPlayerParties.ContainsKey(syncPacket.partyGroupId) && syncPacket.memberActorIds.Length == 0) | ||||
|                     return; | ||||
|                 else if (!currentPlayerParties.ContainsKey(syncPacket.partyGroupId) && syncPacket.memberActorIds.Length == 0) | ||||
|                     NoMembersInParty(currentPlayerParties[syncPacket.partyGroupId]); | ||||
|  | ||||
|             //Add group to everyone | ||||
|             foreach (uint member in currentPlayerParties[syncPacket.partyGroupId].members) | ||||
|             { | ||||
|                 Session session = Server.GetServer().GetSession(member); | ||||
|                 //Get or create group | ||||
|                 if (!currentPlayerParties.ContainsKey(syncPacket.partyGroupId)) | ||||
|                 { | ||||
|                     group = new Party(syncPacket.partyGroupId, syncPacket.owner); | ||||
|                     currentPlayerParties.Add(syncPacket.partyGroupId, group); | ||||
|                 } | ||||
|                 else | ||||
|                     group = currentPlayerParties[syncPacket.partyGroupId]; | ||||
|  | ||||
|                 if (session == null) | ||||
|                     continue; | ||||
|                 group.members = syncPacket.memberActorIds.ToList(); | ||||
|  | ||||
|                 Player player = session.GetActor(); | ||||
|                 if (player == null) | ||||
|                     continue; | ||||
|                 player.SetParty(group); | ||||
|                 //Add group to everyone | ||||
|                 for (int i = 0; i < group.members.Count; i++ ) | ||||
|                 { | ||||
|                     uint member = group.members[i]; | ||||
|                     Session session = Server.GetServer().GetSession(member); | ||||
|  | ||||
|                     if (session == null) | ||||
|                         continue; | ||||
|  | ||||
|                     Player player = session.GetActor(); | ||||
|                     if (player == null) | ||||
|                         continue; | ||||
|                     player.SetParty(group); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -17,6 +17,7 @@ using FFXIVClassic_Map_Server.packets.receive.events; | ||||
| using FFXIVClassic_Map_Server.packets.send.actor.inventory; | ||||
| using FFXIVClassic_Map_Server.actors.group; | ||||
| using FFXIVClassic_Map_Server.packets.send.group; | ||||
| using FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group; | ||||
|  | ||||
| namespace FFXIVClassic_Map_Server.Actors | ||||
| { | ||||
| @@ -1290,8 +1291,10 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|                 return false; | ||||
|         } | ||||
|  | ||||
|         public void PartyOustPlayer() | ||||
|         {             | ||||
|         public void PartyOustPlayer(string name) | ||||
|         { | ||||
|             SubPacket oustPacket = PartyModifyPacket.BuildPacket(playerSession, 1, name); | ||||
|             QueuePacket(oustPacket); | ||||
|         } | ||||
|  | ||||
|         public void PartyLeave() | ||||
| @@ -1302,8 +1305,10 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|         { | ||||
|         } | ||||
|  | ||||
|         public void PartyPromote() | ||||
|         public void PartyPromote(string name) | ||||
|         { | ||||
|             SubPacket promotePacket = PartyModifyPacket.BuildPacket(playerSession, 0, name); | ||||
|             QueuePacket(promotePacket); | ||||
|         } | ||||
|  | ||||
|         //A party member list packet came, set the party | ||||
|   | ||||
| @@ -20,14 +20,14 @@ namespace FFXIVClassic_Map_Server.actors.group | ||||
|             members.Add(leaderCharaId); | ||||
|         } | ||||
|  | ||||
|         public void SetLeader(uint actorId) | ||||
|         public void SetLeader(uint leaderCharaId) | ||||
|         { | ||||
|             partyGroupWork._globalTemp.owner = (ulong)((actorId << 32) | 0xB36F92); | ||||
|             partyGroupWork._globalTemp.owner = (ulong)(((ulong)leaderCharaId << 32) | 0xB36F92); | ||||
|         } | ||||
|  | ||||
|         public uint GetLeader() | ||||
|         { | ||||
|             return (uint)((partyGroupWork._globalTemp.owner >> 32) & 0xFFFFFFFF); | ||||
|             return (uint)((ulong)(partyGroupWork._globalTemp.owner >> 32) & 0xFFFFFFFF); | ||||
|         } | ||||
|          | ||||
|         public bool IsInParty(uint charaId) | ||||
|   | ||||
| @@ -25,11 +25,10 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Receive | ||||
|                     try | ||||
|                     { | ||||
|                         partyGroupId = binReader.ReadUInt64(); | ||||
|                         uint owner = binReader.ReadUInt32(); | ||||
|                         owner = binReader.ReadUInt32(); | ||||
|                         uint numMembers = binReader.ReadUInt32(); | ||||
|                         memberActorIds = new uint[numMembers]; | ||||
|  | ||||
|                         PartyGroup group = new PartyGroup(partyGroupId, owner); | ||||
|                          | ||||
|                         for (int i = 0; i < numMembers; i++)                         | ||||
|                             memberActorIds[i] = binReader.ReadUInt32();                         | ||||
|                     } | ||||
|   | ||||
| @@ -0,0 +1,30 @@ | ||||
| using FFXIVClassic.Common; | ||||
| using FFXIVClassic_Map_Server.Actors; | ||||
| using FFXIVClassic_Map_Server.dataobjects; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using System.Text; | ||||
|  | ||||
| namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group | ||||
| { | ||||
|     class PartyModifyPacket | ||||
|     { | ||||
|         public const ushort OPCODE = 0x1020; | ||||
|         public const uint PACKET_SIZE = 0x48; | ||||
|  | ||||
|         public static SubPacket BuildPacket(Session session, ushort command, string name) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|             using (MemoryStream mem = new MemoryStream(data)) | ||||
|             { | ||||
|                 using (BinaryWriter binWriter = new BinaryWriter(mem)) | ||||
|                 { | ||||
|                     binWriter.Write((UInt16)command); | ||||
|                     binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name)); | ||||
|                 } | ||||
|             } | ||||
|             return new SubPacket(true, OPCODE, session.id, session.id, data); | ||||
|         }       | ||||
|     } | ||||
| } | ||||
| @@ -23,15 +23,15 @@ namespace FFXIVClassic_Map_Server.packets.send.group | ||||
|             { | ||||
|                 using (BinaryWriter binWriter = new BinaryWriter(mem)) | ||||
|                 { | ||||
|                     binWriter.Write((UInt64)group.groupId); | ||||
|                     binWriter.Write((UInt32)group.groupTypeId); | ||||
|                     binWriter.Write((Int32)group.localizedNamed); | ||||
|                     binWriter.Write((UInt64)group.groupIndex); | ||||
|                     binWriter.Write((UInt32)group.GetTypeId()); | ||||
|                     binWriter.Write((Int32)group.GetGroupLocalizedName()); | ||||
|  | ||||
|                     binWriter.Write((UInt16)0x121C); | ||||
|  | ||||
|                     binWriter.Seek(0x20, SeekOrigin.Begin); | ||||
|  | ||||
|                     binWriter.Write(Encoding.ASCII.GetBytes(group.groupName), 0, Encoding.ASCII.GetByteCount(group.groupName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.groupName));                     | ||||
|                     binWriter.Write(Encoding.ASCII.GetBytes(group.GetGroupName()), 0, Encoding.ASCII.GetByteCount(group.GetGroupName()) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.GetGroupName()));                     | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|   | ||||
| @@ -33,15 +33,15 @@ namespace FFXIVClassic_Map_Server.packets.send.group | ||||
|  | ||||
|                         Group group = groups[offset+i]; | ||||
|  | ||||
|                         binWriter.Write((UInt64)group.groupId); | ||||
|                         binWriter.Write((UInt32)group.groupTypeId); | ||||
|                         binWriter.Write((Int32)group.localizedNamed); | ||||
|                         binWriter.Write((UInt64)group.groupIndex); | ||||
|                         binWriter.Write((UInt32)group.GetTypeId()); | ||||
|                         binWriter.Write((Int32)group.GetGroupLocalizedName()); | ||||
|  | ||||
|                         binWriter.Write((UInt16)0x121C); | ||||
|  | ||||
|                         binWriter.Seek(0x20, SeekOrigin.Begin); | ||||
|  | ||||
|                         binWriter.Write(Encoding.ASCII.GetBytes(group.groupName), 0, Encoding.ASCII.GetByteCount(group.groupName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.groupName));                     | ||||
|                         binWriter.Write(Encoding.ASCII.GetBytes(group.GetGroupName()), 0, Encoding.ASCII.GetByteCount(group.GetGroupName()) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.GetGroupName()));                     | ||||
|                     } | ||||
|  | ||||
|                     binWriter.Seek(0x200, SeekOrigin.Begin); | ||||
|   | ||||
| @@ -16,7 +16,7 @@ namespace FFXIVClassic_Map_Server.packets.send.groups | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, Group group) | ||||
|         { | ||||
|             return buildPacket(playerActorID, group.groupId); | ||||
|             return buildPacket(playerActorID, group.groupIndex); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, ulong groupId) | ||||
|   | ||||
| @@ -33,17 +33,17 @@ namespace FFXIVClassic_Map_Server.packets.send.group | ||||
|  | ||||
|                     //Write list id | ||||
|                     binWriter.Write((UInt64)3); | ||||
|                     binWriter.Write((UInt64)group.groupId); | ||||
|                     binWriter.Write((UInt64)group.groupIndex); | ||||
|                     binWriter.Write((UInt64)0); | ||||
|                     binWriter.Write((UInt64)group.groupId); | ||||
|                     binWriter.Write((UInt64)group.groupIndex); | ||||
|  | ||||
|                     //This seems to change depending on what the list is for | ||||
|                     binWriter.Write((UInt32)group.groupTypeId); | ||||
|                     binWriter.Write((UInt32)group.GetTypeId()); | ||||
|                     binWriter.Seek(0x40, SeekOrigin.Begin); | ||||
|  | ||||
|                     //This is for Linkshell | ||||
|                     binWriter.Write((UInt32)group.localizedNamed); | ||||
|                     binWriter.Write(Encoding.ASCII.GetBytes(group.groupName), 0, Encoding.ASCII.GetByteCount(group.groupName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.groupName)); | ||||
|                     binWriter.Write((UInt32)group.GetGroupLocalizedName()); | ||||
|                     binWriter.Write(Encoding.ASCII.GetBytes(group.GetGroupName()), 0, Encoding.ASCII.GetByteCount(group.GetGroupName()) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(group.GetGroupName())); | ||||
|  | ||||
|                     binWriter.Seek(0x64, SeekOrigin.Begin); | ||||
|  | ||||
| @@ -52,7 +52,7 @@ namespace FFXIVClassic_Map_Server.packets.send.group | ||||
|                     binWriter.Write((UInt32)0x6D); | ||||
|                     binWriter.Write((UInt32)0x6D); | ||||
|  | ||||
|                     binWriter.Write((UInt32)group.members.Count); | ||||
|                     binWriter.Write((UInt32)group.GetMemberCount()); | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|   | ||||
| @@ -27,8 +27,8 @@ namespace FFXIVClassic_Map_Server.packets.send.group | ||||
|                     binWriter.Write((UInt64)locationCode); | ||||
|                     binWriter.Write((UInt64)sequenceId); | ||||
|                     //Write List Info | ||||
|                     binWriter.Write((UInt64)group.groupId); | ||||
|                     binWriter.Write((UInt32)group.members.Count); | ||||
|                     binWriter.Write((UInt64)group.groupIndex); | ||||
|                     binWriter.Write((UInt32)group.GetMemberCount()); | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|   | ||||
| @@ -27,7 +27,7 @@ namespace FFXIVClassic_Map_Server.packets.send.group | ||||
|                     binWriter.Write((UInt64)locationCode); | ||||
|                     binWriter.Write((UInt64)sequenceId); | ||||
|                     //Write List Info | ||||
|                     binWriter.Write((UInt64)group.groupId); | ||||
|                     binWriter.Write((UInt64)group.groupIndex); | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user