Exemplo n.º 1
0
        public void WarpRemote(string anchorName, string zoneName)
        {
            NetworkZoneTemplate template = NetworkZoneTemplate.GetZoneBySceneName(zoneName);

            UpdateCooldown(20);

            DatabaseManager.singleton.SaveDataPlayer(this.gameObject);

            // -- uses OpenMMO NetworkManager singleton instead of the Mirror one
            OpenMMO.Network.NetworkManager.singleton.TrySwitchServerPlayer(this.gameObject.name, anchorName, zoneName);

            NetworkServer.Destroy(this.gameObject);
        }
Exemplo n.º 2
0
        public void WarpRemote(string anchorName, string zoneName, int token = 0)
        {
            UpdateCooldown(GameRulesTemplate.singleton.remoteWarpDelay);

            NetworkZoneTemplate template = NetworkZoneTemplate.GetZoneBySceneName(zoneName);

            // -- update anchor & zone
            this.GetComponent <PlayerComponent>().tablePlayerZones.anchorname = anchorName;
            this.GetComponent <PlayerComponent>().tablePlayerZones.zonename   = zoneName;
            securityToken = token;     // token must not be set in table, can be fetched via GetToken

            // -- save player
            DatabaseManager.singleton.SaveDataPlayer(this.gameObject);

            OpenMMO.Network.NetworkManager.singleton.SwitchServerPlayer(this.connectionToClient, this.gameObject.name, anchorName, zoneName, securityToken);

            NetworkServer.Destroy(this.gameObject);
        }
        public void WarpRemote(string anchorName, string zoneName)
        {
            NetworkZoneTemplate template = NetworkZoneTemplate.GetZoneBySceneName(zoneName);

            UpdateCooldown(20);

            DatabaseManager.singleton.SaveDataPlayer(this.gameObject);

            // -- uses OpenMMO NetworkManager singleton instead of the Mirror one
            OpenMMO.Network.NetworkManager.singleton.TrySwitchServerPlayer(this.gameObject.name, anchorName, zoneName);

            /*
             * TODO, NOTE, BUG
             * wrong, thats client side, must be server side
             * also we must save anchorName and zoneName here
             */

            NetworkServer.Destroy(this.gameObject);
        }