Page 1 of 1

Unreal Replication Problems...

PostPosted: Wed Mar 24, 10 12:14 am
by WCCC
I have serious problems with unreal replication, im trying to make a multiplayer ATM that stores money in a mutator, that can then be configured and saved via ini file... only problem is, i'm one of the world's biggest nubs with unreal replication, and after trying a dozen or so combinations... i'm up short on the variables, the functions are executing right, but the atm's being denied access to the variables, to be more specific.
below is all the code you should need to help me, provided your interested, of course.

for reference, a window is triggering a command in the atm, which is in turn triggering command in the mutator, which is then accessing its own variables, but simply because it's being accessed from an outside source, it's not working...

var config string AccountIPs[100];
var config int AccountBalances[100];

replication
{
reliable if (role == ROLE_Authority)
GetAccountNum, GetAccountBalance, MakeNewAccount, AddAccountBalance, SubAccountBalance;
reliable if (role < ROLE_Authority)
AccountIPs, AccountBalances;
}

PostPosted: Tue Apr 06, 10 5:23 pm
by ~[Px]DrugCraze~
Are you trying to make it like the DarkForce ATMS? or exactly like the singleplayer ATM screens?

PostPosted: Wed Apr 07, 10 6:05 pm
by WCCC
Dark Force ATMs were kinda buggy, and singleplayer doesn't have a withdraw button, and I don't want money to gain interest over time, I want the money to just be stored on the server in a .ini file, the atm screen is like single player but has an added withdraw button, and as listed above, the menu screen is having trouble getting access to the either the ATM or the Mutator, for some damn reason it can modify the account balance, but it can't get the amount in the balance, it just assumes 0 every time.

PostPosted: Fri May 07, 10 9:33 am
by ~ô¿ô~Nobody~
I know this topic is older but I have the duty to say that your replication rules are rubbish.
Even if that works, it wouldn't be very secure.

Code: Select all
reliable if (role < ROLE_Authority)
AccountIPs, AccountBalances;


First of all, you should not replicate those variables to the server.
By that, clients could modify the server values of all accounts easily.
Also, the server variables are not replicated to the client which means the client (window system) doesn't know about the current balance.

Code: Select all
reliable if (role == ROLE_Authority)
GetAccountNum, GetAccountBalance, MakeNewAccount, AddAccountBalance, SubAccountBalance;


Hmmm.. are you trying to get the account information from the client?
Basically, the client should know as few as possible.
Independently of that.. you can not call a replicated function and expect to get a proper return value.
As in (for instance).. sending getClientInfo to the client and expecting a return value from the client over the network.
This does not work.

Independently of all this.. calling remote function does NOT work, if a player is not the owner of the object you're calling the functions from...

PostPosted: Fri May 07, 10 11:55 pm
by WCCC
i did try the setowner stuff, and oops, see how little i know about replication? besides i dont know of any way to modify arrays past the first variable. anywho since this post was made a completely revamped the system so you can work the entire thing with your nano wallet, and the mod has since been merged with the wallets mod consequently. it all works when controlled via weapons, its just that trying to do anything with menus is a real bitch, i think ill just avoid them in the future.

and finally, thanks nobody, ill make sure to removed the replication for the variables if i haven't already. :D