// HANDLER /////////////////////////
 // ACCOUNT /////////////////////////
 public static void client_validate_username_handler(string dataObject, NetworkPlayer np)
 {
     PurpleDebug.Log("Username validation received: #" + np.ToString());
     _PMBasic.Data basicData = PurpleSerializer.StringToObjectConverter<_PMBasic.Data> (dataObject);
     basicData.validate = AccountHelper.IsUniqueUsername (basicData.data);
     PurpleNetwork.ToPlayer (np, "server_validate_username_result", basicData);
 }
Ejemplo n.º 2
0
 public static string GenerateToken(string identifier, string password_or_token, NetworkPlayer? np = null)
 {
     PurpleAccount userData = get_database_user (identifier);
     if(userData == null)
         return string.Empty;
     return GenerateToken (userData, password_or_token, np);
 }
		void GetAveragePing()
		{
		
			if (!cachePlayerReference)
			{
				_player = Network.connections[playerIndex.Value];
			}
			
			int _averagePing = Network.GetAveragePing(_player);
			if (!averagePing.IsNone)
			{
				averagePing.Value = _averagePing;
			}
			
			if (_averagePing ==-1 && PlayerNotFoundEvent != null)
			{
				Fsm.Event(PlayerNotFoundEvent);
			}
			
			if (_averagePing!=-1 && PlayerFoundEvent !=null)
			{
				Fsm.Event(PlayerFoundEvent);
			}
					
		}
    static void NetworkPlayer_externalIP(JSVCall vc)
    {
        UnityEngine.NetworkPlayer _this = (UnityEngine.NetworkPlayer)vc.csObj;
        var result = _this.externalIP;

        JSApi.setStringS((int)JSApi.SetType.Rval, result);
    }
Ejemplo n.º 5
0
        public bool checkJobAvailable(string typeString, int carNumber, NetworkPlayer networkPlayer)
        {
            if (carNumber < 0 || carNumber >= Game.Cars.Count)
            {
                return false;
            }

            Car car = Game.Cars[carNumber];
            if (car == null)
            {
                return false;
            }

            Player player = (typeString == "Throttler" ? car.Throttler : car.Driver);
            if (player.NetworkPlayer != default(NetworkPlayer))
            {
                return false;
            }

            if (typeString == "Throttler")
            {
                car.Throttler.NetworkPlayer = networkPlayer;
            }
            else
            {
                car.Driver.NetworkPlayer = networkPlayer;
            }
            return true;
        }
    static void NetworkPlayer_externalPort(JSVCall vc)
    {
        UnityEngine.NetworkPlayer _this = (UnityEngine.NetworkPlayer)vc.csObj;
        var result = _this.externalPort;

        JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(result));
    }
// fields

// properties
    static void NetworkPlayer_ipAddress(JSVCall vc)
    {
        UnityEngine.NetworkPlayer _this = (UnityEngine.NetworkPlayer)vc.csObj;
        var result = _this.ipAddress;

        JSApi.setStringS((int)JSApi.SetType.Rval, result);
    }
 static bool NetworkPlayer_op_Inequality__NetworkPlayer__NetworkPlayer(JSVCall vc, int argc)
 {
     UnityEngine.NetworkPlayer arg0 = (UnityEngine.NetworkPlayer)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
     UnityEngine.NetworkPlayer arg1 = (UnityEngine.NetworkPlayer)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
     JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(arg0 != arg1));
     return(true);
 }
Ejemplo n.º 9
0
 public void OnPlayerConnected(UnityEngine.NetworkPlayer a)
 {
     if (fn != null)
     {
         fn.invoke(gameObject, a);
     }
 }
Ejemplo n.º 10
0
 public void ServerPlaceBlock( NetworkPlayer sender, int x, int y, int z, int chunkx, int chunky, int chunkz, int data )
 {
     if (EnableDebugLog) Debug.Log ("UniblocksServer: Received PlaceBlock from player " + sender.ToString());
     // You can check whether the change sent by the client is valid here
     // if (true) {
     DistributeChange (sender, x,y,z, chunkx, chunky,chunkz, data, false);
     // }
 }
 public static void SwitchServer(NetworkPlayer np, string hostname, string password, int port, string token)
 {
     _PMServer.SwitchMessage switchObject = new _PMServer.SwitchMessage ();
     switchObject.Hostname = hostname;
     switchObject.Password = password;
     switchObject.Port = port;
     switchObject.SwitchToken = token;
     PurpleNetwork.ToPlayer (np, "server_switch", switchObject);
 }
        // DESTROY /////////////////////////
        public static void remove_account_handler(object ob, NetworkPlayer np)
        {
            PurpleNetwork.RemoveListener("client_validate_username", client_validate_username_handler);
            PurpleNetwork.RemoveListener("client_register", client_register_handler);
            PurpleNetwork.RemoveListener("client_disable", client_disable_handler);

            PurpleNetwork.RemoveListener("client_create_character", client_create_character_handler);

            PurpleNetwork.DisconnectedFromPurpleServer -= remove_account_handler;
        }
