74 lines
1.5 KiB
Lua
74 lines
1.5 KiB
Lua
---
|
|
IExtendConfig = {
|
|
extend_id = 0,
|
|
_viewMap = nil
|
|
}
|
|
|
|
local M = IExtendConfig
|
|
--
|
|
function M:GetGameInfo()
|
|
end
|
|
|
|
--卸载资源
|
|
function M:UnAssets()
|
|
end
|
|
|
|
function M:NewRoom()
|
|
return Room.new()
|
|
end
|
|
|
|
function M:GetGameController()
|
|
end
|
|
|
|
function M:FillRoomData(s2croom)
|
|
end
|
|
|
|
function M:FillPlayerData(info, player)
|
|
local room = DataManager.CurrenRoom
|
|
local playerList = info
|
|
local NewPlayer = player
|
|
if not NewPlayer then
|
|
NewPlayer = room:NewPlayer()
|
|
end
|
|
|
|
for i = 1,#playerList do
|
|
local _jp = playerList[i]
|
|
|
|
local p = NewPlayer.new()
|
|
p.seat = _jp["seat"]
|
|
local online = _jp["online"]
|
|
p.line_state = online
|
|
p.ready = _jp["ready"] == 1 and true or false
|
|
local pid = _jp["aid"]
|
|
if (DataManager.SelfUser.account_id == pid) then
|
|
room.self_player = p
|
|
p.self_user = DataManager.SelfUser
|
|
else
|
|
local u = User.new()
|
|
u.account_id = pid
|
|
p.self_user = u
|
|
u.nick_name = _jp["nick"]
|
|
u.head_url = _jp["portrait"]
|
|
u.sex = _jp["sex"]
|
|
end
|
|
p.self_user.location = Location.new(_jp["pos"] or "")
|
|
p.self_user.host_ip = _jp["ip"]
|
|
p.total_score = _jp["score"] or 0
|
|
p.cur_hp = _jp["cur_hp"] or 0
|
|
p.total_hp = _jp["total_hp"] or 0
|
|
if _jp["hp_info"] then
|
|
p.cur_hp = _jp.hp_info.cur_hp
|
|
p.total_hp = _jp.hp_info.total_hp
|
|
end
|
|
if _jp["entrust"] then
|
|
p.entrust = _jp.entrust
|
|
end
|
|
|
|
room:AddPlayer(p)
|
|
end
|
|
end
|
|
|
|
function M:GetView(id)
|
|
local dview_class = self._viewMap[id]
|
|
return dview_class
|
|
end |