-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
SpaceBattleArena.config
72 lines (54 loc) · 2.52 KB
/
SpaceBattleArena.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
Space Battle Arena is a Programming Game.
Copyright (C) 2012-2016 Michael A. Hawker and Brett Wortzman
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
The full text of the license is available online: http://opensource.org/licenses/GPL-2.0
----
Copy this file to %localappdata%\Microsoft\MessageAnalyzer\OpnAndConfiguration\TextLogConfiguration\DevicesAndLogs\
for Microsoft Message Analyzer to pick it up as an available log loader.
*/
message SBAEntry with
EntryInfo {
Regex = @"^(?<timestamp>\d+-\d+-\d+ [\d:,]+)\|(?<Milliseconds>[\d]+)\|(?<LogLevel>[^|]+)\|(?<ThreadName>[^|]+)\|(?<ClassName>[^|]+)\|(?<LineNumber>[0-9]+)\|(?<FunctionName>[^|]+)\|(?<Message>[^\n]+)"
} : LogEntry
{
string timestamp;
ulong Milliseconds;
string LogLevel;
string ThreadName;
string ClassName;
uint LineNumber;
string FunctionName;
string Message;
override string ToString()
{
return Message;
}
}
int get ObjectId(this SBAEntry msg)
{
int s = msg.Message.IndexOf("#");
if (s > -1)
{
// TODO: Find end of Number
string ret = msg.Message.Segment(s+1, 3);
return (ret as int);
}
return -1;
}
//syntax FindObjectID = regex{#\d+};
syntax CustomDateTimeFormat = year:regex{\d\d\d\d} "-" month:regex{\d\d} "-" day:regex{\d\d} " " hours:regex{\d\d} ":" minutes:regex{\d\d} ":" seconds:regex{\d\d} "," milliseconds:regex{\d\d\d} => ToDateTime(year + "-" + month + "-" + day + "T" + hours + ":" + minutes + ":" + seconds + "." + milliseconds, DateTimeStyles.None);
DateTime get customSBAPythonDateTime(this SBAEntry msg) with EntryFieldInfo {IsTimestamp = true, IsLocalTime = true }
{
optional DateTime theDateTime = CustomDateTimeFormat(msg.timestamp);
if (theDateTime == nothing)
{
return CustomDateTimeFormat("01/07 12:34:56") as DateTime;
}
else
{
return theDateTime as DateTime;
}
}