近日我与bangbang就启动器插件问题进行了讨论,决定统一BMCL与MCLauncherBN的插件格式
同时欢迎其他启动器加入该标准
今后将更新为SharpLoginApi,正在进行协议商讨
由于MineLogin已经彻底死翘翘,故删除MineLogin插件!
BMCL (点击进入)
使用方法:放入auths文件夹中(如不存在,请创建)
目前兼容插件版本:V2
兼容V2最小版本:V2.9
兼容V1最小版本:V2.4
MCLauncherBN (点击进入)
使用方法:放入login文件夹中(如不存在,请创建)
目前兼容插件版本:V2
兼容V2最小版本:Release3.0
兼容V1最小版本:Beta2.22
第一代插件标准说明
结构说明
twitch使用方法:
http://www.mcbbs.net/thread-198946-1-1.html
结构体LoginInfo用来存储登陆成功后的数据 Structure LoginInfo Dim UN As String '显示的用户名 Dim UID As String 'User ID Dim SID As String 'Session ID Dim Suc As Boolean '登陆是否成功 Dim Errinfo As String '失败错误信息 Dim OtherInfo As String '其他信息 Dim Client_identifier As String 'yggdrasil所需信息,见wiki.vg End Structure Login函数用来登陆 GetName函数获取登陆方式的名称 GetVer用于获取登陆兼容的版本,目前为1,启动器作者设计时应注意检测此值,当不为1时提示用户更新启动器 |
DLL定义
VB.net
Public Class Login '此处类名称可自定义 Public Structure LoginInfo '此结构体不可修改 Dim UN As String Dim UID As String Dim SID As String Dim Suc As Boolean Dim Errinfo As String Dim OtherInfo As String Dim Client_identifier As String End Structure Public Function Login(UserName As String, Password As String, Optional Client_identifier As String = "", Optional Language As String = "zh-cn") As Login.LoginInfo ’此函数定义不可修改 '登陆部分 Dim RT As LoginInfo Return RT End Function Public Function GetVer() As Long ’此函数不可修改 Return 1 '代表为第一代标准化登陆插件 End Function Public Function GetName(Optional Language As String = "zh-cn") As String ’此函数定义不可修改 Return Nothing '返回使用的名称 End Function End Class |
C#
public class _Login //此处类名称可自定义 { public struct LoginInfo //此结构体不可修改 { public string UN; public string UID; public string SID; public bool Suc; public string Errinfo; public string OtherInfo; public string Client_identifier; } public Login.LoginInfo Login(string UserName, string Password, string Client_identifier = "", string Language = "zh-cn") //此函数定义不可修改 { //登陆部分 LoginInfo RT; return RT; } public long GetVer() //此函数不可修改 { return 1; //代表为第一代标准化登陆插件 } public string GetName(string Language = "zh-cn") //此函数定义不可修改 { return null; //返回使用的名称 } } |
启动器调用(第一代)
VB.net
Structure LoginInfo Dim UN As String Dim UID As String Dim SID As String Dim Suc As Boolean Dim Errinfo As String Dim OtherInfo As String Dim Client_identifier As String End Structure Function GetName(DLLpath As String) As String Dim a As Reflection.Assembly Dim obj As Object = Nothing Dim m As System.Reflection.MethodInfo = Nothing a = Reflection.Assembly.LoadFile(DLLpath) For Each classtemp As Type In a.GetTypes Dim t As String t = classtemp.FullName Dim strs() As String strs = t.Split(".") If classtemp.GetMethod("GetName") <> Nothing Then m = classtemp.GetMethod("GetName") obj = a.CreateInstance(classtemp.FullName) End If Next Return m.Invoke(obj, {"zh-cn"}) End Function Function GetVer(DLLpath As String) As String Dim a As Reflection.Assembly Dim obj As Object = Nothing Dim m As System.Reflection.MethodInfo = Nothing a = Reflection.Assembly.LoadFile(DLLpath) For Each classtemp As Type In a.GetTypes Dim t As String t = classtemp.FullName Dim strs() As String strs = t.Split(".") If classtemp.GetMethod("GetVer") <> Nothing Then m = classtemp.GetMethod("GetVer") obj = a.CreateInstance(classtemp.FullName) End If Next Return m.Invoke(obj, {}) End Function Function DLLLogin(DLLpath As String, username As String, password As String, Optional Client_identifier As String = "", Optional Lanauge As String = "zh-cn") As LoginInfo Dim a As Reflection.Assembly Dim obj As Object = Nothing Dim LoginInfo As Object Dim m As System.Reflection.MethodInfo = Nothing Dim LI As LoginInfo a = Reflection.Assembly.LoadFile(DLLpath) For Each classtemp As Type In a.GetTypes Dim str As String str = classtemp.FullName Dim strs() As String strs = str.Split(".") If InStr(strs(UBound(strs)), "+logininfo", CompareMethod.Text) > 0 Then LoginInfo = a.CreateInstance(classtemp.FullName) End If If classtemp.GetMethod("Login") <> Nothing Then m = classtemp.GetMethod("Login") obj = a.CreateInstance(classtemp.FullName) End If Next LoginInfo = m.Invoke(obj, {username, password, Client_identifier, Lanauge}) Dim ww As Type ww = LoginInfo.GetType LI.Suc = ww.GetField("Suc").GetValue(LoginInfo) If LI.Suc Then LI.UN = ww.GetField("UN").GetValue(LoginInfo) LI.UID = ww.GetField("UID").GetValue(LoginInfo) LI.SID = ww.GetField("SID").GetValue(LoginInfo) LI.OtherInfo = ww.GetField("OtherInfo").GetValue(LoginInfo) LI.Client_identifier = ww.GetField("Client_identifier").GetValue(LoginInfo) Else LI.Errinfo = ww.GetField("Errinfo").GetValue(LoginInfo) End If Return LI End Function |
C#
暂无代码 |
第二代插件标准说明
结构说明
结构体LoginInfo用来存储登陆成功后的数据 Structure LoginInfo Dim UN As String '显示的用户名 '仅为兼容第一代,如不兼容可无此项目 Dim UID As String 'User ID '仅为兼容第一代,如不兼容可无此项目 Dim SID As String 'Session ID '仅为兼容第一代,如不兼容可无此项目 Dim Suc As Boolean '登陆是否成功 Dim Errinfo As String '失败错误信息 Dim OtherInfo As String '其他信息 '仅为兼容第一代,如不兼容可无此项目 Dim OutInfo As String '第二代输出信息 Dim Client_identifier As String '仅为兼容第一代,如不兼容可无此项目 End Structure Login函数用来登陆 GetName函数获取登陆方式的名称 GetVer用于获取登陆兼容的版本,目前为1,启动器作者设计时应注意检测此值,当不为1时提示用户更新启动器 GetVersion用于获取插件兼容的最高版本,如GetVersion(1)如返回2则不兼容第一代标准,如返回1则兼容 OutInfo格式 minecraftArguments:Value minecraftArguments1:Value1 换行标准为CR+LF 如: ${auth_player_name}:UserName ${auth_session}:SID ... |
DLL定义
VB.net
Public Class Login '此处类名称可自定义 Structure LoginInfo '此结构体名称不可修改,内容可按注释修改 Dim UN As String '显示的用户名 '仅为兼容第一代,如不兼容可无此项目 Dim UID As String 'User ID '仅为兼容第一代,如不兼容可无此项目 Dim SID As String 'Session ID '仅为兼容第一代,如不兼容可无此项目 Dim OtherInfo As String '其他信息 '仅为兼容第一代,如不兼容可无此项目 Dim Client_identifier As String '仅为兼容第一代,如不兼容可无此项目 Dim Suc As Boolean '登陆是否成功 Dim Errinfo As String '失败错误信息 Dim OutInfo As String '第二代输出信息 End Structure Public Function Login(UserName As String, Password As String, Optional Client_identifier As String = "", Optional Language As String = "zh-cn") As Login.LoginInfo ’此函数定义不可修改 '登陆部分 Dim RT As LoginInfo Return RT End Function Public Function GetVer() As Long ’此函数作为向下兼容存在 Return 1 '代表为第一代标准化登陆插件,如不兼容,则Return 2 End Function Public Function GetName(Optional Language As String = "zh-cn") As String ’此函数定义不可修改 Return Nothing '返回使用的名称 End Function Public Function GetVersion(Version As Long) As Long ‘此函数定义不可修改 Select Case Version Case 1 Return 1 Case Else Return 2 End Select '如不兼容第一代标准,则只需return 2 End Function End Class |
C#
public class Login { //此处类名称可自定义 public struct LoginInfo { //此结构体名称不可修改,内容可按注释修改 //显示的用户名 '仅为兼容第一代,如不兼容可无此项目 public string UN; //User ID '仅为兼容第一代,如不兼容可无此项目 public string UID; //Session ID '仅为兼容第一代,如不兼容可无此项目 public string SID; //其他信息 '仅为兼容第一代,如不兼容可无此项目 public string OtherInfo; //仅为兼容第一代,如不兼容可无此项目 public string Client_identifier; //登陆是否成功 public bool Suc; //失败错误信息 public string Errinfo; //第二代输出信息 public string OutInfo; } public Login.LoginInfo Login(string UserName, string Password, string Client_identifier = "", string Language = "zh-cn") { //此函数定义不可修改 //登陆部分 LoginInfo RT = default(LoginInfo); return RT; } public long GetVer() { //此函数作为向下兼容存在 return 1; //代表为第一代标准化登陆插件,如不兼容,则Return 2 } public string GetName(string Language = "zh-cn") { //此函数定义不可修改 return null; //返回使用的名称 } public long GetVersion(long Version) { //此函数定义不可修改 switch (Version) { case 1: return 1; default: return 2; } //如不兼容第一代标准,则只需return 2 } } |
启动器调用(第二代)
VB.net
Structure LoginInfo Dim UN As String '显示的用户名 '仅为兼容第一代,如不兼容可无此项目 Dim UID As String 'User ID '仅为兼容第一代,如不兼容可无此项目 Dim SID As String 'Session ID '仅为兼容第一代,如不兼容可无此项目 Dim OtherInfo As String '其他信息 '仅为兼容第一代,如不兼容可无此项目 Dim Client_identifier As String '仅为兼容第一代,如不兼容可无此项目 Dim Suc As Boolean '登陆是否成功 Dim Errinfo As String '失败错误信息 Dim OutInfo As String '第二代输出信息 End Structure Function GetFun(FunName As String, DLLPath As String) As Object() Dim a As Reflection.Assembly Dim obj As Object = Nothing Dim m As System.Reflection.MethodInfo = Nothing a = Reflection.Assembly.LoadFile(DLLPath) For Each classtemp As Type In a.GetTypes Dim t As String t = classtemp.FullName Dim strs() As String strs = t.Split(".") If classtemp.GetMethod(FunName) <> Nothing Then m = classtemp.GetMethod(FunName) obj = a.CreateInstance(classtemp.FullName) End If Next If m Is Nothing Then Return {"0"} End If Return {m, obj} End Function Function GetVer(DLLpath As String) As String Dim obj1 As Object() Dim m As System.Reflection.MethodInfo obj1 = GetFun("GetVersion", "t:\yggdrasil.dll") If obj1.Length = 1 Then Return "1" Else m = obj1(0) Return m.Invoke(obj1(1), {2}) End If End Function Function GetName(DLLpath As String) As String Dim a As Reflection.Assembly Dim obj As Object = Nothing Dim m As System.Reflection.MethodInfo = Nothing a = Reflection.Assembly.LoadFile(DLLpath) For Each classtemp As Type In a.GetTypes Dim t As String t = classtemp.FullName Dim strs() As String strs = t.Split(".") If classtemp.GetMethod("GetName") <> Nothing Then m = classtemp.GetMethod("GetName") obj = a.CreateInstance(classtemp.FullName) End If Next Return m.Invoke(obj, {"zh-cn"}) End Function Function DLLLogin(DLLpath As String, username As String, password As String, Optional Client_identifier As String = "", Optional Lanauge As String = "zh-cn") As LoginInfo Dim a As Reflection.Assembly Dim obj As Object = Nothing Dim LoginInfo As Object Dim m As System.Reflection.MethodInfo = Nothing Dim LI As LoginInfo a = Reflection.Assembly.LoadFile(DLLpath) For Each classtemp As Type In a.GetTypes Dim str As String str = classtemp.FullName Dim strs() As String strs = str.Split(".") If InStr(strs(UBound(strs)), "+logininfo", CompareMethod.Text) > 0 Then LoginInfo = a.CreateInstance(classtemp.FullName) End If If classtemp.GetMethod("Login") <> Nothing Then m = classtemp.GetMethod("Login") obj = a.CreateInstance(classtemp.FullName) End If Next LoginInfo = m.Invoke(obj, {username, password, Client_identifier, Lanauge}) Dim ww As Type ww = LoginInfo.GetType LI.Suc = ww.GetField("Suc").GetValue(LoginInfo) If LI.Suc Then LI.UN = ww.GetField("UN").GetValue(LoginInfo) LI.UID = ww.GetField("UID").GetValue(LoginInfo) LI.SID = ww.GetField("SID").GetValue(LoginInfo) LI.OtherInfo = ww.GetField("OtherInfo").GetValue(LoginInfo) LI.Client_identifier = ww.GetField("Client_identifier").GetValue(LoginInfo) Else LI.Errinfo = ww.GetField("Errinfo").GetValue(LoginInfo) End If Return LI End Function |
C#
暂无代码 |
已完成Legacy正版验证、Skinme验证、minelogin验证、yggdrasil正版验证(即一个账号多个用户的新版验证系统)
yggdrasil插件定义
当登陆时Client_identifier可以不填 登陆结束后: 当Suc=False Errinfo 错误403 当用户名或密码错误时有时会返回403错误,启动器应注意识别,此错误文本收系统语言控制 NoReturnData mojang服务器故障,无返回数据,建议重试 JSON File Error 无法识别的返回数据,需要更新验证系统 No user list mojang账号中无可用的游戏ID 返回符合格式的JSON字符串 为服务器返回的错误信息,但貌似服务器已经不会返回了。。。。 其它错误 返回由WebException产生的Message 当Suc=True OtherInfo代表accessToken Client_identifier代表Client_identifier http://wiki.vg/Authentication可查看关于yggdrasil的详细信息 |
选择方法
根据启动器判断 如果基于.net2/3/3.5则选择.net2.0版本 如果基于.net4.0请选择.net4.0 如果都不是,请根据操作系统判断 注意:.net4.5不一定兼容.net4.0 根据操作系统判断 如果是win7用户,请选择.net2.0 如果是win8用户,请选择.net4.0 剩下的windows用户,就看你装过啥了。。 至于linux和mac用户就不要卖萌了。。 |
下载地址
基于.net2.0 建议MCLauncherBN
2013-8-21 17:32 上传
点击文件名下载附件
2013-8-21 17:32 上传
点击文件名下载附件
2013-8-26 20:51 上传
点击文件名下载附件
2013-11-22 12:32 上传
点击文件名下载附件
2013-11-22 18:56 上传
点击文件名下载附件
|
基于.net4.0 建议BMCL
2013-8-21 17:32 上传
点击文件名下载附件
2013-8-21 17:47 上传
点击文件名下载附件
2013-8-26 20:48 上传
点击文件名下载附件
2013-10-31 13:15 上传
点击文件名下载附件
2013-11-22 18:56 上传
点击文件名下载附件
|