Exemple #1
0
        public MainPage()
        {
            this.InitializeComponent();

            this.navigationHelper            = new NavigationHelper(this);
            this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState += this.NavigationHelper_SaveState;

            this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Required;

            // Set the data context to the friendsData global variable
            AppServices.friendsData._page      = this;
            AppServices.friendsData.myUsername = AppServices.localUsername;
            DataContext          = AppServices.friendsData;
            AppServices.mainPage = this;

            WarpClient.initialize(AppServices.apiKey, AppServices.secretKey);
            WarpClient.setRecoveryAllowance(AppServices.appWarpRecoveryTime);
            AppServices.warpClient = WarpClient.GetInstance();

            AppServices.warpClient.AddConnectionRequestListener(AppServices.connListenObj);
            AppServices.warpClient.AddNotificationListener(AppServices.notificationListnerObj);
            AppServices.warpClient.AddUpdateRequestListener(AppServices.updateListenerObj);

            // Connect to Appwarp and update our online friends in the callback
            AppServices.appWarpConnectMode = appWarpConnectModes.sendAllUpdates;
            WarpClient.GetInstance().Connect(AppServices.localUsername);
        }
Exemple #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            base.OnCreate(bundle);
            //Use UI created in Main.axml
            SetContentView(Resource.Layout.Main);

            //Create the user interface in code
            var layout = new LinearLayout(this);

            layout.Orientation = Orientation.Vertical;

            name = FindViewById <TextView> (Resource.Id.input_name);

            var showSecond = FindViewById <Button> (Resource.Id.connectButton);

            showSecond.Click += (sender, e) => {
                WarpClient.GetInstance().Connect(name.Text);
            };

            WarpClient.initialize(Constants.API_KEY, Constants.SECRET_KEY);
            WarpClient.GetInstance().AddConnectionRequestListener(this);
            WarpClient.GetInstance().AddRoomRequestListener(this);
        }
Exemple #3
0
    private void MenuInit()
    {
        unityObjects = new Dictionary <string, GameObject>();
        GameObject[] _unityObjects = GameObject.FindGameObjectsWithTag("UnityObject");
        foreach (GameObject g in _unityObjects)
        {
            unityObjects.Add(g.name, g);
        }

        unityObjects["Game"].SetActive(false);

        if (listen == null)
        {
            listen = new Listener();
        }

        WarpClient.initialize(apiKey, secretKey);
        WarpClient.GetInstance().AddConnectionRequestListener(listen);
        WarpClient.GetInstance().AddChatRequestListener(listen);
        WarpClient.GetInstance().AddUpdateRequestListener(listen);
        WarpClient.GetInstance().AddLobbyRequestListener(listen);
        WarpClient.GetInstance().AddNotificationListener(listen);
        WarpClient.GetInstance().AddRoomRequestListener(listen);
        WarpClient.GetInstance().AddZoneRequestListener(listen);
        WarpClient.GetInstance().AddTurnBasedRoomRequestListener(listen);

        matchRoomData = new Dictionary <string, object>();
        matchRoomData.Add("Password", "Shenkar2020");

        GlobalVariables.userId = System.DateTime.Now.Ticks.ToString();
        unityObjects["Txt_Menu_UserId"].GetComponent <Text>().text = "UserId: " + GlobalVariables.userId;
        UpdateStatus("Connecting...");
        WarpClient.GetInstance().Connect(GlobalVariables.userId);
    }
Exemple #4
0
    private void MenuInit()
    {
        unityObjects = new Dictionary <string, GameObject>();
        unityObjects = SC_MenuLogic.Instance.screenList;
        Debug.Log(unityObjects.Count);

        unityObjects["Btn_Play"].GetComponent <Button>().interactable = false;
        unityObjects["Screen_SinglePlayer"].SetActive(false);

        if (listen == null)
        {
            listen = new Listener();
        }

        WarpClient.initialize(apiKey, secretKey);
        WarpClient.GetInstance().AddConnectionRequestListener(listen);
        WarpClient.GetInstance().AddChatRequestListener(listen);
        WarpClient.GetInstance().AddUpdateRequestListener(listen);
        WarpClient.GetInstance().AddLobbyRequestListener(listen);
        WarpClient.GetInstance().AddNotificationListener(listen);
        WarpClient.GetInstance().AddRoomRequestListener(listen);
        WarpClient.GetInstance().AddZoneRequestListener(listen);
        WarpClient.GetInstance().AddTurnBasedRoomRequestListener(listen);

        matchRoomData = new Dictionary <string, object>();

        userId = System.DateTime.Now.Ticks.ToString();
        unityObjects["Txt_UserId"].GetComponent <Text>().text = userId;
        Debug.Log(userId);
        WarpClient.GetInstance().Connect(userId);
        UpdateStatus("Connecting...");
    }
