want to log results of client console command on server

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

MascSnake

New Member
Feb 18, 2002
3
0
0
Visit site
Hi,

I'm trying to make a small mod that allows the admin to check what bindings the users are using to look for sketchiness.

Anyhow -- my problem is that the server doesn't seem to be getting the results of the consolecommand. What happens when I run the stuff below is that the client gets logged correctly, but the server just has blanks where is should have keynames and aliases. Is there any way to force this to get transferred??

Thnx

----------
replication
{
reliable if (Role<ROLE_Authority)
ServerLog;
reliable if (Role == ROLE_Authority)
getKeyBinding;
}

function ServerLog(String s)
{
log(s);

}
event PostLogin( playerpawn NewPlayer )
{
local Player P;
Local String s;
Local int i;


super.postLogin(NewPlayer);
NewPlayer.clientMessage("Hello & welcome");
serverLog( "################ Logging keybindings for "$ NewPlayer.PlayerReplicationInfo.PlayerName);
for ( i = 0; i < 255; i++ )
{
s = getKeyBinding(NewPlayer,i);
ServerLog(s);
}
serverLog( "################ Finnished Logging");

}

function String getKeyBinding(playerpawn NewPlayer, int i)
{
Local String keyName, Alias;
keyName = NewPlayer.ConsoleCommand ( "KEYNAME "$i );
Alias = NewPlayer.ConsoleCommand( "KEYBINDING "$keyName );
return NewPlayer.PlayerReplicationInfo.PlayerName$ ">> "$ keyname $ " : "$ Alias;
}
 

MascSnake

New Member
Feb 18, 2002
3
0
0
Visit site
yeah, i figured this out... also, you can only replicate variables to a server from within a playerpawn (?). Unfortunately, the replication isn't immediate, so I had to seperate the setting of the variable, and the logging of it.

Oh well.
 

MascSnake

New Member
Feb 18, 2002
3
0
0
Visit site
I see...

Can a replicationInfo have state code?

I found that, in trying to do this in the playerpawn, the replicated variables only get replicated on a tick. So, when I called the Log function, it was getting the old version, since there was no tick (since I was initially trying to do some of this stuff in PostLogin).

I think what I want to do is have a 'updating' state where the client or replication info gets the info, waits for a tick, or sleeps or something, then logs to the server, then ends the thread.