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); }
//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); }