public MessageFactory(OpCodeNamer opCodeNamer, string region, uint version, bool chatEnabled = false, OpCodeNamer sysMsgNamer = null) { _opCodeNamer = opCodeNamer; _sysMsgNamer = sysMsgNamer; OpcodeNameToType.Clear(); CoreServices.ToList().ForEach(x => OpcodeNameToType[_opCodeNamer.GetCode(x.Key)] = x.Value); if (chatEnabled) { ChatServices.ToList().ForEach(x => OpcodeNameToType[_opCodeNamer.GetCode(x.Key)] = x.Value); } Version = version; Region = region; _chatEnabled = chatEnabled; }
public MessageFactory(OpCodeNamer opCodeNamer) { _opCodeNamer = opCodeNamer; foreach (var name in OpcodeNameToType.Keys) { opCodeNamer.GetCode(name); } }