Exemple #1
0
 public static void SendEnterChatRoomResultResponse(IRealmClient client, EnterChatRoomStatus status,
                                                    Asda2Chatroom room)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.EnterChatRoomResult)) //6243
     {
         packet.WriteByte((byte)status);                                            //{status}default value : 1 Len : 1
         packet.WriteByte(room == null ? 0 : room.IsPrivate ? 1 : 2);
         //{privateOnePublicTwo}default value : 0 Len : 1
         packet.WriteByte(room == null ? 0 : room.MaxMembersCount); //{maxMembers}default value : 15 Len : 1
         packet.WriteByte(room == null ? 0 : room.Members.Count);   //{currentMembers}default value : 2 Len : 1
         packet.WriteFixedAsciiString(room == null ? "" : room.Name, 28);
         //{roomName}default value :  Len : 28
         packet.WriteByte(0);  //value name : unk10 default value : 0Len : 1
         packet.WriteByte(99); //value name : unk11 default value : 99Len : 1
         var mombers = room == null ? new Character[0] : room.Members.Values.ToArray();
         for (int i = 0; i < 20; i += 1)
         {
             var chr = mombers.Length <= i ? null : mombers[i];
             packet.WriteByte(chr == null ? 0 : room != null && (chr == room.Owner) ? 1 : 0);
             //{isLeader}default value : 1 Len : 1
             packet.WriteInt32(chr == null ? -1 : (int)chr.AccId); //{accId}default value : 361343 Len : 4
             packet.WriteInt16(chr == null ? -1 : chr.SessionId);  //{sessId}default value : 28 Len : 2
         }
         client.Send(packet, addEnd: true);
     }
 }
Exemple #2
0
 public static void SendChatRoomEventResponse(Asda2Chatroom client, ChatRoomEventType status, Character triggerer)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.ChatRoomEvent)) //6249
     {
         packet.WriteByte((byte)status);                                      //{status}default value : 3 Len : 1
         packet.WriteInt16(triggerer == null ? 0 : triggerer.SessionId);
         //{trigererSessId}default value : 79 Len : 2
         packet.WriteInt32(triggerer == null ? 0 : triggerer.AccId);
         //{trigererAccId}default value : 366338 Len : 4
         client.Send(packet, true, Locale.Any);
     }
 }
Exemple #3
0
 public static void SendChatRoomCreatedResponse(IRealmClient client, CreateChatRoomStatus status,
                                                Asda2Chatroom room)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.ChatRoomCreated)) //6241
     {
         packet.WriteByte((byte)status);                                        //{status}default value : 1 Len : 1
         packet.WriteByte(room == null ? 0 : room.IsPrivate ? 1 : 0);
         //{zeroPublicOnePrivate}default value : 1 Len : 1
         packet.WriteByte(room == null ? 0 : room.MaxMembersCount); //{maxMemberCount}default value : 15 Len : 1
         packet.WriteFixedAsciiString(room == null ? "" : room.Name, 28);
         //{roomName}default value :  Len : 28
         packet.WriteInt16(0); //value name : unk11 default value : 0Len : 2
         client.Send(packet);
     }
 }
Exemple #4
0
 public static void SendChatRoomVisibleResponse(Character owner, ChatRoomVisibilityStatus status, Asda2Chatroom room, Character character = null)
 {
     if (character != null)
     {
         using (var packet = new RealmPacketOut(RealmServerOpCode.ChatRoomVisible)) //6248
         {
             packet.WriteByte((byte)status);                                        //{status}default value : 2 Len : 1
             packet.WriteInt32(owner.AccId);                                        //{initerAccId}default value : 361343 Len : 4
             packet.WriteByte(room == null ? 0 : room.IsPrivate ? 1 : 0);
             //{zeroPublicOnePrivate}default value : 1 Len : 1
             packet.WriteInt16(room == null ? 0 : room.MaxMembersCount); //{maxMemberCount}default value : 15 Len : 1
             packet.WriteFixedAsciiString(room == null ? "" : room.Name, 28);
             //{roomName}default value :  Len : 28
             packet.WriteInt16(0); //value name : unk11 default value : 0Len : 2
             packet.WriteByte(0);  //value name : unk1 default value : 0Len : 1
             character.Send(packet, addEnd: true);
         }
         return;
     }
     using (var packet = new RealmPacketOut(RealmServerOpCode.ChatRoomVisible)) //6248
     {
         packet.WriteByte((byte)status);                                        //{status}default value : 2 Len : 1
         packet.WriteInt32(owner.AccId);                                        //{initerAccId}default value : 361343 Len : 4
         packet.WriteByte(room == null ? 0 : room.IsPrivate ? 1 : 0);           //{zeroPublicOnePrivate}default value : 1 Len : 1
         packet.WriteInt16(room == null ? 0 : room.MaxMembersCount);            //{maxMemberCount}default value : 15 Len : 1
         packet.WriteFixedAsciiString(room == null ? "" : room.Name, 28);
         //{roomName}default value :  Len : 28
         packet.WriteInt16(0); //value name : unk11 default value : 0Len : 2
         packet.WriteByte(0);  //value name : unk1 default value : 0Len : 1
         owner.SendPacketToArea(packet);
     }
 }