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

Author Topic: replication type  (Read 330 times)

Thazager

  • General Accounts
  • *
  • Posts: 1138
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
replication type
« on: Apr 04, 19, 04:02:53 PM »

I'm trying to replicate a lookuplist from server to client. It seems to work partially, as in

it will replicate:

  lookuplist indexed by integer of string             // where values are stored in a string:   "name price"

but will not replicate:

  lookuplist indexed by integer of class auction    // where values are stored in a class:   data.name   data.price


Using the string, I need to Tokenize the string before checking the value, I think the "class" would be faster in this case.  Using the class, the size of list replicates, but the values are all blank.


edit:
It does not seem to even recognize list of string

  lookuplist indexed by integer of list of string     // where values are in a list:  data[1]   data[2]

« Last Edit: Apr 04, 19, 04:42:01 PM by Thazager »
Logged

HE-CHRISTOPHER

  • HeroEngine
  • *****
  • Posts: 424
    • View Profile
Re: replication type
« Reply #1 on: Apr 04, 19, 04:43:37 PM »

A question for you...

Does the client destination class include destination fields for all of the fields marked to replicate in the server DOM (including anything it would inherit from parent class(es)?

Logged
Christopher Larsen
CTO
HeroEngine

Thazager

  • General Accounts
  • *
  • Posts: 1138
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: replication type
« Reply #2 on: Apr 04, 19, 05:21:10 PM »

Yes, before running the tests using replication, I had copied fields and classes from server to client side.

When originally making the system, I had sent the lookuplist directly from server to client and displayed the info in the GUI. It was using the class and fields at this point on both client and server.

Then I added the replication which works with the integer of string, and then tried integer of class, but it was missing the data.

edit:
will try world sleep
« Last Edit: Apr 04, 19, 05:40:34 PM by Thazager »
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: replication type
« Reply #3 on: Apr 05, 19, 12:04:19 AM »

Did you set the server-side fields of auction to have their corresponding client fields as targets of replication?
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

Thazager

  • General Accounts
  • *
  • Posts: 1138
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: replication type
« Reply #4 on: Apr 06, 19, 01:43:59 PM »

Hmm, I know I had the main list set that way. I will check and see if the others are also set, and if not will try adding them.
Logged

Thazager

  • General Accounts
  • *
  • Posts: 1138
  • Never stop learning
    • View Profile
    • Heroes and Villains MMORPG
Re: replication type
« Reply #5 on: Apr 08, 19, 11:14:34 PM »

Added the other fields for replication also.  Still not getting values.

E_nonPlayerCharacter            class that gets replicated

EO_AuctionItemList                field in class E_nonPlayerCharacter that gets replicated

   type= lookuplist indexed by integer of class AuctionData

AuctionData                          class with 5 fields   (all 5 set to replicate to client)

EO_AuctionItem                    spec ID of item
EO_AuctionPlayer                  name of player selling item
EO_AuctionPrice                    price item selling at
EO_AuctionHours                   amount of time its for sale
EO_AuctionTime                    start of time it started

All client side fields show no value for string, or 0 for ID / integer. List prints, showing they are there, but they are just blank.

Code: [Select]
shared function _OnReplicationFieldUpdated(updateNode as NodeRef, updateField as String)

  when toLower(updateField)
    is "eo_auctionitemlist"
      println("got updated auction list ")
      ShowAuctionList(updateNode)
    .
  .
.

// print values in auction list
function ShowAuctionList(npc as NodeRef)
  where npc is kindof E_nonplayerCharacter
    println("npc "+npc+"  size "+ npc.EO_AuctionItemList.length)
    data as Class AuctionData

    loop i from 1 to npc.EO_AuctionItemList.length
      data = npc.EO_AuctionItemList[i]
      println("offset "+i+"  name "+data.EO_AuctionPlayer+"  item "+data.EO_AuctionItem)
    .
  .
.



add:
Server Side
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: npc 9223372131270022109  size 10
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: offset 1  name Test1  item 22
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: offset 2  name Test2  item 26
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: offset 3  name Test3  item 11
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: offset 4  name Test4  item 3
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: offset 5  name Test5  item 15
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: offset 6  name Test6  item 19
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: offset 7  name Test7  item 6
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: offset 8  name Test8  item 2
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: offset 9  name Test9  item 16
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: offset 10  name Test10  item 10
[hsl_debug] 9223372086796021574,3: SCRIPT[E_nonPlayerCharacterClassMethods]: updating NPC auctionList Auctioneer  size 10

Client Side
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:got updated auction list
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:npc 9223372131270022109  size 10
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:offset 1  name   item 0
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:offset 2  name   item 0
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:offset 3  name   item 0
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:offset 4  name   item 0
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:offset 5  name   item 0
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:offset 6  name   item 0
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:offset 7  name   item 0
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:offset 8  name   item 0
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:offset 9  name   item 0
22:57:16: SCRIPT:[E_nonplayerCharacterClassMethods]:offset 10  name   item 0
« Last Edit: Apr 08, 19, 11:26:41 PM by Thazager »
Logged