Exemple #5
0
    void Start()
    {
        WarpClient.initialize(apiKey, secretKey);
        WarpClient.GetInstance().AddConnectionRequestListener(listener);
        WarpClient.GetInstance().AddChatRequestListener(listener);
        WarpClient.GetInstance().AddRoomRequestListener(listener);
        WarpClient.GetInstance().AddNotificationListener(listener);

        username = "******" + Random.Range(1, 9000);
        WarpClient.GetInstance().Connect(username);
    }
        public JoinPage()
        {
            InitializeComponent();

            // Initialize the SDK with your applications credentials that you received
            // after creating the app from http://apphq.shephertz.com
            WarpClient.initialize(GlobalContext.API_KEY, GlobalContext.SECRET_KEY);
            WarpClient.setRecoveryAllowance(60);
            // Keep a reference of the SDK singleton handy for later use.
            GlobalContext.warpClient = WarpClient.GetInstance();
        }
Exemple #7
0
        public void ConnectToGameserver()
        {
            WarpClient.initialize(Secret.GameServerAPIKey, Secret.GameServerAPIPassword);
            MyGame = WarpClient.GetInstance();

            GameConListener         = new ConnectionListener(this);
            GameZoneRequestListener = new ZoneRequestListener(this);
            MyGame.AddConnectionRequestListener(GameConListener);
            MyGame.AddZoneRequestListener(GameZoneRequestListener);

            MyGame.Connect(Username);
        }
Exemple #8
0
        public void ConnectToGameServer()
        {
            WarpClient.initialize(Secret.GameServerAPIKey, Secret.GameServerAPIPassword);
            WarpClient.setRecoveryAllowance(60);
            MyGame = WarpClient.GetInstance();

            GameConListener         = new ConnectionListener(this);
            GameZoneRequestListener = new ZoneRequestListener(this);
            MyGame.AddConnectionRequestListener(GameConListener);
            MyGame.AddZoneRequestListener(GameZoneRequestListener);

            MyGame.Connect(QuizmasterName);
            MyGame.SetGeo("EU");
        }
 public static void AddEvents(string apiKey, string secretKey)
 {
     WarpClient.initialize(apiKey, secretKey);
     client = WarpClient.GetInstance();
     WarpClient.GetInstance().AddConnectionRequestListener(listener);
     WarpClient.GetInstance().AddChatRequestListener(listener);
     WarpClient.GetInstance().AddUpdateRequestListener(listener);
     WarpClient.GetInstance().AddLobbyRequestListener(listener);
     WarpClient.GetInstance().AddNotificationListener(listener);
     WarpClient.GetInstance().AddRoomRequestListener(listener);
     WarpClient.GetInstance().AddZoneRequestListener(listener);
     WarpClient.GetInstance().AddTurnBasedRoomRequestListener(listener);
     WarpClient.GetInstance().AddChatRequestListener(listener);
 }
Exemple #10
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);
            var rootNavigationController = new UINavigationController();

            WarpClient.initialize(Constants.API_KEY, Constants.SECRET_KEY);

            JoinController jc = new JoinController();

            rootNavigationController.PushViewController(jc, false);

            this.window.RootViewController = rootNavigationController;
            window.MakeKeyAndVisible();

            return(true);
        }
Exemple #11
0
        public GoneBananasGame()
        {
            graphics = new GraphicsDeviceManager(this);

            Content.RootDirectory = "Content";
            graphics.IsFullScreen = false;

            CCApplication application = new GoneBananasApplication(this, graphics);

            Components.Add(application);

            WarpClient.initialize(Constants.AppKey, Constants.SecretKey);

            // You can take input from user or do facebook/3rd party login etc.
            // Using random name to keep things simple
            Context.username = RandomString(4);
        }
