So I'm trying to figure out where I need to start moving my code to Java. I basically have a few different areas:
1) (Zone extension) Very large structures in action script that contain player and monster information. Probably 40 fields for each player. I have an object for each player. I have at least 5000 players in this structure. I have to loop through this object to create maps that send the player information to the clients depending on what map they are on. I only send the client limited data - but the looping seems pretty process intensive.
i.e. when I load the data when the user logs in I do...
// var player = {} in global
player[id] = {}
player[id].name = whatever
player[id].etc = whatever x 40
The loops is something like this
Code: Select all
for (var i in player)
{
var mapid = player[i].mapid
if (mapsend[mapid] == undefined) {
mapsend[mapid] = {}
//loadallplayers
mapsend[mapid].mapstr=player[i].x+"|"+player[i].y+"|"+player[i].playername+" ("+ player[i].explevel+")"+"|"+player[i].picnum+"|"+i+"|N;"
} else {
mapsend[mapid].mapstr=mapsend[mapid].mapstr+player[i].x+"|"+player[i].y+"|"+player[i].playername+" ("+ player[i].explevel+")"+"|"+player[i].picnum+"|"+i+"|N;"
}
}
once that loop is done I loop through the place structure again and send the updated map out to people who are logged in to that map.
2) Combat (own room). Access the player struct and does various hit calculations and deducts hitpoints from a player. Sends the results to an individual in battle.
so any idea if this would be beneficial to move to java? I so - any idea how much? It looks I need a 4x improvement or I need to look into some other options.