OnProximityUpdateList doesnt fire...

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

genar
Posts: 137
Joined: 13 Jul 2017, 11:49

OnProximityUpdateList doesnt fire...

Postby genar » 07 Jan 2018, 14:24

Evening !

Im stuck at the following iusse... Both of my players are in the same MMO-Room. The aoi is 100,100,0

I have two scenes in unity. One scene for the login mechanic and one actual game scene. After the player loged in via the login scene, he instantly logs out and logs in again when the game scene is loaded. Once the game scene is loaded i sent the user pos like this :

Code: Select all

public static void setPosition() {

        GameObject position = GameObject.Find("Position");
        LatLng_XY_Holder holder = position.GetComponent<LatLng_XY_Holder>();

        ConnectionManager.instance.sfs.Send(new SetUserPositionRequest(new Vec3D(holder.LatLngPosition.x, holder.LatLngPosition.y, 0)));

        Debug.Log("Pos sent");

    }


This method fires up everytime, so it seems to work. There are also no errors.

In my class ConnectionManager i listen for callbacks :

Code: Select all

 public void OnProximityListUpdate(BaseEvent evt) {

        Debug.Log("Running");

        var addedUsers = (List<User>)evt.Params["addedUsers"];
        var removedUsers = (List<User>)evt.Params["removedUsers"];

        // Handle all new Users
        foreach (User user in addedUsers)
        {

            GameObject player = GameObject.CreatePrimitive(PrimitiveType.Cube);
            player.transform.position = new Vector3(user.AOIEntryPoint.FloatX, user.AOIEntryPoint.FloatY, user.AOIEntryPoint.FloatZ);
            player.name = user.Name;

        }

        // Handle removed users
        foreach (User user in removedUsers)
        {

            Destroy(GameObject.Find(user.Name));

        }

    }


But the ProximityUpdateList never gets fired... i have no clue why that happens...

Any ideas ?
genar
Posts: 137
Joined: 13 Jul 2017, 11:49

Re: OnProximityUpdateList doesnt fire...

Postby genar » 07 Jan 2018, 15:05

Alright ... im pretty stupid...

I did send the SendUserPositionRequest before the user even entered the room. Problem solved !

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 69 guests