예제 #1
0
//	bool CheckMaintenance()
//	{
//		StringBuilder sb = new StringBuilder();
//		sb.AppendFormat( "{0}{1}&domain={2}&game={3}&version={4}", AsNetworkDefine.WemeGateBaseUrl, market, domain, AsGameDefine.GAME_CODE, AsGameDefine.BUNDLE_VERSION);
//		
//		WWW www = new WWW( sb.ToString());
//		//		yield return www;
//		while( false == www.isDone)	{}
//		
//		if( null != www.error)
//		{
//			Debug.Log( "WemeGateManager ShutDown");
//			AsUtil.ShutDown( string.Empty);
//		}
//		
//		JSONObject topObj = JSONObject.Parse( www.text);
//		www.Dispose();
//		www = null;
//		
//		UInt64 curTime = UInt64.Parse( topObj[ "timestamp"].Str);
//		JSONObject maintenance = topObj.GetObject( "maintenance");
//		if( null == maintenance)
//			return true;
//		
//		string maintenanceBegin = maintenance[ "begin"].Str;
//		string maintenanceEnd = maintenance[ "end"].Str;
//		UInt64 beginTime = UInt64.Parse( maintenanceBegin);
//		UInt64 endTime = UInt64.Parse( maintenanceEnd);
//		
//		if( ( curTime < beginTime) || ( curTime > endTime))
//			return true;
//		
//		return false;
//	}

	public bool ConnectServer()//$yde
	{
//		if( s_SelectedServerData != null)
//			return false;

//		if( false == CheckMaintenance())
//			return false;

		if( false == serverData.bPossibleCreate)
		{
			AsNotify.Instance.MessageBox( AsTableManager.Instance.GetTbl_String(126), AsTableManager.Instance.GetTbl_String(2037), AsNotify.MSG_BOX_TYPE.MBT_OK, AsNotify.MSG_BOX_ICON.MBI_NOTICE);
			return false;
		}

		string ip = System.Text.UTF8Encoding.UTF8.GetString( serverData.szIpaddress);
		AsNetworkManager.Instance.ConnectToServer( ip, serverData.nPort, SOCKET_STATE.SS_GAMESERVER);
		if( true == AsNetworkManager.Instance.IsConnected())
		{
			Debug.Log( "Connect game server...");
			Debug.Log( "AsUserInfo.Instance.isWemeCertified : " + AsUserInfo.Instance.isWemeCertified);

			s_SelectedServerData = serverData;

			body_CG_LOGIN_POSSIBLE possible = new body_CG_LOGIN_POSSIBLE();
			byte[] data = possible.ClassToPacketBytes();
			AsNetworkMessageHandler.Instance.Send( data);

			AsUserInfo.Instance.CurrentServerID = s_SelectedServerData.nWorldIdx;
			AsSocialManager.Instance.ServerName =  AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( s_SelectedServerData.szServerName));
			Debug.Log( "body_CG_LOGIN_POSSIBLE is send");

			return true;
		}

		return false;
	}
	private IEnumerator Integrated_Indun_Gogogo(body_SC_INTEGRATED_INDUN_GOGOGO data)
	{
		if( true == data.bReconnect)
		{
			AsEventNotifyMgr.Instance.CenterNotify.AddGMMessage( AsTableManager.Instance.GetTbl_String( 2818));
			yield return new WaitForSeconds( 3.0f);
		}
		
		// connect integrated server
		AsNetworkIntegratedManager.Instance.ConnectToServer( data.szIpAddress, data.nPort);
		if( false == AsNetworkIntegratedManager.Instance.IsConnected())
		{
			Debug.LogError( "AsNetworkIntegratedManager.Instance.ConnectToServer(): Failed");
			Debug.Log( "ip: " + data.szIpAddress + ", port: " + data.nPort + ", id: " + data.nIndunTableIndex + ", did: " + data.nIndunDuplicationIndex);
//			_IndunGoIntoEnd();
			yield break;
		}

		AsNetworkManager.Instance.Start_SendAlive_GameServer();
		
		_RequestDimpleLog_Indun( 160402);
		
		// login possible
		body_CG_LOGIN_POSSIBLE possible = new body_CG_LOGIN_POSSIBLE();
		byte[] possibleData = possible.ClassToPacketBytes();
		AsNetworkMessageHandler.Instance.Send( possibleData);
		
		// indun login
		uint uiUserUniqKey = AsUserInfo.Instance.LoginUserUniqueKey;
		body_CS_INTEGRATED_INDUN_LOGIN data2 = new body_CS_INTEGRATED_INDUN_LOGIN( uiUserUniqKey, data.nIndunTableIndex, data.nIndunDuplicationIndex, data.bReconnect);
		byte[] sendData = data2.ClassToPacketBytes();
		AsNetworkMessageHandler.Instance.Send( sendData);
		
		_RequestDimpleLog_Indun( 160403);
		
		// remove matching room
		isMatching = false;
		m_bStartOnce = false;
		
		m_nIndunTableIndex = data.nIndunTableIndex;
		
		if( true == data.bReconnect)
			m_nIndunBranchTableIndex = data.nReconnectBranchTableIdx;
		
		Debug.Log( "ip: " + data.szIpAddress + ", port: " + data.nPort + ", id: " + data.nIndunTableIndex + ", did: " + data.nIndunDuplicationIndex);
	}
예제 #3
0
	private void FirstConnect( AS_LC_SERVERLIST_BODY serverData)
	{
		string ip = System.Text.UTF8Encoding.UTF8.GetString( serverData.szIpaddress);
		AsNetworkManager.Instance.ConnectToServer( ip, serverData.nPort, SOCKET_STATE.SS_GAMESERVER);
		if( true == AsNetworkManager.Instance.IsConnected())
		{
			Debug.Log( "Connect game server...");
			Debug.Log( "AsUserInfo.Instance.isWemeCertified : " + AsUserInfo.Instance.isWemeCertified);

			body_CG_LOGIN_POSSIBLE possible = new body_CG_LOGIN_POSSIBLE();
			byte[] data = possible.ClassToPacketBytes();
			AsNetworkMessageHandler.Instance.Send( data);

			AsUserInfo.Instance.CurrentServerID = serverData.nWorldIdx;
			AsSocialManager.Instance.ServerName = AsUtil.GetRealString( System.Text.UTF8Encoding.UTF8.GetString( serverData.szServerName));
			Debug.Log("body_CG_LOGIN_POSSIBLE is send");

			if( true == AssetbundleManager.Instance.useAssetbundle)
			{
				AssetbundleManager.Instance.SceneAssetbundleLoadCache( "CharacterSelect");
				AssetbundleManager.Instance.SceneAssetbundleLoadCache( "CharacterCreate");
				AssetbundleManager.Instance.SceneAssetbundleLoadCache( "ChannelSelect");
			}

			isAutoServerSelected = true;
		}
	}
예제 #4
0
	void PossibleProcess()
	{
		body_CG_LOGIN_POSSIBLE possible = new body_CG_LOGIN_POSSIBLE();
		byte[] data = possible.ClassToPacketBytes();
		AsNetworkMessageHandler.Instance.Send( data );
		
		Debug.Log("body_CG_LOGIN_POSSIBLE is send");
	}