コード例 #1
0
        public async Task SetUp()
        {
            var ipAddress = "192.168.201.201";
            var port      = 7778;

            _udpResponse = new Response
            {
                Payload = "test info data",
                Success = true,
                Error   = null
            };

            _expectedResponse = new ServerResponse
            {
                Data    = "test info data",
                Error   = null,
                Success = true
            };

            _udpServerClient = new Mock <IUdpServerClient>();
            _udpServerClient.Setup(c => c.GetData(It.IsAny <Request>())).ReturnsAsync(_udpResponse);

            _protocolClient = new GamespyClient(_udpServerClient.Object);
            _actualResponse = await _protocolClient.GetInfo(ipAddress, port);
        }
コード例 #2
0
 public ListRequestPacket(GamespyClient client, byte[] data)
 {
     base(client, data);
     this.UseCipher = true; //turn on encryption
     //https://github.com/derkalle4/gamespy-masterserver/blob/68b075cd4b667df42aecb2e079b73c013f5979c2/GamespyMasterserver/linkbase/packets/PacketBase.vb
     //SEE FetchString function
     this.Filter         = FetchString(this.data);              //Fetch the filter-string
     this.ParameterArray = Split(FetchString(this.data), "\\"); //Get the requested params
     //TODO: might be casted to int32, however doesn't match std.C - style int32 - format(LE ?)
     this.Options = this.data(bytesParsed + 3);                 //BitConverter.ToInt32(Me.data, Me.bytesParsed)
 }
コード例 #3
0
 public ServerinfoRequestPacket(GamespyClient client, byte[] data)
 {
     base(client, data);
     //Turn on encryption
     this.UseCipher = true;
 }