예제 #1
0
        public static void StartServer(int port)
        {
            PacketRecorder pr = new PacketRecorder(100, 300000);

            serverObject = new PRServer(port, objectsManager, pr, pr, new NetworkMonitor());

            RpcHandler.Initialize(RegisterMessageEvent);
            RpcHandler.ObjectRegistryCallback callback = FindNetworkEntityWithId;
            RpcHandler.SetObjectRegistryCallback(callback);

            active = true;
        }
예제 #2
0
        public static void ConnectClient(string ip, int port)
        {
            Debug.Log("Connecting client");

            PacketRecorder pr = new PacketRecorder(100, 300000);

            clientObject = new PRClient(objectsManager, pr, pr, new NetworkMonitor());
            clientObject.RequestConnection(ip, port);

            RpcHandler.Initialize(RegisterMessageEvent);
            RpcHandler.ObjectRegistryCallback callback = FindNetworkEntityWithId;
            RpcHandler.SetObjectRegistryCallback(callback);

            active = true;
        }