Changeset 7631 for code/branches/masterserver/data/gui
- Timestamp:
- Nov 10, 2010, 3:35:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/masterserver/data/gui/scripts/MultiplayerMenu.lua
r7163 r7631 129 129 end 130 130 131 132 -- same as above, but use WAN Discovery 133 function P.showServerList() 134 local listbox = winMgr:getWindow("orxonox/MultiplayerListbox") 135 CEGUI.toListbox(listbox):resetList() 136 local discovery = orxonox.WANDiscovery:getInstance() 137 discovery:discover() 138 P.serverList = {} 139 local index = 0 140 local servername = "" 141 local serverip = "" 142 while true do 143 servername = discovery:getServerListItemName(index) 144 if servername == "" then 145 break 146 end 147 serverip = discovery:getServerListItemIP(index) 148 if serverip == "" then 149 break 150 end 151 table.insert(P.serverList, {servername, serverip}) 152 index = index + 1 153 end 154 index = 1 155 for k,v in pairs(P.serverList) do 156 local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2] ) 157 item:setID(index) 158 index = index + 1 159 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 160 CEGUI.toListbox(listbox):addItem(item) 161 end 162 end 163 131 164 return P 132 165
Note: See TracChangeset
for help on using the changeset viewer.