private static void Build_Connection_Message_Samples( List< CNetworkMessage > message_list ) { message_list.Add( new CClientHelloRequest( "SomeLoginName" ) ); message_list.Add( new CClientHelloResponse( EMessageRequestID.Start, new CPersistentPlayerData( (EPersistenceID) 1, "PlayerName" ) ) ); message_list.Add( new CConnectionDroppedMessage( EConnectRefusalReason.Name_Already_Connected ) ); message_list.Add( new CDisconnectRequestMessage() ); message_list.Add( new CDisconnectResultMessage( EDisconnectReason.Client_Request_Quit ) ); message_list.Add( new CPingMessage() ); CQueryPlayerInfoRequest query_info_request = new CQueryPlayerInfoRequest(); for ( int i = 0; i < 5; i++ ) { query_info_request.Add_Player( (EPersistenceID) i ); } message_list.Add( query_info_request ); CQueryPlayerInfoResponse query_info_response = new CQueryPlayerInfoResponse( EMessageRequestID.Start ); for ( int i = 0; i < 5; i++ ) { query_info_response.Add_Player_Info( new CPlayerInfo( (EPersistenceID) i, "SomePlayer" + i.ToString() ) ); } message_list.Add( query_info_response ); }
private void Service_Query() { if ( m_QueryPlayers.Count == 0 ) { return; } CQueryPlayerInfoRequest request = new CQueryPlayerInfoRequest(); m_QueryPlayers.Apply( id => request.Add_Player( id ) ); CClientLogicalThread.Instance.Send_Message( request, ESessionID.First ); m_QueryPlayers.Clear(); }