コード例 #1
0
    // Send down initial data the admin client will need
    public void SendInitialData(long aClientId)
    {
        // Send a bunch of data to the admin client
        List <ServerNetwork.ClientData> clients = serverNet.GetAllClients();

        foreach (ServerNetwork.ClientData client in clients)
        {
            serverNet.CallRPC("UpdateClient", aClientId, -1, client.networkIdentifier, client.connection.RemoteEndPoint.Address.ToString(), client.areaId, client.numberOfIds, client.clientType);
        }

        // Send down all the network objects
        Dictionary <int, ServerNetwork.NetworkObject> objects = serverNet.GetAllObjects();

        foreach (KeyValuePair <int, ServerNetwork.NetworkObject> obj in objects)
        {
            //public void AddObject(int aId, int aAreaId, string aPrefabName, Vector3 aPosition, Quaternion aRotation, bool aFollowsClient) {
            serverNet.CallRPC("UpdateNetObject", aClientId, -1, obj.Value.networkId, obj.Value.areaId, obj.Value.prefabName, obj.Value.position, obj.Value.rotation, obj.Value.followsClient);
        }
    }