#Custom synctype not being recognized correctly

5 messages · Page 1 of 1 (latest)

ocean parrot
#

Fishnet V4.5.5R.Pro
I have an inventoryslot class which simply has two integers.

public class SyncInventorySlot2
{

    public int itemID; // Item ID 
    public int stacksize;

    public SyncInventorySlot2()
    {
        itemID = -1;
        stacksize = -1;
    }

    public SyncInventorySlot2(int id, int stack)
    {
        itemID = id;
        stacksize = stack;
    }

}

I then create a synclist of InventorySlot2 type, and everything syncs perfectly fine, with no custom synctype being used:

[AllowMutableSyncType]
public SyncList<SyncInventorySlot2> inventoryList = new SyncList<SyncInventorySlot2>(new SyncTypeSettings()
{
    ReadPermission = ReadPermission.OwnerOnly,
    WritePermission = WritePermission.ServerOnly
});

However, when I attempt to create a custom synctype for it and put it in a synclist, these two integers are no longer recognized properly. What am I doing wrong?

Attached is my custom synctype code.


lethal prism
ocean parrot
#

oooooo interesting!
Does this mean that I have no choice but to use first method and just make a synclist of my two-integer class?
And that I cant just sync a one of the two integers?
If I change one value, a new version of both integers will be sent over the network?

Oh perhaps the solution is to create a custom synclist?

lethal prism
#

To the best of my knowledge, yeah

ocean parrot