Beispiel #1
0
    void Start()
    {
        listen   = new AppWarpListener();
        getCards = new ArrayList();


        //bind all events

        //to connect with usa server
        //WarpClient.initialize(apiKey_us,secretKey_us);

        //to connect with Japan server
        //WarpClient.initialize(apiKey,secretKey);

        //to connect to appwarps2 server on my pc
        WarpClient.initialize(apiKey_s2, address, port);
        //WarpClient.initialize (apiKey, secretKey);

        WarpClient.setRecoveryAllowance(0);          //max recovery time set
        WarpClient.GetInstance().AddConnectionRequestListener(listen);
        WarpClient.GetInstance().AddChatRequestListener(listen);
        WarpClient.GetInstance().AddLobbyRequestListener(listen);
        WarpClient.GetInstance().AddNotificationListener(listen);
        WarpClient.GetInstance().AddRoomRequestListener(listen);
        WarpClient.GetInstance().AddUpdateRequestListener(listen);
        WarpClient.GetInstance().AddZoneRequestListener(listen);

        //connect
        UserName = UserName + UnityEngine.Random.Range(1, 1000).ToString();
        //WarpClient.GetInstance ().Connect (UserName, "");
    }