mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-26 05:50:18 +00:00
add dates to some logs
This commit is contained in:
parent
25f9c8a2a7
commit
d022f6bb41
3 changed files with 14 additions and 4 deletions
|
@ -72,7 +72,7 @@ namespace SanAndreasUnity.Net
|
|||
{
|
||||
// log some info
|
||||
if (NetStatus.IsServer && !this.isLocalPlayer)
|
||||
Debug.LogFormat("Player (netId={0}, addr={1}) connected", this.netId, this.connectionToClient.address);
|
||||
Debug.LogFormat("Player (netId={0}, addr={1}) connected, time: {2}", this.netId, this.connectionToClient.address, F.CurrentDateForLogging);
|
||||
|
||||
F.InvokeEventExceptionSafe(onStart, this);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ namespace SanAndreasUnity.Net
|
|||
|
||||
// log some info about this
|
||||
if (NetStatus.IsServer && !this.isLocalPlayer)
|
||||
Debug.LogFormat("Player (netId={0}, addr={1}) disconnected", this.netId, this.connectionToClient.address);
|
||||
Debug.LogFormat("Player (netId={0}, addr={1}) disconnected, time: {2}", this.netId, this.connectionToClient.address, F.CurrentDateForLogging);
|
||||
}
|
||||
|
||||
void OnOwnedGameObjectChanged(GameObject newGo)
|
||||
|
|
|
@ -107,6 +107,18 @@ namespace SanAndreasUnity.Utilities
|
|||
new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;
|
||||
}
|
||||
|
||||
public static string CurrentDateForLogging
|
||||
{
|
||||
get
|
||||
{
|
||||
try {
|
||||
return System.DateTime.Now.ToString("dd MMM HH:mm:ss");
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string Nl2Br(this string str)
|
||||
{
|
||||
return str.Replace(Environment.NewLine, "<br>");
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
|
||||
- add ability for client to request: ;
|
||||
|
||||
- port the whole UI to multiplayer
|
||||
|
||||
- fix connection timeout bug
|
||||
|
||||
- add current date to logs
|
||||
|
|
Loading…
Reference in a new issue