private void SendLoginGame(string sUser, string sPaswd) { PacketOut pack = new PacketOut(); pack.WriteCmd(PacketTypes.LOGIN, PacketTypes.LoginPacketTypes.cLogin); pack.WriteString(sUser); MD5 md5 = MD5.Create(); byte[] data_paswd = Coding.GetDefauleCoding().GetBytes(sPaswd); data_paswd = md5.ComputeHash(data_paswd); StringBuilder sBuilder = new StringBuilder(); for (int i = 0; i < data_paswd.Length; i++) { sBuilder.Append(data_paswd[i].ToString("x2")); } sPaswd = sBuilder.ToString(); pack.WriteString(sPaswd); uint gameServerSpanID = 1; uint gameServerID = 1; const string sign = "ab6e03537c22c1b7f6763178a5882df7"; const string time = "1445486107"; const string identity = "000000198010100000"; pack.WriteUInt32(gameServerSpanID); pack.WriteUInt32(gameServerID); pack.WriteString(sign); pack.WriteString(time); pack.WriteString(identity); this.Send(pack.GetBuffer()); Account = sUser; }
private void SendEnterGameScene(uint nAccountId, uint nRoleId) { PacketOut pack = new PacketOut(); pack.WriteCmd(PacketTypes.LOGIC, PacketTypes.LogicPacketTypes.cLoginGame); pack.WriteUInt32(nAccountId); pack.WriteUInt32(nRoleId); pack.WriteUInt32(0); //出生点id m_pSession.Send(pack.GetBuffer()); }