コード例 #1
0
    void MultiPlayerInit()
    {
        apiKey    = "58271c1a56f7b42d7a979d66e372b409ca81dabd1d1ea25c599dd1b7fd3a780b";
        secretKey = "9c38fcd3b67e65bb94a4c109ea0c2d50f0fd5f28d0bae2c66d6d8298898ac86f";
        roomIndex = 0;
        roomId    = "";

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

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



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

        serverConnection.Connect(DefinedVariables.userName);
    }
コード例 #2
0
 void Start()
 {
     Debug.Log("MULTIPLAYER ENGINE");
     roomId      = Constants.ROOM_ID;
     CARD_STATUS = Constants.BLIND;
     GAME_STATUS = Constants.STOPPED;
     theClient.AddConnectionRequestListener(this);
     theClient.AddRoomRequestListener(this);
     theClient.AddTurnBasedRoomRequestListener(this);
     theClient.AddNotificationListener(this);
     progressDialog.show("Waiting to start game");
     progressDialog.setCancelable(true);
 }
コード例 #3
0
ファイル: MainPage.xaml.cs プロジェクト: Katry4/WinRepo
        // Simple button Click event handler to take us to the second page
        public static void GetConnect(string API_key, string Secret_key)
        {
            ///не пахає
            MainPage _MPage = new MainPage();
            Random   R      = new Random();

            _MPage.textBlock1.Text = "";
            WarpClient.initialize(API_key, Secret_key);
            WarpClient game = WarpClient.GetInstance();

            game.AddConnectionRequestListener(new ConListen(_MPage));
            //game.AddZoneRequestListener(new ZoneReqListener(this));
            //game.AddRoomRequestListener(new RoomReqListener(this));
            //game.AddNotificationListener(new NotificationListener(this));
            //game.AddLobbyRequestListener(new LobbyReqListen(this));
            Thread.Sleep(500);
            UserDates._UserName = _MPage.textBox1.Text + R.Next(2000).ToString();
            WarpClient.GetInstance().Connect(UserDates._UserName);
        }
コード例 #4
0
ファイル: MainPage.xaml.cs プロジェクト: Katry4/WinRepo
        private void btn_USA_server_Click(object sender, RoutedEventArgs e)
        {
            Random R = new Random();

            textBlock1.Text = "";
            WarpClient.initialize("c27b5f96a94fe0e53183643fd1221af45ccbd94894201a0a51eacd5694bf0d36", "9dc629fdd584be0922cf38415057d1d80868a03ca60ac51c7048b68696a4ff4e");
            WarpClient game = WarpClient.GetInstance();

            game.AddConnectionRequestListener(new ConListen(this));
            //game.AddZoneRequestListener(new ZoneReqListener(this));
            //game.AddRoomRequestListener(new RoomReqListener(this));
            //game.AddNotificationListener(new NotificationListener(this));
            //game.AddLobbyRequestListener(new LobbyReqListen(this));
            Thread.Sleep(500);
            UserDates._UserName = textBox1.Text + R.Next(2000).ToString();
            WarpClient.GetInstance().Connect(UserDates._UserName);

            //GetConnect("c27b5f96a94fe0e53183643fd1221af45ccbd94894201a0a51eacd5694bf0d36", "9dc629fdd584be0922cf38415057d1d80868a03ca60ac51c7048b68696a4ff4e");
        }
コード例 #5
0
ファイル: MainActivity.cs プロジェクト: FunMan88/ProjectSyp
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            WarpClient.initialize(Constants.apiKey, Constants.secretKey);
            App42API.Initialize(Constants.apiKey, Constants.secretKey);

            w = WarpClient.GetInstance();
            w.AddConnectionRequestListener(this);

            Button   button = FindViewById <Button>(Resource.Id.myButton);
            EditText et     = FindViewById <EditText>(Resource.Id.editText1);

            button.Click += delegate
            {
                w.Connect(et.Text);
            };
        }
コード例 #6
0
    //Api refernce: http://appwarp.shephertz.com/game-development-center/csharp-api-reference/
    //Callbacks: http://appwarp.shephertz.com/game-development-center/windows-game-developers-home/windows-client-listener/#connectionrequestlistener
    // Start is called before the first frame update
    private void Start()
    {
        WarpClient.initialize("9a8f11688a5028bd91cee478f992c94a69bfbdfbf5fe661b498a922603c5cd2a", "073e537d85b820a19b211ac9714d432726b83537f85037b3631e358d31c384b8");
        WarpClient.setRecoveryAllowance(5);
        m_warpClient = WarpClient.GetInstance();

        //Registering to connection callbacks
        m_warpClient.AddConnectionRequestListener(m_warpListener);
        //Registering to Chat callbacks
        m_warpClient.AddChatRequestListener(m_warpListener);
        //Registering to Update Request callbacks
        m_warpClient.AddUpdateRequestListener(m_warpListener);
        //Registering to Lobby callbacks
        m_warpClient.AddLobbyRequestListener(m_warpListener);
        //Registering to Notifier callbacks
        m_warpClient.AddNotificationListener(m_warpListener);
        //Registering to Room/Subscribe callbacks
        m_warpClient.AddRoomRequestListener(m_warpListener);
        //Registering to Zone callbacks
        m_warpClient.AddZoneRequestListener(m_warpListener);
        //Registering to Turn Based callbacks
        m_warpClient.AddTurnBasedRoomRequestListener(m_warpListener);
    }
コード例 #7
0
 // Use this for initialization
 void Start()
 {
     //Debug.Log ("Start");
     theClient.AddConnectionRequestListener(this);
     onPlayGameClicked();
 }