DarkEmu_GameServer.Systems.SendAll C# (CSharp) Метод

SendAll() публичный статический Метод

public static SendAll ( byte buff ) : void
buff byte
Результат void
        public static void SendAll(byte[] buff)
        {
            lock (Systems.clients)
            {
                for (int i = 0; i < Systems.clients.Count; i++)
                {
                    try
                    {
                        if (Systems.clients[i] != null && Systems.clients[i].Character.InGame)
                            Systems.clients[i].client.Send(buff);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("SendAll Error on index {1}/{2}: {0}", ex, i, Systems.clients.Count);
                        Systems.Debugger.Write(ex);
                    }
                }
            }
        }

Usage Example

Пример #1
0
        private void doCommand(string command, List <string> parameters)
        {
            try
            {
                Console.WriteLine("[EVENT] Command: {0}, Parameters: {1}", command, listToString(parameters));

                switch (NameToEnum(command))
                {
                case ScriptCommandType.Sleep:
                    Thread.Sleep(Int32.Parse(parameters[0]));
                    break;

                case ScriptCommandType.SpawnUnique:
                    this.SpawnUnique(parameters);
                    break;

                case ScriptCommandType.Notice:
                    Systems.SendAll(Packet.ChatPacket(7, 0, listToString(parameters, false), ""));
                    break;

                case ScriptCommandType.SpawnMob:
                    this.spawnMob(parameters);
                    break;

                default:
                    break;
                }
            }
            catch (Exception)
            {
                Console.WriteLine("exception at handling command: Type = {0} ::: Parameters = {1}", command, listToString(parameters));
            }
        }
All Usage Examples Of DarkEmu_GameServer.Systems::SendAll
Systems