Ejemplo n.º 1
0
            public void SendMultiplyPackets(ref Packets.PacketClass packet)
            {
                lock (this)
                {
                    try
                    {
                        if (packet.OpCode == Opcodes.SMSG_UPDATE_OBJECT)
                        {
                            packet.CompressUpdatePacket();
                        }
                        packet.UpdateLength();
                        byte[] data = (byte[])packet.Data.Clone();

                        if (WorldServiceLocator._WorldServer.ClsWorldServer.Cluster != null)
                        {
                            WorldServiceLocator._WorldServer.ClsWorldServer.Cluster.ClientSend(Index, data);
                        }
                    }
                    catch (Exception ex)
                    {
                        SetError(ex, $"Connection from [{IP}:{Port}] cause error {ex.Message}{Environment.NewLine}", LogType.CRITICAL);

                        if (DEBUG_CONNECTION)
                        {
                            return;
                        }

                        WorldServiceLocator._WorldServer.ClsWorldServer.Cluster = null;
                        Delete();
                    }
                }
            }
Ejemplo n.º 2
0
 public void Broadcast(Packets.PacketClass p)
 {
     p.UpdateLength();
     WorldServiceLocator._WorldServer.ClsWorldServer.Cluster.BroadcastGroup(ID, p.Data);
 }