Ejemplo n.º 13
0
 public static void SendRPC(string rpcName, int eventIndex, UnityEngine.NetworkPlayer target, Distance::IBitSerializable data, NetworkView view)
 {
     bitStreamWriter.Clear();
     bitStreamWriter.Serialize(ref eventIndex);
     if (data != null)
     {
         data.Serialize(bitStreamWriter);
     }
     view.RPC(rpcName, target, new object[] { bitStreamWriter.ToBytes() });
 }
        public static void client_authenticate_switch_handler(string dataObject, NetworkPlayer np)
        {
            PurpleDebug.Log("Authentication Switch received: #" + np.ToString());
            if(np.ToString() == Constants.SERVER_ID_STRING && Network.isServer) return;

            _PMClient.Authentication authObject = PurpleSerializer.StringToObjectConverter<_PMClient.Authentication> (dataObject);
            bool validationResult = false;
            string newToken = string.Empty;

            // TODO...
        }
        //TODO: test
        public static void client_disable_handler(string dataObject, NetworkPlayer np)
        {
            PurpleDebug.Log("Authentication received: #" + np.ToString());
            _PMClient.Authentication authObject = PurpleSerializer.StringToObjectConverter<_PMClient.Authentication> (dataObject);
            _PMBasic.Boolean returnData = new _PMBasic.Boolean ();
            returnData.value = AccountHelper.Disable (authObject.ClientName, authObject.ClientPassword, np);

            AccountHelper.AddLog(get_network_player_reference(np).UserName,
                                 "client_disable_handler " + authObject.ClientName + " - " + returnData.value.ToString());
            PurpleNetwork.ToPlayer (np, "server_disable_result", returnData);
        }
Ejemplo n.º 16
0
 public void SendVoxelData( NetworkPlayer player, int chunkx, int chunky, int chunkz )
 {
     // >> You can check whether the request for voxel data is valid here <<
     // if (true) {
     Chunk chunk = ChunkManager.SpawnChunk (chunkx,chunky,chunkz).GetComponent<Chunk>(); // get the chunk (spawn it if it's not spawned already)
     chunk.Lifetime = 0f; // refresh the chunk's lifetime
     string data = ChunkDataFiles.CompressData (chunk); // get data from the chunk and compress it
     byte[] dataBytes = GetBytes (data); // convert to byte array (sending strings over RPC doesn't work too well)
     GetComponent<NetworkView>().RPC ("ReceiveVoxelData", player, chunkx, chunky, chunkz, dataBytes); // send compressed data to the player who requested it
     // }
 }
    static bool NetworkPlayer_ToString(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 0)
        {
            UnityEngine.NetworkPlayer argThis = (UnityEngine.NetworkPlayer)vc.csObj;                JSApi.setStringS((int)JSApi.SetType.Rval, argThis.ToString());
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
Ejemplo n.º 18
0
 public override void OnEnter()
 {
     if (this.cachePlayerReference)
     {
         this._player = Network.connections[this.playerIndex.Value];
     }
     this.GetLastPing();
     if (!this.everyFrame)
     {
         base.Finish();
     }
 }
    static bool Network_GetLastPing__NetworkPlayer(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 1)
        {
            UnityEngine.NetworkPlayer arg0 = (UnityEngine.NetworkPlayer)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(UnityEngine.Network.GetLastPing(arg0)));
        }

        return(true);
    }
    static bool NetworkPlayer_GetHashCode(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 0)
        {
            UnityEngine.NetworkPlayer argThis = (UnityEngine.NetworkPlayer)vc.csObj;                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(argThis.GetHashCode()));
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
    static bool Network_RemoveRPCs__NetworkPlayer(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 1)
        {
            UnityEngine.NetworkPlayer arg0 = (UnityEngine.NetworkPlayer)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            UnityEngine.Network.RemoveRPCs(arg0);
        }

        return(true);
    }
 // EVENT /////////////////////////
 public static void connected_to_server_handler(object ob, NetworkPlayer np)
 {
     // TODO - server switch
     if(string.IsNullOrEmpty(PurpleClient.CurrentConfig.ServerSwitchToken))
     {
         Calls.Base.Authenticate (PurpleClient.CurrentConfig);
     }
     else
     {
         Calls.Base.AuthenticateSwitch (PurpleClient.CurrentConfig);
     }
     Calls.Base.GetVersion ();
 }
    static bool Network_CloseConnection__NetworkPlayer__Boolean(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 2)
        {
            UnityEngine.NetworkPlayer arg0 = (UnityEngine.NetworkPlayer)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            System.Boolean            arg1 = (System.Boolean)JSApi.getBooleanS((int)JSApi.GetType.Arg);
            UnityEngine.Network.CloseConnection(arg0, arg1);
        }

        return(true);
    }
		public override void OnEnter()
		{
			if (cachePlayerReference){
				_player = Network.connections[playerIndex.Value];
			}
			
			GetLastPing();
			
			if(!everyFrame)
			{
				Finish();
			}
		}
    static bool Network_RemoveRPCs__NetworkPlayer__Int32(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 2)
        {
            UnityEngine.NetworkPlayer arg0 = (UnityEngine.NetworkPlayer)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            System.Int32 arg1 = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
            UnityEngine.Network.RemoveRPCs(arg0, arg1);
        }

        return(true);
    }
