using Common.Network; using Model; namespace Controller { public class CMsgLogin { public byte[] Account { get; set; } public byte[] PassMd5 { get; set; } } [Message(Opcode.CMsgLogin, typeof(CMsgLogin), ServerType.Gate)] internal class CMsgLoginEvent: IEventSync { public void Run(Env env) { CMsgLogin cmsg = env.Get(EnvKey.Message); Unit unit = World.Instance.GetComponent>().Create(UnitType.GatePlayer, 1); AChannel channel = env.Get(EnvKey.Channel); ChannelUnitInfoComponent channelUnitInfoComponent = channel.AddComponent(); channelUnitInfoComponent.Account = cmsg.Account; channelUnitInfoComponent.UnitId = unit.Id; World.Instance.GetComponent().AssociateUnitIdAndChannel(unit.Id, channel); } } }