forked from ngld/OverlayPlugin
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOverlayPluginLogLines.cs
More file actions
101 lines (97 loc) · 4.63 KB
/
OverlayPluginLogLines.cs
File metadata and controls
101 lines (97 loc) · 4.63 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using RainbowMage.OverlayPlugin.MemoryProcessors.Combatant;
using RainbowMage.OverlayPlugin.MemoryProcessors.ContentFinderSettings;
using RainbowMage.OverlayPlugin.MemoryProcessors.InCombat;
using RainbowMage.OverlayPlugin.Updater;
using MachinaRegion = System.String;
using OpcodeName = System.String;
using OpcodeVersion = System.String;
namespace RainbowMage.OverlayPlugin.NetworkProcessors
{
class OverlayPluginLogLines
{
public OverlayPluginLogLines(TinyIoCContainer container)
{
container.Register(new OverlayPluginLogLineConfig(container));
container.Register(new LineMapEffect(container));
container.Register(new LineFateControl(container));
container.Register(new LineCEDirector(container));
container.Register(new LineInCombat(container));
container.Register(new LineCombatant(container));
container.Register(new LineRSV(container));
container.Register(new LineActorCastExtra(container));
container.Register(new LineAbilityExtra(container));
container.Register(new LineContentFinderSettings(container));
container.Register(new LineNpcYell(container));
container.Register(new LineBattleTalk2(container));
container.Register(new LineCountdown(container));
container.Register(new LineCountdownCancel(container));
container.Register(new LineActorMove(container));
container.Register(new LineActorSetPos(container));
container.Register(new LineSpawnNpcExtra(container));
container.Register(new LineActorControlExtra(container));
container.Register(new LineActorControlSelfExtra(container));
}
}
class OverlayPluginLogLineConfig
{
private TinyIoCContainer container;
private ILogger logger;
private Dictionary<string, OpcodeConfigEntry> opcodes = new Dictionary<string, OpcodeConfigEntry>();
public OverlayPluginLogLineConfig(TinyIoCContainer container)
{
this.container = container;
logger = container.Resolve<ILogger>();
opcodes.Add("CEDirector", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.CEDirectorOpcode, size = 16 });
opcodes.Add("MapEffect", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.MapEffectOpcode, size = 11 });
opcodes.Add("RSVData", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.RSVDataOpcode, size = 1080 });
opcodes.Add("NpcYell", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.NpcYellOpcode, size = 32 });
opcodes.Add("BattleTalk2", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.BattleTalk2Opcode, size = 40 });
opcodes.Add("Countdown", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.CountdownOpcode, size = 48 });
opcodes.Add("CountdownCancel", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.CountdownCancelOpcode, size = 40 });
opcodes.Add("ActorMove", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.ActorMoveOpcode, size = 16 });
opcodes.Add("ActorSetPos", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.ActorSetPosOpcode, size = 24 });
opcodes.Add("MapEffect4", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.MapEffect4Opcode, size = 0 });
opcodes.Add("MapEffect8", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.MapEffect8Opcode, size = 0 });
opcodes.Add("MapEffect12", new OpcodeConfigEntry { opcode = (uint)GameRepoInfo.MapEffect12Opcode, size = 0 });
}
public IOpcodeConfigEntry this[string name]
{
get
{
return this[name];
}
}
public IOpcodeConfigEntry this[string name, MachinaRegion machinaRegion]
{
get
{
OpcodeConfigEntry entry;
if (opcodes.TryGetValue(name, out entry))
{
return entry;
}
else
{
logger.LogError("Unable to resolve opcode config for " + name);
return null;
}
}
}
}
interface IOpcodeConfigEntry
{
uint opcode { get; }
uint size { get; }
}
[JsonObject(NamingStrategyType = typeof(Newtonsoft.Json.Serialization.DefaultNamingStrategy))]
class OpcodeConfigEntry : IOpcodeConfigEntry
{
public uint opcode { get; set; }
public uint size { get; set; }
}
}