News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 18th Oct 2003, 02:37 AM   #1
emailer33
Registered User
 
Join Date: May. 23rd, 2002
Posts: 40
UT Replication Trouble

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 by emailer33; 18th Oct 2003 at 02:40 AM.
emailer33 is offline   Reply With Quote
Old 18th Oct 2003, 02:41 AM   #2
Joey`
azn lolr
 
Joey`'s Avatar
 
Join Date: Jun. 23rd, 2003
Posts: 6
replication sucks, sorry i cant help ya, i hope some one else reads this and does so. :/
__________________
rm -rf /yu0
Joey` is offline   Reply With Quote
Old 18th Oct 2003, 03:42 AM   #3
Daid303
MSPA
 
Join Date: Aug. 7th, 2002
Location: The Netherlands (yes, that's Holland)
Posts: 246
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.
Daid303 is offline   Reply With Quote
Old 18th Oct 2003, 03:50 AM   #4
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,774
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.

Quote:
Originally Posted by Joey`
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 18th Oct 2003, 04:23 AM   #5
Joey`
azn lolr
 
Joey`'s Avatar
 
Join Date: Jun. 23rd, 2003
Posts: 6
in that case suck me off :]
__________________
rm -rf /yu0
Joey` is offline   Reply With Quote
Old 18th Oct 2003, 08:11 AM   #6
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,774
Quote:
Originally Posted by Joey`
in that case suck me off :]
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 18th Oct 2003, 04:10 PM   #7
emailer33
Registered User
 
Join Date: May. 23rd, 2002
Posts: 40
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.
emailer33 is offline   Reply With Quote
Old 18th Oct 2003, 04:41 PM   #8
Joey`
azn lolr
 
Joey`'s Avatar
 
Join Date: Jun. 23rd, 2003
Posts: 6
fyi wormbo and others; this is for ut1 not 2k3.
__________________
rm -rf /yu0
Joey` is offline   Reply With Quote
Old 18th Oct 2003, 05:02 PM   #9
Daid303
MSPA
 
Join Date: Aug. 7th, 2002
Location: The Netherlands (yes, that's Holland)
Posts: 246
Quote:
Originally Posted by Joey`
fyi wormbo and others; this is for ut1 not 2k3.
You're starting to piss people OFF!

Wasn't the Role of a pawn on the client ROLE_Authority?
Daid303 is offline   Reply With Quote
Old 18th Oct 2003, 06:43 PM   #10
Joey`
azn lolr
 
Joey`'s Avatar
 
Join Date: Jun. 23rd, 2003
Posts: 6
wtf whatd i do now? :|

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

how am i pissing you off :/
__________________
rm -rf /yu0
Joey` is offline   Reply With Quote
Old 18th Oct 2003, 08:43 PM   #11
emailer33
Registered User
 
Join Date: May. 23rd, 2002
Posts: 40
Quote:
Originally Posted by Daid303
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
emailer33 is offline   Reply With Quote
Old 19th Oct 2003, 04:50 AM   #12
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,774
Quote:
Originally Posted by emailer33
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".
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

Quote:
Originally Posted by emailer33
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.

Quote:
Originally Posted by Joey`
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 19th Oct 2003, 10:10 AM   #13
emailer33
Registered User
 
Join Date: May. 23rd, 2002
Posts: 40
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 is offline   Reply With Quote
Old 19th Oct 2003, 01:26 PM   #14
emailer33
Registered User
 
Join Date: May. 23rd, 2002
Posts: 40
Quote:
Originally Posted by Wormbo
Oops, missed that the topic says "UT Replication Trouble".
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
emailer33 is offline   Reply With Quote
Old 19th Oct 2003, 02:31 PM   #15
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,774
Quote:
Originally Posted by Wormbo
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.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 20th Oct 2003, 01:41 AM   #16
emailer33
Registered User
 
Join Date: May. 23rd, 2002
Posts: 40
hmm good idea. yea i thgouht this was a good structure to copy down to UT.
emailer33 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:14 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer