public void RunConnect(NetAddress serverAddress, System.Action <StressTest_LoginUser> OnLoginConnected, System.Action <StressTest_LoginUser, SF.Net.SendMessageLogin> OnLoginDisConnected, System.Action <StressTest_LoginUser, int> OnLoginFailed, System.Action <StressTest_LoginUser> OnGameSvrConnected, System.Action <StressTest_LoginUser, SF.Net.SendMessageGame> OnGameSvrDisConnected, System.Action <StressTest_LoginUser> OnGameSvrFailedConnect, System.Action <StressTest_LoginUser, bool> OnGameJoinAction) { mLoginConnectedAction = OnLoginConnected; mLoginDisConnectedAction = OnLoginDisConnected; mLoginFailedAction = OnLoginFailed; // Game Sever mGameSvrConnectedAction = OnGameSvrConnected; mGameSvrDisConnectedAction = OnGameSvrDisConnected; mGameSvrFailedConnectAction = OnGameSvrFailedConnect; mGameJoinResAction = OnGameJoinAction; NextState = eTesterState.LOGINING; mCurDeltaTime = 0; m_ConnectionLogin = new SFConnection(m_MessageRouter); m_ConnectionLogin.Connect(0, serverAddress.Address, (int)serverAddress.Port); }
void HandleLoginRes(SFMessage message) { var loginResult = message.GetValue <Result>("Result"); if (loginResult.IsFailed) { PrintStatus(1, "Login failed {0}", loginResult); if (mLoginFailedAction != null) { mLoginFailedAction(this, 2); } CloseAllConnections(); return; } NextState = eTesterState.GAME_LOGINING; m_LoginTicket = message.GetValue <UInt64>("Ticket"); m_AccountID = message.GetValue <UInt64>("AccID"); m_GameServerAddress = message.GetValue <NetAddress>("GameServerAddrIPV4"); m_LoginEntityID = message.GetValue <UInt64>("LoginEntityUID"); PrintStatus(1, "Login Success!! {0}", m_LoginID);////loginResult); if (!string.IsNullOrEmpty(m_GameServerAddress.Address)) { m_ConnectionGame = new SFConnection(m_MessageRouter); m_ConnectionGame.Connect(m_LoginTicket, m_GameServerAddress.Address, m_GameServerAddress.Port); } }
void Connect(NetAddress serverAddress) { CloseAllConnections(); m_ConnectionLogin = new SFConnection(m_MessageRouter); m_ConnectionLogin.Connect(0, serverAddress.Address, (int)serverAddress.Port); m_Login = new SF.Net.SendMessageLogin(m_ConnectionLogin); }
public void RunConnect(NetAddress serverAddress, System.Action <StressTest_Matched_Chat> OnLoginConnected, System.Action <StressTest_Matched_Chat, SF.Net.SendMessageLogin> OnLoginDisConnected, System.Action <StressTest_Matched_Chat, int> OnLoginFailed, System.Action <StressTest_Matched_Chat> OnGameSvrConnected, System.Action <StressTest_Matched_Chat, SF.Net.SendMessageGame> OnGameSvrDisConnected, System.Action <StressTest_Matched_Chat> OnGameSvrFailedConnect, System.Action <StressTest_Matched_Chat, bool> OnGameJoinResAction, System.Action <StressTest_Matched_Chat> OnPartyCreateAction, System.Action <StressTest_Matched_Chat, bool> OnGamePartyJoinedAction, System.Action <StressTest_Matched_Chat, bool> OnPartyChatSendResAction, System.Action <StressTest_Matched_Chat, UInt64> OnPartyChatOneKBRecivedTen, System.Action <StressTest_Matched_Chat, int, UInt64> OnPartyChatOneKBRecivedSingle) { mLoginConnectedAction = OnLoginConnected; mLoginDisConnectedAction = OnLoginDisConnected; mLoginFailedAction = OnLoginFailed; // Game Sever mGameSvrConnectedAction = OnGameSvrConnected; mGameSvrDisConnectedAction = OnGameSvrDisConnected; mGameSvrFailedConnectAction = OnGameSvrFailedConnect; //--- mGameJoinResAction = OnGameJoinResAction; mPartyCreateAction = OnPartyCreateAction; mGamePartyJoinedAction = OnGamePartyJoinedAction; mPartyChatSendResAction = OnPartyChatSendResAction; mPartyChatOneKBRecivedTen = OnPartyChatOneKBRecivedTen; mPartyChatOneKBRecivedSingle = OnPartyChatOneKBRecivedSingle; mTotalRecvedPartyChatMessageCount = 0; m_PartyInfo = new PartyMatchedInfo(0); NextState = eTesterState.LOGINING; m_ConnectionLogin = new SFConnection(m_MessageRouter); m_ConnectionLogin.Connect(0, serverAddress.Address, (int)serverAddress.Port); mHeartBitTime = 0; }
public void RunConnect(NetAddress serverAddress, System.Action <StressTest_RankTestUser> OnLoginConnected, System.Action <StressTest_RankTestUser, SF.Net.SendMessageLogin> OnLoginDisConnected) { m_ConnectionLogin = new SFConnection(m_MessageRouter); m_ConnectionLogin.Connect(0, serverAddress.Address, (int)serverAddress.Port); mLoginConnectedAction = OnLoginConnected; mLoginDisConnectedAction = OnLoginDisConnected; m_Timer = new DispatcherTimer(); m_Timer.Tick += new EventHandler(OnTimerTick); m_Timer.Interval = new TimeSpan(0, 0, 1); m_Timer.Start(); }
public void RunConnect(NetAddress serverAddress, System.Action <StressTest_MatchingUser> OnLoginConnected, System.Action <StressTest_MatchingUser, SF.Net.SendMessageLogin> OnLoginDisConnected, System.Action <StressTest_MatchingUser, int> OnLoginFailed, System.Action <StressTest_MatchingUser> OnGameSvrConnected, System.Action <StressTest_MatchingUser, SF.Net.SendMessageGame> OnGameSvrDisConnected, System.Action <StressTest_MatchingUser> OnGameSvrFailedConnect, System.Action <StressTest_MatchingUser, bool> OnGameJoinAction, System.Action <StressTest_MatchingUser> On4xMatchedAction, System.Action <StressTest_MatchingUser> OnSendMatchAction, System.Action <StressTest_MatchingUser, bool> OnReqMatchResAction, System.Action <StressTest_MatchingUser> OnRecvChatDataAction) { mLoginConnectedAction = OnLoginConnected; mLoginDisConnectedAction = OnLoginDisConnected; mLoginFailedAction = OnLoginFailed; // Game Sever mGameSvrConnectedAction = OnGameSvrConnected; mGameSvrDisConnectedAction = OnGameSvrDisConnected; mGameSvrFailedConnectAction = OnGameSvrFailedConnect; mGameJoinResAction = OnGameJoinAction; m4xMatchedAction = On4xMatchedAction; mSendReqMatchAction = OnSendMatchAction; mReqMatchResAction = OnReqMatchResAction; mRecvChatDataAction = OnRecvChatDataAction; m_MatchedInfo = new MatchedInfo(0); NextState = eTesterState.LOGINING; mCurDeltaTime = 0; m_ConnectionLogin = new SFConnection(m_MessageRouter); m_ConnectionLogin.Connect(0, serverAddress.Address, (int)serverAddress.Port); }
public void RunConnect(NetAddress serverAddress, System.Action <StressTest_TenKBUser> OnLoginConnected, System.Action <StressTest_TenKBUser, SF.Net.SendMessageLogin> OnLoginDisConnected, System.Action <StressTest_TenKBUser> OnLoginFailedConnect, System.Action <StressTest_TenKBUser, bool> OnLoginRes, System.Action <StressTest_TenKBUser, bool> OnDataTestSendRes) { mLoginConnectedAction = OnLoginConnected; mLoginDisConnectedAction = OnLoginDisConnected; mLoginFailedConnectAction = OnLoginFailedConnect; mLoginResAction = OnLoginRes; mDataTestSendRes = OnDataTestSendRes; mNextState = eTesterState.LOGINING; mDataTestResCount = 0; mCurDeltaTime = 0; m_ConnectionLogin = new SFConnection(m_MessageRouter); m_ConnectionLogin.Connect(0, serverAddress.Address, (int)serverAddress.Port); }