refactored the welcome plugin to use a web api instead of a hard coded file
removed deprecated file class don't wait for response when setting dvar/sending command in T6 potential fix for duplicate kick message in JS plugin
This commit is contained in:
@ -95,6 +95,7 @@ namespace SharedLibraryCore.RCon
|
||||
Ttl = 42,
|
||||
ExclusiveAddressUse = true,
|
||||
};
|
||||
|
||||
connectionState.OnSentData.Reset();
|
||||
connectionState.OnReceivedData.Reset();
|
||||
connectionState.ConnectionAttempts++;
|
||||
@ -103,7 +104,7 @@ namespace SharedLibraryCore.RCon
|
||||
#endif
|
||||
try
|
||||
{
|
||||
response = await SendPayloadAsync(payload);
|
||||
response = await SendPayloadAsync(payload, waitForResponse);
|
||||
connectionState.OnComplete.Release(1);
|
||||
connectionState.ConnectionAttempts = 0;
|
||||
}
|
||||
@ -139,7 +140,7 @@ namespace SharedLibraryCore.RCon
|
||||
return splitResponse;
|
||||
}
|
||||
|
||||
private async Task<byte[]> SendPayloadAsync(byte[] payload)
|
||||
private async Task<byte[]> SendPayloadAsync(byte[] payload, bool waitForResponse)
|
||||
{
|
||||
var connectionState = ActiveQueries[this.Endpoint];
|
||||
var rconSocket = (Socket)connectionState.SendEventArgs.UserToken;
|
||||
@ -171,6 +172,11 @@ namespace SharedLibraryCore.RCon
|
||||
}
|
||||
}
|
||||
|
||||
if (!waitForResponse)
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
|
||||
connectionState.ReceiveEventArgs.SetBuffer(connectionState.ReceiveBuffer);
|
||||
|
||||
// get our response back
|
||||
|
Reference in New Issue
Block a user