Exemple #1
0
        public void CallRpcOnServer(string name, int channelId, object argumentsObj)
        {
            var rpcId   = NetLib.rpcIdByName[name];
            var rpcInfo = NetLib.rpcInfoById[rpcId];

            Assert.IsTrue(rpcInfo.ExecuteOn == NetworkPeerType.Server);

            var messageBytes = NetworkSerializationUtils.SerializeRpcCall(rpcInfo, argumentsObj);

            SendMessageToServer(channelId, messageBytes);
        }
Exemple #2
0
        public void CallRpcOnAllClientsExcept(string name, int exceptClientConnectionId, int channelId, object argumentsObj)
        {
            var rpcId   = NetLib.rpcIdByName[name];
            var rpcInfo = NetLib.rpcInfoById[rpcId];

            Assert.IsTrue(rpcInfo.ExecuteOn == NetworkPeerType.Client);

            var messageBytes = NetworkSerializationUtils.SerializeRpcCall(rpcInfo, argumentsObj);

            SendMessageToAllClientsExcept(exceptClientConnectionId, channelId, messageBytes);
        }