GithubHelp home page GithubHelp logo

native.framework's People

Contributors

backrunner avatar jie2gg avatar traceless0929 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

native.framework's Issues

Wiki请求更新

目前的代码的依赖包已经是

using Native.Csharp.Sdk.Cqp.EventArgs;
using Native.Csharp.Sdk.Cqp.Interface;

而Wiki第05部分的代码依然是

using Native.Csharp.App.EventArgs;
using Native.Csharp.App.Interface;

这对刚接触框架的新手可能不是太友好,请求修改。(三四个月没拿它写插件都差点不会用了。。T_T)

另外就是可以考虑对Event文件夹中的文件,可以直接从模版新建(有个很老的C#框架用到了这种方法),当然如果太麻烦就算了Orz

第一次启动模块必无响应

编译后载入CQ,进入应用管理,启动模块,无响应,重新启动CQ后正常。
程序只有一个简单的复读机。
WINDOWS上面倒是还好,主要是在LINUX容器上部署的,出现这个问题挺烦人的。

AppInfo函数不存在或错误(-105)

请问出现这个错误怎么解决,AppInfo已经改成public 还是不行

com.aa.bb.demo.dll 加载失败!错误:AppInfo函数不存在或错误(-105)

	[DllExport (ExportName = "AppInfo", CallingConvention = CallingConvention.StdCall)]
	public static string AppInfo ()
	{
		// 请勿随意修改
		// 
		Common.AppName = "酷Q样例应用";
		Common.AppVersion = Version.Parse ("1.0.0");		

		//
		// 当前项目名称: com.aa.bb.demo
		// Api版本: 9

		return string.Format ("{0},{1}", 9, "com.aa.bb.demo");
	}

AuthCode串应用的问题

当两个文件结构相类似的、同时使用该SDK编写的插件在同一个CoolQ上运行的时候,日志中显示的应用名会混乱(即无论应用A还是应用B处理的消息会显示为应用A发出的,但在重启之前显示的发出应用一定相同)。
同时,如果将“日志中的发出应用”禁用掉(如应用A),那么应用B的应答也会失效。

以下贴子中最新版本是使用本SDK编写的:
实际应用A 实际应用B
实际应用A代码(Github):点此
应用B除了部分变量外基本结构与A相同。

PS:其实如果我刚开始没有把Native.Demo/App.Event/SQLiteManager.cs中的数据库地址(path)用常量写死,而是采用EnApi.Instance.GetAppDirectory()的话,甚至连数据库都会串Orz。。。

据开发者群dalao讲应当是AuthCode没有处理好的问题。。。

CQExport.tt无法运行

自定义工具“TextTemplatingFileGenerator”与文件“Export\CQExport.tt”相关联,但在项目中找不到该自定义工具的输出。 你可以通过在解决方案资源管理器中右击该文件并选择“运行自定义工具”,尝试重新运行该自定义工具。

按照 https://native.run/articles/01.html 做的。重复运行仍然是相同的结果。不管改没改appid都无法运行。

虽然CQEventExport.cs里的相关项目已经被更改了,但是指引页面上说的是

若在运行过程中, 没有发生任何错误与警告. 则表示 tt 文件编译正常. 至此 AppID 设置完成

所以想确认一下

VS Community 2019.

异常堆栈(exception)

异常堆栈:Native.Sdk.Cqp.CQApi.GetGroupMemberInfo(Int64 groupId, Int64 qqId, Boolean notCache)
message:无法读取数据, 因为已读取到数据流末尾

Wiki 里的 "10. IniConfig的使用" 需要更新

经查阅源码和` IniConfig 类的 ReadMe 发现,Wiki 中的这一条栏目所提供的代码已经过时,需要更新。

IniObject iniFile = IniObject.LoadOrCreate ("test.ini");
// 方式一
// 判断是否存在 "节点1"
if (iniFile.ContainsKey ("节点1"))
{
    IniValue iniValue = iniFile["节点1"]["Username"];            // 获取 "Username" 的值, 返回的是 IniValue 对象
    string username = iniValue.Value;                           // 获取字符串
    bool isManager = iniFile["节点1"]["IsManager"].ToBoolean (); // 获取布尔值
    int level = -1;
    // 为了代码安全, 还可以判断是否存在键
    if (iniFile["节点1"].ContainsKey ("Level"))
    {
        level = iniFile["节点1"]["Level"].ToInt32 ();
    }
}

// 方式二
IniSection section1 = null;
if (iniFile.TryGetValue ("节点1", out section1))
{
    IniValue iniValue = null;
    if (section1.TryGetValue ("Username", out iniValue))
    {
        string username = iniValue.Value;
    }
    if (section1.TryGetValue ("IsManager", out iniValue))
    {
        bool isManager = iniValue.ToBoolean ();
    }
}

Wiki更新

目前Wiki也没教学怎么用menu功能,是否应该加上高阶的教学?

请教如何连接sqllite

遇到的问题,显示sqllite.DLL未加载
image

尝试了两种方案引入tool下的sqllite:

  1. 引入native.TOOLS项目
  2. 先编译native.TOOLS,生成dll后引入,均失败

请求协助,不胜感激~

群发Api似乎失效了

,我按照wiki做了复读机不管用,但是日志正常显示,做了私聊复读机也是完全正常

多个该框架打包而成的CPK会由于加载时间过长报错

多个该框架打包而成的CPK会由于加载时间过长报错,
实例:
A应用,Event_AppStatus.AppEnable中为空(框架默认内容,没有做任何修改)
B应用,Event_AppStatus.AppEnable中加载了一些配置,

现象:A加载成功,B报加载错误。

机器配置:windows server 2008 R2
CPU: 2.3G Xeon E5-26xx v3
Memory:1GB

初步判断是
Event_AppStatus.AppEnable及框架在该方法之前进行初始化的时间过长。

可以联系我采集详细数据

关于V4.2.2.0501 release版API使用GroupMemberInfo.ToString()方法报错的问题及临时解决方案

不知道现在git上面的版本修了这个问题没有,初步(未设置错误处理代码时)提示读取内存失败,使用try/catch抓到的问题是未将对象引用设置到对象的实例。
定位到问题主要在于性别的GetDescription方法不能正确返回描述,考虑到问题出在GetDescription方法,MemberType成员类型那里可能也会触发同样的bug。
我把GetDescription替换成ToString凑活了一下,勉强能用了。
顺便一提,最后一行(允许修改名片)后面的换行似乎可以删掉

获取好友列表报错

在群消息发送好友,返回好友列表(e.CQApi.GetFriendList())。获取列表报以下错误

发现未处理的异常!
System.ArgumentOutOfRangeException: 指定的参数已超出有效值的范围。
参数名: qqId
在 Native.Csharp.Sdk.Cqp.Model.QQ..ctor(CQApi api, Int64 qqId) 位置 D:\Code\Native.Csharp.Frame-master\Native.Csharp.Frame-master\Native.Csharp.Sdk\Cqp\Model\QQ.cs:行号 50
在 Native.Csharp.Sdk.Cqp.Model.FriendInfo..ctor(CQApi api, Byte[] cipherBytes) 位置 D:\Code\Native.Csharp.Frame-master\Native.Csharp.Frame-master\Native.Csharp.Sdk\Cqp\Model\FriendInfo.cs:行号 54
在 Native.Csharp.Sdk.Cqp.CQApi.GetFriendList() 位置 D:\Code\Native.Csharp.Frame-master\Native.Csharp.Frame-master\Native.Csharp.Sdk\Cqp\CQApi.cs:行号 818
在 com.apbenben.quote.Core.Event_GroupMessage.GroupMessage(Object sender, CQGroupMessageEventArgs e) 位置 D:\Code\Native.Csharp.Frame-master\Native.Csharp.Frame-master\com.apbenben.quote.Core\Event_GroupMessage.cs:行号 40
在 Native.Csharp.App.Export.CQEventExport.Event_eventGroupMsg(Int32 subType, Int32 msgId, Int64 fromGroup, Int64 fromQQ, String fromAnonymous, IntPtr msg, Int32 font)

CQP.dll->CQ_setFatal(0x10588)+0x27=0x100105AF
0x0BC54FDD
0x0BC54F56
clr.dll+0xF066=0x7224F066
clr.dll->LogHelp_TerminateOnAssert(0x119E0)+0x93A=0x7225231A
clr.dll+0x77CDB=0x722B7CDB
clr.dll+0x31CDF7=0x7255CDF7
clr.dll+0x383B63=0x725C3B63
clr.dll+0x383F30=0x725C3F30
clr.dll+0x30389E=0x7254389E
clr.dll+0x3036B9=0x725436B9
clr.dll+0x30304C=0x7254304C
clr.dll+0x31A08B=0x7255A08B
clr.dll+0x31951D=0x7255951D
clr.dll+0x319795=0x72559795
mscoreei.dll->GetXMLElementAttribute(0x50650)+0x3077=0x72B936C7
mscoreei.dll->GetXMLElementAttribute(0x50650)+0x2FC1=0x72B93611
KERNELBASE.dll->UnhandledExceptionFilter(0x1AA010)+0x1CB=0x75A8A1DB
ntdll.dll+0xA303E=0x7727303E
ntdll.dll->RtlGetAppContainerNamedObjectPath(0x66540)+0xBD=0x772365FD

我无法使用这个项目

严重性	代码	说明	项目	文件	行	禁止显示状态
错误		“Fody.WeavingTask”任务意外失败。
System.TypeInitializationException:ContainsTypeChecker”的类型初始值设定项引发异常。 ---> System.IO.FileLoadException: 未能加载文件或程序集“file:///D:\project\Native.Csharp.Frame\packages\Fody.2.2.1.0\FodyIsolated.dll”或它的某一个依赖项。不支持操作。 (异常来自 HRESULT:0x80131515) ---> System.NotSupportedException: 尝试从一个网络位置加载程序集,在早期版本的 .NET Framework 中,这会导致对该程序集进行沙盒处理。此发行版的 .NET Framework 默认情况下不启用 CAS 策略,因此,此加载可能会很危险。如果此加载不是要对程序集进行沙盒处理,请启用 loadFromRemoteSources 开关。有关详细信息,请参见 http://go.microsoft.com/fwlink/?LinkId=155569。

   --- 内部异常堆栈跟踪的结尾 ---
   在 System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   在 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   在 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   在 System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   在 System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence)
   在 System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
   在 System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
   在 System.AppDomain.CreateInstanceFromAndUnwrap(String assemblyName, String typeName)
   在 System.AppDomain.CreateInstanceFromAndUnwrap(String assemblyName, String typeName)
   在 ContainsTypeChecker..cctor()
   --- 内部异常堆栈跟踪的结尾 ---
   在 ContainsTypeChecker..ctor()
   在 Processor..ctor()
   在 Fody.WeavingTask.Execute()
   在 Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   在 Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	Native.Csharp			

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.