示例#1
0
 public ForwardThread(Client aClient, BinaryReader aInput, BinaryWriter aOutput, Direction aDirection)
 {
     this.client = aClient;
     this.incoming = aInput;
     this.outgoing = aOutput;
     this.direction = aDirection;
 }
 public static void removeClient(Client client)
 {
     clients.Remove(client.playerData.name);
     clientsById.Remove(client.playerData.id);
 }
 public static void addClient(Client client)
 {
     clients.Add(client.playerData.name, client);
     clientsById.Add(client.playerData.id, client);
 }
示例#4
0
        public bool checkTrigger(int count, Client client)
        {
            if (count == countToTrigger)
            {
                PlayerData player = client.playerData;

                switch (actionName)
                {
                    case "mute":
                        player.isMuted = true;
                        StarryboundServer.sendGlobalMessage("^#f75d5d;" + player.name + " has been muted automatically for spamming.");
                        break;

                    case "kick":
                        client.kickClient(reason);
                        break;

                    case "ban":
                        if (length != 0) length = Utils.getTimestamp() + (length * 60);

                        Bans.addNewBan(player.name, player.uuid, player.ip, Utils.getTimestamp(), "[SYSTEM]", length, reason);

                        client.banClient(reason);
                        break;
                }

                return true;
            }

            return false;
        }