Ejemplo n.º 26
0
        // multiplayer
        public static void DestroyBlockMultiplayer( VoxelInfo voxelInfo, NetworkPlayer sender )
        {
            // received from server, don't use directly

            GameObject voxelObject = Instantiate ( Engine.GetVoxelGameObject (voxelInfo.GetVoxel()) ) as GameObject;
            VoxelEvents events = voxelObject.GetComponent<VoxelEvents>();
            if (events != null) {
            events.OnBlockDestroy(voxelInfo);
            events.OnBlockDestroyMultiplayer(voxelInfo, sender);
            }
            voxelInfo.chunk.SetVoxel (voxelInfo.index, 0, true);
            Destroy(voxelObject);
        }
// methods

    static bool NetworkPlayer_Equals__Object(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 1)
        {
            System.Object             arg0    = (System.Object)JSMgr.datax.getWhatever((int)JSApi.GetType.Arg);
            UnityEngine.NetworkPlayer argThis = (UnityEngine.NetworkPlayer)vc.csObj;                JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(argThis.Equals(arg0)));
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
// methods

    static bool NetworkView_SetScope__NetworkPlayer__Boolean(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 2)
        {
            UnityEngine.NetworkPlayer arg0 = (UnityEngine.NetworkPlayer)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            System.Boolean            arg1 = (System.Boolean)JSApi.getBooleanS((int)JSApi.GetType.Arg);
            JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(((UnityEngine.NetworkView)vc.csObj).SetScope(arg0, arg1)));
        }

        return(true);
    }
        public static void client_authenticate_handler(string dataObject, NetworkPlayer np)
        {
            PurpleDebug.Log("Authentication received: #" + np.ToString());
            if(np.ToString() == Constants.SERVER_ID_STRING && Network.isServer) return;

            _PMClient.Authentication authObject = PurpleSerializer.StringToObjectConverter<_PMClient.Authentication> (dataObject);
            bool validationResult = false;
            string newToken = string.Empty;

            if(string.IsNullOrEmpty(authObject.ClientPassword))
            {
                validationResult = AccountHelper.ValidateAuthentication (authObject.ClientName, authObject.ClientToken);
                if(validationResult)
                    newToken = AccountHelper.GenerateToken(authObject.ClientName, authObject.ClientToken, np);
            }
            else
            {
                validationResult = AccountHelper.Login (authObject.ClientName, authObject.ClientPassword, np, out newToken);
            }

            authObject.validate = validationResult;
            authObject.timestamp = DateTime.Now;

            // save 2 spaces if monitoring is allowed otherwise just one for Admin/Mod/GM
            int maxAllowedConnections = PurpleServer.CurrentConfig.ServerMaxClients;
            maxAllowedConnections -= (PurpleServer.CurrentConfig.ServerAllowMonitoring) ? 2 : 1;

            authObject.ClientPassword = String.Empty;
            authObject.ClientToken = String.Empty;
            authObject.ClientAuthenticated = false;

            if(validationResult && PurpleServer.UserList.Count <= maxAllowedConnections)
            {
                authObject.ClientToken = newToken;
                authObject.ClientAuthenticated = true;

            }
            else if(validationResult)
            {
                PurpleNetworkUser playerReference = get_network_player_reference(np);
                if (playerReference.UserType != UserTypes.User)
                {
                    authObject.ClientToken = newToken;
                    authObject.ClientAuthenticated = true;
                }
            }
            AccountHelper.AddLog(get_network_player_reference(np).UserName, "client_authenticate_handler "
                                 + authObject.ClientName + " - "+ authObject.ClientAuthenticated);
            PurpleDebug.Log("Authentication result: " + authObject.ClientName + ": " + authObject.ClientAuthenticated);
            PurpleNetwork.ToPlayer(np, "server_authenticate_result", authObject);
        }
    static bool Network_SetSendingEnabled__NetworkPlayer__Int32__Boolean(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 3)
        {
            UnityEngine.NetworkPlayer arg0 = (UnityEngine.NetworkPlayer)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            System.Int32   arg1            = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
            System.Boolean arg2            = (System.Boolean)JSApi.getBooleanS((int)JSApi.GetType.Arg);
            UnityEngine.Network.SetSendingEnabled(arg0, arg1, arg2);
        }

        return(true);
    }
