Announcement

Collapse
No announcement yet.

UT2004 Replication bug???

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    UT2004 Replication bug???

    Hi... i'm programming a new mutator but have a little problem with my replication variables.
    To not replace the playerPawn or PlayerReplicationInfo class i spawn my subclassed ReplicationInfo class to any player that enter the game and initialize any class with the ID of the player.
    This is because i need interaction with all players and need that my mutator (server-side) know who are making a request pressing a key.
    Now... i've found my problem initializing my new replicationinfo class. To spawn that class i use...
    Code:
    Spawn(myclass, PlayerController);
    ...with a playerOwner assigned to the class.
    Then, my ReplicationInfo class is defined as...
    Code:
    bOnlyOwnerSee=true
    bOnlyRelevantToOwner=true
    bAlwaysRelevant=true
    ...and my replication look like...
    Code:
    reliable if(Role==ROLE_Authority && bNetOwner)
      playerID;
    ...but seem that playerID variable, on the client be incorrect if more then 2 players are on the server. Seem that two class receive the same ID from the server.

    Please....... someone can help me?

    #2
    Huh. This might be related to a problem I'm having, but if it is then I'll not be much help since I can't fix mine Still, I can give it a shot.

    I'm assuming you're logging the ID you pass and looking at both .log files to see the ID, so you know the same ID is passed to both.

    Where is the Spawn() happening? On the server or on the client? I had a lot of trouble with Spawn when it happened on the client (ie. it didn't work at all).

    Comment


      #3
      Yes... i use the server log file to see what value have the ID.
      I proceed as follow...
      1. Everytime a player join the server a subclassed ReplicationInfo is spawned with the player PlayerController as Owner.
      2. The playerID is passed to the client of the ReplicationInfo class that is replicated as posted before.
      3. The class wait for a valid PlayerID (> 0) in the PostNetReceive function as follow...
        Code:
        simulated event PostNetReceive()
        {
        	if(Level.NetMode == NM_DedicatedServer)
        		return;
        	
        	if(My_PlayerID > 0 && !My_Initialized)
        	{
        		bNetNotify = false;
        		My_Initialized = true;
        		My_Initialize();
        	}
        }
      4. The My_Initialize() function spawn the interaction class on the client and initialize it.
      5. When a user press a key, the interaction class call a function in the ReplicationInfo class passing the received playerID.
        My_NotifyReady is replicated in ReplicationInfo class as follow...
        Code:
        reliable if(Role<ROLE_Authority)
        	My_NotifyReady
      6. My_NotifyReady function call a notification function in the mutator class passing the received playerID from the client.
      7. Log the value of the playerID received by the notification function in the Mutator class.

      In both client log and server log i can verify the problem.

      I have tried all but nothing seem work :cry:

      Comment


        #4
        Wait, what are you trying to do with this? Add a key binding for your mutator? If that's all you want, I can give you step-by-step to achieving that since I had to go through that for my mutator (it's a pain to figure out).

        Of course, you may need that ReplicationInfo for other things, in which case the above may not be of help to you. But I know that I didn't use a RepInfo when I setup my Interaction.

        Comment


          #5
          i know... you probably use the mutator class to do this... but i need to do different things on every player client.
          The interaction draw on the hud of every player and block all console commands... and block some other things

          I need to know the state of every player... ready / not ready... i must know who have set their ready state or not ready state.

          Comment

          Working...
          X