![]() |
|
|
#1 |
|
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.
}
Last edited by emailer33; 18th Oct 2003 at 02:40 AM. |
|
|
|
|
|
#2 |
|
replication sucks, sorry i cant help ya, i hope some one else reads this and does so. :/
__________________
rm -rf /yu0 |
|
|
|
|
|
|
#3 |
|
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.
|
|
|
|
|
|
#4 | |
|
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:
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak | 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!" |
||
|
|
|
|
|
#5 |
|
in that case suck me off :]
__________________
rm -rf /yu0 |
|
|
|
|
|
|
#6 | |
|
Quote:
Now please stay out of this thread unless you can really contribute something useful.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak | 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!" |
||
|
|
|
|
|
#7 |
|
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.
|
|
|
|
|
|
#8 |
|
fyi wormbo and others; this is for ut1 not 2k3.
__________________
rm -rf /yu0 |
|
|
|
|
|
|
#9 | |
|
MSPA
Join Date: Aug. 7th, 2002
Location: The Netherlands (yes, that's Holland)
Posts: 246
|
Quote:
Wasn't the Role of a pawn on the client ROLE_Authority? |
|
|
|
|
|
|
#10 |
|
wtf whatd i do now? :|
i was honestly trying to be informative, and its true... how am i pissing you off :/
__________________
rm -rf /yu0 |
|
|
|
|
|
|
#11 | |
|
Registered User
Join Date: May. 23rd, 2002
Posts: 40
|
Quote:
|
|
|
|
|
|
|
#12 | |||
|
Quote:
![]() 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:
Quote:
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak | 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!" |
||||
|
|
|
|
|
#13 |
|
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. |
|
|
|
|
|
#14 | |
|
Registered User
Join Date: May. 23rd, 2002
Posts: 40
|
Quote:
|
|
|
|
|
|
|
#15 | |
|
Quote:
That's what I wanted to say.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak | 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!" |
||
|
|
|
|
|
#16 |
|
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.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|