mangostwo服务端启动后自动修改realmd下realmlist表realmbuilds字段,导致客户端无法看到服务器名称!

mangostwo服务端启动后自动修改realmd下realmlist表realmbuilds字段,导致客户端无法看到服务器名称!,第1张

用Navicat打开realmd 数据库 找到table 然后里面会有realmlist表,在里面找到gamebuild这一栏,然后改成你要改的客户端版本号(Navicat是图形化界面工具 *** 作起来很简单的)。如果你够牛...就自己写sql语句改写就是了.command.sql?这个估计是哪个表生成的sql patch文件吧,Navicat 把你图形化 *** 作的结果生成后缀.sql文件的功能,以供你进行导入到Navicat中。

https://stackoverflow.com/questions/40428923/realm-react-native-and-objective-c

1:yarn add realm --save

这时候,如果直接运行,会错误:红屏错误

Cannot read property 'debugHosts' of undefined

2:react-native link realm

链接原生库

运行正常

1:pod ‘Realm’

这时候运行失败:

pod 集成的realm中的librealmcore-ios.a 和 rn 链接原生库libRealmReact.a 有字段重复定义

2:将pod集成的realm需要的静态库删除

这时候运行报错:

3:将rn链接原生库libRealmReact.a删除,报红屏错误:Cannot read property 'debugHosts' of undefined

问题演示

注: 很恶心,无法上传pdf,这个链接可能打开的草鸡慢,抱歉,下面官方沟通记录里也有

沟通记录

I did some research and found that the reason you may been running into issues is that Realm can't support two SDKs at the same time. When you begin working with realm objects there is no way to convert the format from framework to framework.

I'm sorry if this doesn't work your use case. Our engineering is aware of the problem and may work on it in the future.

跟官方沟通暂时不支持

1:Dynamic Framework

2:cocoapods

3:Static Framework(ios only)。后续验证

2:cocoapds方式集成依然不行,后续跟进删除一方的文件依赖试试。但是感觉不行,因为rn,native中关于realm的依赖方式不同。

3:环境可行

https://stackoverflow.com/questions/40428923/realm-react-native-and-objective-c

1:native 提供方法 共rn调用:RCTBridgeModule。在方法上更统一

2:各自独立访问,感觉在结构上更合理一些。

Access Control

指定路径:ios 》 rn

rn中:

realm中的对象属性总是可选的,不需要显式地指定,也不需要指定。默认optional

field:‘type’(required)

filed:‘type?’ (optional)

filed:{type:‘type’, optional:true/false}

native-ios:

复写requiredproperties方法,return @[@“filed”,@“filed”]指定字段是required的。需要显示指定required/optional

解决方式:保持两端permission一致即可

1:required

2:optional

个人rn相关专题

背景

在本地session移至redis存储时,原本以为引入spring-session-data-redis依赖,配置RedisHttpSessionConfiguration,在web.xml中引入springSessionRepositoryFilter就结束了,没想到遇到序列化相关的问题,具体就是只有getter,没有setter。日志如下:

分析

提示很清楚,就是shiro的SimplePrincipalCollection类中realmNames字段没有setter方法,没法反序列化。

来看看realmNames是什么鬼,作为成熟的框架也偷懒不写setter?仔细一看,发现并不简单。类里面没有realmNames,只有个getRealmNames方法。

原来是个假getter,是由其他字段动态生成的,如下:

看下redis里面存的值

核心就是objectMapper.addMixIn()和objectMapper.setFilters()两个方法

SimplePrincipalCollection是需要处理的类,IncludShiroFields就是一个简单的接口,如下:

通过上面的配置间接控制SimplePrincipalCollection类中必要字段的序列化,从而解决了问题。

ps :因为使用了注解,一定要去掉objectMapper.configure(MapperFeature.USE_ANNOTATIONS, false),不然配置不生效。


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/bake/7942590.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-11
下一篇2023-04-11

发表评论

登录后才能评论

评论列表(0条)

    保存