Ejemplo n.º 31
0
        public static void ChangeBlockMultiplayer( VoxelInfo voxelInfo, ushort data, NetworkPlayer sender )
        {
            // received from server, don't use directly

            voxelInfo.chunk.SetVoxel (voxelInfo.index, data, true);

            GameObject voxelObject = Instantiate ( Engine.GetVoxelGameObject (data) ) as GameObject;
            VoxelEvents events = voxelObject.GetComponent<VoxelEvents>();
            if (events != null) {
            events.OnBlockChange(voxelInfo);
            events.OnBlockChangeMultiplayer(voxelInfo, sender);
            }
            Destroy (voxelObject);
        }
Ejemplo n.º 32
0
        public PurpleNetworkUser(NetworkPlayer player)
        {
            UserReference 		= player;

            UserGUID 			= new Guid ();
            UserID				= -1;
            UserType 			= UserTypes.User;
            UserAuthenticated 	= false;
            UserConnectedTime 	= DateTime.Now;

            UserName			= String.Empty;
            UserPassword        = String.Empty;
            UserToken 			= String.Empty;
            UserTokenCreated	= DateTime.MinValue;
        }
Ejemplo n.º 33
0
        public void ReceiveChangeBlock( NetworkPlayer sender, int x, int y, int z, int chunkx, int chunky, int chunkz, int data )
        {
            // receives a change sent by other client or server

            GameObject chunkObject = ChunkManager.GetChunk (chunkx,chunky,chunkz);
            if (chunkObject != null) {

            // convert back to VoxelInfo
            Index voxelIndex = new Index (x,y,z);
            VoxelInfo info = new VoxelInfo (voxelIndex, chunkObject.GetComponent<Chunk>());

            // apply change
            Voxel.ChangeBlockMultiplayer (info, (ushort)data, sender);
            }
        }
        // DESTROY /////////////////////////
        public static void remove_base_handler(object ob, NetworkPlayer np)
        {
            PurpleClient.CurrentConfig.PlayerAuthenticated = false;
            PurpleNetwork.ConnectedToPurpleServer -= connected_to_server_handler;

            PurpleNetwork.RemoveListener("server_broadcast", server_broadcast_handler);

            PurpleNetwork.RemoveListener("server_authenticate_result", server_authenticate_result_handler);
            PurpleNetwork.RemoveListener("server_generate_token_result", server_generate_token_result_handler);
            PurpleNetwork.RemoveListener("server_logout_result", server_logout_result_handler);
            PurpleNetwork.RemoveListener("server_ping", server_ping_handler);
            PurpleNetwork.RemoveListener("server_switch", server_switch_handler);
            PurpleNetwork.RemoveListener("server_version_result", server_version_result_handler);

            PurpleNetwork.DisconnectedFromPurpleServer -= remove_base_handler;
        }
