Exemple #1
0
    protected void Awake()
    {
        Guid clientId = Guid.NewGuid();

        karmanClient = new KarmanClient(
            clientId, Guid.NewGuid(),
            "Client " + clientId.ToString().Substring(0, 4),
            ServerFlow.GAME_ID, ServerFlow.GAME_VERSION
            );
    }
Exemple #2
0
 protected void Start()
 {
     karmanClient                   = clientFlow.GetKarmanClient();
     clientIdText.text              = karmanClient.id.ToString();
     clientProtocolText.text        = KarmanServer.KARMAN_PROTOCOL_VERSION;
     karmanClient.OnJoinedCallback += () => {
         clientStatusText.text  = "Joined";
         clientStatusText.color = successColor;
     };
     karmanClient.OnConnectedCallback += () => {
         clientConnectionStatusText.text  = "Connected";
         clientConnectionStatusText.color = successColor;
         leaveButton.interactable         = true;
     };
     karmanClient.OnDisconnectedCallback += () => {
         clientConnectionStatusText.text  = "Not connected";
         clientConnectionStatusText.color = failureColor;
         leaveButton.interactable         = false;
     };
     karmanClient.OnLeftCallback += (reason) => {
         clientStatusText.text  = "Left: " + reason;
         clientStatusText.color = failureColor;
     };
 }
 protected void Start()
 {
     karmanClient = clientFlow.GetKarmanClient();
     karmanClient.OnPacketReceivedCallback += OnPacketReceived;
 }
Exemple #4
0
 public Replicator(KarmanClient client) : base(client.id)
 {
     this.client = client;
     this.client.OnPacketReceivedCallback += OnPacketReceived;
     this.client.OnLeftCallback           += OnLeft;
 }