Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 26, 2015, 1:38:24 PM (10 years ago)
Author:
frovelli
Message:

Added serverlist ping display in LAN

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/multiplayerFS15/data/gui/scripts/MultiplayerMenu.lua

    r8858 r10334  
    9393        local servername = ""
    9494        local serverip = ""
     95        local serverrtt = ""
    9596        while true do
    9697            servername = discovery:getServerListItemName(index)
     
    102103                break
    103104            end
    104             table.insert(P.serverList, {servername, serverip})
     105            serverrtt = discovery:getServerListItemRTT(index)
     106
     107            table.insert(P.serverList, {servername, serverip, serverrtt})
    105108            index = index + 1
    106109        end
    107110        index = 1
    108111        for k,v in pairs(P.serverList) do
    109             local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2] )
     112            local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2] .. " Ping: " .. v[3] .."ms" )
    110113            item:setID(index)
    111114            index = index + 1
     
    125128        local servername = ""
    126129        local serverip = ""
     130        local serverrtt = ""
    127131        while true do
    128132            servername = discovery:getServerListItemName(index)
     
    134138                break
    135139            end
    136             table.insert(P.serverList, {servername, serverip})
     140            serverrtt = discovery:getServerListItemRTT(index)
     141
     142            table.insert(P.serverList, {servername, serverip, serverrtt})
    137143            index = index + 1
    138144        end
    139145        index = 1
    140146        for k,v in pairs(P.serverList) do
    141             local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2] )
     147            local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2] .. " Ping: " .. v[3] .."ms" )
    142148            item:setID(index)
    143149            index = index + 1
     
    150156
    151157return P
    152 
Note: See TracChangeset for help on using the changeset viewer.