1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

UT Replication Trouble

Discussion in 'Programming' started by emailer33, Oct 18, 2003.

  1. emailer33

    emailer33 New Member

    Joined:
    May 23, 2002
    Messages:
    40
    Likes Received:
    0
    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: Oct 18, 2003
  2. Joey`

    Joey` azn lolr

    Joined:
    Jun 23, 2003
    Messages:
    6
    Likes Received:
    0
    replication sucks, sorry i cant help ya, i hope some one else reads this and does so. :/
     
  3. Daid303

    Daid303 MSPA

    Joined:
    Aug 7, 2002
    Messages:
    246
    Likes Received:
    0
    The calling back of functions to the server only worked in the Pawn class (for me atleast) and only in the Pawn that is the 'client' itself.
     
  4. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,915
    Likes Received:
    36
    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.

    In that case stay away from that "post reply" button, please.
     
  5. Joey`

    Joey` azn lolr

    Joined:
    Jun 23, 2003
    Messages:
    6
    Likes Received:
    0
    in that case suck me off :]
     
  6. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,915
    Likes Received:
    36
    Just in case you think you are being funny: You're not.
    Now please stay out of this thread unless you can really contribute something useful.
     
  7. emailer33

    emailer33 New Member

    Joined:
    May 23, 2002
    Messages:
    40
    Likes Received:
    0
    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.
     
  8. Joey`

    Joey` azn lolr

    Joined:
    Jun 23, 2003
    Messages:
    6
    Likes Received:
    0
    fyi wormbo and others; this is for ut1 not 2k3.
     
  9. Daid303

    Daid303 MSPA

    Joined:
    Aug 7, 2002
    Messages:
    246
    Likes Received:
    0
    You're starting to piss people OFF!

    Wasn't the Role of a pawn on the client ROLE_Authority?
     
  10. Joey`

    Joey` azn lolr

    Joined:
    Jun 23, 2003
    Messages:
    6
    Likes Received:
    0
    wtf whatd i do now? :|

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

    how am i pissing you off :/
     
  11. emailer33

    emailer33 New Member

    Joined:
    May 23, 2002
    Messages:
    40
    Likes Received:
    0
    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
     
  12. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,915
    Likes Received:
    36
    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

    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.

    You were being an idiot, that's what you did. I'm pretty sure emailer33 doesn't need somebody repeating his statements.
     
  13. emailer33

    emailer33 New Member

    Joined:
    May 23, 2002
    Messages:
    40
    Likes Received:
    0
    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.
     
  14. emailer33

    emailer33 New Member

    Joined:
    May 23, 2002
    Messages:
    40
    Likes Received:
    0
    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 :(
     
  15. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,915
    Likes Received:
    36
    ...Info and is spawned for each PlayerController.
    That's what I wanted to say. :con:
     
  16. emailer33

    emailer33 New Member

    Joined:
    May 23, 2002
    Messages:
    40
    Likes Received:
    0
    hmm good idea. yea i thgouht this was a good structure to copy down to UT.
     

Share This Page