fix issue with partial matches for map load command
This commit is contained in:
parent
84189cf136
commit
e76976799b
@ -875,7 +875,7 @@ namespace SharedLibraryCore.Commands
|
|||||||
E.Owner.Broadcast(_translationLookup["COMMANDS_MAP_SUCCESS"].FormatExt(foundMap.Alias));
|
E.Owner.Broadcast(_translationLookup["COMMANDS_MAP_SUCCESS"].FormatExt(foundMap.Alias));
|
||||||
|
|
||||||
await Task.Delay(delay);
|
await Task.Delay(delay);
|
||||||
await E.Owner.LoadMap(newMap);
|
await E.Owner.LoadMap(foundMap?.Name ?? newMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,6 +606,25 @@ namespace ApplicationTests
|
|||||||
A.CallTo(() => rconParser.ExecuteCommandAsync(A<IRConConnection>.Ignored, A<string>.Ignored))
|
A.CallTo(() => rconParser.ExecuteCommandAsync(A<IRConConnection>.Ignored, A<string>.Ignored))
|
||||||
.MustHaveHappened();
|
.MustHaveHappened();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_LoadMap_FindsMapName_FromPartialAlias()
|
||||||
|
{
|
||||||
|
var cmd = serviceProvider.GetRequiredService<LoadMapCommand>();
|
||||||
|
var server = serviceProvider.GetRequiredService<IW4MServer>();
|
||||||
|
var rconParser = serviceProvider.GetRequiredService<IRConParser>();
|
||||||
|
server.Maps.Add(new Map()
|
||||||
|
{
|
||||||
|
Name = "mp_test",
|
||||||
|
Alias = "test"
|
||||||
|
});
|
||||||
|
var gameEvent = EventGenerators.GenerateEvent(GameEvent.EventType.Command, server.Maps.First().Name, server);
|
||||||
|
|
||||||
|
await cmd.ExecuteAsync(gameEvent);
|
||||||
|
|
||||||
|
A.CallTo(() => rconParser.ExecuteCommandAsync(A<IRConConnection>.Ignored, A<string>.That.Contains(server.Maps[0].Name)))
|
||||||
|
.MustHaveHappened();
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user