HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Solved] How does 'call clientReplicas' work?  (Read 1217 times)

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
[Solved] How does 'call clientReplicas' work?
« on: Jan 14, 12, 06:42:04 AM »

I've got a node on the server which exists on my connected client too. From a method (it is not untrusted so I cannot do 'reply') in server script I call 'call clientReplicas me.test()' but the test never gets called in client script. How does it work, please?
« Last Edit: Jan 16, 12, 12:38:32 PM by HE-Cooper »
Logged

XCalPro

  • General Accounts
  • *
  • Posts: 105
  • 3D Artist & HSL Coder
    • View Profile
    • Excalibur Productions
Re: How does 'call clientReplicas' work?
« Reply #1 on: Jan 14, 12, 07:49:48 AM »

Code: [Select]
// a server script
public function demo(exampleNode as NodeRef)
  call clientReplicas exampleNode.aClientMethod()
.
« Last Edit: Jan 14, 12, 08:00:45 AM by XCalPro »
Logged
Tony Oliveira aka XCalPro
HeroEngine Projects: Traveller 6 Online - www.traveller6.com/forum/
Portfolio: www.xcalpro.com/art

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: How does 'call clientReplicas' work?
« Reply #2 on: Jan 14, 12, 08:07:31 AM »

Code: [Select]
// a server script
public function demo(exampleNode as NodeRef)
  call clientReplicas exampleNode.aClientMethod()
.

Yeah I found that on the wiki. The only problem is it does not work :( At least not how I am using it (see 1st post)
Logged

XCalPro

  • General Accounts
  • *
  • Posts: 105
  • 3D Artist & HSL Coder
    • View Profile
    • Excalibur Productions
Re: How does 'call clientReplicas' work?
« Reply #3 on: Jan 14, 12, 09:30:06 AM »

So your calling a client method from a server script?
Have you tried?
Code: [Select]
// a server script
public function makeRemoteCall(account as NodeRef)
  call client account aClientScript:aClientFunction( "test", 42 )
.
Code: [Select]
// a client script
remote function aClientFunction( s as string, i as integer)
  println("got s="+s+" i="+i)
.
« Last Edit: Jan 14, 12, 09:34:55 AM by XCalPro »
Logged
Tony Oliveira aka XCalPro
HeroEngine Projects: Traveller 6 Online - www.traveller6.com/forum/
Portfolio: www.xcalpro.com/art

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: How does 'call clientReplicas' work?
« Reply #4 on: Jan 14, 12, 09:50:40 AM »

Code: [Select]
call clientReplicas exampleNode.aClientMethod()would send the call to all clients to whom exampleNode is currently replicated, so if that method is not getting called, then that node is not replicated to any client.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
Re: How does 'call clientReplicas' work?
« Reply #5 on: Jan 14, 12, 02:08:59 PM »

Code: [Select]
call clientReplicas exampleNode.aClientMethod()would send the call to all clients to whom exampleNode is currently replicated, so if that method is not getting called, then that node is not replicated to any client.

Well the node is in a replication group and propagates correctly to the client so I expect it to be replicated.. Anyway, I solved it with a function call instead of method call... Thanks for answers tho
Logged