UT Replication Trouble

  • 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.

emailer33

New Member
May 23, 2002
40
0
0
38
Visit site
Well i'm trying to make a UT mod, and this is actually my first where I am forced to deal with replication. After reading many articles, i gave it a shot, and am stuck on this problem. The following code works replicating to the client, i checked it with logs and such, but it never can replicate back to teh server thru a different function. Here's some code that i dumbed down to what I have:

What could be causing this not to work? There's no indication of ServerCallBack being run at all.

Code:
enum CheckType {
  CT_Type1 //Only Checktype i have made so far, it's for expansion reasons
};

replication
{
//Functions
   reliable if (Role < ROLE_Authority)
     ServerCallBack;
   reliable if (Role == ROLE_Authority)
     ClientPerform;
}

simulated function ServerCallBack(CheckType CT, string Data)
{
   local private int i;
   if (Role < ROLE_Authority)  return;
   bLog("ServerCallback("$Role$") - CheckType "$int(CT));
   //Here I have some code that processes Data corresponding to CT
}

simulated function ClientPerform(CheckType CT, string Command)
{
  local string Ret;
  if (Role == ROLE_Authority) return;
  bLog("tpBR - ClientPerform("$int(CT)$") - Role:"@Role);
  switch (CT)
  {
  case CT_Type1:
    //Code setting Ret corresponding to CT and Command
    ServerCallBack(CT,Ret);        //Should be replicating back to the server, right?
    break;
  }
}

simulated event PostNetBeginPlay ()
{
  //Some Beginning Code
  bLog("tpBR - PostNetBeginPlay("$Role$")");
  ClientPerform(CT_PackageValidation,SpecialCmd); //This does work and does replicate to the client correctly.
}

Also you can ignore bLog if you're worried about that, i made my own log file. Anyone that can provide any insight it is MUCH appreciated. Thank you.
 
Last edited:

Joey`

azn lolr
Jun 23, 2003
6
0
0
replication sucks, sorry i cant help ya, i hope some one else reads this and does so. :/
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
AFAIK client to server replication is only possible for actors owned by a PlayerController and maybe also for actors owned by a PlayerController's Pawn (i.e. a player's inventory). In any case replication is only possible from and to that single client.

Joey` said:
replication sucks, sorry i cant help ya, i hope some one else reads this and does so. :/
In that case stay away from that "post reply" button, please.
 

emailer33

New Member
May 23, 2002
40
0
0
38
Visit site
oops, i forgot to clarify soemthing. that class is an a new PlayerPawn class for UT. i override the old one, so it is owned by one player. i do realize i can't "broadcast" replication statements. i am referencing one player when i do this, since the client->server replication worked. i just do not know why it didn't make it back.
 

Joey`

azn lolr
Jun 23, 2003
6
0
0
wtf whatd i do now? :|

i was honestly trying to be informative, and its true...

how am i pissing you off :/
 

emailer33

New Member
May 23, 2002
40
0
0
38
Visit site
Daid303 said:
You're starting to piss people OFF!

Wasn't the Role of a pawn on the client ROLE_Authority?

wrong. the role of clients is ROLE_AutonomousProxy or ROLE_SimulatedProxy. only the server is ROLE_Authority, cuz the server is the authority. Wormbo, if i could talk to you, that'd be great, i'm emailer33 on aim and pizzaboy7979@hotmail.com on msn
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
emailer33 said:
oops, i forgot to clarify soemthing. that class is an a new PlayerPawn class for UT.
Oops, missed that the topic says "UT Replication Trouble". :eek:
You seem to be creating some kind of security checker. Wouldn't it be better to create a seperate actor for that? UT2003's Engine.Security class is a subclass of

emailer33 said:
Wormbo, if i could talk to you, that'd be great, i'm emailer33 on aim and pizzaboy7979@hotmail.com on msn
Sorry to dissapoint you, but I don't use IMs that much lately and what's more important: I never used MSN and don't intent start doing that in the near future.

Joey` said:
wtf whatd i do now? :|

i was honestly trying to be informative, and its true...

how am i pissing you off :/
You were being an idiot, that's what you did. I'm pretty sure emailer33 doesn't need somebody repeating his statements.
 

emailer33

New Member
May 23, 2002
40
0
0
38
Visit site
lol it's alright i know him.

i would prefer to stay as a playerpawn subclass rather than a custom checker, so i'll keep trying. thanx tho.
 

emailer33

New Member
May 23, 2002
40
0
0
38
Visit site
Wormbo said:
Oops, missed that the topic says "UT Replication Trouble". :eek:
You seem to be creating some kind of security checker. Wouldn't it be better to create a seperate actor for that? UT2003's Engine.Security class is a subclass of

yes i realize it yes, i was copying the same basic structure back to UT, just with out the native call back to teh server. i'd still like to get it working :(
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
Wormbo said:
You seem to be creating some kind of security checker. Wouldn't it be better to create a seperate actor for that? UT2003's Engine.Security class is a subclass of
...Info and is spawned for each PlayerController.
That's what I wanted to say. :con: