设备信息
- 格式:pdf
- 大小:65.52 KB
- 文档页数:4
ileName="
function DeviceInfo_Lua:ctor()
self.m_deviceType=EDeviceType.kIOS;----设备类型
self.m_DeviceOSVersion="";----设备操作系统版本
self.m_DeviceModel="";----设备型号名称
self.m_MacAddress="";----设备Mac地址
self.m_game_uuid="";----设备UUID self.m_is_device_online=true;
self.m_device_network_model="unkonw"----设备网络模式
self.m_debug_uuid=false;
end
function DeviceInfo_Lua:dispose()
end
function DeviceInfo_Lua:getInstance()
if DeviceInfo_Lua.intance_==nil then
DeviceInfo_Lua.intance_=DeviceInfo_Lua.new();
DeviceInfo_Lua.intance_:initDeviceInfo();
end
return DeviceInfo_Lua.intance_
end
function DeviceInfo_Lua:initDeviceInfo()
self.m_MacAddress=
DeviceMetaInfo:getInstance():getMacAddress();
----初始化设备的mac地址
self.m_deviceType=
DeviceMetaInfo:getInstance():getMyDeviceTypeInt();
----初始化设备的类型的ID编号【服务器自定义】
self.m_DeviceOSVersion=
DeviceMetaInfo:getInstance():getDeviceOSVersion();----初始化设备的操作系统版本号
self.m_DeviceModel=
DeviceMetaInfo:getInstance():getDeviceModel();
----初始化设备的型号名称
self.m_game_uuid=
DeviceMetaInfo:getInstance():getDeviceUUID();
----初始化设备的UUID
self.m_is_device_online=
DeviceMetaInfo:getInstance():checkIsNetWorkOpen();
self.m_device_network_model=
DeviceMetaInfo:getInstance():getDeviceNetworkModel(); end
------获取设备类型
function DeviceInfo_Lua:getDeviceType()
return self.m_deviceType;
end
------获取设备UUID
function DeviceInfo_Lua:getDeviceUUID()
if self.m_debug_uuid==false then
self.m_game_uuid=
DeviceMetaInfo:getInstance():getDeviceUUID();
end
return self.m_game_uuid
end
function DeviceInfo_Lua:set_Debug_UUID(strUUID) self.m_game_uuid=
DeviceMetaInfo:getInstance():genDeviceUUID_debug(strUUI D);
self.m_debug_uuid=true;
return self.m_game_uuid;
end
------再次检测设备是否联网[不是游戏逻辑的那个能否连接上服务器]
function DeviceInfo_Lua:checkIsNetWorkOpen()
self.m_is_device_online=
DeviceMetaInfo:getInstance():checkIsNetWorkOpen();
return self.m_is_device_online;
end
function DeviceInfo_Lua:getDeviceNetworkModel() self.m_device_network_model=
DeviceMetaInfo:getInstance():getDeviceNetworkModel();
return self.m_device_network_model;
end。