Ejemplo n.º 35
0
 private void GetLastPing()
 {
     if (!this.cachePlayerReference)
     {
         this._player = Network.connections[this.playerIndex.Value];
     }
     int num = Network.GetLastPing(this._player);
     this.lastPing.Value = num;
     if (num == -1 && this.PlayerNotFoundEvent != null)
     {
         base.Fsm.Event(this.PlayerNotFoundEvent);
     }
     if (num != -1 && this.PlayerFoundEvent != null)
     {
         base.Fsm.Event(this.PlayerFoundEvent);
     }
 }
        void GetLastPing()
        {
            if (!cachePlayerReference){

                _player = Network.connections[playerIndex.Value];
            }

            int _lastPing = Network.GetLastPing(_player);
            lastPing.Value = _lastPing;

            if (_lastPing ==-1 && PlayerNotFoundEvent != null){
                Fsm.Event(PlayerNotFoundEvent);
            }

            if (_lastPing!=-1 && PlayerFoundEvent !=null)
            {
                Fsm.Event(PlayerFoundEvent);
            }
        }
Ejemplo n.º 37
0
        public static bool Disable(string identifier, string password, NetworkPlayer? np = null)
        {
            if(!ValidateAuthentication (identifier, password))
                return false;

            PurpleAccount userData = get_database_user (identifier);
            if(userData == null)
                return false;

            userData.active = false;

            if(np != null)
            {
                return update_user_reference (userData, np, false);
            }
            else
            {
                return update_user_reference (userData, false);
            }
        }
Ejemplo n.º 38
0
        public void SetupServer()
        {
            _networkPlayer = new NetworkPlayer();
            _gameObject = GameObject.CreatePrimitive(PrimitiveType.Cube);
            _testServer = _gameObject.AddComponent<Server>();
            _carObject = _gameObject.AddComponent<CarBehaviour>();
            Network = new Mock<INetwork>();
            NetworkView = new Mock<INetworkView>();
            _testServer.Game = new Game();
            _testServer.Network = Network.Object;
            _testServer.StartServer();
            _testServer.NetworkView = NetworkView.Object;
            _carObject.NetworkView = NetworkView.Object;

            var cars = new List<Car>();
            for (var i = 0; i < GameData.CARS_AMOUNT; i++)
            {
                var c = new Car(_carObject);
                cars.Add(c);
            }
            MainScript.Cars = cars;
        }
        // HANDLER /////////////////////////
        // GAMEMASTER /////////////////////////
        public static void gamemaster_add_warning_handler(string dataObject, NetworkPlayer np)
        {
            PurpleDebug.Log("Gamemaster add warning received: #" + np.ToString(), 1);
            _PMGamemaster.Warning accountWarning = PurpleSerializer.StringToObjectConverter<_PMGamemaster.Warning> (dataObject);
            string password_or_token = string.Empty;

            PurpleNetworkUser playerReference = get_network_player_reference(np);
            if (playerReference.UserType != UserTypes.User)
            {
                if(!string.IsNullOrEmpty(accountWarning.gmToken))
                    password_or_token = accountWarning.gmToken;
                if(!string.IsNullOrEmpty(accountWarning.gmPassword))
                    password_or_token = accountWarning.gmPassword;

                accountWarning.validate = AccountHelper.AddWarning (accountWarning.gmUsername, password_or_token,
                    accountWarning.warningUser, accountWarning.warningComment,
                    accountWarning.warningLevel);

                AccountHelper.AddLog (get_network_player_reference (np).UserName,
                    "gamemaster_add_warning_handler " + accountWarning.gmUsername);
                PurpleNetwork.ToPlayer (np, "server_add_warning_result", accountWarning);
            }
        }
 public static void server_authenticate_result_handler(string dataObject, NetworkPlayer np)
 {
     _PMClient.Authentication authObject = PurpleSerializer.StringToObjectConverter<_PMClient.Authentication> (dataObject);
     if (authObject.validate)
     {
         PurpleClient.CurrentConfig.PlayerAuthenticated = authObject.ClientAuthenticated;
         if (!authObject.ClientAuthenticated)
         {
             // authentication okay but too many clients connected
             trigger_purple_event (Authentication, authObject);
             return;
         }
         PurpleClient.CurrentConfig.ClientToken = authObject.ClientToken;
         PurpleClient.CurrentConfig.ClientTokenCreated = authObject.timestamp;
         // authentication okay
         trigger_purple_event (Authentication, authObject);
     }
     else
     {
         // incorect data
         trigger_purple_event (Authentication, authObject);
     }
 }
        public static void client_register_handler(string dataObject, NetworkPlayer np)
        {
            PurpleDebug.Log("Registration received: #" + np.ToString());
            _PMClient.CreateAccount accountData = PurpleSerializer.StringToObjectConverter<_PMClient.CreateAccount> (dataObject);
            Entities.Database.PurpleAccount purpleAccount = new Entities.Database.PurpleAccount ();

            purpleAccount.birthday		= accountData.ClientBirthday;
            purpleAccount.country_code	= accountData.ClientCountry;
            purpleAccount.email 		= accountData.ClientEmail;
            purpleAccount.first_name 	= accountData.ClientFirstName;
            purpleAccount.gender 		= accountData.ClientGender;
            purpleAccount.language_code = accountData.ClientLanguage;
            purpleAccount.last_name 	= accountData.ClientLastName;
            purpleAccount.username 		= accountData.ClientName;

            // TODO: test
            accountData.validate = AccountHelper.Register (purpleAccount, accountData.ClientPassword);
            accountData.error = AccountHelper.GetErrorList();

            AccountHelper.AddLog(get_network_player_reference(np).UserName,
                                 "client_register_handler " + accountData.ClientName + " - " + accountData.validate.ToString());
            PurpleNetwork.ToPlayer (np, "server_register_result", accountData);
        }