Exemple #12
0
 public MainPage()
 {
     UIDispatcher.Initialize();
     this.InitializeComponent();
     //MasterClient.initialize("192.168.1.78", 12349);
     //WarpClient.initialize("0a338a1f-4521-4acf-9", "192.168.1.17");
     WarpClient.initialize(CloudApiKey, SecretApiKey);
     WarpClient.GetInstance().AddConnectionRequestListener(new ConnectionListen(tblResponse));
     WarpClient.GetInstance().AddNotificationListener(new NotificationListener(tblNotification));
     WarpClient.GetInstance().AddZoneRequestListener(new ZoneListener(tblResponse));
     WarpClient.GetInstance().AddRoomRequestListener(new RoomListener(tblResponse));
     WarpClient.GetInstance().AddUpdateRequestListener(new UpdateListener(tblResponse));
     WarpClient.GetInstance().AddLobbyRequestListener(new LobbyListener(tblResponse));
     WarpClient.GetInstance().AddTurnBasedRoomRequestListener(new TurnRoomListener(tblResponse));
     WarpClient.setRecoveryAllowance(60);
     //MasterClient.GetInstance().AddMasterRequestListener(new MasterListener(tblMessage));
 }
        public void Connection()
        {
            // Debug.Log ("working "+UserController.getInstance.ID);
            string player_name = UserController.getInstance.ID;

            WarpClient.initialize(appKey, ipAddress, port);
            WarpClient.setRecoveryAllowance(120);
            newConnection = true;
            listen        = GetComponent <Listener>();
            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);
            WarpClient.GetInstance().Connect(player_name, "");
        }
Exemple #14
0
        public void Connection()
        {
            string player_name = PlayerPrefs.GetString(PlayerDetails.ConnectionId);

            Debug.Log("player_name " + player_name);
            //player_name = "Ram";
            WarpClient.initialize(appKey, ipAddress, port);
            WarpClient.setRecoveryAllowance(100);
            listen = new Roulette_ListnerClass();
            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);
            WarpClient.GetInstance().Connect(player_name, "");
        }
Exemple #15
0
    // Use this for initialization
    void Start()
    {
        WarpClient.initialize("ad7a9695fd69c0d124977e2753fa6d3ae73a25d006e16d2192ed3548a220d11f", "b7b5f6797bc48d54628c14b98089ef64a3592deec4df49df7e19a5ac7a47c8de");
        ServiceApi = new ServiceAPI("ad7a9695fd69c0d124977e2753fa6d3ae73a25d006e16d2192ed3548a220d11f", "b7b5f6797bc48d54628c14b98089ef64a3592deec4df49df7e19a5ac7a47c8de");

        listener = GetComponent <MultiplayerListener>();
        WarpClient.GetInstance().AddConnectionRequestListener(listener);
        WarpClient.GetInstance().AddChatRequestListener(listener);
        WarpClient.GetInstance().AddLobbyRequestListener(listener);
        WarpClient.GetInstance().AddNotificationListener(listener);
        WarpClient.GetInstance().AddRoomRequestListener(listener);
        WarpClient.GetInstance().AddUpdateRequestListener(listener);
        WarpClient.GetInstance().AddZoneRequestListener(listener);

        UserManagement.InitializeUserManagement();

        StaticPlayer = NonStaticPlayer;
    }
Exemple #16
0
    void Start()
    {
        //Initialise the WarpClient with API KEY and SECRET KEY.
        WarpClient.initialize(apiKey, secretKey);
        listen = GetComponent <scene1_listener>();
        //WarpClient is a singleton Class, always use GetInstance() to access the singeton object of WarpClient
        //Add the listeners to the WarpClient. We only need Connection, Room, Notification and Chat Listeners for this sample
        WarpClient.GetInstance().AddConnectionRequestListener(listen);
        WarpClient.GetInstance().AddChatRequestListener(listen);
        WarpClient.GetInstance().AddNotificationListener(listen);
        WarpClient.GetInstance().AddRoomRequestListener(listen);

        // join with a unique name (current time stamp)
        username = System.DateTime.UtcNow.Ticks.ToString();
        //Connect to the AppWarp Server
        WarpClient.GetInstance().Connect(username);

        //EditorApplication.playmodeStateChanged += OnEditorStateChanged;
    }
 private void Init()
 {
     listener = new Listener();
     rooms    = new List <string>();
     data     = new Dictionary <string, object> {
         { "Password", "12345" }
     };
     WarpClient.initialize(Globals.API_KEY, Globals.SECRET_KEY);
     WarpClient.GetInstance().AddConnectionRequestListener(listener);
     WarpClient.GetInstance().AddChatRequestListener(listener);
     WarpClient.GetInstance().AddUpdateRequestListener(listener);
     WarpClient.GetInstance().AddLobbyRequestListener(listener);
     WarpClient.GetInstance().AddNotificationListener(listener);
     WarpClient.GetInstance().AddRoomRequestListener(listener);
     WarpClient.GetInstance().AddZoneRequestListener(listener);
     WarpClient.GetInstance().AddTurnBasedRoomRequestListener(listener);
     DontDestroyOnLoad(WarpClient.GetInstance());
     username = System.DateTime.UtcNow.Ticks.ToString();
 }