Unable to connect- Please help!

0 votes

Hi all.. fairly new to programming and have just found out about AppWarp. Will be very useful for a project I am working on, however I am unable to connect app when running my program. I have been prodding at the issue and looking for solutions online for hours now and I can not figure out what is going wrong here. I am programming a Windows Forms application in c# using visual studio. Any help is appreciated. I'll note that I also was unable to connect the sample webpage chat aswell.

My connection request listener spits out: "Unkown Error".

Here is my full code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using com.shephertz.app42.gaming.multiplayer.client;
using com.shephertz.app42.gaming.multiplayer.client.events;
using com.shephertz.app42.gaming.multiplayer.client.command;
using com.shephertz.app42.gaming.multiplayer.client.listener;  

namespace WindowsFormsApplication1
{
    public partial class MainForm : Form
    {
        private int loggedInID;
        private string loggedInUser;
        public WarpClient _warpClient;

        public MainForm(int userIDInput, string usernameInput)
        {
            InitializeComponent();
            loggedInID = userIDInput;
            loggedInUser = usernameInput;
            nameDisplayLbl.Text = loggedInUser;
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
        }

        private void matchQueueBtn_Click(object sender, EventArgs e)
        {
            WarpClient.initialize("api redacted for question", "secretkey redacted for question");
            _warpClient = WarpClient.GetInstance();
            _warpClient.AddConnectionRequestListener(new MyConnectionListener());
            _warpClient.Connect(loggedInUser);
            _warpClient.JoinRoom("Gamelobbytest");
        }
        
        public class MyConnectionListener : ConnectionRequestListener
        {
            public MyConnectionListener()
            {

            }

            public void onConnectDone(ConnectEvent eventObj)
            {
                switch (eventObj.getResult())
                {
                    case WarpResponseResultCode.SUCCESS:
                        System.Diagnostics.Debug.WriteLine("connection success");
                        break;
                    case WarpResponseResultCode.AUTH_ERROR:
                        System.Diagnostics.Debug.WriteLine("Auth Error");
                        break;
                    case WarpResponseResultCode.BAD_REQUEST:
                        System.Diagnostics.Debug.WriteLine("Bad Request");
                        break;
                    case WarpResponseResultCode.CONNECTION_ERR:
                        System.Diagnostics.Debug.WriteLine("Connection Error");
                        break;
                    case WarpResponseResultCode.CONNECTION_ERROR_RECOVERABLE:
                        System.Diagnostics.Debug.WriteLine("Connection Error Recoverable");
                        break;
                    case WarpResponseResultCode.RESOURCE_MOVED:
                        System.Diagnostics.Debug.WriteLine("Resource moved");
                        break;
                    case WarpResponseResultCode.RESOURCE_NOT_FOUND:
                        System.Diagnostics.Debug.WriteLine("Resource not found");
                        break;
                    case WarpResponseResultCode.RESULT_SIZE_ERROR:
                        System.Diagnostics.Debug.WriteLine("Size Error");
                        break;
                    case WarpResponseResultCode.SUCCESS_RECOVERED:
                        System.Diagnostics.Debug.WriteLine("Success recoeverd");
                        break;
                    case WarpResponseResultCode.UNKNOWN_ERROR:
                        System.Diagnostics.Debug.WriteLine("Unknown Error");
                        break;
                    default:
                        System.Diagnostics.Debug.WriteLine("Any error");
                        break;
                }
            }

            public void onDisconnectDone(ConnectEvent eventObj)
            {
                // handle Disconnect here
            }

            public void onInitUDPDone(byte resultCode)
            {
                // handle onInitUDPDone here
            }
        }
    }
}

 

closed with the note: Turns out I was using the wrong SDK. This works: https://github.com/shephertz/AppWarp.Net
asked Sep 19, 2016 in Windows by Kio604 (10 points)
closed Sep 19, 2016 by Kio604
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...