Remove Tabs when disconnect
This commit is contained in:
@@ -175,7 +175,7 @@ namespace ClientApp.Utils
|
||||
/// starts sending a message to the server
|
||||
/// </summary>
|
||||
/// <param name="message">the message to send</param>
|
||||
private void sendMessage(byte[] message)
|
||||
public void sendMessage(byte[] message)
|
||||
{
|
||||
stream.BeginWrite(message, 0, message.Length, new AsyncCallback(OnWrite), null);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ namespace ClientApp.Utils
|
||||
public const string START_SESSION = "START SESSION";
|
||||
public const string STOP_SESSION = "STOP SESSION";
|
||||
public const string SET_RESISTANCE = "SET RESISTANCE";
|
||||
public const string NEW_CONNECTION = "NEW CONNECTION";
|
||||
public const string DISCONNECT = "DISCONNECT";
|
||||
/// <summary>
|
||||
/// makes the json object with LOGIN identifier and username and password
|
||||
/// </summary>
|
||||
@@ -201,6 +203,24 @@ namespace ClientApp.Utils
|
||||
return ((dynamic)JsonConvert.DeserializeObject(Encoding.ASCII.GetString(json))).data.worked;
|
||||
}
|
||||
|
||||
public static byte[] getNewConnectionJson(string user)
|
||||
{
|
||||
dynamic data = new
|
||||
{
|
||||
username = user
|
||||
};
|
||||
return getJsonMessage(NEW_CONNECTION, data);
|
||||
}
|
||||
|
||||
public static byte[] getDisconnectJson(string user)
|
||||
{
|
||||
dynamic data = new
|
||||
{
|
||||
username = user
|
||||
};
|
||||
return getJsonMessage(DISCONNECT, data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user