Added a couple of useful services to rconservice

This commit is contained in:
Garry Newman
2016-02-29 13:03:23 +00:00
parent a5a5e107fe
commit 1387e4cb3f
13 changed files with 400 additions and 273 deletions
+28
View File
@@ -0,0 +1,28 @@
app.controller( 'ConsoleController', ['$scope', 'rconService', ConsoleController] );
function ConsoleController( $scope, rconService )
{
$scope.Output = rconService.Output;
$scope.SubmitCommand = function ()
{
rconService.Command( $scope.Command, 0 );
$scope.Command = "";
}
$scope.$on( "OnMessage", function ( event, msg )
{
if ( msg.Message.startsWith( "[CHAT] " ) )
msg.Class = "Chat";
if ( msg.Identifier == 1 )
msg.Class = "Requested";
if ( msg.Identifier > 1 )
return;
$( "#ConsoleController .Output" ).scrollTop( $( "#ConsoleController .Output" )[0].scrollHeight );
} );
}