Ejemplo n.º 42
0
 public void Serialize(ref NetworkPlayer value)
 {
     int index = value.index;
     this.Serializei(ref index);
     value.index = index;
 }
Ejemplo n.º 43
0
 private static extern void INTERNAL_CALL_Internal_GetOwner(ref NetworkViewID value, out NetworkPlayer player);
Ejemplo n.º 44
0
 void OnPlayerDisconnected(UnityEngine.NetworkPlayer player)
 {
     //Network.CloseConnection(Network.player, true);
     //SceneManager.LoadScene("Menu");
 }
Ejemplo n.º 45
0
 public void OnPlayerConnected(UnityEngine.NetworkPlayer a)
 {
     RunFunctions(a);
 }
 public override void Fire(UnityEngine.NetworkPlayer target, Distance::IBitSerializable data)
 {
     DistanceServerMain.SendRPC("ReceiveSerializeEvent", eventIndex, target, null, networkView);
 }
Ejemplo n.º 47
0
 public void SetUnityPlayer(UnityEngine.NetworkPlayer player)
 {
     unityPlayer    = player;
     unityPlayerSet = true;
 }
Ejemplo n.º 48
0
 public virtual void Fire(UnityEngine.NetworkPlayer target, Distance::IBitSerializable data)
 {
     Log.WriteLine("Fired RPC to unimplemented NetworkEvent");
 }
 void OnPlayerDisconnected(UnityEngine.NetworkPlayer player)
 {
     Debug.Log("Clean up after player " + player);
     Network.RemoveRPCs(player);
     Network.DestroyPlayerObjects(player);
 }
Ejemplo n.º 50
0
 /// <summary>Called on the server whenever a player disconnected from the server.</summary>
 public override void OnPlayerDisconnected(NetworkPlayer player)
 {
     if (onPlayerDisconnected != null) onPlayerDisconnected.OnNext(player);
 }
Ejemplo n.º 51
0
 public override void Fire(UnityEngine.NetworkPlayer target, Distance::IBitSerializable data)
 {
     DistanceServerMain.SendRPC("ReceiveServerToClientEvent", DistanceServerMain.ServerToClientEvents.IndexOf(this), target, data);
 }
Ejemplo n.º 52
0
 private static extern void INTERNAL_CALL_Internal_GetOwner(ref NetworkViewID value, out NetworkPlayer player);
Ejemplo n.º 53
0
 public void OnPlayerConnected(NetworkPlayer player)
 {
 }
Ejemplo n.º 54
0
 public static void SendRPC(string rpcName, int eventIndex, UnityEngine.NetworkPlayer target, Distance::IBitSerializable data)
 {
     SendRPC(rpcName, eventIndex, target, data, View);
 }
Ejemplo n.º 55
0
 public Boolean UnityEngine.NetworkPlayer::op_Inequality(UnityEngine.NetworkPlayer,UnityEngine.NetworkPlayer)
Ejemplo n.º 56
0
 internal static void Internal_GetOwner(NetworkViewID value, out NetworkPlayer player)
 {
     NetworkViewID.INTERNAL_CALL_Internal_GetOwner(ref value, out player);
 }