Commit ee25ad83 authored by Chengzhao Li's avatar Chengzhao Li
Browse files

- minor update

parent 748ea199
......@@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -313,9 +313,11 @@ public class PackageRateActivity extends Activity {
tmp += "a";
}
int token = m_totalCount+1;
mb.setMessage(tmp);
mb.setToken(m_totalCount+1);
mb.setToken(token);
mb.setMessageType(Message.PingMessage.MsgType.PING);
mb.setResponseTime(0.0);
mb.setIsReliable(false);
......@@ -324,17 +326,17 @@ public class PackageRateActivity extends Activity {
long startTime = System.nanoTime();
Log.d(TAG, "doPing: message size: " + m_messageSize + ", total size: " + msg.toByteArray().length);
MultiplayerController.getInstance().sendDataToAllPeer(msg.toByteArray(), NCMCSession.NCMCSessionSendDataUnreliable);
MultiplayerController.getInstance().sendDataToAllPeer(msg.toByteArray(), NCMCSession.NCMCSessionSendDataReliable);
PingInfo info = new PingInfo();
info.m_startTime = startTime;
info.m_token = m_totalCount+1;
info.m_token = token;
info.m_totalCount = MultiplayerController.getInstance().getCurrentSession().getConnectedPeers().size();
info.m_currentCount = 0;
info.m_number = m_totalCount + 1;
m_totalCount += info.m_totalCount;
m_pingDict.put(m_totalCount, info);
m_pingDict.put(token, info);
if (m_totalCount >= MaxPingCount) {
m_isPingEnabled = false;
......
......@@ -211,7 +211,7 @@ public class PackageSizeActivity extends Activity {
mb.setIsReliable(message.getIsReliable());
mb.setMessage("");
double responseTime = ((double)System.nanoTime())/1000000.0 - ((double)receiveTime) / 1000000.0;
double responseTime = ((double)System.nanoTime())/1000000.0 - ((double)receiveTime) / 1000000.0; // to ms
mb.setResponseTime(responseTime);
Message.PingMessage msg = mb.build();
......@@ -270,9 +270,11 @@ public class PackageSizeActivity extends Activity {
tmp += "a";
}
int token = m_totalCount+1;
mb.setMessage(tmp);
mb.setToken(m_totalCount+1);
mb.setToken(token);
mb.setMessageType(Message.PingMessage.MsgType.PING);
mb.setResponseTime(0.0);
mb.setIsReliable(false);
......@@ -280,18 +282,18 @@ public class PackageSizeActivity extends Activity {
Message.PingMessage msg = mb.build();
long startTime = System.nanoTime();
Log.d(TAG, "doPing: message size: " + m_messageSize + ", total size: " + msg.toByteArray().length);
MultiplayerController.getInstance().sendDataToAllPeer(msg.toByteArray(), NCMCSession.NCMCSessionSendDataUnreliable);
Log.d(TAG, "doPing: message size: " + m_messageSize + ", total size: " + msg.toByteArray().length + ", packageSize: " + getPackageSize());
MultiplayerController.getInstance().sendDataToAllPeer(msg.toByteArray(), NCMCSession.NCMCSessionSendDataReliable);
PingInfo info = new PingInfo();
info.m_startTime = startTime;
info.m_token = m_totalCount+1;
info.m_token = token;
info.m_totalCount = MultiplayerController.getInstance().getCurrentSession().getConnectedPeers().size();
info.m_currentCount = 0;
info.m_number = m_totalCount + 1;
m_totalCount += info.m_totalCount;
m_pingDict.put(m_totalCount, info);
m_pingDict.put(token, info);
if (m_totalCount >= MaxPingCount) {
m_isPingEnabled = false;
......
......@@ -148,7 +148,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Bandwith : "
android:text="Bandwidth : "
android:id="@+id/textView10"
android:layout_below="@+id/textViewpackagerate"
android:layout_alignParentStart="true" />
......
......@@ -755,7 +755,7 @@ import java.util.concurrent.ConcurrentHashMap;
NCMCPeripheralInfo info = this.mDiscoveredPeripherals.get(deviceAddress);
if (info != null) {
if (info.bluetoothGatt != null) {
Log.d(TAG, "enableHighTraffic: " + deviceAddress);
Log.d(TAG, "disableHighTraffic: " + deviceAddress);
info.bluetoothGatt.requestConnectionPriority(BluetoothGatt.CONNECTION_PRIORITY_BALANCED);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment