PDA

View Full Version : Clientside ini file..



}DA{Moneyshot
12-04-2007, 01:34 AM
Is it possible to have a mutator that saves client related settings to the client? These would be settings that could be different for every user.

Gugi
12-04-2007, 08:16 AM
I guess yes, as it was possible to do it in UT2004.
You need to create a config-variable (and of course you need to add config in the class-header). Then call SaveConfig() on the client. You can do this with a replicated and simulated function from the server (in a class which has RemoteRole set to ROLE_SimulatedProxy and Role to ROLE_Authority). If I am not completely wrong you can call the following function from the server and it will be executed on the client:

reliable server simulated function Save()
{
SaveConfig();
}
But I am not sure... Look in the UT3-script source for the correct Syntax.

}DA{Moneyshot
12-04-2007, 08:30 AM
I guess yes, as it was possible to do it in UT2004.
You need to create a config-variable (and of course you need to add config in the class-header). Then call SaveConfig() on the client. You can do this with a replicated and simulated function from the server (in a class which has RemoteRole set to ROLE_SimulatedProxy and Role to ROLE_Authority). If I am not completely wrong you can call the following function from the server and it will be executed on the client:

reliable server simulated function Save()
{
SaveConfig();
}
But I am not sure... Look in the UT3-script source for the correct Syntax.

Sweet. I will have a look. Thanks for giving me a direction.

BattleMode
12-04-2007, 08:50 AM
AFAIK that will only work if the mutator is active on the client (e.g. standalone mode). Why not store the information on the server and use the ID of the player as index?

}DA{Moneyshot
12-04-2007, 11:57 AM
AFAIK that will only work if the mutator is active on the client (e.g. standalone mode). Why not store the information on the server and use the ID of the player as index?

Would you have an example? Is the id of the player unique to the session or to the player regardless of session? The reason I am asking is because I have been trying to figure out how I could do just that sort of thing as well but was drawing a blank.

TheCatcher
12-04-2007, 01:45 PM
In previous versions of UT, I have used client based INIs by spawning ReplicationInfo actors.

This is routine in CaptureTheTreeUT3V10 that gets executed when a new player joins. It starts up a ReplicationInfo Actor on the client's machine.




function AddClientReplicationInfo(PlayerController Player)
{
local CTTClient CTTC;

LogInternal("****CTT: Spawning CTTClient");
CTTC = Spawn(class 'CaptureTheTreeUT3V10.CTTClient',Player,,Player.Lo cation);
if (CTTC==None)
LogInternal("****CTT: Could not spawn CTTClient");
else
{
LogInternal("****CTT: Spawn CTTClient");
CTTC.VersionNumber = 1.0;
}
}


This is the definition of the CTTClient class in the CTTClient.uc file.



CTTClient.uc

class CTTClient extends ReplicationInfo;



You might be able to get client based INI file by adding a config to the class definition in the client script.



CTTClient.uc

class CTTClient extends ReplicationInfo config(LOCALINI);



I'm not sure if this will still work in UT3, but it seems like it should.

BattleMode
12-04-2007, 01:52 PM
Would you have an example? Is the id of the player unique to the session or to the player regardless of session? The reason I am asking is because I have been trying to figure out how I could do just that sort of thing as well but was drawing a blank. I think studying this might be helpful: http://ut2004.titaninternet.co.uk/forums/showthread.php?t=14574. It seems to use things like PlayerController(Sender).PlayerReplicationInfo.Uni queId). This is probably the ID that is connected to the CD Key, so it is unique.

}DA{Moneyshot
12-04-2007, 02:30 PM
I think studying this might be helpful: http://ut2004.titaninternet.co.uk/forums/showthread.php?t=14574. It seems to use things like PlayerController(Sender).PlayerReplicationInfo.Uni queId). This is probably the ID that is connected to the CD Key, so it is unique.

Thank you very much. I will have a look at this and see what I can come up with.