Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using TS3QueryLib.Core.Common.Responses;
- using TS3QueryLib.Core.Server.Entities;
- using TS3QueryLib.Core;
- using System.Timers;
- using System;
- namespace MoVeMe
- {
- class Program
- {
- public static ListResponse<ClientListEntry> Clients;
- public static TS3QueryLib.Core.Server.QueryRunner Server = new TS3QueryLib.Core.Server.QueryRunner(new SyncTcpDispatcher("qwertyuiop.no-ip.biz", 10011));
- public static System.Threading.Thread GiveGroup = new System.Threading.Thread(new System.Threading.ThreadStart(Steam.GiveGroupFromSteam));
- static void Main(string[] args)
- {
- System.Threading.Thread Message = new System.Threading.Thread(new System.Threading.ThreadStart(RegisterForMessages));
- Message.Start();
- Server.Login("serveradmin", "");
- Server.SelectVirtualServerById(1);
- Clients = Server.GetClientList(true);
- GiveGroup.Start();
- Timer Time = new Timer(5000);
- Time.Start();
- Time.Elapsed += new ElapsedEventHandler(Query);
- Console.ReadKey();
- }
- private static void Query(object source, ElapsedEventArgs e)
- {
- try
- {
- Steam.Manual_Poll();
- foreach (ClientListEntry Client in Clients)
- {
- if (!Client.Nickname.StartsWith("server") && !Client.Nickname.StartsWith("Unk"))
- {
- if (Client.ClientIdleDuration.GetValueOrDefault().TotalMinutes >= 15)
- {
- Console.WriteLine("Moving Client: {0} Reason: Idle", Client.Nickname);
- Server.MoveClient(Client.ClientId, 4);
- }
- if (Client.IsClientAway == true && Client.ClientIdleDuration.GetValueOrDefault().TotalMinutes >= 5)
- {
- Console.WriteLine("Moving Client: {0} Reason: Idle & Away", Client.Nickname);
- Server.MoveClient(Client.ClientId, 4);
- }
- }
- }
- }
- catch (Exception E)
- {
- Console.WriteLine(E.Message);
- }
- }
- static void RegisterForMessages()
- {
- //while (true)
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement