Beispiel #1
0
    public void InstantiateGameObject(byte[] data, Socket socket, int from)
    {
        NetworkObjectData objectData = ByteParser.ConvertDataToObject(data) as NetworkObjectData;

        if (objectData.index >= ClientManager.instance.GetClientSettings().networkedObjects.Count)
        {
            Logging.CreateLog("Error: Object not found: " + objectData.index + ", " + ClientManager.instance.GetClientSettings().networkedObjects.Count);
            return;
        }

        SNetwork.Network.Instantiate(ClientManager.instance.GetClientSettings().networkedObjects[objectData.index], objectData.position, objectData.rotation, false, objectData.fromId);
    }
Beispiel #2
0
 public void Response50(byte[] resposneBytes, Socket fromSocket, int fromId)
 {
     Messaging.instance.Send(resposneBytes, 50, 2, fromId, 0, ServerManager.instance.server.clientSockets);
     Logging.CreateLog("Adding GameObject to game :) from: " + fromId);
     ServerManager.instance.server.networkObjects.Add(ByteParser.ConvertDataToObject(resposneBytes) as NetworkObject);
 }