Game Data Update
QueryMaster Update
This commit is contained in:
Brett Hewitson 2022-06-13 10:22:49 +10:00
parent 523396d810
commit f33d463782
6 changed files with 56 additions and 106 deletions

View file

@ -9,14 +9,14 @@ namespace QueryMaster
class RconSource : Rcon
{
internal TcpQuery socket;
private RconSource(IPEndPoint address)
private RconSource(IPEndPoint address, int sendTimeOut, int receiveTimeOut)
{
socket = new TcpQuery(address, 3000, 3000);
socket = new TcpQuery(address, sendTimeOut, receiveTimeOut);
}
internal static Rcon Authorize(IPEndPoint address, string msg)
internal static Rcon Authorize(IPEndPoint address, string msg, int sendTimeOut, int receiveTimeOut)
{
RconSource obj = new RconSource(address);
RconSource obj = new RconSource(address, sendTimeOut, receiveTimeOut);
byte[] recvData = new byte[50];
RconSrcPacket packet = new RconSrcPacket() { Body = msg, Id = (int)PacketId.ExecCmd, Type = (int)PacketType.Auth };
recvData = obj.socket.GetResponse(RconUtil.GetBytes(packet));

View file

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net;
namespace QueryMaster
{
@ -11,7 +7,7 @@ namespace QueryMaster
internal Source(IPEndPoint address, int sendTimeOut, int receiveTimeOut) : base(address, EngineType.Source, false, sendTimeOut, receiveTimeOut) { }
public override Rcon GetControl(string pass)
{
RConObj = RconSource.Authorize(socket.Address, pass);
RConObj = RconSource.Authorize(socket.Address, pass, socket.socket.SendTimeout, socket.socket.ReceiveTimeout);
return RConObj;
}
}